Skip to content

Commit a27a856

Browse files
committed
adjust renameatW to always supply dest root dir
this fixes tests for wine
1 parent 7e45a3e commit a27a856

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/std/mem.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub const Allocator = struct {
116116
pub fn allocSentinel(self: *Allocator, comptime Elem: type, n: usize, comptime sentinel: Elem) Error![:sentinel]Elem {
117117
var ptr = try self.alloc(Elem, n + 1);
118118
ptr[n] = sentinel;
119-
return ptr[0 .. n :sentinel];
119+
return ptr[0..n :sentinel];
120120
}
121121

122122
pub fn alignedAlloc(

lib/std/os.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ pub fn renameatW(
16641664

16651665
rename_info.* = .{
16661666
.ReplaceIfExists = ReplaceIfExists,
1667-
.RootDirectory = if (old_dir_fd == new_dir_fd or std.fs.path.isAbsoluteWindowsW(new_path_w)) null else new_dir_fd,
1667+
.RootDirectory = if (std.fs.path.isAbsoluteWindowsW(new_path_w)) null else new_dir_fd,
16681668
.FileNameLength = @intCast(u32, new_path.len * 2), // already checked error.NameTooLong
16691669
.FileName = undefined,
16701670
};

0 commit comments

Comments
 (0)