1 --- strcoll.c.orig 2003-05-20 15:23:54.000000000 -0700
2 +++ strcoll.c 2005-03-30 15:16:28.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/string/strcoll.c,v 1.13 2001/11/07 19:55:16 obrien Exp $");
7 +#include "xlocale_private.h"
17 +strcoll_l(s, s2, loc)
21 - int len, len2, prim, prim2, sec, sec2, ret, ret2;
25 + const wchar_t *t = NULL, *t2 = NULL;
28 - if (__collate_load_error)
29 + NORMALIZE_LOCALE(loc);
30 + if (loc->__collate_load_error || (t = __collate_mbstowcs(s, loc)) == NULL || (t2 = __collate_mbstowcs(s2, loc)) == NULL) {
39 - if (__collate_substitute_nontrivial) {
40 - t = tt = __collate_substitute(s);
41 - t2 = tt2 = __collate_substitute(s2);
49 - while(*t && !prim) {
50 - __collate_lookup(t, &len, &prim, &sec);
53 - while(*t2 && !prim2) {
54 - __collate_lookup(t2, &len2, &prim2, &sec2);
67 - ret = -(int)((u_char)*t2);
70 - else if(!*t && !*t2)
76 + ret = wcscoll_l(t, t2, loc);
89 + return strcoll_l(s, s2, __current_locale());