summaryrefslogtreecommitdiff
path: root/unix.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-09-23 21:16:23 +0000
committerdarkvater <darkvater@openttd.org>2004-09-23 21:16:23 +0000
commit198f841c7e5632ef224839ece6caee4d700b0d01 (patch)
tree865345c1a4d461247345aa7778d11229bff9701e /unix.c
parentf3758d133a2a0330cdaee175383807bac0ad0249 (diff)
downloadopenttd-198f841c7e5632ef224839ece6caee4d700b0d01.tar.xz
(svn r313) -Feature/Fix: directories in *nix are now sorted alphabetically in ascending order (Tron).
Diffstat (limited to 'unix.c')
-rw-r--r--unix.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/unix.c b/unix.c
index 6735446cd..2ea2fcf8a 100644
--- a/unix.c
+++ b/unix.c
@@ -100,6 +100,14 @@ FiosItem *FiosGetSavegameList(int *num, int mode)
closedir(dir);
}
+ {
+ /* XXX ugly global variables ... */
+ byte order = _savegame_sort_order;
+ _savegame_sort_order = 2; // sort ascending by name
+ qsort(_fios_items, _fios_count, sizeof(FiosItem), compare_FiosItems);
+ _savegame_sort_order = order;
+ }
+
// this is where to start sorting
sort_start = _fios_count;