summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--library/safe.tcl8
-rw-r--r--tests/safe.test4
3 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 831a721..daed68b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-01 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * library/safe.tcl: Improved handling of non-standard module
+ * tests/safe.test: path lists, empty path lists in particular.
+
2010-11-01 Kevin B. Kenny <kennykb@acm.org>
* library/tzdata/Asia/Hong_Kong:
diff --git a/library/safe.tcl b/library/safe.tcl
index 0cae5fd..3c2a2c4 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.41 2010/09/02 18:31:00 andreas_kupries Exp $
+# RCS: @(#) $Id: safe.tcl,v 1.42 2010/11/02 21:42:28 stwo Exp $
#
# The implementation is based on namespaces. These naming conventions are
@@ -500,9 +500,9 @@ proc ::safe::InterpInit {
# Sync the paths used to search for Tcl modules. This can be done only
# now, after tm.tcl was loaded.
namespace upvar ::safe S$slave state
- ::interp eval $slave [list \
- ::tcl::tm::add {*}$state(tm_path_slave)]
-
+ if {[llength $state(tm_path_slave)] > 0} {
+ ::interp eval $slave [list ::tcl::tm::add {*}$state(tm_path_slave)]
+ }
return $slave
}
diff --git a/tests/safe.test b/tests/safe.test
index c22cf6e..14cd021 100644
--- a/tests/safe.test
+++ b/tests/safe.test
@@ -10,7 +10,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.test,v 1.34 2010/08/18 13:31:55 dkf Exp $
+# RCS: @(#) $Id: safe.test,v 1.35 2010/11/02 21:42:28 stwo Exp $
package require Tcl 8.5
@@ -205,7 +205,7 @@ test safe-7.2 {tests specific path and interpFind/AddToAccessPath} -body {
[catch {interp eval $i {package require http 1}} msg] $msg \
[safe::interpConfigure $i]\
[safe::interpDelete $i]
-} -match glob -result "{\$p(:0:)} {\$p(:[expr 1+[llength [tcl::tm::list]]]:)} 1 {can't find package http 1} {-accessPath {[list $tcl_library * /dummy/unixlike/test/path]} -statics 0 -nested 1 -deleteHook {}} {}"
+} -match glob -result "{\$p(:0:)} {\$p(:[expr 1+[llength [tcl::tm::list]]]:)} 1 {can't find package http 1} {-accessPath {[list $tcl_library */dummy/unixlike/test/path]} -statics 0 -nested 1 -deleteHook {}} {}"
# test source control on file name
test safe-8.1 {safe source control on file} -setup {