From 5d6bed5903c5448fb571d77aeb25ef24d9c36d47 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 8 Apr 2009 16:04:44 +0000 Subject: * library/tcltest/tcltest.tcl: Converted [eval]s (some unsafe!) to * library/tcltest/pkgIndex.tcl: {*} in tcltest package. [Bug 2570363] * unix/Makefile.in: => tcltest 2.3.1 * win/Makefile.in: --- ChangeLog | 7 +++++++ library/tcltest/pkgIndex.tcl | 2 +- library/tcltest/tcltest.tcl | 20 ++++++++++---------- unix/Makefile.in | 6 +++--- win/Makefile.in | 6 +++--- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8d47f5..27fa36d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-08 Don Porter + + * library/tcltest/tcltest.tcl: Converted [eval]s (some unsafe!) to + * library/tcltest/pkgIndex.tcl: {*} in tcltest package. [Bug 2570363] + * unix/Makefile.in: => tcltest 2.3.1 + * win/Makefile.in: + 2009-04-07 Don Porter * generic/tclStringObj.c: Completed backports of fixes for diff --git a/library/tcltest/pkgIndex.tcl b/library/tcltest/pkgIndex.tcl index f062cde..5b33ac7 100644 --- a/library/tcltest/pkgIndex.tcl +++ b/library/tcltest/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.5]} {return} -package ifneeded tcltest 2.3.0 [list source [file join $dir tcltest.tcl]] +package ifneeded tcltest 2.3.1 [list source [file join $dir tcltest.tcl]] diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index d799eb0..52f7bf4 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -16,7 +16,7 @@ # Contributions from Don Porter, NIST, 2002. (not subject to US copyright) # All rights reserved. # -# RCS: @(#) $Id: tcltest.tcl,v 1.103 2007/12/13 15:26:03 dgp Exp $ +# RCS: @(#) $Id: tcltest.tcl,v 1.103.2.1 2009/04/08 16:04:48 dgp Exp $ package require Tcl 8.5 ;# -verbose line uses [info frame] namespace eval tcltest { @@ -24,7 +24,7 @@ namespace eval tcltest { # When the version number changes, be sure to update the pkgIndex.tcl file, # and the install directory in the Makefiles. When the minor version # changes (new feature) be sure to update the man page as well. - variable Version 2.3.0 + variable Version 2.3.1 # Compatibility support for dumb variables defined in tcltest 1 # Do not use these. Call [package provide Tcl] and [info patchlevel] @@ -602,7 +602,7 @@ namespace eval tcltest { } proc configure args { RemoveAutoConfigureTraces - set code [catch {eval Configure $args} msg] + set code [catch {Configure {*}$args} msg] return -code $code $msg } @@ -1420,7 +1420,7 @@ proc tcltest::ProcessFlags {flagArray} { RemoveAutoConfigureTraces } else { set args $flagArray - while {[llength $args]>1 && [catch {eval configure $args} msg]} { + while {[llength $args]>1 && [catch {configure {*}$args} msg]} { # Something went wrong parsing $args for tcltest options # Check whether the problem is "unknown option" @@ -1585,7 +1585,7 @@ proc tcltest::Replace::puts {args} { # If we haven't returned by now, we don't know how to handle the # input. Let puts handle it. - return [eval Puts $args] + return [Puts {*}$args] } # tcltest::Eval -- @@ -2242,12 +2242,12 @@ proc tcltest::Skipped {name constraints} { set doTest 0 if {[string match {*[$\[]*} $constraints] != 0} { # full expression, e.g. {$foo > [info tclversion]} - catch {set doTest [uplevel #0 expr $constraints]} + catch {set doTest [uplevel #0 [list expr $constraints]]} } elseif {[regexp {[^.:_a-zA-Z0-9 \n\r\t]+} $constraints] != 0} { # something like {a || b} should be turned into # $testConstraints(a) || $testConstraints(b). regsub -all {[.\w]+} $constraints {$testConstraints(&)} c - catch {set doTest [eval expr $c]} + catch {set doTest [eval [list expr $c]]} } elseif {![catch {llength $constraints}]} { # just simple constraints such as {unixOnly fonts}. set doTest 1 @@ -2571,7 +2571,7 @@ proc tcltest::cleanupTests {{calledFromAllFile 0}} { # None # a lower case version is needed for compatibility with tcltest 1.0 -proc tcltest::getMatchingFiles args {eval GetMatchingFiles $args} +proc tcltest::getMatchingFiles args {GetMatchingFiles {*}$args} proc tcltest::GetMatchingFiles { args } { if {[llength $args]} { @@ -3326,12 +3326,12 @@ namespace eval tcltest { Tcl list: $msg" return } - if {[llength $::env(TCLTEST_OPTIONS)] % 2} { + if {[llength $options] % 2} { Warn "invalid TCLTEST_OPTIONS: \"$options\":\n should be\ -option value ?-option value ...?" return } - if {[catch {eval Configure $::env(TCLTEST_OPTIONS)} msg]} { + if {[catch {Configure {*}$options} msg]} { Warn "invalid TCLTEST_OPTIONS: \"$options\":\n $msg" return } diff --git a/unix/Makefile.in b/unix/Makefile.in index 84ad721..c9f3e26 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -4,7 +4,7 @@ # "./configure", which is a configuration script generated by the "autoconf" # program (constructs like "@foo@" will get replaced in the actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.229.2.11 2009/01/20 03:54:35 kennykb Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.229.2.12 2009/04/08 16:04:48 dgp Exp $ VERSION = @TCL_VERSION@ MAJOR_VERSION = @TCL_MAJOR_VERSION@ @@ -795,8 +795,8 @@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs done; @echo "Installing package msgcat 1.4.2 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.4.2.tm; - @echo "Installing package tcltest 2.3.0 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.0.tm; + @echo "Installing package tcltest 2.3.1 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.1.tm; @echo "Installing package platform 1.0.3 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.3.tm; diff --git a/win/Makefile.in b/win/Makefile.in index ed02377..00b6793 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -4,7 +4,7 @@ # "./configure", which is a configuration script generated by the "autoconf" # program (constructs like "@foo@" will get replaced in the actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.124.2.6 2008/11/10 17:57:10 andreas_kupries Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.124.2.7 2009/04/08 16:04:59 dgp Exp $ VERSION = @TCL_VERSION@ @@ -644,8 +644,8 @@ install-libraries: libraries install-tzdata install-msgs done; @echo "Installing package msgcat 1.4.2 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.4.2.tm; - @echo "Installing package tcltest 2.3.0 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.0.tm; + @echo "Installing package tcltest 2.3.1 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.1.tm; @echo "Installing package platform 1.0.3 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.3.tm; @echo "Installing package platform::shell 1.1.4 as a Tcl Module"; -- cgit v0.12