mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +00:00
getargs: minor simplification
* src/getargs.c (flag_argmatch): Simplify the handling of "none".
This commit is contained in:
@@ -84,23 +84,19 @@ flag_argmatch (const char *option,
|
|||||||
const char * const keys[], const int values[],
|
const char * const keys[], const int values[],
|
||||||
int all, int *flags, char *arg, size_t no)
|
int all, int *flags, char *arg, size_t no)
|
||||||
{
|
{
|
||||||
int value = 0;
|
int value = XARGMATCH (option, arg + no, keys, values);
|
||||||
value = XARGMATCH (option, arg + no, keys, values);
|
|
||||||
|
|
||||||
if (value)
|
/* -rnone == -rno-all, and -rno-none == -rall. */
|
||||||
|
if (!value)
|
||||||
{
|
{
|
||||||
if (no)
|
value = all;
|
||||||
*flags &= ~value;
|
no = !no;
|
||||||
else
|
|
||||||
*flags |= value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (no)
|
||||||
|
*flags &= ~value;
|
||||||
else
|
else
|
||||||
{
|
*flags |= value;
|
||||||
if (no)
|
|
||||||
*flags |= all;
|
|
||||||
else
|
|
||||||
*flags &= ~all;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Decode an option's set of keys.
|
/** Decode an option's set of keys.
|
||||||
|
|||||||
Reference in New Issue
Block a user