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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 1 22:18:45 PDT 2013


Author: hamish
Date: 2013-05-01 22:18:45 -0700 (Wed, 01 May 2013)
New Revision: 56071

Modified:
   grass/branches/develbranch_6/lib/init/gis_set.tcl
Log:
regex .* is greedy, was eating C: too. (see #1727, r45817, #1340)

Modified: grass/branches/develbranch_6/lib/init/gis_set.tcl
===================================================================
--- grass/branches/develbranch_6/lib/init/gis_set.tcl	2013-05-02 04:59:07 UTC (rev 56070)
+++ grass/branches/develbranch_6/lib/init/gis_set.tcl	2013-05-02 05:18:45 UTC (rev 56071)
@@ -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