From eb8476367a6bc605f4c88e534db5caefc769f216 Mon Sep 17 00:00:00 2001 From: hobbs Date: Sat, 29 Dec 2001 00:52:22 +0000 Subject: * library/init.tcl: make sure env(COMSPEC) on Windows is executed with the right case, as it may otherwise fail inexplicably. --- ChangeLog | 7 ++++++- library/init.tcl | 11 +++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index eacfebe..b6971fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2001-12-29 Don Porter +2001-12-28 Jeff Hobbs + + * library/init.tcl: make sure env(COMSPEC) on Windows is executed + with the right case, as it may otherwise fail inexplicably. + +2001-12-28 Don Porter * generic/tclCkalloc.c (MemoryCmd, TclFinalizeMemorySubsystem): Added the [memory onexit] command, intended to replace [checkmem]. 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} { -- cgit v0.12