aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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