diff options
author | San Jacobs | 2025-06-07 02:12:07 +0200 |
---|---|---|
committer | San Jacobs | 2025-06-07 02:12:07 +0200 |
commit | d73b837d4b9a0dbf39e4ab82f406f912b03e5b21 (patch) | |
tree | 8ab08181122b3e6cfeea513744f5422c4d6060d6 | |
parent | 7cae333f258136f7bea4014f029f39511de9ec4e (diff) | |
download | better-report-d73b837d4b9a0dbf39e4ab82f406f912b03e5b21.tar.gz better-report-d73b837d4b9a0dbf39e4ab82f406f912b03e5b21.tar.bz2 better-report-d73b837d4b9a0dbf39e4ab82f406f912b03e5b21.zip |
-rwxr-xr-x | main.odin | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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
|