[GRASS-SVN] r61997 - grass/trunk/lib/temporal/lib
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Sep 16 09:38:33 PDT 2014
Author: huhabla
Date: 2014-09-16 09:38:33 -0700 (Tue, 16 Sep 2014)
New Revision: 61997
Modified:
grass/trunk/lib/temporal/lib/connect.c
Log:
temporal library: Better environment management
Modified: grass/trunk/lib/temporal/lib/connect.c
===================================================================
--- grass/trunk/lib/temporal/lib/connect.c 2014-09-16 15:26:22 UTC (rev 61996)
+++ grass/trunk/lib/temporal/lib/connect.c 2014-09-16 16:38:33 UTC (rev 61997)
@@ -90,11 +90,12 @@
static char *get_mapset_connection_name(const char *mapset, int contype)
{
const char *val = NULL;
- char *ret_val = NULL;
+ char *ret_val = NULL;;
+ const char *gisdbase = G__getenv("GISDBASE");
+ const char *location = G__getenv("LOCATION_NAME");
int ret;
- ret = G__mapset_permissions2(G__getenv("GISDBASE"),
- G__getenv("LOCATION_NAME"), mapset);
+ ret = G__mapset_permissions2(gisdbase, location, mapset);
switch (ret) {
case 0:
G_warning(_("You don't have permission to access the mapset <%s>"),
@@ -109,8 +110,8 @@
}
G_create_alt_env();
- G__setenv("GISDBASE", G_gisdbase());
- G__setenv("LOCATION_NAME", G_location());
+ G__setenv("GISDBASE", gisdbase);
+ G__setenv("LOCATION_NAME", location);
G__setenv("MAPSET", mapset);
G__read_mapset_env();
More information about the grass-commit
mailing list