[GRASS-SVN] r56105 - grass/branches/releasebranch_6_4/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 3 20:59:48 PDT 2013


Author: hamish
Date: 2013-05-03 20:59:48 -0700 (Fri, 03 May 2013)
New Revision: 56105

Modified:
   grass/branches/releasebranch_6_4/lib/init/gis_set.tcl
Log:
regex .* is greedy, was eating C: too. (see #1727, r45817, #1340; merge from devbr6 r56071)

Modified: grass/branches/releasebranch_6_4/lib/init/gis_set.tcl
===================================================================
--- grass/branches/releasebranch_6_4/lib/init/gis_set.tcl	2013-05-04 03:31:47 UTC (rev 56104)
+++ grass/branches/releasebranch_6_4/lib/init/gis_set.tcl	2013-05-04 03:59:48 UTC (rev 56105)
@@ -60,13 +60,13 @@
 
             lappend grassrc_list "$thisline"
 
-	    if { [regexp -- {^GISDBASE.*:(.*)$} $thisline dummy env_database] } {
+	    if { [regexp -- {^GISDBASE:(.*)$} $thisline dummy env_database] } {
                 set database [string trim $env_database]
             }
-            if { [regexp -- {^LOCATION_NAME.*:(.*)$} $thisline dummy env_location] } {
+            if { [regexp -- {^LOCATION_NAME:(.*)$} $thisline dummy env_location] } {
                 set location [string trim $env_location]
             }
-            if { [regexp -- {^MAPSET.*:(.*)$} $thisline dummy 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



More information about the grass-commit mailing list