diff options
author | Christopher Faylor <me@cgf.cx> | 2000-10-31 23:14:29 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-10-31 23:14:29 +0000 |
commit | b12796a06d220e56474d2b28158fda9a193d9f37 (patch) | |
tree | 1333fe686fd71dd00c822095dc09969cd59a6c4f /winsup/cygwin/fhandler.cc | |
parent | 772e2322bd066c72b8af0f82f82c51306088bacc (diff) | |
download | cygnal-b12796a06d220e56474d2b28158fda9a193d9f37.tar.gz cygnal-b12796a06d220e56474d2b28158fda9a193d9f37.tar.bz2 cygnal-b12796a06d220e56474d2b28158fda9a193d9f37.zip |
* 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.cc | 3 |
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); |