* server.c (gpgsm_status2): Insert a blank between all optional
authorWerner Koch <wk@gnupg.org>
Wed, 3 Jul 2002 16:03:22 +0000 (16:03 +0000)
committerWerner Koch <wk@gnupg.org>
Wed, 3 Jul 2002 16:03:22 +0000 (16:03 +0000)
arguments when using assuan.
* server.c (cmd_recipient): No more need for extra blank in constants.
* import.c (print_imported_status): Ditto.
* gpgsm.c (main): Ditto.

sm/ChangeLog
sm/gpgsm.c
sm/import.c
sm/server.c

index 423c223..34a73a2 100644 (file)
@@ -1,3 +1,11 @@
+2002-07-03  Werner Koch  <wk@gnupg.org>
+
+       * server.c (gpgsm_status2): Insert a blank between all optional
+       arguments when using assuan.
+       * server.c (cmd_recipient): No more need for extra blank in constants.
+       * import.c (print_imported_status): Ditto.
+       * gpgsm.c (main): Ditto.
+
 2002-07-02  Werner Koch  <wk@gnupg.org>
 
        * verify.c (gpgsm_verify): Extend the STATUS_BADSIG line with
 2002-07-02  Werner Koch  <wk@gnupg.org>
 
        * verify.c (gpgsm_verify): Extend the STATUS_BADSIG line with
index 1bfc1bf..f2287ef 100644 (file)
@@ -1068,14 +1068,14 @@ main ( int argc, char **argv)
                      sl->d, gnupg_strerror (rc));
           gpgsm_status2 (&ctrl, STATUS_INV_RECP,
                          rc == -1? "1":
                      sl->d, gnupg_strerror (rc));
           gpgsm_status2 (&ctrl, STATUS_INV_RECP,
                          rc == -1? "1":
-                         rc == GNUPG_Ambiguous_Name?      "2 ":
-                         rc == GNUPG_Wrong_Key_Usage?     "3 ":
-                         rc == GNUPG_Certificate_Revoked? "4 ":
-                         rc == GNUPG_Certificate_Expired? "5 ":
-                         rc == GNUPG_No_CRL_Known?        "6 ":
-                         rc == GNUPG_CRL_Too_Old?         "":
-                         rc == GNUPG_No_Policy_Match?     "8 ":
-                         "0 ",
+                         rc == GNUPG_Ambiguous_Name?      "2":
+                         rc == GNUPG_Wrong_Key_Usage?     "3":
+                         rc == GNUPG_Certificate_Revoked? "4":
+                         rc == GNUPG_Certificate_Expired? "5":
+                         rc == GNUPG_No_CRL_Known?        "6":
+                         rc == GNUPG_CRL_Too_Old?         "7":
+                         rc == GNUPG_No_Policy_Match?     "8":
+                         "0",
                          sl->d, NULL);
         }
   }
                          sl->d, NULL);
         }
   }
index 2b7fbfe..b0e3127 100644 (file)
@@ -41,7 +41,7 @@ print_imported_status (CTRL ctrl, KsbaCert cert)
   char *fpr;
  
   fpr = gpgsm_get_fingerprint_hexstring (cert, GCRY_MD_SHA1);
   char *fpr;
  
   fpr = gpgsm_get_fingerprint_hexstring (cert, GCRY_MD_SHA1);
-  gpgsm_status2 (ctrl, STATUS_IMPORTED, fpr, " [X.509]", NULL);
+  gpgsm_status2 (ctrl, STATUS_IMPORTED, fpr, "[X.509]", NULL);
   xfree (fpr);
 }
 
   xfree (fpr);
 }
 
index 4a8a8c4..5f490b5 100644 (file)
@@ -243,14 +243,14 @@ cmd_recipient (ASSUAN_CONTEXT ctx, char *line)
   if (rc)
     gpgsm_status2 (ctrl, STATUS_INV_RECP,
                    rc == -1? "1":
   if (rc)
     gpgsm_status2 (ctrl, STATUS_INV_RECP,
                    rc == -1? "1":
-                   rc == GNUPG_Ambiguous_Name?      "2 ":
-                   rc == GNUPG_Wrong_Key_Usage?     "3 ":
-                   rc == GNUPG_Certificate_Revoked? "4 ":
-                   rc == GNUPG_Certificate_Expired? "5 ":
-                   rc == GNUPG_No_CRL_Known?        "6 ":
-                   rc == GNUPG_CRL_Too_Old?         "":
-                   rc == GNUPG_No_Policy_Match?     "8 ":
-                   "0 ",
+                   rc == GNUPG_Ambiguous_Name?      "2":
+                   rc == GNUPG_Wrong_Key_Usage?     "3":
+                   rc == GNUPG_Certificate_Revoked? "4":
+                   rc == GNUPG_Certificate_Expired? "5":
+                   rc == GNUPG_No_CRL_Known?        "6":
+                   rc == GNUPG_CRL_Too_Old?         "7":
+                   rc == GNUPG_No_Policy_Match?     "8":
+                   "0",
                    line, NULL);
 
   return map_to_assuan_status (rc);
                    line, NULL);
 
   return map_to_assuan_status (rc);
@@ -873,7 +873,12 @@ gpgsm_status2 (CTRL ctrl, int no, ...)
       n = 0;
       while ( (text = va_arg (arg_ptr, const char *)) )
         {
       n = 0;
       while ( (text = va_arg (arg_ptr, const char *)) )
         {
-          for ( ; *text && n < DIM (buf)-1; n++)
+          if (n)
+            {
+              *p++ = ' ';
+              n++;
+            }
+          for ( ; *text && n < DIM (buf)-2; n++)
             *p++ = *text++;
         }
       *p = 0;
             *p++ = *text++;
         }
       *p = 0;