summaryrefslogtreecommitdiffstats
path: root/ip/ip.c
diff options
context:
space:
mode:
authorshemminger <shemminger>2005-12-02 20:02:26 +0000
committershemminger <shemminger>2005-12-02 20:02:26 +0000
commite25d697069a1c3d5eb13a44050eeed5f007d31d4 (patch)
tree6a18b96798731bf6791f0a9f1295e9b7d3c3e4c4 /ip/ip.c
parentede723964a065992bf9d0dbe3f780e65ca917872 (diff)
Backout ambigious error for ip
Diffstat (limited to 'ip/ip.c')
-rw-r--r--ip/ip.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/ip/ip.c b/ip/ip.c
index df6bc10b..59039255 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -80,23 +80,13 @@ static const struct cmd {
static int do_cmd(const char *argv0, int argc, char **argv)
{
- const struct cmd *c, *m = NULL;
+ const struct cmd *c;
for (c = cmds; c->cmd; ++c) {
- if (matches(argv0, c->cmd) == 0) {
- if (m && m->func != c->func) {
- fprintf(stderr,
- "Ambiguious command \"%s\" matches both %s and %s\n",
- argv0, m->cmd, c->cmd);
- return -1;
- }
- m = c;
- }
+ if (matches(argv0, c->cmd) == 0)
+ return c->func(argc-1, argv+1);
}
- if (m)
- return m->func(argc-1, argv+1);
-
fprintf(stderr, "Object \"%s\" is unknown, try \"ip help\".\n", argv0);
return -1;
}