Fix std.os.unlinkatW for absolute paths
RootDirectory can't be set in ObjectAttributes if ObjectName is an absolute path. Fixes #4606
This commit is contained in:
parent
00be934569
commit
d7579a2fcb
|
@ -1438,7 +1438,7 @@ pub fn unlinkatW(dirfd: fd_t, sub_path_w: [*:0]const u16, flags: u32) UnlinkatEr
|
|||
|
||||
var attr = w.OBJECT_ATTRIBUTES{
|
||||
.Length = @sizeOf(w.OBJECT_ATTRIBUTES),
|
||||
.RootDirectory = dirfd,
|
||||
.RootDirectory = if (std.fs.path.isAbsoluteWindowsW(sub_path_w)) null else dirfd,
|
||||
.Attributes = 0, // Note we do not use OBJ_CASE_INSENSITIVE here.
|
||||
.ObjectName = &nt_name,
|
||||
.SecurityDescriptor = null,
|
||||
|
|
Loading…
Reference in New Issue
Block a user