Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nob.h
Original file line number Diff line number Diff line change
Expand Up @@ -2100,7 +2100,7 @@ NOBDEF bool nob_dir_entry_next(Nob_Dir_Entry *dir)
NOBDEF void nob_dir_entry_close(Nob_Dir_Entry dir)
{
#ifdef _WIN32
FindClose(dir.nob__private.win32_hFind);
if (dir->nob__private.win32_hFind != INVALID_HANDLE_VALUE) FindClose(dir.nob__private.win32_hFind);
#else
if (dir.nob__private.posix_dir) closedir(dir.nob__private.posix_dir);
#endif
Expand Down Expand Up @@ -2190,7 +2190,7 @@ bool nob__walk_dir_opt_impl(Nob_String_Builder *file_path, Nob_Walk_Func func, s
file_path->count = saved_file_path_count;
nob_da_last(file_path) = '\0';

nob_dir_entry_close(dir);
if (file_type == NOB_FILE_DIRECTORY) nob_dir_entry_close(dir);
return result;
}

Expand Down