* nlsfuncs.cc (__collate_range_cmp): Convert input to wchar_t and call

wcscoll since all calling functions are using wide chars.  Explain in
	preceeding comment.
This commit is contained in:
Corinna Vinschen 2013-06-19 15:24:48 +00:00
parent 9e8cf6ebbd
commit c1d6d05470
2 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2013-06-18 Corinna Vinschen <corinna@vinschen.de>
* nlsfuncs.cc (__collate_range_cmp): Convert input to wchar_t and call
wcscoll since all calling functions are using wide chars. Explain in
preceeding comment.
2013-06-18 Corinna Vinschen <corinna@vinschen.de>
* spawn.cc (child_info_spawn::worker): Eliminate wascygexec.

View File

@ -1187,13 +1187,15 @@ strcoll (const char *s1, const char *s2)
return ret - CSTR_EQUAL;
}
/* BSD. Used in glob.cc and regcomp.c, for instance. */
/* BSD. Used from glob.cc, fnmatch.c and regcomp.c. Make sure caller is
using wide chars. Unfortunately the definition of this functions hides
the required input type. */
extern "C" int
__collate_range_cmp (int c1, int c2)
{
char s1[2] = { (char) c1, '\0' };
char s2[2] = { (char) c2, '\0' };
return strcoll (s1, s2);
wchar_t s1[2] = { (wchar_t) c1, L'\0' };
wchar_t s2[2] = { (wchar_t) c2, L'\0' };
return wcscoll (s1, s2);
}
extern "C" size_t