瀏覽代碼

r.univar: use G_option_to_separator()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@60612 15284696-431f-4ddb-bdfa-cd5b030d7da7
Huidae Cho 11 年之前
父節點
當前提交
45c71d6de3
共有 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);
     
     /* 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 */

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

@@ -126,15 +126,7 @@ int main(int argc, char *argv[])
     }
 
     /* 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 */