diff options
author | dgp <dgp@users.sourceforge.net> | 2001-11-09 23:09:09 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2001-11-09 23:09:09 (GMT) |
commit | 3bfeaf20080eedcc80fb76c3c10449ed366bee4d (patch) | |
tree | 8aabe6df3d9216410154276d30f97c0b895a9525 | |
parent | d3041fc8916b673bd05d90747fd37b0d8765e8f8 (diff) | |
download | tcl-3bfeaf20080eedcc80fb76c3c10449ed366bee4d.zip tcl-3bfeaf20080eedcc80fb76c3c10449ed366bee4d.tar.gz tcl-3bfeaf20080eedcc80fb76c3c10449ed366bee4d.tar.bz2 |
* tests/var.test:
* generic/tclVar.c: Corrected bug in [global] when dealing
with variable names matching :*. [Bug 480176]
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclVar.c | 4 | ||||
-rw-r--r-- | tests/var.test | 12 |
3 files changed, 19 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2001-11-09 Don Porter <dgp@users.sourceforge.net> + + * tests/var.test: + * generic/tclVar.c: Corrected bug in [global] when dealing + with variable names matching :*. [Bug 480176] + 2001-11-06 Andreas Kupries <andreas_kupries@users.sourceforge.net> * generic/tclIO.c (ReadChars): Fixed bug #478856 reported by diff --git a/generic/tclVar.c b/generic/tclVar.c index ee3d63e..f770ee1 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclVar.c,v 1.16.2.1 2001/04/03 22:54:38 hobbs Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.16.2.2 2001/11/09 23:09:09 dgp Exp $ */ #include "tclInt.h" @@ -3785,7 +3785,7 @@ Tcl_GlobalObjCmd(dummy, interp, objc, objv) while ((tail > varName) && ((*tail != ':') || (*(tail-1) != ':'))) { tail--; } - if (*tail == ':') { + if ((*tail == ':') && (tail > varName)) { tail++; } diff --git a/tests/var.test b/tests/var.test index fb378ae..3966830 100644 --- a/tests/var.test +++ b/tests/var.test @@ -14,7 +14,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: var.test,v 1.15 2000/04/10 17:19:06 ericm Exp $ +# RCS: @(#) $Id: var.test,v 1.15.2.1 2001/11/09 23:09:09 dgp Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { @@ -324,6 +324,16 @@ test var-6.3 {Tcl_GlobalObjCmd, variable named {} qualified by a namespace name} } p } {24} +test var-6.4 {Tcl_GlobalObjCmd, variable name matching :*} { + # Test for Tcl Bug 480176 + set :v broken + proc p {} { + global :v + set :v fixed + } + p + set :v +} {fixed} test var-7.1 {Tcl_VariableObjCmd, create and initialize one new ns variable} { catch {namespace delete test_ns_var} |