diff options
Diffstat (limited to 'library/init.tcl')
-rw-r--r-- | library/init.tcl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/library/init.tcl b/library/init.tcl index 4802683..84d361a 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.50 2001/11/04 17:59:48 vincentdarley Exp $ +# RCS: @(#) $Id: init.tcl,v 1.51 2001/12/29 00:52:22 hobbs Exp $ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -552,7 +552,14 @@ proc auto_execok name { } if {[lsearch -exact $shellBuiltins $name] != -1} { - return [set auto_execs($name) [list $env(COMSPEC) /c $name]] + # When this is command.com for some reason on Win2K, Tcl won't + # exec it unless the case is right, which this corrects. COMSPEC + # may not point to a real file, so do the check. + set cmd $env(COMSPEC) + if {[file exists $cmd]} { + set cmd [file attributes $cmd -shortname] + } + return [set auto_execs($name) [list $cmd /c $name]] } if {[llength [file split $name]] != 1} { |