From 75f86a7a21c6c6ea2e5067a5eb9a8690d8584ed1 Mon Sep 17 00:00:00 2001 From: terkhen Date: Sat, 27 Nov 2010 22:52:12 +0000 Subject: (svn r21344) -Feature [FS#4214]: Natural sorting of strings using ICU. --- src/industry_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/industry_gui.cpp') diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 32ffff33a..f365c060a 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -120,7 +120,7 @@ static int CDECL IndustryTypeNameSorter(const IndustryType *a, const IndustryTyp SetDParam(0, indsp2->name); GetString(industry_name[1], STR_JUST_STRING, lastof(industry_name[1])); - int r = strcmp(industry_name[0], industry_name[1]); + int r = strnatcmp(industry_name[0], industry_name[1]); // Sort by name (natural sorting). /* If the names are equal, sort by industry type. */ return (r != 0) ? r : (*a - *b); @@ -1137,7 +1137,7 @@ protected: GetString(buf_cache, STR_INDUSTRY_NAME, lastof(buf_cache)); } - return strcmp(buf, buf_cache); + return strnatcmp(buf, buf_cache); // Sort by name (natural sorting). } /** Sort industries by type and name */ -- cgit v1.2.3-54-g00ecf