diff options
author | Werner Koch <wk@gnupg.org> | 2022-01-25 18:52:19 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2022-01-25 18:56:50 +0100 |
commit | 5ab088aba9f05b480c311e94d45a88728ac9320b (patch) | |
tree | b56bbe1760ac48738dc2cdfe5ccd0e955cf8cf72 /src/argparse.c | |
parent | 0150919b6a8244be1055d01ad21d6fa47788ab0e (diff) | |
download | libgpg-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/argparse.c')
-rw-r--r-- | src/argparse.c | 11 |
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; |