From 17b89ce1f8d2ab6d484284e7a63e0fc7fb901871 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 8 Mar 2016 15:29:51 +0000 Subject: Proposed fix for [e21fc32c2aa]: auto_execok does not check executability on Windows --- library/init.tcl | 6 +++--- 1 file 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]] } } -- cgit v0.12