[svn] GnuPG - r5018 - trunk/g10

svn author wk cvs at cvs.gnupg.org
Wed May 20 12:23:34 CEST 2009


Author: wk
Date: 2009-05-20 12:23:33 +0200 (Wed, 20 May 2009)
New Revision: 5018

Modified:
   trunk/g10/ChangeLog
   trunk/g10/gpg.c
Log:
Fixed bug#1044.  Use of --fingerprint with --with-fingerprint. 


Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog	2009-05-20 09:57:10 UTC (rev 5017)
+++ trunk/g10/ChangeLog	2009-05-20 10:23:33 UTC (rev 5018)
@@ -1,5 +1,8 @@
 2009-05-20  Werner Koch  <wk at g10code.com>
 
+	* gpg.c (main): Fix --fingerprint/--with-fingerprint command
+	detection.  Fixes bug#1044.
+
 	* keygen.c (ask_keysize): Allow selection of DSA key size even
 	without --enable-dsa2.
 	(gen_dsa): Remove size check.

Modified: trunk/g10/gpg.c
===================================================================
--- trunk/g10/gpg.c	2009-05-20 09:57:10 UTC (rev 5017)
+++ trunk/g10/gpg.c	2009-05-20 10:23:33 UTC (rev 5018)
@@ -1892,7 +1892,7 @@
     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 @@
 
 	  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 @@
 	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 )




More information about the Gnupg-commits mailing list