mirror of
git://git.gnupg.org/gnupg.git
synced 2024-10-31 20:08:43 +01:00
g10: Fix --list-packets.
* g10/gpg.c (main): Call set_packet_list_mode after assignment of opt.list_packets. * g10/mainproc.c (do_proc_packets): Don't stop processing with --list-packets as the comment says. * g10/options.h (list_packets): Fix the comment. * g10/parse-packet.c: Fix the condition for opt.list_packets. -- Debian-bug-id: 828109 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
b6872353ba
commit
52f65281f9
@ -4656,7 +4656,6 @@ main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case aListPackets:
|
case aListPackets:
|
||||||
opt.list_packets=2;
|
|
||||||
default:
|
default:
|
||||||
if( argc > 1 )
|
if( argc > 1 )
|
||||||
wrong_args(_("[filename]"));
|
wrong_args(_("[filename]"));
|
||||||
@ -4685,8 +4684,8 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( cmd == aListPackets ) {
|
if( cmd == aListPackets ) {
|
||||||
set_packet_list_mode(1);
|
|
||||||
opt.list_packets=1;
|
opt.list_packets=1;
|
||||||
|
set_packet_list_mode(1);
|
||||||
}
|
}
|
||||||
rc = proc_packets (ctrl, NULL, a );
|
rc = proc_packets (ctrl, NULL, a );
|
||||||
if( rc )
|
if( rc )
|
||||||
|
@ -1328,7 +1328,7 @@ do_proc_packets (ctrl_t ctrl, CTX c, iobuf_t a)
|
|||||||
/* Stop processing when an invalid packet has been encountered
|
/* Stop processing when an invalid packet has been encountered
|
||||||
* but don't do so when we are doing a --list-packets. */
|
* but don't do so when we are doing a --list-packets. */
|
||||||
if (gpg_err_code (rc) == GPG_ERR_INV_PACKET
|
if (gpg_err_code (rc) == GPG_ERR_INV_PACKET
|
||||||
&& opt.list_packets != 2 )
|
&& opt.list_packets == 0)
|
||||||
break;
|
break;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ struct
|
|||||||
int print_pka_records;
|
int print_pka_records;
|
||||||
int print_dane_records;
|
int print_dane_records;
|
||||||
int no_armor;
|
int no_armor;
|
||||||
int list_packets; /* list-packets mode: 1=normal, 2=invoked by command*/
|
int list_packets; /* Option --list-packets active. */
|
||||||
int def_cipher_algo;
|
int def_cipher_algo;
|
||||||
int force_mdc;
|
int force_mdc;
|
||||||
int disable_mdc;
|
int disable_mdc;
|
||||||
|
@ -211,7 +211,7 @@ set_packet_list_mode (int mode)
|
|||||||
enable the list mode only with a special option. */
|
enable the list mode only with a special option. */
|
||||||
if (!listfp)
|
if (!listfp)
|
||||||
{
|
{
|
||||||
if (opt.list_packets == 2)
|
if (opt.list_packets)
|
||||||
{
|
{
|
||||||
listfp = es_stdout;
|
listfp = es_stdout;
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
|
Loading…
Reference in New Issue
Block a user