[GRASS-SVN] r64414 - grass/branches/releasebranch_7_0/general/g.gisenv
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Feb 3 03:07:35 PST 2015
Author: martinl
Date: 2015-02-03 03:07:35 -0800 (Tue, 03 Feb 2015)
New Revision: 64414
Modified:
grass/branches/releasebranch_7_0/general/g.gisenv/main.c
Log:
g.gisenv (bugfix): check for mandatory variables which cannot be unset
(merge r64413 from trunk)
Modified: grass/branches/releasebranch_7_0/general/g.gisenv/main.c
===================================================================
--- grass/branches/releasebranch_7_0/general/g.gisenv/main.c 2015-02-03 11:03:00 UTC (rev 64413)
+++ grass/branches/releasebranch_7_0/general/g.gisenv/main.c 2015-02-03 11:07:35 UTC (rev 64414)
@@ -9,7 +9,7 @@
* Markus Neteler <neteler itc.it>
* Martin Landa <landa.martin gmail.com>
* PURPOSE:
- * COPYRIGHT: (C) 2003-2014 by the GRASS Development Team
+ * COPYRIGHT: (C) 2003-2015 by the GRASS Development Team
*
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
@@ -165,6 +165,14 @@
n = 0;
while (unset_opt->answers[n]) {
u_name = parse_variable(unset_opt->answers[n], &value);
+ if (G_strcasecmp(u_name, "GISDBASE") == 0 ||
+ G_strcasecmp(u_name, "LOCATION_NAME") == 0 ||
+ G_strcasecmp(u_name, "MAPSET") == 0) {
+ G_warning(_("Variable <%s> is mandatory. No operation performed."),
+ u_name);
+ n++;
+ continue;
+ }
if (value)
G_warning(_("Value '%s' ignored when unsetting the GRASS variable"),
value);
More information about the grass-commit
mailing list