From d73b837d4b9a0dbf39e4ab82f406f912b03e5b21 Mon Sep 17 00:00:00 2001 From: San Jacobs Date: Sat, 7 Jun 2025 02:12:07 +0200 Subject: Fixed non-os2 directory walk stopping early --- main.odin | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'main.odin') diff --git a/main.odin b/main.odin index b09154c..c5f3125 100755 --- a/main.odin +++ b/main.odin @@ -540,14 +540,13 @@ walk_directory :: proc(path : string, file_number : ^int, file_list : ^[dynamic] } defer os.close(handle) - files, okr := os.read_dir(handle, -1) + files, okr := os.read_dir(handle, -1, context.temp_allocator) if okr != os.ERROR_NONE { indent_by(depth) fmt.printf("ERROR [{}] reading dir: %s\n", okr, path) if okr == os.ERROR_FILE_IS_NOT_DIR do return true return true } - defer delete(files) for file in files { @@ -557,7 +556,7 @@ walk_directory :: proc(path : string, file_number : ^int, file_list : ^[dynamic] if file.is_dir { indent_by(depth) fmt.printf("📁 %s\n", file.name) - return walk_directory(full_path, file_number, file_list, depth+1) // Recurse + walk_directory(full_path, file_number, file_list, depth+1) // Recurse } else { // If file is actually a file -- cgit v1.2.1