mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
common: Fix returning of option attributes for options with args.
* common/argparse.c (gnupg_argparse): Set attribute flags -- GnuPG-bug-id: 5799 This is a backport from the fix in libgpg-error in case gnupg 2.2 is build against an older version of libgpg-error.
This commit is contained in:
parent
38c666ec3f
commit
d8e6d1e9ed
@ -1344,6 +1344,17 @@ gnupg_argparse (estream_t fp, gnupg_argparse_t *arg, gnupg_opt_t *opts_orig)
|
|||||||
xfree (buffer);
|
xfree (buffer);
|
||||||
else
|
else
|
||||||
gpgrt_annotate_leaked_object (buffer);
|
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;
|
goto leave;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user