Accept an enum immediately when it is an exact match - wouldn't accept
authorAndrew Cagney <cagney@redhat.com>
Tue, 6 Jun 2000 12:13:53 +0000 (12:13 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 6 Jun 2000 12:13:53 +0000 (12:13 +0000)
``d10v'' when the choice was d10v{,:ts2,:ts3}.

gdb/ChangeLog
gdb/command.c

index e95019e6b1d384183801bd64fec61c9d77577c41..2d007543c70a3ae11723ae8530febadea4ece638 100644 (file)
@@ -1,3 +1,8 @@
+Tue Jun  6 21:14:47 2000  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * command.c (do_setshow_command): Accept an enum option immediatly
+       when it is an exact match.
+
 Tue Jun  6 16:46:37 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * config/mips/tm-vr5000el.h, config/mips/tm-vr5000.h,
index 02ee4745a8ce25eab97ce4891e013a26fe385bdb..ec67d960a2c50c6499165987eb224ef6b35293f9 100644 (file)
@@ -1696,8 +1696,17 @@ do_setshow_command (arg, from_tty, c)
            for (i = 0; c->enums[i]; i++)
              if (strncmp (arg, c->enums[i], len) == 0)
                {
-                 match = c->enums[i];
-                 nmatches++;
+                 if (c->enums[i][len] == '\0')
+                   {
+                     match = c->enums[i];
+                     nmatches = 1;
+                     break; /* exact match. */
+                   }
+                 else
+                   {
+                     match = c->enums[i];
+                     nmatches++;
+                   }
                }
 
            if (nmatches <= 0)