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
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-08-11 19:05:25 +0400
committerCorinna Vinschen <corinna@vinschen.de>2008-08-11 19:05:25 +0400
commit0ea2c19934d201dd0b9a1b87a7783401b1eefafd (patch)
treeae26a408075e24d313ea9f23fd39b51968d6b877 /winsup
parent36f17b4b40f54057401a10c8fba2a685b5f4537f (diff)
* syscalls.cc (rename): If newpath doesn't exist, check if .exe suffix
in oldpath has been omitted before appending .exe to newpath.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/syscalls.cc5
2 files changed, 8 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 4527099c7..e319b44b4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-11 Corinna Vinschen <corinna@vinschen.de>
+
+ * syscalls.cc (rename): If newpath doesn't exist, check if .exe suffix
+ in oldpath has been omitted before appending .exe to newpath.
+
2008-08-09 Corinna Vinschen <corinna@vinschen.de>
* fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Don't set
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 92446bcc0..7801ea2b3 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1656,10 +1656,11 @@ rename (const char *oldpath, const char *newpath)
&& !RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
L".lnk", TRUE))
rename_append_suffix (newpc, newpath, nlen, ".lnk");
- else if (oldpc.is_binary ()
+ else if (oldpc.is_binary () && !old_explicit_suffix
&& !RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
L".exe", TRUE))
- /* NOTE: No way to rename an executable foo.exe to foo. */
+ /* To rename an executable foo.exe to bar-without-exe-suffix, the
+ .exe suffix must be given explicitly in oldpath. */
rename_append_suffix (newpc, newpath, nlen, ".exe");
}
else if (newpc.isdir ())