From aa8910955ad813d2c57076d61fc64efd029a13e6 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 6 Jun 2000 12:13:53 +0000 Subject: [PATCH] Accept an enum immediately when it is an exact match - wouldn't accept ``d10v'' when the choice was d10v{,:ts2,:ts3}. --- gdb/ChangeLog | 5 +++++ gdb/command.c | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e95019e6b1d..2d007543c70 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +Tue Jun 6 21:14:47 2000 Andrew Cagney + + * 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 * config/mips/tm-vr5000el.h, config/mips/tm-vr5000.h, diff --git a/gdb/command.c b/gdb/command.c index 02ee4745a8c..ec67d960a2c 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) -- 2.30.2