summaryrefslogtreecommitdiffstats
path: root/library/init.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-07-05 18:03:44 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-07-05 18:03:44 (GMT)
commit8fc56e3e5207febe33e62a904815dc8be87a6163 (patch)
tree33aa64cb31ab43146bf30d021269ec1f1aa8b1c7 /library/init.tcl
parent3087809a6fb271a1356aa0e6511a53a95606f3e6 (diff)
downloadtcl-8fc56e3e5207febe33e62a904815dc8be87a6163.zip
tcl-8fc56e3e5207febe33e62a904815dc8be87a6163.tar.gz
tcl-8fc56e3e5207febe33e62a904815dc8be87a6163.tar.bz2
* library/init.tcl (unknown): Corrected inconsistent error message
in interactive [unknown] when empty command is invoked. [Bug 1743676]
Diffstat (limited to 'library/init.tcl')
-rw-r--r--library/init.tcl23
1 files changed, 11 insertions, 12 deletions
diff --git a/library/init.tcl b/library/init.tcl
index 8105642..be02fa1 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.55.2.6 2005/07/22 21:59:40 dgp Exp $
+# RCS: @(#) $Id: init.tcl,v 1.55.2.7 2007/07/05 18:03:45 dgp Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -312,19 +312,18 @@ proc unknown args {
"error in unknown while checking if \"$name\" is\
a unique command abbreviation:\n$msg"
}
- # Handle empty $name separately due to strangeness in [string first]
- if {$name eq ""} {
- if {[llength $candidates] != 1} {
- return -code error "empty command name \"\""
- }
- 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} {