Explorar o código

g.mlist: fix segfault when mapset is not in the path

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58667 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa %!s(int64=11) %!d(string=hai) anos
pai
achega
017ac4e4b3
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      general/g.mlist/main.c

+ 2 - 1
general/g.mlist/main.c

@@ -273,7 +273,8 @@ static void make_list(
 
 	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);