summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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]} {