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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 13 21:43:22 PST 2013


Author: glynn
Date: 2013-02-13 21:43:22 -0800 (Wed, 13 Feb 2013)
New Revision: 55041

Modified:
   grass/trunk/general/g.mlist/main.c
Log:
Add mapset when required for disambiguation (issue #1390)


Modified: grass/trunk/general/g.mlist/main.c
===================================================================
--- grass/trunk/general/g.mlist/main.c	2013-02-14 05:22:36 UTC (rev 55040)
+++ grass/trunk/general/g.mlist/main.c	2013-02-14 05:43:22 UTC (rev 55041)
@@ -261,6 +261,7 @@
     
     for (i = 0; i < count; i++) {
 	char *name = list[i];
+	int need_mapset = 0;
 
 	if (any && i != 0)
 	    fprintf(stdout, "%s", separator);
@@ -270,7 +271,11 @@
 
 	fprintf(stdout, "%s", name);
 
-	if (add_mapset)
+	if (!add_mapset) {
+	    const char *mapset2 = G_find_raster2(name, "");
+	    need_mapset = strcmp(mapset, mapset2) != 0;
+	}
+	if (add_mapset || need_mapset)
 	    fprintf(stdout, "@%s", mapset);
 
 	G_free(name);



More information about the grass-commit mailing list