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>2000-11-01 02:14:29 +0300
committerChristopher Faylor <me@cgf.cx>2000-11-01 02:14:29 +0300
commitb12796a06d220e56474d2b28158fda9a193d9f37 (patch)
tree1333fe686fd71dd00c822095dc09969cd59a6c4f /winsup/cygwin/fhandler.cc
parent772e2322bd066c72b8af0f82f82c51306088bacc (diff)
* path.h (has_exec_chars): Standard function for checking for executable magic
numbers. * path.cc (symlink_info::check): Use the above function. * fhandler.cc (fhandler_disk_file::open): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 811b03888..d7015b7ab 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -1227,8 +1227,7 @@ fhandler_disk_file::open (path_conv& real_path, int flags, mode_t mode)
/* FIXME should we use /etc/magic ? */
magic[0] = magic[1] = magic[2] = '\0';
ReadFile (get_handle (), magic, 3, &done, 0);
- if ((magic[0] == ':' && magic[1] == '\n') ||
- (magic[0] == '#' && magic[1] == '!'))
+ if (has_exec_chars (magic, done))
real_path.set_exec ();
if (!(flags & O_APPEND))
SetFilePointer (get_handle(), 0, 0, FILE_BEGIN);