1
1

Fix crash when attempting to sort an empty directory

I had taken care to not sort empty directories during dirlist_open(),
but forgot that manual user actions can still cause dirlist_set_sort()
to be called, which does not handle empty directories.

Reported by Alex Wilson.
Этот коммит содержится в:
Yorhel 2019-01-20 16:43:55 +01:00
родитель 93583e645f
Коммит 2501fb1ad5

Просмотреть файл

@ -371,7 +371,8 @@ void dirlist_set_sort(int col, int desc, int df) {
dirlist_sort_df = df;
/* sort the list (excluding the parent, which is always on top) */
head_real = dirlist_sort(head_real);
if(head_real)
head_real = dirlist_sort(head_real);
if(dirlist_parent)
dirlist_parent->next = head_real;
else