Skip to content

Commit 19b50e4

Browse files
jeremyd2019dscho
andcommitted
amend! Instead of creating Cygwin symlinks, use deep copy by default
Instead of creating Cygwin symlinks, use deep copy by default The new `winsymlinks` mode `deepcopy` (which is made the default) lets calls to `symlink()` create (deep) copies of the source file/directory. This is necessary because unlike Cygwin, MSYS2 does not try to be its own little ecosystem that lives its life separate from regular Win32 programs: the latter have _no idea_ about Cygwin-emulated symbolic links (i.e. system files whose contents start with `!<symlink>\xff\xfe` and the remainder consists of the NUL-terminated, UTF-16LE-encoded symlink target). To support Cygwin-style symlinks, the new mode `sysfile` is introduced. Co-authored-by: Johannes Schindelin <[email protected]> Co-authored-by: Jeremy Drake <[email protected]>
1 parent cf77c3e commit 19b50e4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎winsup/cygwin/path.cc‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,10 @@ symlink_deepcopy (const char *oldpath, path_conv &win32_newpath)
21602160
tmp_pathbuf tp;
21612161
path_conv win32_oldpath;
21622162

2163+
/* **BEGIN** replace this with
2164+
resolve_symlink_target (oldpath, win32_newpath. win32_oldpath);
2165+
when rebasing over 5a706ff0fceb83fd1fe7f072fc28a741fdde65f2
2166+
(probably Cygwin 3.6) */
21632167
/* The symlink target is relative to the directory in which the
21642168
symlink gets created, not relative to the cwd. Therefore we
21652169
have to mangle the path quite a bit before calling path_conv.*/
@@ -2174,6 +2178,7 @@ symlink_deepcopy (const char *oldpath, path_conv &win32_newpath)
21742178
oldpath);
21752179
win32_oldpath.check (absoldpath, PC_SYM_NOFOLLOW, stat_suffixes);
21762180
}
2181+
/* **END** */
21772182
if (win32_oldpath.error)
21782183
{
21792184
set_errno (win32_oldpath.error);

0 commit comments

Comments
 (0)