[Gpg4win-commits] r398 - in trunk: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu May 17 17:38:19 CEST 2007


Author: werner
Date: 2007-05-17 17:38:19 +0200 (Thu, 17 May 2007)
New Revision: 398

Modified:
   trunk/ChangeLog
   trunk/src/gpgwrap.c
Log:
Hack to print the version only if --version is given twice.
Also output the real used filename then.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-05-17 11:14:03 UTC (rev 397)
+++ trunk/ChangeLog	2007-05-17 15:38:19 UTC (rev 398)
@@ -5,6 +5,7 @@
 	* src/inst-gnupg.nsi: Install gpgwrap for gpg, gpgv and gpgsplit.
 	
 	* src/gpgwrap.c: New.
+
 	* configure.ac: Check for strip.
 	(AC_CONFIG_HEADER): New.
 	* src/Makefile.am (g4wihelp.dll): Strip.

Modified: trunk/src/gpgwrap.c
===================================================================
--- trunk/src/gpgwrap.c	2007-05-17 11:14:03 UTC (rev 397)
+++ trunk/src/gpgwrap.c	2007-05-17 15:38:19 UTC (rev 398)
@@ -36,12 +36,6 @@
   char pgm[MAX_PATH+100];
   char *p, *p0;
 
-  if (argc >= 2 && !strcmp(argv[1], "--version"))
-    {
-      puts ("gpgwrap (gpg4win) " PACKAGE_VERSION "\n");
-      fflush (stdout);
-    }
-
   if ( !GetModuleFileNameA (NULL, pgm, sizeof pgm -1) )
     {
       fprintf (stderr, "gpgwrap: error getting my own name: rc=%d\n",
@@ -61,6 +55,20 @@
   while (*p)
     *p0++ = *p++;
   *p0 = 0;
+
+  /* Hack to output our own version along with the real file name
+     before the actual, we require that the --version option is given
+     twice. */
+  if (argc > 2
+      && !strcmp(argv[1], "--version")
+      && !strcmp(argv[2], "--version"))
+    {
+      fputs ("gpgwrap (Gpg4win) " PACKAGE_VERSION " ", stdout);
+      fputs (pgm, stdout);
+      fputc ('\n', stdout);
+      fflush (stdout);
+    }
+
   execv (pgm, argv);
   fprintf (stderr, "gpgwrap: executing `%s' failed: %s\n",
            pgm, strerror (errno));



More information about the Gpg4win-commits mailing list