summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2022-01-25 18:52:19 +0100
committerWerner Koch <wk@gnupg.org>2022-01-25 18:56:50 +0100
commit5ab088aba9f05b480c311e94d45a88728ac9320b (patch)
treeb56bbe1760ac48738dc2cdfe5ccd0e955cf8cf72 /src
parent0150919b6a8244be1055d01ad21d6fa47788ab0e (diff)
downloadlibgpg-error-5ab088aba9f05b480c311e94d45a88728ac9320b.tar.gz
core: Fix returning of option attributes for options with args.
* src/argparse.c (_gpgrt_argparse): Set attributes info flags -- GnuPG-bug-id: 5799
Diffstat (limited to 'src')
-rw-r--r--src/argparse.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/argparse.c b/src/argparse.c
index a144881..cedb2f5 100644
--- a/src/argparse.c
+++ b/src/argparse.c
@@ -1874,6 +1874,17 @@ _gpgrt_argparse (estream_t fp, gpgrt_argparse_t *arg, gpgrt_opt_t *opts_orig)
xfree (buffer);
else
gpgrt_annotate_leaked_object (buffer);
+ /* If the caller wants us to return the attributes or
+ * ignored options, or these flags in. */
+ if ((arg->flags & ARGPARSE_FLAG_WITHATTR))
+ {
+ if (opts[idx].ignore)
+ arg->r_type |= ARGPARSE_ATTR_IGNORE;
+ if (opts[idx].forced)
+ arg->r_type |= ARGPARSE_ATTR_FORCE;
+ if (set_ignore)
+ arg->r_type |= ARGPARSE_OPT_IGNORE;
+ }
}
}
goto leave;