os: resolve relative path before SHFileOperationW in remove_all (windows)

This commit is contained in:
Victor Mororó
2026-08-05 08:45:01 -03:00
parent f558ab105c
commit 7ff00d39bd

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