瀏覽代碼

r.category: use G_option_to_separator()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54814 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年之前
父節點
當前提交
2a323f977a
共有 1 個文件被更改,包括 2 次插入14 次删除
  1. 2 14
      raster/r.category/main.c

+ 2 - 14
raster/r.category/main.c

@@ -108,20 +108,8 @@ int main(int argc, char *argv[])
 
 
     name = parm.map->answer;
     name = parm.map->answer;
 
 
-    /* see v.in.ascii for a better solution */
-    if (strcmp(parm.fs->answer, "space") == 0)
-	fs = ' ';
-    else if (strcmp(parm.fs->answer, "\\t") == 0)
-	fs = '\t';
-    else if (strcmp(parm.fs->answer, "newline") == 0)
-	fs = '\n';
-    else if (strcmp(parm.fs->answer, "comma") == 0)
-	fs = ',';
-    else if (strcmp(parm.fs->answer, "tab") == 0)
-	fs = '\t';
-    else
-	fs = parm.fs->answer[0];
-
+    fs = G_option_to_separator(parm.fs);
+    
     mapset = G_find_raster2(name, "");
     mapset = G_find_raster2(name, "");
     if (mapset == NULL)
     if (mapset == NULL)
 	G_fatal_error(_("Raster map <%s> not found"), name);
 	G_fatal_error(_("Raster map <%s> not found"), name);