1
0
Fork 0

(svn r15657) -Fix [FS#2716]: undeterministic file sorting when the date is equal for all files

release/0.7
rubidium 2009-03-09 21:55:17 +00:00
parent aa7a19fd49
commit c4c0a09927
1 changed files with 3 additions and 3 deletions

View File

@ -51,12 +51,12 @@ int CDECL compare_FiosItems(const void *a, const void *b)
const FiosItem *db = (const FiosItem *)b; const FiosItem *db = (const FiosItem *)b;
int r = 0; int r = 0;
if ((_savegame_sort_order & SORT_BY_NAME) == 0) { if ((_savegame_sort_order & SORT_BY_NAME) == 0 && da->mtime != db->mtime) {
r = da->mtime < db->mtime ? -1 : 1; r = da->mtime < db->mtime ? -1 : 1;
} else {
r = strcasecmp(da->title, db->title);
} }
if (r == 0) r = strcasecmp(da->title, db->title);
if (_savegame_sort_order & SORT_DESCENDING) r = -r; if (_savegame_sort_order & SORT_DESCENDING) r = -r;
return r; return r;
} }