diff options
author | Darkvater <darkvater@openttd.org> | 2006-10-12 15:39:33 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-10-12 15:39:33 +0000 |
commit | 2b7a0a8dac7ce67d5291ff171c7bc52946173afc (patch) | |
tree | d705376e9e937904d1443898456b5b57b023ffae | |
parent | 841afe5c5003f87aa95cfc7de40eb27e34fd7c1c (diff) | |
download | openttd-2b7a0a8dac7ce67d5291ff171c7bc52946173afc.tar.xz |
(svn r6760) -Codechange: Do a case insensitive sort of train engine names and just normally
check a boolean; no special magic needed
-rw-r--r-- | train_gui.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/train_gui.c b/train_gui.c index eb919b25e..7d588a088 100644 --- a/train_gui.c +++ b/train_gui.c @@ -144,14 +144,14 @@ static int CDECL TrainEngineNameSorter(const void *a, const void *b) GetString(_bufcache, GetCustomEngineName(vb)); } - r = strcmp(buf1, _bufcache); // sort by name + r = strcasecmp(buf1, _bufcache); // sort by name if (r == 0) { /* Use EngineID to sort instead since we want consistent sorting */ return TrainEngineNumberSorter(a, b); } - return (_internal_sort_order & 1) ? -r : r; + return _internal_sort_order ? -r : r; } static int CDECL TrainEngineRunningCostSorter(const void *a, const void *b) |