summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-25 15:20:08 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-25 15:20:08 +0000
commit37ceff6b5c92a6383ec3d3334eb435a790a26abb (patch)
tree1ce2e89479c66bc0b4d281939d9f192c6c6401c0 /usr.bin
parent17892fbd48343a33097737881b871dad3b03d934 (diff)
distinguish ambigious and unknown commands; netbsd pr$2536; leo@marco.de
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/systat/cmds.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/systat/cmds.c b/usr.bin/systat/cmds.c
index 7531ced94b4..2225a059a8d 100644
--- a/usr.bin/systat/cmds.c
+++ b/usr.bin/systat/cmds.c
@@ -110,9 +110,7 @@ command(cmd)
}
p = lookup(cmd);
if (p == (struct cmdtab *)-1) {
- /* if not a primary command, try a display specific one */
- if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(cmd, cp))
- error("%s: Ambiguous command.", cmd);
+ error("%s: Ambiguous command.", cmd);
goto done;
}
if (p) {
@@ -142,6 +140,8 @@ command(cmd)
status();
goto done;
}
+ if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(cmd, cp))
+ error("%s: Unknown command.", cmd);
done:
sigsetmask(omask);
}
@@ -170,7 +170,7 @@ lookup(name)
nmatches++;
}
}
- if (nmatches != 1)
+ if (nmatches > 1)
return ((struct cmdtab *)-1);
return (found);
}