瀏覽代碼

hcho: r.univar: use G_option_to_separator()
(merge https://trac.osgeo.org/grass/changeset/60612 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@60636 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 11 年之前
父節點
當前提交
9a83d785a5
共有 2 個文件被更改,包括 2 次插入18 次删除
  1. 1 9
      raster/r.univar/r.univar_main.c
  2. 1 9
      raster/r.univar/r3.univar_main.c

+ 1 - 9
raster/r.univar/r.univar_main.c

@@ -120,15 +120,7 @@ int main(int argc, char *argv[])
     G_get_window(&region);
     G_get_window(&region);
     
     
     /* table field separator */
     /* 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.min = 0.0 / 0.0;	/* set to nan as default */
     zone_info.max = 0.0 / 0.0;	/* set to nan as default */
     zone_info.max = 0.0 / 0.0;	/* set to nan as default */

+ 1 - 9
raster/r.univar/r3.univar_main.c

@@ -126,15 +126,7 @@ int main(int argc, char *argv[])
     }
     }
 
 
     /* table field separator */
     /* 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 */
     dmin = 0.0 / 0.0;	/* set to nan as default */
     dmax = 0.0 / 0.0;	/* set to nan as default */
     dmax = 0.0 / 0.0;	/* set to nan as default */