Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-06-19 19:24:48 +0400
committerCorinna Vinschen <corinna@vinschen.de>2013-06-19 19:24:48 +0400
commitc1d6d0547036543038d5687373813bdc84088eba (patch)
treeca04284b055595a87f02dd087aacf93752bad653 /winsup/cygwin/nlsfuncs.cc
parent9e8cf6ebbd867983c2cf8e416213aca7a3a19bdc (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/nlsfuncs.cc')
-rw-r--r--winsup/cygwin/nlsfuncs.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/winsup/cygwin/nlsfuncs.cc b/winsup/cygwin/nlsfuncs.cc
index 0bbd4759c..0388f32fd 100644
--- a/winsup/cygwin/nlsfuncs.cc
+++ b/winsup/cygwin/nlsfuncs.cc
@@ -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