summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-07-05 18:02:54 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-07-05 18:02:54 (GMT)
commit1f2c28c2c103837020231711a9f62febb8ea9845 (patch)
treef50b066270dcf95ce4d7634703414e3a747957b7 /library
parent4aa88d59d473ee543215444203e8d03a2b7cc6da (diff)
downloadtcl-1f2c28c2c103837020231711a9f62febb8ea9845.zip
tcl-1f2c28c2c103837020231711a9f62febb8ea9845.tar.gz
tcl-1f2c28c2c103837020231711a9f62febb8ea9845.tar.bz2
* library/init.tcl (unknown): Corrected inconsistent error message
in interactive [unknown] when empty command is invoked. [Bug 1743676]
Diffstat (limited to 'library')
-rw-r--r--library/init.tcl24
1 files changed, 11 insertions, 13 deletions
diff --git a/library/init.tcl b/library/init.tcl
index e1ff2a3..b84a197 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.91 2007/05/18 18:39:30 dgp Exp $
+# RCS: @(#) $Id: init.tcl,v 1.92 2007/07/05 18:02:55 dgp Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -404,20 +404,18 @@ proc unknown args {
"\n (expanding command prefix \"$name\" in unknown)"
return -options $opts $msg
}
- # Handle empty $name separately due to strangeness in [string first]
- if {$name eq ""} {
- if {[llength $candidates] != 1} {
- return -code error "empty command name \"\""
- }
- # It's not really possible to reach here.
- return [uplevel 1 [lreplace $args 0 0 [lindex $candidates 0]]]
- }
# Filter out bogus matches when $name contained
# a glob-special char [Bug 946952]
- set cmds [list]
- foreach x $candidates {
- if {[string first $name $x] == 0} {
- lappend cmds $x
+ if {$name eq ""} {
+ # Handle empty $name separately due to strangeness
+ # in [string first] (See RFE 1243354)
+ set cmds $candidates
+ } else {
+ set cmds [list]
+ foreach x $candidates {
+ if {[string first $name $x] == 0} {
+ lappend cmds $x
+ }
}
}
if {[llength $cmds] == 1} {