Ticket #3496: (dir_list_sort): do not call qsort for 'unsorted' sort order

...since qsort may shuffle first and last files in some lists.

Thanks Nicolas Rybkin for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2015-08-19 17:15:02 +03:00 committed by Yury V. Zaytsev
parent 11645aadb9
commit 280bf87680
1 changed files with 1 additions and 1 deletions

View File

@ -508,7 +508,7 @@ dir_list_sort (dir_list * list, GCompareFunc sort, const dir_sort_options_t * so
file_entry_t *fentry;
int dot_dot_found = 0;
if (list->len < 2)
if (list->len < 2 || sort == (GCompareFunc) unsorted)
return;
/* If there is an ".." entry the caller must take care to