summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-06-19 15:24:48 +0000
committerCorinna Vinschen <corinna@vinschen.de>2013-06-19 15:24:48 +0000
commitc1d6d0547036543038d5687373813bdc84088eba (patch)
treeca04284b055595a87f02dd087aacf93752bad653
parent9e8cf6ebbd867983c2cf8e416213aca7a3a19bdc (diff)
downloadcygnal-c1d6d0547036543038d5687373813bdc84088eba.tar.gz
cygnal-c1d6d0547036543038d5687373813bdc84088eba.tar.bz2
cygnal-c1d6d0547036543038d5687373813bdc84088eba.zip
* 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.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/nlsfuncs.cc10
2 files changed, 12 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 7c3eb28e8..4eeac6ae4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
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.
2013-06-18 Christopher Faylor <me.cygwin2013@cgf.cx>
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