[GRASS-SVN] r51962 - grass/trunk/general/g.parser

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 3 11:44:36 PDT 2012


Author: martinl
Date: 2012-06-03 11:44:36 -0700 (Sun, 03 Jun 2012)
New Revision: 51962

Modified:
   grass/trunk/general/g.parser/translate.c
Log:
g.parser: empty string == NULL (to unset property)


Modified: grass/trunk/general/g.parser/translate.c
===================================================================
--- grass/trunk/general/g.parser/translate.c	2012-06-03 18:23:30 UTC (rev 51961)
+++ grass/trunk/general/g.parser/translate.c	2012-06-03 18:44:36 UTC (rev 51962)
@@ -1,4 +1,5 @@
 #include <stdlib.h>
+#include <string.h>
 
 #include "proto.h"
 
@@ -12,6 +13,10 @@
 
     if (arg == NULL)
 	return arg;
+
+    if (strlen(arg) == 0)
+        return NULL; /* unset */
+    
     if (*arg && translate_output) {
 	fputs(arg, stdout);
 	fputs("\n", stdout);



More information about the grass-commit mailing list