proper handling of empty dirs (hopefully)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user