From 68cff1f8ba4b8318409e3201ff3440e64369c52f Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 22 Apr 2004 18:18:44 +0000 Subject: [PATCH] Use wcscoll(), if available, when sorting index terms. (In a somewhat roundabout and arse-backwards sort of way, due to some other properties of the sort that I rather wanted to maintain. But I hope it should still do some good.) git-svn-id: svn://svn.tartarus.org/sgt/halibut@4119 cda61777-01e9-0310-a592-d414129be87e --- misc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/misc.c b/misc.c index 12333e7..aa05878 100644 --- a/misc.c +++ b/misc.c @@ -194,10 +194,25 @@ int compare_wordlists(word *a, word *b) { } } +#ifdef HAS_WCSCOLL + { + wchar_t a[2], b[2]; + int ret; + + a[0] = pos[0].c; + b[0] = pos[1].c; + a[1] = b[1] = L'\0'; + + ret = wcscoll(a, b); + if (ret) + return ret; + } +#else if (pos[0].c < pos[1].c) return -1; else if (pos[0].c > pos[1].c) return +1; +#endif if (!pos[0].c) break; /* they're equal */ -- 2.11.0