summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_content_gui.cpp4
-rw-r--r--src/network/network_gui.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 44b37cc4a..70cc0d8a1 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -266,7 +266,7 @@ class NetworkContentListWindow : public QueryStringBaseWindow, ContentCallback {
/** Sort content by name. */
static int CDECL NameSorter(const ContentInfo * const *a, const ContentInfo * const *b)
{
- return strcasecmp((*a)->name, (*b)->name);
+ return strnatcmp((*a)->name, (*b)->name); // Sort by name (natural sorting).
}
/** Sort content by type. */
@@ -278,7 +278,7 @@ class NetworkContentListWindow : public QueryStringBaseWindow, ContentCallback {
char b_str[64];
GetString(a_str, STR_CONTENT_TYPE_BASE_GRAPHICS + (*a)->type - CONTENT_TYPE_BASE_GRAPHICS, lastof(a_str));
GetString(b_str, STR_CONTENT_TYPE_BASE_GRAPHICS + (*b)->type - CONTENT_TYPE_BASE_GRAPHICS, lastof(b_str));
- r = strcasecmp(a_str, b_str);
+ r = strnatcmp(a_str, b_str);
}
if (r == 0) r = NameSorter(a, b);
return r;
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 6b1c15da7..7c4914aa7 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -279,7 +279,7 @@ protected:
/** Sort servers by name. */
static int CDECL NGameNameSorter(NetworkGameList * const *a, NetworkGameList * const *b)
{
- return strcasecmp((*a)->info.server_name, (*b)->info.server_name);
+ return strnatcmp((*a)->info.server_name, (*b)->info.server_name); // Sort by name (natural sorting).
}
/**