added natural sort
This commit is contained in:
@ -39,6 +39,7 @@ void get_dir_content(char *path, unsigned long *dir_file_count, file *dir_conten
|
||||
scandir(path, &entry, skip_hidden_files, alphasort);
|
||||
}
|
||||
|
||||
|
||||
unsigned long i = 0;
|
||||
for (i = 0; i < *dir_file_count; i++ ) {
|
||||
if (entry[i]->d_name[0] == '.' && !(file_modifiers & FILE_MODIFIERS_HIDDEN_FILES)) {
|
||||
@ -99,6 +100,7 @@ void get_dir_content(char *path, unsigned long *dir_file_count, file *dir_conten
|
||||
free(file);
|
||||
}
|
||||
}
|
||||
qsort(dir_content, *dir_file_count, sizeof(file), sort_natural);
|
||||
|
||||
for (i = 0; i < *dir_file_count; i++) {
|
||||
free(entry[i]);
|
||||
|
Reference in New Issue
Block a user