[GRASS-SVN] r38852 - grass/branches/develbranch_6/lib/symbol

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 25 03:31:59 EDT 2009


Author: hamish
Date: 2009-08-25 03:31:57 -0400 (Tue, 25 Aug 2009)
New Revision: 38852

Modified:
   grass/branches/develbranch_6/lib/symbol/read.c
Log:
skip empty and comment lines

Modified: grass/branches/develbranch_6/lib/symbol/read.c
===================================================================
--- grass/branches/develbranch_6/lib/symbol/read.c	2009-08-25 06:58:41 UTC (rev 38851)
+++ grass/branches/develbranch_6/lib/symbol/read.c	2009-08-25 07:31:57 UTC (rev 38852)
@@ -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) {
@@ -287,7 +292,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