[GRASS-SVN] r68057 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 15 00:59:25 PDT 2016


Author: hcho
Date: 2016-03-15 00:59:25 -0700 (Tue, 15 Mar 2016)
New Revision: 68057

Modified:
   grass/trunk/lib/gis/parser.c
Log:
Don't ignore an empty answer when splitting options.
Fixes the command history for e.g., v.edit where="". Without this fix, where="" is not included, which makes an invalid command.


Modified: grass/trunk/lib/gis/parser.c
===================================================================
--- grass/trunk/lib/gis/parser.c	2016-03-14 23:03:50 UTC (rev 68056)
+++ grass/trunk/lib/gis/parser.c	2016-03-15 07:59:25 UTC (rev 68057)
@@ -1416,7 +1416,7 @@
 		for (len = 0, ptr2 = ptr1; *ptr2 != '\0' && *ptr2 != ',';
 		     ptr2++, len++) ;
 
-		if (len > 0) {	/* skip ,, */
+		if (ptr2 == opt->answer || len > 0) {	/* answer = "" or skip ,, */
 		    opt->answers[ans_num] = G_malloc(len + 1);
 		    memcpy(opt->answers[ans_num], ptr1, len);
 		    opt->answers[ans_num][len] = 0;



More information about the grass-commit mailing list