summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 7899a0520..93032199f 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2319,11 +2319,12 @@ symlink_info::check (const char *in_path, const suffix_info *suffixes)
else
{
/* Not a symlink, see if executable. */
- if (!(pflags & PATH_ALL_EXEC) && got >= 2 &&
- ((cookie_buf[0] == '#' && cookie_buf[1] == '!') ||
- (cookie_buf[0] == ':' && cookie_buf[1] == '\n') ||
- (cookie_buf[0] == 'M' && cookie_buf[1] == 'Z')))
+ if (!(pflags & PATH_ALL_EXEC) &&
+ has_exec_chars (cookie_buf, got))
+{
+debug_printf ("setting exec flag");
pflags |= PATH_EXEC;
+}
close_and_return:
CloseHandle (h);
goto file_not_symlink;