diff options
author | Werner Koch <wk@gnupg.org> | 2009-05-20 12:23:33 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2009-05-20 12:23:33 +0200 |
commit | 41ee7a14cfa7b8c5be81f62930d2d054b45d8f01 (patch) | |
tree | ad88c5e9b90e26545dd63b012e1ca1dc399704bd /g10/gpg.c | |
parent | Allow generation of DSA2 keys without --enable-dsa2. (diff) | |
download | gnupg2-41ee7a14cfa7b8c5be81f62930d2d054b45d8f01.tar.xz gnupg2-41ee7a14cfa7b8c5be81f62930d2d054b45d8f01.zip |
Fixed bug#1044. Use of --fingerprint with --with-fingerprint.
Diffstat (limited to 'g10/gpg.c')
-rw-r--r-- | g10/gpg.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -1892,7 +1892,7 @@ main (int argc, char **argv) int eyes_only=0; int multifile=0; int pwfd = -1; - int with_fpr = 0; /* make an option out of --fingerprint */ + int fpr_maybe_cmd = 0; /* --fingerprint maybe a command. */ int any_explicit_recipient = 0; int require_secmem=0,got_secmem=0; @@ -2241,8 +2241,13 @@ main (int argc, char **argv) case oWithFingerprint: opt.with_fingerprint = 1; - with_fpr=1; /*fall thru*/ - case oFingerprint: opt.fingerprint++; break; + opt.fingerprint++; + break; + case oFingerprint: + opt.fingerprint++; + fpr_maybe_cmd = 1; + break; + case oSecretKeyring: append_to_strlist( &sec_nrings, pargs.r.ret_str); break; @@ -3299,9 +3304,12 @@ main (int argc, char **argv) xfree(p); } - if( !cmd && opt.fingerprint && !with_fpr ) { - set_cmd( &cmd, aListKeys); - } + /* If there is no command but the --fingerprint is given, default + to the --list-keys command. */ + if (!cmd && fpr_maybe_cmd) + { + set_cmd (&cmd, aListKeys); + } if( opt.verbose > 1 ) |