summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2009-12-30 13:47:52 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2009-12-30 13:47:52 (GMT)
commit7c7c6aa17bf0f27a8d5890a53d75e74830212d02 (patch)
tree20bae48cbf87d3b4b303e4948cedafe99ff44019
parent443f16f9ffd4df41748337a63571c02f7081ff14 (diff)
downloadtcl-7c7c6aa17bf0f27a8d5890a53d75e74830212d02.zip
tcl-7c7c6aa17bf0f27a8d5890a53d75e74830212d02.tar.gz
tcl-7c7c6aa17bf0f27a8d5890a53d75e74830212d02.tar.bz2
* library/init.tcl (unknown): fix infinite recursion of ::unknown
when [set] is undefined [Bug 2824981].
-rw-r--r--ChangeLog5
-rw-r--r--library/init.tcl11
2 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 280603b..4308e41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-30 Miguel Sofer <msofer@users.sf.net>
+
+ * library/init.tcl (unknown): fix infinite recursion of ::unknown
+ when [set] is undefined [Bug 2824981].
+
2009-12-29 Donal K. Fellows <dkf@users.sf.net>
* generic/tclHistory.c (Tcl_RecordAndEvalObj): Reduce the amount
diff --git a/library/init.tcl b/library/init.tcl
index 6ca4873..a62f3a0 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.121 2009/03/09 09:12:39 dkf Exp $
+# RCS: @(#) $Id: init.tcl,v 1.122 2009/12/30 13:47:53 msofer Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -237,8 +237,13 @@ proc unknown args {
variable ::tcl::UnknownPending
global auto_noexec auto_noload env tcl_interactive
- catch {set savedErrorInfo $::errorInfo}
- catch {set savedErrorCode $::errorCode}
+
+ if {[info exists ::errorInfo]} {
+ set savedErrorInfo $::errorInfo
+ }
+ if {[info exists ::errorCode]} {
+ set savedErrorCode $::errorCode
+ }
set name [lindex $args 0]
if {![info exists auto_noload]} {