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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 8 04:03:09 PDT 2014


Author: hcho
Date: 2014-06-08 04:03:09 -0700 (Sun, 08 Jun 2014)
New Revision: 60749

Modified:
   grass/trunk/general/g.mlist/main.c
Log:
g.mlist: check if mapset exists

Modified: grass/trunk/general/g.mlist/main.c
===================================================================
--- grass/trunk/general/g.mlist/main.c	2014-06-08 10:49:09 UTC (rev 60748)
+++ grass/trunk/general/g.mlist/main.c	2014-06-08 11:03:09 UTC (rev 60749)
@@ -215,6 +215,10 @@
 			  mapset);
         mapset = NULL;         /* all mapsets */
     }
+    else if ((i = G__mapset_permissions(mapset)) == -1)
+	G_fatal_error(_("Mapset <%s> does not exist"), mapset);
+    else if (i == 0)
+	G_warning(_("Permission denied for mapset <%s>. Trying to list files..."), mapset);
 
     for (i = 0; opt.type->answers[i]; i++) {
 	if (strcmp(opt.type->answers[i], "all") == 0)



More information about the grass-commit mailing list