OSDN Git Service

* path.cc (path_conv::is_binary): Fix test. Add comment.
authorcorinna <corinna>
Wed, 2 Jul 2008 14:00:26 +0000 (14:00 +0000)
committercorinna <corinna>
Wed, 2 Jul 2008 14:00:26 +0000 (14:00 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/path.cc

index 9eecb64..cf58c1c 100644 (file)
@@ -1,3 +1,7 @@
+2008-07-02  Corinna Vinschen  <corinna@vinschen.de>
+
+       * path.cc (path_conv::is_binary): Fix test.  Add comment.
+
 2008-06-24  Corinna Vinschen  <corinna@vinschen.de>
 
        * net.cc (cygwin_bindresvport_sa): Fix usage of last_used_bindresvport.
index 0eeee8c..c69f9d8 100644 (file)
@@ -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.