[GRASS-SVN] r37357 - grass/branches/develbranch_6/general/g.version

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 22 07:37:47 EDT 2009


Author: hamish
Date: 2009-05-22 07:37:47 -0400 (Fri, 22 May 2009)
New Revision: 37357

Modified:
   grass/branches/develbranch_6/general/g.version/main.c
Log:
parse out '$' from svn keywords

Modified: grass/branches/develbranch_6/general/g.version/main.c
===================================================================
--- grass/branches/develbranch_6/general/g.version/main.c	2009-05-22 10:00:17 UTC (rev 37356)
+++ grass/branches/develbranch_6/general/g.version/main.c	2009-05-22 11:37:47 UTC (rev 37357)
@@ -66,9 +66,14 @@
 	fprintf(stdout, "\n");
     }
 
-    if (gish_rev->answer)
-	fprintf(stdout, "%s\n%s\n", GIS_H_VERSION, GIS_H_DATE);
-	/* use G_tokenize() if you want to get rid of the '$'s */
+    if (gish_rev->answer) {
+	/* fprintf(stdout, "%s\n%s\n", GIS_H_VERSION, GIS_H_DATE); */
+	char **rev_ver = G_tokenize(GIS_H_VERSION, "$");
+	char **rev_time = G_tokenize(GIS_H_DATE, "$");
+	fprintf(stdout, "%s\n%s\n", rev_ver[1], rev_time[1]);
+	G_free_tokens(rev_ver);
+	G_free_tokens(rev_time);
+    }
 
     return (EXIT_SUCCESS);
 }



More information about the grass-commit mailing list