summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-03-08 15:29:51 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-03-08 15:29:51 (GMT)
commit17b89ce1f8d2ab6d484284e7a63e0fc7fb901871 (patch)
tree76c06ea37fb340579080a1bc0b629cefdd722a7c
parent7f848a3e85d288409cc73c957717a2a9f83ea47a (diff)
downloadtcl-bug_e21fc32c2aa.zip
tcl-bug_e21fc32c2aa.tar.gz
tcl-bug_e21fc32c2aa.tar.bz2
Proposed fix for [e21fc32c2aa]: auto_execok does not check executability on Windowsbug_e21fc32c2aa
-rw-r--r--library/init.tcl6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/init.tcl b/library/init.tcl
index 544ea77..f522a7c 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -650,7 +650,7 @@ proc auto_execok name {
# 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]} {
+ if {[file executable $cmd]} {
set cmd [file attributes $cmd -shortname]
}
return [set auto_execs($name) [list $cmd /c $name]]
@@ -659,7 +659,7 @@ proc auto_execok name {
if {[llength [file split $name]] != 1} {
foreach ext $execExtensions {
set file ${name}${ext}
- if {[file exists $file] && ![file isdirectory $file]} {
+ if {[file executable $file] && ![file isdirectory $file]} {
return [set auto_execs($name) [list $file]]
}
}
@@ -692,7 +692,7 @@ proc auto_execok name {
}
set checked($dir) {}
set file [file join $dir ${name}${ext}]
- if {[file exists $file] && ![file isdirectory $file]} {
+ if {[file executable $file] && ![file isdirectory $file]} {
return [set auto_execs($name) [list $file]]
}
}