adjust renameatW to always supply dest root dir

this fixes tests for wine
This commit is contained in:
Andrew Kelley 2020-03-15 17:26:29 -04:00
parent 7e45a3ef6a
commit a27a8561e9
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
2 changed files with 2 additions and 2 deletions

View File

@ -116,7 +116,7 @@ pub const Allocator = struct {
pub fn allocSentinel(self: *Allocator, comptime Elem: type, n: usize, comptime sentinel: Elem) Error![:sentinel]Elem {
var ptr = try self.alloc(Elem, n + 1);
ptr[n] = sentinel;
return ptr[0 .. n :sentinel];
return ptr[0..n :sentinel];
}
pub fn alignedAlloc(

View File

@ -1664,7 +1664,7 @@ pub fn renameatW(
rename_info.* = .{
.ReplaceIfExists = ReplaceIfExists,
.RootDirectory = if (old_dir_fd == new_dir_fd or std.fs.path.isAbsoluteWindowsW(new_path_w)) null else new_dir_fd,
.RootDirectory = if (std.fs.path.isAbsoluteWindowsW(new_path_w)) null else new_dir_fd,
.FileNameLength = @intCast(u32, new_path.len * 2), // already checked error.NameTooLong
.FileName = undefined,
};