summaryrefslogtreecommitdiffstats
path: root/library/safe.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-07-22 21:59:36 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-07-22 21:59:36 (GMT)
commit14816591e601d46ce04cda2a9046995076aa51f5 (patch)
tree1afdc31e39babf2156e2ff5c0cbc65c505ed0116 /library/safe.tcl
parentc7cbce40a31cd045bd4d15ebf401f13f6172ab2b (diff)
downloadtcl-14816591e601d46ce04cda2a9046995076aa51f5.zip
tcl-14816591e601d46ce04cda2a9046995076aa51f5.tar.gz
tcl-14816591e601d46ce04cda2a9046995076aa51f5.tar.bz2
* library/auto.tcl: Updates to the Tcl script library to make
* library/history.tcl: use of Tcl 8.4 feautures. Thanks to * library/init.tcl: Patrick Fradin for prompting on this. * library/package.tcl: [Patch 1237755]. * library/safe.tcl: * library/word.tcl:
Diffstat (limited to 'library/safe.tcl')
-rw-r--r--library/safe.tcl28
1 files changed, 14 insertions, 14 deletions
diff --git a/library/safe.tcl b/library/safe.tcl
index f34fea2..9c8aff5 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -12,7 +12,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: safe.tcl,v 1.9.2.2 2004/06/29 09:39:01 dkf Exp $
+# RCS: @(#) $Id: safe.tcl,v 1.9.2.3 2005/07/22 21:59:41 dgp Exp $
#
# The implementation is based on namespaces. These naming conventions
@@ -77,7 +77,7 @@ namespace eval ::safe {
upvar $v $v
}
set flag [::tcl::OptProcArgGiven -noStatics];
- if {$flag && ($noStatics == $statics)
+ if {$flag && (!$noStatics == !$statics)
&& ([::tcl::OptProcArgGiven -statics])} {
return -code error\
"conflicting values given for -statics and -noStatics"
@@ -98,7 +98,7 @@ namespace eval ::safe {
set flag [::tcl::OptProcArgGiven -nestedLoadOk];
# note that the test here is the opposite of the "InterpStatics"
# one (it is not -noNested... because of the wanted default value)
- if {$flag && ($nestedLoadOk != $nested)
+ if {$flag && (!$nestedLoadOk != !$nested)
&& ([::tcl::OptProcArgGiven -nested])} {
return -code error\
"conflicting values given for -nested and -nestedLoadOk"
@@ -324,7 +324,7 @@ namespace eval ::safe {
nestedok deletehook} {
# determine and store the access path if empty
- if {[string equal "" $access_path]} {
+ if {$access_path eq ""} {
set access_path [uplevel \#0 set auto_path]
# Make sure that tcl_library is in auto_path
# and at the first position (needed by setAccessPath)
@@ -640,15 +640,15 @@ proc ::safe::setLogCmd {args} {
}
# set/get values
proc Set {args} {
- eval [list Toplevel set] $args
+ eval [linsert $args 0 Toplevel set]
}
# lappend on toplevel vars
proc Lappend {args} {
- eval [list Toplevel lappend] $args
+ eval [linsert $args 0 Toplevel lappend]
}
# unset a var/token (currently just an global level eval)
proc Unset {args} {
- eval [list Toplevel unset] $args
+ eval [linsert $args 0 Toplevel unset]
}
# test existance
proc Exists {varname} {
@@ -778,7 +778,7 @@ proc ::safe::setLogCmd {args} {
# Determine where to load. load use a relative interp path
# and {} means self, so we can directly and safely use passed arg.
set target [lindex $args 1]
- if {[string length $target]} {
+ if {$target ne ""} {
# we will try to load into a sub sub interp
# check that we want to authorize that.
if {![NestedOk $slave]} {
@@ -790,9 +790,9 @@ proc ::safe::setLogCmd {args} {
}
# Determine what kind of load is requested
- if {[string length $file] == 0} {
+ if {$file eq ""} {
# static package loading
- if {[string length $package] == 0} {
+ if {$package eq ""} {
set msg "load error: empty filename and no package name"
Log $slave $msg
return -code error $msg
@@ -860,7 +860,7 @@ proc ::safe::setLogCmd {args} {
proc Subset {slave command okpat args} {
set subcommand [lindex $args 0]
if {[regexp $okpat $subcommand]} {
- return [eval [list $command $subcommand] [lrange $args 1 end]]
+ return [eval [linsert $args 0 $command]]
}
set msg "not allowed to invoke subcommand $subcommand of $command"
Log $slave $msg
@@ -895,11 +895,11 @@ proc ::safe::setLogCmd {args} {
set subcommand [lindex $args 0]
if {[regexp $okpat $subcommand]} {
- return [eval ::interp invokehidden $slave encoding $subcommand \
- [lrange $args 1 end]]
+ return [eval [linsert $args 0 \
+ ::interp invokehidden $slave encoding]]
}
- if {[string match $subcommand system]} {
+ if {[string first $subcommand system] == 0} {
if {$argc == 1} {
# passed all the tests , lets source it:
if {[catch {::interp invokehidden \