[GRASS-SVN] r38853 - grass/trunk/lib/symbol

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 25 03:34:39 EDT 2009


Author: hamish
Date: 2009-08-25 03:34:39 -0400 (Tue, 25 Aug 2009)
New Revision: 38853

Modified:
   grass/trunk/lib/symbol/README
   grass/trunk/lib/symbol/read.c
Log:
skip empty and comment lines (merge from devbr6)

Modified: grass/trunk/lib/symbol/README
===================================================================
--- grass/trunk/lib/symbol/README	2009-08-25 07:31:57 UTC (rev 38852)
+++ grass/trunk/lib/symbol/README	2009-08-25 07:34:39 UTC (rev 38853)
@@ -27,8 +27,8 @@
 (specified in module options such as 'd.vect color='). This color may be 
 overwritten by using the COLOR and FCOLOR keywords.
 
+Blank lines and lines starting with a #hash will be ignored.
 
-
 ---- DESCRIPTION OF OBJECTS ----
 
 In the following descriptions these variables are used:

Modified: grass/trunk/lib/symbol/read.c
===================================================================
--- grass/trunk/lib/symbol/read.c	2009-08-25 07:31:57 UTC (rev 38852)
+++ grass/trunk/lib/symbol/read.c	2009-08-25 07:34:39 UTC (rev 38853)
@@ -195,6 +195,11 @@
 
     while (G_getl2(buf, 500, fp) != 0) {
 	G_chop(buf);
+
+	/* skip empty and comment lines */
+	if ((buf[0] == '#') || (buf[0] == '\0'))
+	    continue;
+
 	get_key_data(buf);
 
 	if (strcmp(key, "END") == 0) {
@@ -288,7 +293,12 @@
     /* read file */
     while (G_getl2(buf, 2000, fp) != 0) {
 	G_chop(buf);
-	G_debug(3, "  BUF: %s", buf);
+	G_debug(3, "  BUF: [%s]", buf);
+
+	/* skip empty and comment lines */
+	if ((buf[0] == '#') || (buf[0] == '\0'))
+	    continue;
+
 	get_key_data(buf);
 
 	if (strcmp(key, "VERSION") == 0) {



More information about the grass-commit mailing list