summaryrefslogtreecommitdiffstats
path: root/library/init.tcl
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-12-29 00:52:22 (GMT)
committerhobbs <hobbs>2001-12-29 00:52:22 (GMT)
commiteb8476367a6bc605f4c88e534db5caefc769f216 (patch)
treef043d5e9faf2a242077d6f89552496c7fd92dee3 /library/init.tcl
parentdbff148bc3ffb42b93769a8e0f852fd1014d4363 (diff)
downloadtcl-eb8476367a6bc605f4c88e534db5caefc769f216.zip
tcl-eb8476367a6bc605f4c88e534db5caefc769f216.tar.gz
tcl-eb8476367a6bc605f4c88e534db5caefc769f216.tar.bz2
* library/init.tcl: make sure env(COMSPEC) on Windows is executed
with the right case, as it may otherwise fail inexplicably.
Diffstat (limited to 'library/init.tcl')
-rw-r--r--library/init.tcl11
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} {