diff options
author | dgp <dgp@users.sourceforge.net> | 2004-05-03 14:28:34 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2004-05-03 14:28:34 (GMT) |
commit | de6db8c03eed86af2bd00514dc4da5c321a822ab (patch) | |
tree | dc7d6ac9ba549a3e6e7d3125698e2e8433165ab7 | |
parent | bd2452b05ad18d7a755643a1608882eee9f37023 (diff) | |
download | tcl-de6db8c03eed86af2bd00514dc4da5c321a822ab.zip tcl-de6db8c03eed86af2bd00514dc4da5c321a822ab.tar.gz tcl-de6db8c03eed86af2bd00514dc4da5c321a822ab.tar.bz2 |
* library/init.tcl: Corrected unique prefix matching of
interactive command completion in [unknown]. [Bug 946952]
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | library/init.tcl | 15 |
2 files changed, 17 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2004-05-03 Don Porter <dgp@users.sourceforge.net> + + * library/init.tcl: Corrected unique prefix matching of + interactive command completion in [unknown]. [Bug 946952] + 2004-05-02 Miguel Sofer <msofer@users.sf.net> * generic/tclProc.c (TclObjInvokeProc): diff --git a/library/init.tcl b/library/init.tcl index e645ac9..de2f8c6 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.60 2004/03/17 18:14:14 das Exp $ +# RCS: @(#) $Id: init.tcl,v 1.61 2004/05/03 14:28:35 dgp Exp $ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -293,13 +293,22 @@ proc unknown args { return [uplevel 1 $newcmd] } - set ret [catch {set cmds [info commands $name*]} msg] + set ret [catch {set candidates [info commands $name*]} msg] if {[string equal $name "::"]} { set name "" } if {$ret != 0} { return -code $ret -errorcode $errorCode \ - "error in unknown while checking if \"$name\" is a unique command abbreviation: $msg" + "error in unknown while checking if \"$name\" is\ + a unique command abbreviation:\n$msg" + } + # Filter out bogus matches when $name contained + # a glob-special char [Bug 946952] + set cmds [list] + foreach x $candidates { + if {[string range $x 0 [expr [string length $name]-1]] eq $name} { + lappend cmds $x + } } if {[llength $cmds] == 1} { return [uplevel 1 [lreplace $args 0 0 $cmds]] |