Jeroen van Rijn 5 months ago
parent
commit
660598ca8a
1 changed files with 3 additions and 2 deletions
  1. 3 2
      core/os/dir_unix.odin

+ 3 - 2
core/os/dir_unix.odin

@@ -5,9 +5,10 @@ import "core:strings"
 
 @(require_results)
 read_dir :: proc(fd: Handle, n: int, allocator := context.allocator) -> (fi: []File_Info, err: Error) {
-	dupfd := _dup(fd) or_return
+	context.allocator = allocator
 
-	dirp := _fdopendir(dupfd) or_return
+	dupfd := _dup(fd) or_return
+	dirp  := _fdopendir(dupfd) or_return
 	defer _closedir(dirp)
 
 	dirpath := absolute_path_from_handle(dupfd) or_return