aboutsummaryrefslogtreecommitdiff
path: root/posix/fnmatch.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2014-09-16 11:17:04 +0200
committerAndreas Schwab <schwab@suse.de>2019-02-04 15:45:02 +0100
commit65f7767a914144ae303f7b9ae81865061793dcb9 (patch)
tree9af5f491383e603957b206d18336972572cde7c1 /posix/fnmatch.c
parent3f635fb43389b54f682fc9ed2acc0b2aaf4a923d (diff)
downloadglibc-65f7767a914144ae303f7b9ae81865061793dcb9.zip
glibc-65f7767a914144ae303f7b9ae81865061793dcb9.tar.gz
glibc-65f7767a914144ae303f7b9ae81865061793dcb9.tar.bz2
Fix handling of collating elements in fnmatch (bug 17396, bug 16976)
This fixes the same bug in fnmatch that was fixed by commit 7e2f0d2d77 for regexp matching. As a side effect it also removes the use of an unbound VLA.
Diffstat (limited to 'posix/fnmatch.c')
-rw-r--r--posix/fnmatch.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/posix/fnmatch.c b/posix/fnmatch.c
index 7b225cf..a58e174 100644
--- a/posix/fnmatch.c
+++ b/posix/fnmatch.c
@@ -53,7 +53,6 @@
we support a correct implementation only in glibc. */
#ifdef _LIBC
# include "../locale/localeinfo.h"
-# include "../locale/elem-hash.h"
# include "../locale/coll-lookup.h"
# include <shlib-compat.h>
@@ -237,6 +236,11 @@ __wcschrnul (const wchar_t *s, wint_t c)
# define MEMPCPY(D, S, N) __wmempcpy (D, S, N)
# define MEMCHR(S, C, N) __wmemchr (S, C, N)
# define STRCOLL(S1, S2) wcscoll (S1, S2)
+# ifdef _LIBC
+# define WMEMCMP(S1, S2, N) __wmemcmp (S1, S2, N)
+# else
+# define WMEMCMP(S1, S2, N) wmemcmp (S1, S2, N)
+# endif
# define WIDE_CHAR_VERSION 1
/* Change the name the header defines so it doesn't conflict with
the <locale/weight.h> version included above. */