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

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


Author: hamish
Date: 2009-05-22 07:39:22 -0400 (Fri, 22 May 2009)
New Revision: 37358

Modified:
   grass/trunk/general/g.version/main.c
Log:
parse out '$' from svn keywords (merge from devbr6)

Modified: grass/trunk/general/g.version/main.c
===================================================================
--- grass/trunk/general/g.version/main.c	2009-05-22 11:37:47 UTC (rev 37357)
+++ grass/trunk/general/g.version/main.c	2009-05-22 11:39:22 UTC (rev 37358)
@@ -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