diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ea3041806..79106eb19 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2002-05-28 Christopher Faylor + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Properly + check for whether we should be opening the file to search for #! + characters. Set path_conv structure execability, too, if found. + 2002-05-28 Corinna Vinschen * security.cc (set_security_attribute): Call getegid32() instead of diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index a1237cc3c..de8476445 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -266,7 +266,7 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc, else { buf->st_mode |= S_IFREG; - if (!pc->exec_state () == dont_know_if_executable) + if (pc->exec_state () == dont_know_if_executable) { DWORD cur, done; char magic[3]; @@ -283,7 +283,10 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc, magic[0] = magic[1] = magic[2] = '\0'; if (ReadFile (get_handle (), magic, 3, &done, NULL) && has_exec_chars (magic, done)) + { set_execable_p (); + pc->set_exec (); + } SetFilePointer (get_handle(), cur, NULL, FILE_BEGIN); } }