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
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 933baafcf..5a9b24c0f 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1246,7 +1246,7 @@ _rename (const char *oldpath, const char *newpath)
/* Shortcut hack. */
char new_lnk_buf[MAX_PATH + 5];
- if (real_old.issymlink () && !real_new.error)
+ if (real_old.issymlink () && !real_new.error && !real_new.case_clash)
{
int len_old = strlen (real_old.get_win32 ());
if (strcasematch (real_old.get_win32 () + len_old - 4, ".lnk"))
@@ -1258,10 +1258,10 @@ _rename (const char *oldpath, const char *newpath)
}
}
- if (real_new.error)
+ if (real_new.error || real_new.case_clash)
{
syscall_printf ("-1 = rename (%s, %s)", oldpath, newpath);
- set_errno (real_new.error);
+ set_errno (real_new.case_clash ? ECASECLASH : real_new.error);
return -1;
}