* syscalls.cc (rename): Fix typo in comment. Fix condition to handle

the case oldpath is no .lnk symlink and newpath points to an existing
	.lnk symlink or .exe file and no explicit .lnk suffix has been given
	in oldpath.  Add a comment to explain.
This commit is contained in:
Corinna Vinschen 2011-12-19 17:01:37 +00:00
parent a48970970e
commit 18d0c0fb8b
2 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2011-12-19 Corinna Vinschen <vinschen@redhat.com>
* syscalls.cc (rename): Fix typo in comment. Fix condition to handle
the case oldpath is no .lnk symlink and newpath points to an existing
.lnk symlink or .exe file and no explicit .lnk suffix has been given
in oldpath. Add a comment to explain.
2011-12-19 Corinna Vinschen <vinschen@redhat.com>
* dcrt0.cc (dll_crt0_0): Check for wincap.wow64_has_secondary_stack

View File

@ -2162,7 +2162,7 @@ rename (const char *oldpath, const char *newpath)
{
/* Never append .exe suffix if oldpath had .exe suffix given
explicitely, or if newfile is a binary (in which case the given
name probably makes sesne as it is), or if the destination
name probably makes sense as it is), or if the destination
filename has one of the blessed executable suffixes. */
if (!old_explicit_suffix && oldpc.known_suffix
&& !newpc.is_binary ()
@ -2174,8 +2174,12 @@ rename (const char *oldpath, const char *newpath)
}
else
{
if ((RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
&ro_u_lnk, TRUE)
/* If the new path is an existing .lnk symlink or a .exe file,
but the new path has not been specified with explicit suffix,
rename to the new name without suffix, as expected, but also
remove the clashing symlink or executable. Did I ever mention
how I hate the file suffix idea? */
if ((newpc.is_lnk_special ()
|| RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
&ro_u_exe, TRUE))
&& !new_explicit_suffix)