[svn] GnuPG - r5019 - branches/STABLE-BRANCH-1-4/g10

svn author wk cvs at cvs.gnupg.org
Wed May 20 12:25:59 CEST 2009


Author: wk
Date: 2009-05-20 12:25:58 +0200 (Wed, 20 May 2009)
New Revision: 5019

Modified:
   branches/STABLE-BRANCH-1-4/g10/ChangeLog
   branches/STABLE-BRANCH-1-4/g10/gpg.c
Log:
Fix bug#1044.


Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/ChangeLog	2009-05-20 10:23:33 UTC (rev 5018)
+++ branches/STABLE-BRANCH-1-4/g10/ChangeLog	2009-05-20 10:25:58 UTC (rev 5019)
@@ -1,3 +1,8 @@
+2009-05-20  Werner Koch  <wk at g10code.com>
+
+	* gpg.c (main): Fix --fingerprint/--with-fingerprint command
+	detection.  Fixes bug#1044.
+
 2009-05-11  Werner Koch  <wk at g10code.com>
 
 	* apdu.c (send_le): Replace log_error by log_info.  Fixes bug#1043.

Modified: branches/STABLE-BRANCH-1-4/g10/gpg.c
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/gpg.c	2009-05-20 10:23:33 UTC (rev 5018)
+++ branches/STABLE-BRANCH-1-4/g10/gpg.c	2009-05-20 10:25:58 UTC (rev 5019)
@@ -1859,7 +1859,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;
 #ifdef USE_SHM_COPROCESSING
@@ -2228,8 +2228,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;
@@ -3268,9 +3273,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( cmd == aKMode || cmd == aKModeC ) { /* kludge to be compatible to pgp */
 	if( cmd == aKModeC ) {




More information about the Gnupg-commits mailing list