[GRASS-SVN] r45817 - grass/branches/develbranch_6/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Mar 31 08:45:34 EDT 2011


Author: marisn
Date: 2011-03-31 05:45:34 -0700 (Thu, 31 Mar 2011)
New Revision: 45817

Modified:
   grass/branches/develbranch_6/lib/init/gis_set.tcl
Log:
gis.m Don't fail on wxGUI broken .grassrc file (merge from 6.4 r45815)

Modified: grass/branches/develbranch_6/lib/init/gis_set.tcl
===================================================================
--- grass/branches/develbranch_6/lib/init/gis_set.tcl	2011-03-31 12:44:30 UTC (rev 45816)
+++ grass/branches/develbranch_6/lib/init/gis_set.tcl	2011-03-31 12:45:34 UTC (rev 45817)
@@ -60,14 +60,14 @@
 
             lappend grassrc_list "$thisline"
 
-	    if { [regexp -- {^GISDBASE: *(.*)$} $thisline dummy env_database] } {
-                set database $env_database
+	    if { [regexp -- {^GISDBASE.*:(.*)$} $thisline dummy env_database] } {
+                set database [string trim $env_database]
             }
-            if { [regexp -- {^LOCATION_NAME: *(.*)$} $thisline dummy env_location] } {
-                set location $env_location
+            if { [regexp -- {^LOCATION_NAME.*:(.*)$} $thisline dummy env_location] } {
+                set location [string trim $env_location]
             }
-            if { [regexp -- {^MAPSET: *(.*)$} $thisline dummy env_mapset] } {
-                set mapset $env_mapset
+            if { [regexp -- {^MAPSET.*:(.*)$} $thisline dummy env_mapset] } {
+                set mapset [string trim $env_mapset]
             }
             set thisline [gets $ifp]
       }
@@ -96,11 +96,11 @@
 	set ofp [open $filename "w"]
 
 	foreach i $grassrc_list {
-		if { [regexp {^GISDBASE:} $i] } {
+		if { [regexp {^GISDBASE.*:} $i] } {
 			puts $ofp "GISDBASE: $database"
-		} elseif { [regexp {^LOCATION_NAME:} $i] } {
+		} elseif { [regexp {^LOCATION_NAME.*:} $i] } {
 			puts $ofp "LOCATION_NAME: $location"
-		} elseif { [regexp {^MAPSET:} $i] } {
+		} elseif { [regexp {^MAPSET.*:} $i] } {
 			puts $ofp "MAPSET: $mapset"
 		} else {
 			puts $ofp $i


Property changes on: grass/branches/develbranch_6/lib/init/gis_set.tcl
___________________________________________________________________
Added: svn:mergeinfo
   + /grass/branches/releasebranch_6_4/lib/init/gis_set.tcl:45815
/grass/trunk/lib/init/gis_set.tcl:42592,42597



More information about the grass-commit mailing list