aboutsummaryrefslogtreecommitdiff
path: root/gdb/command.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-06-06 12:13:53 +0000
committerAndrew Cagney <cagney@redhat.com>2000-06-06 12:13:53 +0000
commitaa8910955ad813d2c57076d61fc64efd029a13e6 (patch)
treefb646cc52490ba62ce65663f20952c204b2089ca /gdb/command.c
parent69c49926bb843a21872cf79962d9bf4866b101ff (diff)
downloadgdb-aa8910955ad813d2c57076d61fc64efd029a13e6.zip
gdb-aa8910955ad813d2c57076d61fc64efd029a13e6.tar.gz
gdb-aa8910955ad813d2c57076d61fc64efd029a13e6.tar.bz2
Accept an enum immediately when it is an exact match - wouldn't accept
``d10v'' when the choice was d10v{,:ts2,:ts3}.
Diffstat (limited to 'gdb/command.c')
-rw-r--r--gdb/command.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gdb/command.c b/gdb/command.c
index 02ee474..ec67d96 100644
--- a/gdb/command.c
+++ b/gdb/command.c
@@ -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)