mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-21 14:47:03 +01:00
common: Improve fucntion parse_debug_flag.
* common/miscellaneous.c (parse_debug_flag): Add hack not to call exit. Add "none" and "all" flags. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
5e1d2fe655
commit
8195e55d0c
@ -440,7 +440,8 @@ parse_debug_flag (const char *string, unsigned int *debugvar,
|
||||
log_info ("available debug flags:\n");
|
||||
for (i=0; flags[i].name; i++)
|
||||
log_info (" %5u %s\n", flags[i].flag, flags[i].name);
|
||||
exit (0);
|
||||
if (flags[i].flag != 77)
|
||||
exit (0);
|
||||
}
|
||||
else if (digitp (string))
|
||||
{
|
||||
@ -466,7 +467,17 @@ parse_debug_flag (const char *string, unsigned int *debugvar,
|
||||
break;
|
||||
}
|
||||
if (!flags[j].name)
|
||||
log_info (_("unknown debug flag '%s' ignored\n"), words[i]);
|
||||
{
|
||||
if (!strcmp (words[i], "none"))
|
||||
{
|
||||
*debugvar = 0;
|
||||
result = 0;
|
||||
}
|
||||
else if (!strcmp (words[i], "all"))
|
||||
result = ~0;
|
||||
else
|
||||
log_info (_("unknown debug flag '%s' ignored\n"), words[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
xfree (words);
|
||||
|
Loading…
x
Reference in New Issue
Block a user