[GRASS-SVN] r57470 - grass/trunk/lib/vector/Vlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Aug 19 03:03:05 PDT 2013
Author: martinl
Date: 2013-08-19 03:03:04 -0700 (Mon, 19 Aug 2013)
New Revision: 57470
Modified:
grass/trunk/lib/vector/Vlib/open.c
Log:
vlib: fix opening temporary vector maps (when `mapset == ""`)
Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c 2013-08-18 16:20:43 UTC (rev 57469)
+++ grass/trunk/lib/vector/Vlib/open.c 2013-08-19 10:03:04 UTC (rev 57470)
@@ -241,9 +241,15 @@
else {
char file_path[GPATH_MAX];
- if (strcmp(Map->mapset, G_mapset()) != 0) {
- G_warning(_("Temporary vector maps can be accessed only in the current mapset"));
- return -1;
+ /* temporary map: reduce to current mapset if search path
+ * was set */
+ if (strcmp(Map->mapset, "") == 0)
+ Map->mapset = G_store(G_mapset());
+ else {
+ if (strcmp(Map->mapset, G_mapset()) != 0) {
+ G_warning(_("Temporary vector maps can be accessed only in the current mapset"));
+ return -1;
+ }
}
G_file_name(file_path, path, GV_HEAD_ELEMENT, Map->mapset);
if (access(file_path, F_OK) != 0)
More information about the grass-commit
mailing list