about summary refs log tree commit diff
path: root/posix/regex_internal.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-06-05 20:04:47 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-06-05 20:04:47 +0000
commit9dd6b7799a0b04034f2d2266845c64a309b015a3 (patch)
tree0ddf22dfc3d7d7f5b5aab3b6fe830d41075b9067 /posix/regex_internal.c
parenta330baa05bf827b67a6391721fa3ab2f72f1f4dc (diff)
downloadglibc-9dd6b7799a0b04034f2d2266845c64a309b015a3.tar.gz
glibc-9dd6b7799a0b04034f2d2266845c64a309b015a3.tar.xz
glibc-9dd6b7799a0b04034f2d2266845c64a309b015a3.zip
Fix regex wctype namespace (bug 18495).
regcomp brings in references to various wctype functions that aren't
in all the standards including regcomp.  This patch fixes this in the
usual way by using the __* versions of these functions (which already
exist, but some didn't have libc_hidden_proto / libc_hidden_def
before).

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).  (Other wide character
function references from the regex code mean that this patch by itself
doesn't fix any XFAILed linknamespace test failures; further patches
will be needed for that.)

	[BZ #18495]
	* wctype/wcfuncs.c (__iswalnum): Use libc_hidden_def.
	(__iswlower): Likewise.
	* include/wctype.h (__iswalnum): Declare.  Use libc_hidden_proto.
	(__iswlower): Likewise.
	* posix/regcomp.c (re_compile_fastmap_iter): Call __towlower
	instead of towlower.
	* posix/regex_internal.c (build_wcs_upper_buffer): Call __iswlower
	instead of iswlower.  Call __towupper instead of towupper.
	* posix/regex_internal.h (IS_WIDE_WORD_CHAR): Call __iswalnum
	instead of iswalnum.
Diffstat (limited to 'posix/regex_internal.c')
-rw-r--r--posix/regex_internal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/posix/regex_internal.c b/posix/regex_internal.c
index e5a14cde20..d77d3a14dc 100644
--- a/posix/regex_internal.c
+++ b/posix/regex_internal.c
@@ -312,11 +312,11 @@ build_wcs_upper_buffer (re_string_t *pstr)
 	  if (BE (mbclen + 2 > 2, 1))
 	    {
 	      wchar_t wcu = wc;
-	      if (iswlower (wc))
+	      if (__iswlower (wc))
 		{
 		  size_t mbcdlen;
 
-		  wcu = towupper (wc);
+		  wcu = __towupper (wc);
 		  mbcdlen = wcrtomb (buf, wcu, &prev_st);
 		  if (BE (mbclen == mbcdlen, 1))
 		    memcpy (pstr->mbs + byte_idx, buf, mbclen);
@@ -382,11 +382,11 @@ build_wcs_upper_buffer (re_string_t *pstr)
 	if (BE (mbclen + 2 > 2, 1))
 	  {
 	    wchar_t wcu = wc;
-	    if (iswlower (wc))
+	    if (__iswlower (wc))
 	      {
 		size_t mbcdlen;
 
-		wcu = towupper (wc);
+		wcu = __towupper (wc);
 		mbcdlen = wcrtomb ((char *) buf, wcu, &prev_st);
 		if (BE (mbclen == mbcdlen, 1))
 		  memcpy (pstr->mbs + byte_idx, buf, mbclen);