Buggy sort

There's a problem when "unsorted" sort order is chosen. When I choose "undsorted" when I've already entered 
directory it displays list properly, but when I enter directory with (sort order = "unsorted") it often (not 
for every dir) displays the first entry of the list last and the last first. It seems that the number of 
entries in the dir doesn't matter.
When I comment qsort() call in dir.c everything is OK (except other sort orders don't work, of course).
Here's sort routine for unsorted:
unsorted (file_entry_t * a, file_entry_t * b)
    (void) a;
    (void) b;
    return 0;
So it seems to be OK.
Here's qsort() call:
qsort (&(list->list)[dot_dot_found], list->len - dot_dot_found, sizeof (file_entry_t), sort);
dot_dot_found seems doesn't matter. So I have no idea what's wrong, maybe bug in qsort. I'm going to make a 
change that qsort() won't be called if sort order == "unsorted".  But maybe anyone has any ideas? This issue 
is really important to me.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]