authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-15 17:26:29-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-15 17:26:29-04:00
loga27a8561e9387b22d7c694af924e8f2ed0f17290
tree0a408efead84b1277ae769c0e92d60a2e2079c08
parent7e45a3ef6ac9a5a24276d26cde11fdbf94e373e4
signaturelock-open Commit is signed but in an unrecognized format.

adjust renameatW to always supply dest root dir

this fixes tests for wine

2 files changed, 2 insertions(+), 2 deletions(-)

lib/std/mem.zig+1-1
...@@ -116,7 +116,7 @@ pub const Allocator = struct {...@@ -116,7 +116,7 @@ pub const Allocator = struct {
116 pub fn allocSentinel(self: *Allocator, comptime Elem: type, n: usize, comptime sentinel: Elem) Error![:sentinel]Elem {116 pub fn allocSentinel(self: *Allocator, comptime Elem: type, n: usize, comptime sentinel: Elem) Error![:sentinel]Elem {
117 var ptr = try self.alloc(Elem, n + 1);117 var ptr = try self.alloc(Elem, n + 1);
118 ptr[n] = sentinel;118 ptr[n] = sentinel;
119 return ptr[0 .. n :sentinel];119 return ptr[0..n :sentinel];
120 }120 }
121121
122 pub fn alignedAlloc(122 pub fn alignedAlloc(
lib/std/os.zig+1-1
...@@ -1664,7 +1664,7 @@ pub fn renameatW(...@@ -1664,7 +1664,7 @@ pub fn renameatW(
16641664
1665 rename_info.* = .{1665 rename_info.* = .{
1666 .ReplaceIfExists = ReplaceIfExists,1666 .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,
1668 .FileNameLength = @intCast(u32, new_path.len * 2), // already checked error.NameTooLong1668 .FileNameLength = @intCast(u32, new_path.len * 2), // already checked error.NameTooLong
1669 .FileName = undefined,1669 .FileName = undefined,
1670 };1670 };