Importing Lite2 broke lookup() to return -1 for the nmatches == 0 case.

Fixed.
This commit is contained in:
Bruce Evans 1997-07-06 04:13:20 +00:00
parent 94143ce785
commit 237f53369c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=27231

View File

@ -32,7 +32,11 @@
*/ */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95"; static char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95";
#endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */ #endif /* not lint */
#include <stdlib.h> #include <stdlib.h>
@ -165,7 +169,7 @@ lookup(name)
nmatches++; nmatches++;
} }
} }
if (nmatches != 1) if (nmatches > 1)
return ((struct cmdtab *)-1); return ((struct cmdtab *)-1);
return (found); return (found);
} }