[GRASS-SVN] r30629 - in grass/trunk: lib/gis raster/r.colors
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Mar 19 02:55:50 EDT 2008
Author: hamish
Date: 2008-03-19 02:55:50 -0400 (Wed, 19 Mar 2008)
New Revision: 30629
Modified:
grass/trunk/lib/gis/color_rules.c
grass/trunk/raster/r.colors/rules.c
Log:
use G_getl2() instead of fgets; ie strip off trailing newline so empty line is skipped
Modified: grass/trunk/lib/gis/color_rules.c
===================================================================
--- grass/trunk/lib/gis/color_rules.c 2008-03-19 06:31:28 UTC (rev 30628)
+++ grass/trunk/lib/gis/color_rules.c 2008-03-19 06:55:50 UTC (rev 30629)
@@ -134,10 +134,11 @@
for (;;)
{
- if (!fgets(buf, sizeof(buf), fp))
+ if (!G_getl2(buf, sizeof(buf), fp))
return 0;
G_strip(buf);
+ G_debug(5, "color buf = [%s]", buf);
if (*buf == '\0')
continue;
Modified: grass/trunk/raster/r.colors/rules.c
===================================================================
--- grass/trunk/raster/r.colors/rules.c 2008-03-19 06:31:28 UTC (rev 30628)
+++ grass/trunk/raster/r.colors/rules.c 2008-03-19 06:55:50 UTC (rev 30629)
@@ -81,7 +81,7 @@
if (tty)
fprintf(stderr,"> ");
- if (!fgets(buf, sizeof(buf), fp))
+ if (!G_getl2(buf, sizeof(buf), fp))
return 0;
for (i = 0; buf[i]; i++)
More information about the grass-commit
mailing list