collcmp.c.patch   [plain text]


--- collcmp.c.orig	2004-11-25 11:38:16.000000000 -0800
+++ collcmp.c	2005-03-30 08:36:37.000000000 -0800
@@ -27,19 +27,22 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: src/lib/libc/locale/collcmp.c,v 1.17 2003/08/03 19:28:23 ache Exp $");
 
-#include <string.h>
+#include <xlocale.h>
+#include <wchar.h>
 #include "collate.h"
 
 /*
  * Compare two characters using collate
  */
 
-int __collate_range_cmp(c1, c2)
-	int c1, c2;
+__private_extern__ int
+__collate_range_cmp(c1, c2, loc)
+	wchar_t c1, c2;
+	locale_t loc;
 {
-	static char s1[2], s2[2];
+	static wchar_t s1[2], s2[2];
 
 	s1[0] = c1;
 	s2[0] = c2;
-	return (strcoll(s1, s2));
+	return (wcscoll_l(s1, s2, loc));
 }