diff options
author | Werner Koch <wk@gnupg.org> | 2023-01-31 11:32:41 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2023-01-31 11:32:41 +0100 |
commit | 5a223303d70ed3634a1ca7aa3216a9eb753d2923 (patch) | |
tree | 52b98cb4ca5adc4efb9c502d91e76608cf4bfa0c | |
parent | gpg: For readibility use macro instead of integers in key-clean. (diff) | |
download | gnupg2-5a223303d70ed3634a1ca7aa3216a9eb753d2923.tar.xz gnupg2-5a223303d70ed3634a1ca7aa3216a9eb753d2923.zip |
gpg: Make "--list-options show-sig-subpackets=n,m" work again.
* g10/gpg.c (parse_list_options): Set value for show-sig-subpackets.
--
Fixes-commit: 811cfa34cb3e7166f0cf1f94565504dee21cd9f5
and thus a regression in 2.4.0
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | g10/gpg.c | 15 |
2 files changed, 14 insertions, 4 deletions
@@ -1,6 +1,9 @@ Noteworthy changes in version 2.4.1 (unreleased) ------------------------------------------------ + * gpg: Make "--list-options show-sig-subpackets" work again. + Fixes regression in 2.4.0. + Noteworthy changes in version 2.4.0 (2022-12-16) ------------------------------------------------ @@ -2047,6 +2047,8 @@ parse_list_options(char *str) char *subpackets=""; /* something that isn't NULL */ struct parse_options lopts[]= { + {"show-sig-subpackets",LIST_SHOW_SIG_SUBPACKETS,NULL, + NULL}, {"show-photos",LIST_SHOW_PHOTOS,NULL, N_("display photo IDs during key listings")}, {"show-usage",LIST_SHOW_USAGE,NULL, @@ -2077,20 +2079,25 @@ parse_list_options(char *str) N_("show preferences")}, {"show-pref-verbose", LIST_SHOW_PREF_VERBOSE, NULL, N_("show preferences")}, - {"show-sig-subpackets",LIST_SHOW_SIG_SUBPACKETS,NULL, - NULL}, {"show-only-fpr-mbox",LIST_SHOW_ONLY_FPR_MBOX, NULL, NULL}, {"sort-sigs", LIST_SORT_SIGS, NULL, NULL}, {NULL,0,NULL,NULL} }; + int i; /* C99 allows for non-constant initializers, but we'd like to compile everywhere, so fill in the show-sig-subpackets argument here. Note that if the parse_options array changes, we'll have - to change the subscript here. */ - lopts[13].value=&subpackets; + to change the subscript here. We use a loop here in case the + list above is reordered. */ + for (i=0; lopts[i].name; i++) + if (lopts[i].bit == LIST_SHOW_SIG_SUBPACKETS) + { + lopts[i].value = &subpackets; + break; + } if(parse_options(str,&opt.list_options,lopts,1)) { |