From 056c8026509e0de0bbfc4d56930d7f86e578f6cd Mon Sep 17 00:00:00 2001 From: James Cherry Date: Mon, 9 Mar 2020 14:20:51 -0700 Subject: [PATCH] "history.tcl, 306 invoked "return" outside of a proc." (again) --- tcl/Util.tcl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tcl/Util.tcl b/tcl/Util.tcl index 24d1b2a9..e8fdbd4b 100644 --- a/tcl/Util.tcl +++ b/tcl/Util.tcl @@ -433,7 +433,15 @@ proc sta_unknown { args } { "ambiguous command name \"$name\": [lsort $cmds]" } } else { - return [uplevel 1 [concat builtin_unknown $args]] + # I cannot figure out why the first call to ::history add + # that presumably loads history.tcl causes the following error: + # Error: history.tcl, 306 invoked "return" outside of a proc. + # But this squashes the error. + if { [lindex $args 0] == "::history" } { + return "" + } else { + return [uplevel 1 builtin_unknown $args] + } } } }