diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-08-04 07:48:39 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-08-04 07:48:39 (GMT) |
commit | f4b9d9697eed263a69362a80ff78b872ad123e0c (patch) | |
tree | ebbe618f12e927b1158cf966062bcb0d7194f73b /library/init.tcl | |
parent | 7fe49bb7164153f93609697d3501cf9277b87a5c (diff) | |
parent | 24ef33dc101a3e9114318b884c1e99d792f4739d (diff) | |
download | tcl-dkf_documentation_figures.zip tcl-dkf_documentation_figures.tar.gz tcl-dkf_documentation_figures.tar.bz2 |
merge trunkdkf_documentation_figures
Diffstat (limited to 'library/init.tcl')
-rw-r--r-- | library/init.tcl | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/library/init.tcl b/library/init.tcl index 685fc7b..51c7f29 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -651,7 +651,7 @@ proc auto_execok name { set execExtensions [list {} .com .exe .bat .cmd] } - if {$name in $shellBuiltins} { + if {[string tolower $name] in $shellBuiltins} { # 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. @@ -689,13 +689,14 @@ proc auto_execok name { } } - foreach dir [split $path {;}] { - # Skip already checked directories - if {[info exists checked($dir)] || ($dir eq "")} { - continue - } - set checked($dir) {} - foreach ext $execExtensions { + foreach ext $execExtensions { + unset -nocomplain checked + foreach dir [split $path {;}] { + # Skip already checked directories + if {[info exists checked($dir)] || ($dir eq "")} { + continue + } + set checked($dir) {} set file [file join $dir ${name}${ext}] if {[file exists $file] && ![file isdirectory $file]} { return [set auto_execs($name) [list $file]] |