summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/init.tcl18
1 files changed, 14 insertions, 4 deletions
diff --git a/library/init.tcl b/library/init.tcl
index e1f4b05..626f9f3 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.78 2005/07/23 04:12:49 dgp Exp $
+# RCS: @(#) $Id: init.tcl,v 1.79 2005/07/27 16:24:14 dgp Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -328,7 +328,11 @@ proc unknown args {
if {[namespace which -command console] eq ""} {
set redir ">&@stdout <@stdin"
}
- return [uplevel 1 exec $redir $new [lrange $args 1 end]]
+ uplevel 1 [list ::catch \
+ [concat exec $redir $new [lrange $args 1 end]] \
+ ::tcl::UnknownResult ::tcl::UnknownOptions]
+ dict incr ::tcl::UnknownOptions -level
+ return -options $::tcl::UnknownOptions $::tcl::UnknownResult
}
}
if {$name eq "!!"} {
@@ -342,7 +346,10 @@ proc unknown args {
if {[info exists newcmd]} {
tclLog $newcmd
history change $newcmd 0
- return [uplevel 1 $newcmd]
+ uplevel 1 [list ::catch $newcmd \
+ ::tcl::UnknownResult ::tcl::UnknownOptions]
+ dict incr ::tcl::UnknownOptions -level
+ return -options $::tcl::UnknownOptions $::tcl::UnknownResult
}
set ret [catch {set candidates [info commands $name*]} msg]
@@ -371,7 +378,10 @@ proc unknown args {
}
}
if {[llength $cmds] == 1} {
- return [uplevel 1 [lreplace $args 0 0 [lindex $cmds 0]]]
+ uplevel 1 [list ::catch [lreplace $args 0 0 [lindex $cmds 0]] \
+ ::tcl::UnknownResult ::tcl::UnknownOptions]
+ dict incr ::tcl::UnknownOptions -level
+ return -options $::tcl::UnknownOptions $::tcl::UnknownResult
}
if {[llength $cmds]} {
return -code error "ambiguous command name \"$name\": [lsort $cmds]"