[GRASS-SVN] r60636 - grass/branches/releasebranch_7_0/raster/r.univar

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 31 07:45:48 PDT 2014


Author: martinl
Date: 2014-05-31 07:45:48 -0700 (Sat, 31 May 2014)
New Revision: 60636

Modified:
   grass/branches/releasebranch_7_0/raster/r.univar/r.univar_main.c
   grass/branches/releasebranch_7_0/raster/r.univar/r3.univar_main.c
Log:
hcho: r.univar: use G_option_to_separator()
      (merge r60612 from trunk)


Modified: grass/branches/releasebranch_7_0/raster/r.univar/r.univar_main.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.univar/r.univar_main.c	2014-05-31 14:16:58 UTC (rev 60635)
+++ grass/branches/releasebranch_7_0/raster/r.univar/r.univar_main.c	2014-05-31 14:45:48 UTC (rev 60636)
@@ -120,15 +120,7 @@
     G_get_window(&region);
     
     /* table field separator */
-    zone_info.sep = param.separator->answer;
-    if (strcmp(zone_info.sep, "\\t") == 0)
-	zone_info.sep = "\t";
-    if (strcmp(zone_info.sep, "tab") == 0)
-	zone_info.sep = "\t";
-    if (strcmp(zone_info.sep, "space") == 0)
-	zone_info.sep = " ";
-    if (strcmp(zone_info.sep, "comma") == 0)
-	zone_info.sep = ",";
+    zone_info.sep = G_option_to_separator(param.separator);
 
     zone_info.min = 0.0 / 0.0;	/* set to nan as default */
     zone_info.max = 0.0 / 0.0;	/* set to nan as default */

Modified: grass/branches/releasebranch_7_0/raster/r.univar/r3.univar_main.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.univar/r3.univar_main.c	2014-05-31 14:16:58 UTC (rev 60635)
+++ grass/branches/releasebranch_7_0/raster/r.univar/r3.univar_main.c	2014-05-31 14:45:48 UTC (rev 60636)
@@ -126,15 +126,7 @@
     }
 
     /* table field separator */
-    zone_info.sep = param.separator->answer;
-    if (strcmp(zone_info.sep, "\\t") == 0)
-	zone_info.sep = "\t";
-    if (strcmp(zone_info.sep, "tab") == 0)
-	zone_info.sep = "\t";
-    if (strcmp(zone_info.sep, "space") == 0)
-	zone_info.sep = " ";
-    if (strcmp(zone_info.sep, "comma") == 0)
-	zone_info.sep = ",";
+    zone_info.sep = G_option_to_separator(param.separator);
 
     dmin = 0.0 / 0.0;	/* set to nan as default */
     dmax = 0.0 / 0.0;	/* set to nan as default */



More information about the grass-commit mailing list