[GRASS-SVN] r63941 - grass/trunk/general/g.version

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 3 04:42:34 PST 2015


Author: martinl
Date: 2015-01-03 04:42:34 -0800 (Sat, 03 Jan 2015)
New Revision: 63941

Modified:
   grass/trunk/general/g.version/main.c
Log:
improve r63940

Modified: grass/trunk/general/g.version/main.c
===================================================================
--- grass/trunk/general/g.version/main.c	2015-01-03 12:38:51 UTC (rev 63940)
+++ grass/trunk/general/g.version/main.c	2015-01-03 12:42:34 UTC (rev 63941)
@@ -125,13 +125,14 @@
 	/* if number of tokes is right, print it */
 	if (G_number_of_tokens(rev_ver) == tokens_expected &&
 	    G_number_of_tokens(rev_time) == tokens_expected) {
-            char *p;
-            p = strstr(rev_ver[1], " ");
 	    if (shell->answer) {
+                const char *p;
+                p = strstr(rev_ver[1], " ");
 		fprintf(stdout, "libgis_revision=%s\n",
 			p ? p + 1 : "00000");
+                p = strstr(rev_time[1], " ");
 		fprintf(stdout, "libgis_date=\"%s\"\n",
-			p ? strstr(rev_time[1], " ") + 1 : "?");
+			p ? p + 1 : "?");
 	    }
 	    else {
 		fprintf(stdout, "libgis %s\nlibgis %s\n", rev_ver[1],



More information about the grass-commit mailing list