proper handling of empty dirs (hopefully)

This commit is contained in:
nova
2026-06-15 20:28:39 +02:00
parent 4def2c7cf0
commit c0299aef8c
4 changed files with 68 additions and 30 deletions
+6
View File
@@ -49,6 +49,12 @@ unsigned long get_dir_size(char *path){
}
void get_dir_content(char *path, dir *dir){
if (dir->file_count == 0) {
return;
dir = NULL;
}
struct dirent **entry = NULL;
if (file_modifiers & FILE_MODIFIERS_HIDDEN_FILES) { /* print hidden files */
scandir(path, &entry, skip_dot, NULL);