Merge pull request #7230 from mororo18/fix/remove-all-windows-relative-path-race

os (windows): resolve relative path before SHFileOperationW in _remove_all
This commit is contained in:
gingerBill
2026-08-05 14:26:49 +02:00
committed by GitHub

View File

@@ -84,7 +84,13 @@ _remove_all :: proc(path: string) -> Error {
}
temp_allocator := TEMP_ALLOCATOR_GUARD({})
dir := win32_utf8_to_wstring(path, temp_allocator) or_return
// SHFileOperationW is documented as not thread safe with relative paths.
abs_path := path
if !_is_absolute_path(path) {
abs_path = _get_absolute_path(path, temp_allocator) or_return
}
dir := win32_utf8_to_wstring(abs_path, temp_allocator) or_return
empty: [1]u16