[GRASS-SVN] r60570 - grass/trunk/general/g.mlist
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed May 28 20:17:59 PDT 2014
Author: hcho
Date: 2014-05-28 20:17:59 -0700 (Wed, 28 May 2014)
New Revision: 60570
Modified:
grass/trunk/general/g.mlist/main.c
Log:
g.mlist: fatal error on bad pattern
Modified: grass/trunk/general/g.mlist/main.c
===================================================================
--- grass/trunk/general/g.mlist/main.c 2014-05-29 00:26:42 UTC (rev 60569)
+++ grass/trunk/general/g.mlist/main.c 2014-05-29 03:17:59 UTC (rev 60570)
@@ -52,7 +52,7 @@
struct Flag *full;
} flag;
int i, n, all, num_types, nlist;
- void *filter = NULL, *exclude = NULL;
+ void *filter, *exclude;
FILE *fp;
const char *mapset;
char *separator;
@@ -159,7 +159,12 @@
(int)flag.extended->answer);
else
filter = G_ls_glob_filter(opt.pattern->answer, 0);
+ if (!filter)
+ G_fatal_error(_("Unable to compile pattern <%s>"),
+ opt.pattern->answer);
}
+ else
+ filter = NULL;
if (opt.exclude->answer) {
if (flag.regex->answer || flag.extended->answer)
@@ -167,7 +172,12 @@
(int)flag.extended->answer);
else
exclude = G_ls_glob_filter(opt.exclude->answer, 1);
+ if (!exclude)
+ G_fatal_error(_("Unable to compile pattern <%s>"),
+ opt.exclude->answer);
}
+ else
+ exclude = NULL;
separator = G_option_to_separator(opt.separator);
fp = G_open_option_file(opt.output);
More information about the grass-commit
mailing list