[GRASS5] [bug #1797] (grass) g.gisenv

Request Tracker grass-bugs at intevation.de
Sat Apr 12 03:33:39 EDT 2003


this bug's URL: http://intevation.de/rt/webrt?serial_num=1797
-------------------------------------------------------------------------

Subject: g.gisenv

g.gisenv lets you set a variable to nonexistant values without a check, and
the only way to go on is to exit GRASS and delete/edit the .grassrc5 file.

e.g., (user1 exists, usr1 doesn't)

GRASS:~ > g.gisenv MAPSET
user1
GRASS:~ > g.gisenv set="MAPSET=usr1"
GRASS:~ >
GRASS:~ > g.gisenv
ERROR: MAPSET usr1 not found
GRASS:~ >
GRASS:~ > g.gisenv set="MAPSET=user1"
ERROR: MAPSET usr1 not found
GRASS:~ > exit


I had a try using G_getenv to make a backup copy of the old value before
attempting to G_setenv, and then test G_getenv for success, but as G_getenv
fails with an exit, I can't set it back to the original if it fails..

When you try to fix it later with another set= to a real value, it fails (and
G_fatal_error's) again before it can set the new value.

any ideas?


Hamish


-------------------------------------------- Managed by Request Tracker




More information about the grass-dev mailing list