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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 10 08:24:34 PST 2014


Author: martinl
Date: 2014-01-10 08:24:34 -0800 (Fri, 10 Jan 2014)
New Revision: 58667

Modified:
   grass/trunk/general/g.mlist/main.c
Log:
g.mlist: fix segfault when mapset is not in the path


Modified: grass/trunk/general/g.mlist/main.c
===================================================================
--- grass/trunk/general/g.mlist/main.c	2014-01-10 15:26:56 UTC (rev 58666)
+++ grass/trunk/general/g.mlist/main.c	2014-01-10 16:24:34 UTC (rev 58667)
@@ -273,7 +273,8 @@
 
 	if (!add_mapset) {
 	    const char *mapset2 = G_find_file2(element, name, "");
-	    need_mapset = strcmp(mapset, mapset2) != 0;
+            if (mapset2)
+                need_mapset = strcmp(mapset, mapset2) != 0;
 	}
 	if (add_mapset || need_mapset)
 	    fprintf(stdout, "@%s", mapset);



More information about the grass-commit mailing list