aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSan Jacobs2025-06-07 02:12:07 +0200
committerSan Jacobs2025-06-07 02:12:07 +0200
commitd73b837d4b9a0dbf39e4ab82f406f912b03e5b21 (patch)
tree8ab08181122b3e6cfeea513744f5422c4d6060d6
parent7cae333f258136f7bea4014f029f39511de9ec4e (diff)
downloadbetter-report-d73b837d4b9a0dbf39e4ab82f406f912b03e5b21.tar.gz
better-report-d73b837d4b9a0dbf39e4ab82f406f912b03e5b21.tar.bz2
better-report-d73b837d4b9a0dbf39e4ab82f406f912b03e5b21.zip
Fixed non-os2 directory walk stopping earlyHEADmaster
-rwxr-xr-xmain.odin5
1 files changed, 2 insertions, 3 deletions
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