diff --git a/g10/gpg.c b/g10/gpg.c index 97975fb23..3a7dc3802 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -4130,7 +4130,6 @@ main (int argc, char **argv) break; case aListPackets: - opt.list_packets=2; default: if( argc > 1 ) wrong_args(_("[filename]")); @@ -4157,8 +4156,8 @@ main (int argc, char **argv) } } if( cmd == aListPackets ) { - set_packet_list_mode(1); opt.list_packets=1; + set_packet_list_mode(1); } rc = proc_packets(NULL, a ); if( rc ) diff --git a/g10/mainproc.c b/g10/mainproc.c index 17d40def9..8c2d2e19d 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -1292,7 +1292,7 @@ do_proc_packets( CTX c, IOBUF a ) /* stop processing when an invalid packet has been encountered * but don't do so when we are doing a --list-packets. */ if (gpg_err_code (rc) == GPG_ERR_INV_PACKET - && opt.list_packets != 2 ) + && opt.list_packets == 0 ) break; continue; } diff --git a/g10/options.h b/g10/options.h index cc8718eee..b02c0d920 100644 --- a/g10/options.h +++ b/g10/options.h @@ -62,7 +62,7 @@ struct int fingerprint; /* list fingerprints */ int list_sigs; /* list signatures */ 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 force_v3_sigs; int force_v4_certs; diff --git a/g10/parse-packet.c b/g10/parse-packet.c index c925e9440..1030204e2 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -207,7 +207,7 @@ set_packet_list_mode( int mode ) whether using log_stream() would be better. Perhaps we should enable the list mdoe only with a special option. */ if (!listfp) - listfp = opt.list_packets == 2 ? stdout : stderr; + listfp = opt.list_packets ? stdout : stderr; return old; }