diff options
author | Christopher Faylor <me@cgf.cx> | 2002-05-29 03:06:37 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-05-29 03:06:37 +0000 |
commit | a761ad820081c0a6fd907be0a87ae7fbde7e24c8 (patch) | |
tree | f9638d5111a3df41c2b7201691efa1fd25e05d8f | |
parent | b1f07180b5e7897f07e390e020b307e6496c9cb1 (diff) | |
download | newlib-a761ad820081c0a6fd907be0a87ae7fbde7e24c8.zip newlib-a761ad820081c0a6fd907be0a87ae7fbde7e24c8.tar.gz newlib-a761ad820081c0a6fd907be0a87ae7fbde7e24c8.tar.bz2 |
* 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.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ea30418..79106eb 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2002-05-28 Christopher Faylor <cgf@redhat.com> + + * 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 <corinna@vinschen.de> * 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 a1237cc..de84764 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); } } |