]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Backout ambigious error for ip
authorshemminger <shemminger>
Fri, 2 Dec 2005 20:02:26 +0000 (20:02 +0000)
committershemminger <shemminger>
Fri, 2 Dec 2005 20:02:26 +0000 (20:02 +0000)
ChangeLog
ip/ip.c

index 4a062cc39e556e945d06dd1144f39f7284629897..7db8c6869ed09646798b1d6838c841e14da4abb5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-12-02  Stephen Hemminger  <shemminger@osdl.org
+
+       * Backout ambigious ip command matches
+
 2005-11-22  Stephen Hemminger  <shemminger@osdl.org
 
        * Handle ambigious ip command matches
diff --git a/ip/ip.c b/ip/ip.c
index df6bc10b3dd544d0b19bb85651bf0d6dbc47363d..590392555ce2aec1f87455a3a63fbb7cf3eaacc9 100644 (file)
--- 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;
 }