diff options
-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
|