From a9b7d3dfc638f7dbdbc20be1c74283a652c2c742 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Sun, 16 Aug 2026 18:08:17 +0200 Subject: [PATCH] Fix #7350 --- core/os/dir_windows.odin | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/os/dir_windows.odin b/core/os/dir_windows.odin index 3fd045560..9d245f6ad 100644 --- a/core/os/dir_windows.odin +++ b/core/os/dir_windows.odin @@ -16,8 +16,15 @@ find_data_to_file_info :: proc(base_path: string, d: ^win32.WIN32_FIND_DATAW, al } temp_allocator := TEMP_ALLOCATOR_GUARD({ allocator }) - path := concatenate({base_path, `\`, win32_wstring_to_utf8(cstring16(raw_data(d.cFileName[:])), temp_allocator) or_else ""}, allocator) or_return + filename := win32_wstring_to_utf8(cstring16(raw_data(d.cFileName[:])), temp_allocator) or_else "" + pieces: []string + if len(base_path) > 0 && is_path_separator(base_path[len(base_path) - 1]) { + pieces = {base_path, filename} + } else { + pieces = {base_path, Path_Separator_String, filename} + } + path := concatenate(pieces, allocator) or_return handle := win32.HANDLE(_open_internal(path, {.Read}, Permissions_Read_Write_All) or_else 0) defer win32.CloseHandle(handle)