From c4c0a09927c25654e2457afe3997510364fca1d5 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 9 Mar 2009 21:55:17 +0000 Subject: (svn r15657) -Fix [FS#2716]: undeterministic file sorting when the date is equal for all files --- src/fios.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/fios.cpp b/src/fios.cpp index 9d5db867a..7a0573acb 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -51,12 +51,12 @@ int CDECL compare_FiosItems(const void *a, const void *b) const FiosItem *db = (const FiosItem *)b; 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; + } else { + r = strcasecmp(da->title, db->title); } - if (r == 0) r = strcasecmp(da->title, db->title); - if (_savegame_sort_order & SORT_DESCENDING) r = -r; return r; } -- cgit v1.2.3-70-g09d2