From bb82bbe6ff1e97b1e2baba9436676aa9406fcef3 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 2 Jul 2008 14:00:27 +0000 Subject: * path.cc (path_conv::is_binary): Fix test. Add comment. --- winsup/cygwin/path.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 0eeee8cd8..c69f9d88e 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1314,9 +1314,11 @@ path_conv::is_binary () tmp_pathbuf tp; PWCHAR bintest = tp.w_get (); DWORD bin; + /* Do NOT check for .exe suffix, otherwise rename(2) misbehaves + when renaming files to existing executables with omitted suffix. + strip(1) is a candidate uncovering wrong behaviour here. */ return exec_state () == is_executable - && RtlEqualUnicodePathSuffix (get_nt_native_path (), L".exe", TRUE) - && GetBinaryTypeW (get_wide_win32_path (bintest), &bin); + || GetBinaryTypeW (get_wide_win32_path (bintest), &bin); } /* Normalize a Win32 path. -- cgit v1.2.3