aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/os/dir_windows.odin4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/os/dir_windows.odin b/core/os/dir_windows.odin
index 78c7d357b..6b8fa5dbe 100644
--- a/core/os/dir_windows.odin
+++ b/core/os/dir_windows.odin
@@ -4,7 +4,7 @@ import win32 "core:sys/windows"
import "core:strings"
import "core:time"
-read_dir :: proc(fd: Handle, n: int) -> (fi: []File_Info, err: Errno) {
+read_dir :: proc(fd: Handle, n: int, allocator := context.allocator) -> (fi: []File_Info, err: Errno) {
find_data_to_file_info :: proc(base_path: string, d: ^win32.WIN32_FIND_DATAW) -> (fi: File_Info) {
// Ignore "." and ".."
if d.cFileName[0] == '.' && d.cFileName[1] == 0 {
@@ -53,6 +53,8 @@ read_dir :: proc(fd: Handle, n: int) -> (fi: []File_Info, err: Errno) {
return nil, ERROR_INVALID_HANDLE;
}
+ context.allocator = allocator;
+
h := win32.HANDLE(fd);
dir_fi, _ := stat_from_file_information("", h);