diff options
author | dgp <dgp@users.sourceforge.net> | 2008-10-16 17:04:58 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2008-10-16 17:04:58 (GMT) |
commit | 2b0bd4b76e50ee9f511c827309e0078efc6f537a (patch) | |
tree | 738c51b51c56a3b596d1150e84b72b3ecd695d04 /library/init.tcl | |
parent | c0fe0fb01cd4a52aca1ac071d98e7f78e96f5817 (diff) | |
download | tcl-2b0bd4b76e50ee9f511c827309e0078efc6f537a.zip tcl-2b0bd4b76e50ee9f511c827309e0078efc6f537a.tar.gz tcl-2b0bd4b76e50ee9f511c827309e0078efc6f537a.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]
Diffstat (limited to 'library/init.tcl')
-rw-r--r-- | library/init.tcl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/library/init.tcl b/library/init.tcl index 4fae191..084ddbc 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.114 2008/10/16 16:08:09 dgp Exp $ +# RCS: @(#) $Id: init.tcl,v 1.115 2008/10/16 17:04:58 dgp Exp $ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -262,12 +262,15 @@ proc unknown args { unset UnknownPending } if {$msg} { - unset -nocomplain ::errorCode ::errorInfo if {[info exists savedErrorCode]} { set ::errorCode $savedErrorCode + } else { + unset -nocomplain ::errorCode } if {[info exists savedErrorInfo]} { set ::errorInfo $savedErrorInfo + } else { + unset -nocomplain ::errorInfo } set code [catch {uplevel 1 $args} msg opts] if {$code == 1} { |