diff options
author | Werner Koch <[email protected]> | 2022-01-25 17:52:19 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2022-01-25 17:56:50 +0000 |
commit | 5ab088aba9f05b480c311e94d45a88728ac9320b (patch) | |
tree | b56bbe1760ac48738dc2cdfe5ccd0e955cf8cf72 /src | |
parent | build: Detect more flexible musl variants of GNU (diff) | |
download | libgpg-error-5ab088aba9f05b480c311e94d45a88728ac9320b.tar.gz libgpg-error-5ab088aba9f05b480c311e94d45a88728ac9320b.zip |
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.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; |