summaryrefslogtreecommitdiff
path: root/src/argparse.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-12-21 17:19:17 +0100
committerWerner Koch <wk@gnupg.org>2020-12-21 17:19:17 +0100
commit7021b58b0f2d95b94a2bac43e15ec97d89706b7f (patch)
tree4cac149cff96ea01ad84f3a101c3c7fa9522f3fc /src/argparse.c
parent0170a058bf72190d0a86718d6f5e6e4e519569bb (diff)
downloadlibgpg-error-7021b58b0f2d95b94a2bac43e15ec97d89706b7f.tar.gz
core: Yet another fix to the ignore meta command.
* src/argparse.c (_gpgrt_argparse): Entirely skip ignored sysconf commands. Fix state transitions in the ignore case.
Diffstat (limited to 'src/argparse.c')
-rw-r--r--src/argparse.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/argparse.c b/src/argparse.c
index e4a1436..e116fff 100644
--- a/src/argparse.c
+++ b/src/argparse.c
@@ -1113,6 +1113,23 @@ _gpgrt_argparse (estream_t fp, gpgrt_argparse_t *arg, gpgrt_opt_t *opts_orig)
opts[idx].ignore = 1;
if (arg->internal->explicit_ignore)
opts[idx].explicit_ignore = 1;
+
+ if (opts[idx].ignore && !opts[idx].forced)
+ {
+ if (arg->internal->verbose)
+ _gpgrt_log_info ("%s:%u: ignoring option \"--%s\"\n",
+ arg->internal->confname,
+ arg->lineno,
+ opts[idx].long_opt);
+ if ((arg->flags & ARGPARSE_FLAG_WITHATTR))
+ set_ignore = 1;
+ else
+ {
+ state = state == Akeyword_eol? Ainit : Acomment;
+ i = 0;
+ goto nextstate; /* Ignore this one. */
+ }
+ }
}
else /* Non-sysconf file */
{ /* Act upon the forced and ignored attributes. */
@@ -1130,7 +1147,7 @@ _gpgrt_argparse (estream_t fp, gpgrt_argparse_t *arg, gpgrt_opt_t *opts_orig)
set_ignore = 1;
else
{
- state = Ainit;
+ state = state == Akeyword_eol? Ainit : Acomment;
i = 0;
goto nextstate; /* Ignore this one. */
}