Skip to content

Commit 4eb812d

Browse files
committed
Temporary workaround for symlink_junction
`symlink_junction_inner` has been failing for mysterious reasons. This seems to fix it on my local machine. This should be properly investigated and fixed though.
1 parent 9b8dbd5 commit 4eb812d

File tree

1 file changed

+5
-2
lines changed
  • library/std/src/sys/windows

1 file changed

+5
-2
lines changed

library/std/src/sys/windows/fs.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1398,10 +1398,13 @@ fn symlink_junction_inner(original: &Path, junction: &Path) -> io::Result<()> {
13981398
// FIXME: this conversion is very hacky
13991399
let v = br"\??\";
14001400
let v = v.iter().map(|x| *x as u16);
1401-
for c in v.chain(original.as_os_str().encode_wide()) {
1401+
// FIXME: Note that this uses for_each instead of a for loop because that
1402+
// sometimes mysteriously fails to write the buffer for some reason.
1403+
// See #107884
1404+
v.chain(original.as_os_str().encode_wide()).for_each(|c| {
14021405
*buf.add(i) = c;
14031406
i += 1;
1404-
}
1407+
});
14051408
*buf.add(i) = 0;
14061409
i += 1;
14071410
(*db).ReparseTag = c::IO_REPARSE_TAG_MOUNT_POINT;

0 commit comments

Comments
 (0)