From 7021b58b0f2d95b94a2bac43e15ec97d89706b7f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 21 Dec 2020 17:19:17 +0100 Subject: 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. --- src/argparse.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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. */ } -- cgit v1.2.3