[GRASS-SVN] r60509 - grass/trunk/general/g.mlist

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 27 02:32:00 PDT 2014


Author: martinl
Date: 2014-05-27 02:32:00 -0700 (Tue, 27 May 2014)
New Revision: 60509

Modified:
   grass/trunk/general/g.mlist/main.c
Log:
g.mlist: use G_option_to_separator

Modified: grass/trunk/general/g.mlist/main.c
===================================================================
--- grass/trunk/general/g.mlist/main.c	2014-05-27 09:17:02 UTC (rev 60508)
+++ grass/trunk/general/g.mlist/main.c	2014-05-27 09:32:00 UTC (rev 60509)
@@ -55,7 +55,7 @@
     void *filter = NULL, *exclude = NULL;
     FILE *fp;
     const char *mapset;
-    char separator[2];
+    char *separator;
 
     G_gisinit(argv[0]);
 
@@ -169,17 +169,7 @@
 	    exclude = G_ls_glob_filter(opt.exclude->answer, 1);
     }
 
-    if (strcmp(opt.separator->answer, "newline") == 0)
-	separator[0] = '\n';
-    else if (strcmp(opt.separator->answer, "comma") == 0)
-	separator[0] = ',';
-    else if (strcmp(opt.separator->answer, "space") == 0)
-	separator[0] = ' ';
-    else if (strcmp(opt.separator->answer, "tab") == 0)
-	separator[0] = '\t';
-    else
-	separator[0] = opt.separator->answer[0];
-    separator[1] = 0;
+    separator = G_option_to_separator(opt.separator);
 
     if (!opt.output->answer || strcmp(opt.output->answer, "-") == 0)
 	fp = stdout;



More information about the grass-commit mailing list