Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-05-29 07:06:37 +0400
committerChristopher Faylor <me@cgf.cx>2002-05-29 07:06:37 +0400
commita761ad820081c0a6fd907be0a87ae7fbde7e24c8 (patch)
treef9638d5111a3df41c2b7201691efa1fd25e05d8f /winsup/cygwin/fhandler_disk_file.cc
parentb1f07180b5e7897f07e390e020b307e6496c9cb1 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc5
1 files changed, 4 insertions, 1 deletions
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);
}
}