Skip to content

Commit 0cfedd4

Browse files
committed
fixup! Instead of creating Cygwin symlinks, use deep copy by default
Adjust the infinite recursion check to make sure the source ends with a dir sep, so it doesn't think abcd is a subdirectory of a. Fixes #277 Signed-off-by: Jeremy Drake <[email protected]>
1 parent 8ed79cf commit 0cfedd4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

winsup/cygwin/path.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,9 @@ recursiveCopy (PUNICODE_STRING src, PUNICODE_STRING dst, USHORT origsrclen,
18551855
/* Recurse into the child directory */
18561856
/* avoids endless recursion */
18571857
if (src->Length <= origsrclen ||
1858-
!wcsncmp (src->Buffer, dst->Buffer, origdstlen / sizeof (WCHAR)))
1858+
(!wcsncmp (src->Buffer, dst->Buffer, origdstlen / sizeof (WCHAR)) &&
1859+
(!src->Buffer[origdstlen / sizeof (WCHAR)] ||
1860+
iswdirsep(src->Buffer[origdstlen / sizeof (WCHAR)]))))
18591861
{
18601862
set_errno (ELOOP);
18611863
goto done;

0 commit comments

Comments
 (0)