diff options
author | dgp <dgp@users.sourceforge.net> | 2009-04-08 16:02:07 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2009-04-08 16:02:07 (GMT) |
commit | 56d606da4f2c662cd78633e61ac518bd99f52c57 (patch) | |
tree | 308410a7672c62d0bca58e1c415e7056b7f970e2 /library | |
parent | a04bd79877fc0082c18a3b9f7afa934b9f67cfd0 (diff) | |
download | tcl-56d606da4f2c662cd78633e61ac518bd99f52c57.zip tcl-56d606da4f2c662cd78633e61ac518bd99f52c57.tar.gz tcl-56d606da4f2c662cd78633e61ac518bd99f52c57.tar.bz2 |
* library/tcltest/tcltest.tcl: Fixed unsafe [eval]s in the tcltest
* library/tcltest/pkgIndex.tcl: package. [Bug 2570363]
Diffstat (limited to 'library')
-rw-r--r-- | library/tcltest/pkgIndex.tcl | 2 | ||||
-rw-r--r-- | library/tcltest/tcltest.tcl | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/library/tcltest/pkgIndex.tcl b/library/tcltest/pkgIndex.tcl index ec0ef1f..e569fa5 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.3]} {return} -package ifneeded tcltest 2.2.9 [list source [file join $dir tcltest.tcl]] +package ifneeded tcltest 2.2.10 [list source [file join $dir tcltest.tcl]] diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index b78c822..f799f90 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.78.2.14 2007/09/11 21:18:42 dgp Exp $ +# RCS: @(#) $Id: tcltest.tcl,v 1.78.2.15 2009/04/08 16:02:20 dgp Exp $ package require Tcl 8.3 ;# uses [glob -directory] 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.2.9 + variable Version 2.2.10 # Compatibility support for dumb variables defined in tcltest 1 # Do not use these. Call [package provide Tcl] and [info patchlevel] @@ -1419,7 +1419,7 @@ proc tcltest::ProcessFlags {flagArray} { RemoveAutoConfigureTraces } else { set args $flagArray - while {[llength $args]>1 && [catch {eval configure $args} msg]} { + while {[llength $args]>1 && [catch {eval [linsert $args 0 configure]} msg]} { # Something went wrong parsing $args for tcltest options # Check whether the problem is "unknown option" @@ -2221,12 +2221,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 @@ -3305,12 +3305,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 {eval [linsert $options 0 Configure]} msg]} { Warn "invalid TCLTEST_OPTIONS: \"$options\":\n $msg" return } |