summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-07-31 15:20:00 +0000
committerCorinna Vinschen <corinna@vinschen.de>2007-07-31 15:20:00 +0000
commit9235f3ead1cc91bd1a864ecf635717823f1da610 (patch)
tree4b7ffdaf98112e1f9715805b01c00d5e1b185daf /winsup/cygwin/path.cc
parent378692ee42bb29280c439600832e84a0ddb7471a (diff)
downloadcygnal-9235f3ead1cc91bd1a864ecf635717823f1da610.tar.gz
cygnal-9235f3ead1cc91bd1a864ecf635717823f1da610.tar.bz2
cygnal-9235f3ead1cc91bd1a864ecf635717823f1da610.zip
* fhandler_disk_file.cc (fhandler_disk_file::link): Revert to checking
for binary in case of .exe files. * ntdll.h (RtlPrefixUnicodeString): Declare. * path.cc (path_conv::is_binary): New method. * path.h (path_conv::is_binary): Declare. * syscalls.cc (rename_append_suffix): New static helper function for rename. (rename): Rewrite. New suffix tests. Use native NT functions.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 062f5ab7e..fe4f1d9e0 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1205,6 +1205,16 @@ path_conv::~path_conv ()
}
}
+bool
+path_conv::is_binary ()
+{
+ DWORD bin;
+ PBYTE bintest[get_nt_native_path ()->Length + sizeof (WCHAR)];
+ return exec_state () == is_executable
+ && RtlEqualUnicodePathSuffix (get_nt_native_path (), L".exe", TRUE)
+ && GetBinaryTypeW (get_wide_win32_path ((PWCHAR) bintest), &bin);
+}
+
/* Return true if src_path is a valid, internally supported device name.
In that case, win32_path gets the corresponding NT device name and
dev is appropriately filled with device information. */