Accept an enum immediately when it is an exact match - wouldn't accept
``d10v'' when the choice was d10v{,:ts2,:ts3}.
This commit is contained in:
parent
69c49926bb
commit
aa8910955a
@ -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>
|
Tue Jun 6 16:46:37 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||||
|
|
||||||
* config/mips/tm-vr5000el.h, config/mips/tm-vr5000.h,
|
* config/mips/tm-vr5000el.h, config/mips/tm-vr5000.h,
|
||||||
|
@ -1695,10 +1695,19 @@ do_setshow_command (arg, from_tty, c)
|
|||||||
nmatches = 0;
|
nmatches = 0;
|
||||||
for (i = 0; c->enums[i]; i++)
|
for (i = 0; c->enums[i]; i++)
|
||||||
if (strncmp (arg, c->enums[i], len) == 0)
|
if (strncmp (arg, c->enums[i], len) == 0)
|
||||||
|
{
|
||||||
|
if (c->enums[i][len] == '\0')
|
||||||
|
{
|
||||||
|
match = c->enums[i];
|
||||||
|
nmatches = 1;
|
||||||
|
break; /* exact match. */
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
match = c->enums[i];
|
match = c->enums[i];
|
||||||
nmatches++;
|
nmatches++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (nmatches <= 0)
|
if (nmatches <= 0)
|
||||||
error ("Undefined item: \"%s\".", arg);
|
error ("Undefined item: \"%s\".", arg);
|
||||||
|
Loading…
Reference in New Issue
Block a user