summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-10-16 16:07:06 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-10-16 16:07:06 (GMT)
commit51a97c1adeeab4331646ad039505c7b99f7e1031 (patch)
treee231a2fbbbb6ae9f5a08149f52cdd8461deb47ae
parente348c5bb11e5d6330f0faa7b67d9d0f1bf21fb28 (diff)
downloadtcl-51a97c1adeeab4331646ad039505c7b99f7e1031.zip
tcl-51a97c1adeeab4331646ad039505c7b99f7e1031.tar.gz
tcl-51a97c1adeeab4331646ad039505c7b99f7e1031.tar.bz2
* library/init.tcl: Revised [unknown] so that it carefully
preserves the state of the ::errorInfo and ::errorCode variables at the start of auto-loading and restores that state before the autoloaded command is evaluated. [Bug 2140628]
-rw-r--r--ChangeLog7
-rw-r--r--library/init.tcl11
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 169ce4b..1713e50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-10-16 Don Porter <dgp@users.sourceforge.net>
+
+ * library/init.tcl: Revised [unknown] so that it carefully
+ preserves the state of the ::errorInfo and ::errorCode variables
+ at the start of auto-loading and restores that state before the
+ autoloaded command is evaluated. [Bug 2140628]
+
2008-10-10 Don Porter <dgp@users.sourceforge.net>
*** 8.5.5 TAGGED FOR RELEASE ***
diff --git a/library/init.tcl b/library/init.tcl
index 7105276..8491c16 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -3,7 +3,7 @@
# Default system startup file for Tcl-based applications. Defines
# "unknown" procedure and auto-load facilities.
#
-# RCS: @(#) $Id: init.tcl,v 1.104.2.7 2008/10/10 18:16:48 dgp Exp $
+# RCS: @(#) $Id: init.tcl,v 1.104.2.8 2008/10/16 16:07:06 dgp Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -276,8 +276,13 @@ proc unknown args {
unset UnknownPending
}
if {$msg} {
- catch {set ::errorCode $savedErrorCode}
- catch {set ::errorInfo $savedErrorInfo}
+ unset -nocomplain ::errorCode ::errorInfo
+ if {[info exists savedErrorCode]} {
+ set ::errorCode $savedErrorCode
+ }
+ if {[info exists savedErrorInfo]} {
+ set ::errorInfo $savedErrorInfo
+ }
set code [catch {uplevel 1 $args} msg opts]
if {$code == 1} {
#