From 65f7767a914144ae303f7b9ae81865061793dcb9 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 16 Sep 2014 11:17:04 +0200 Subject: 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. --- posix/fnmatch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'posix/fnmatch.c') diff --git a/posix/fnmatch.c b/posix/fnmatch.c index 7b225cf2ba..a58e1743ce 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 @@ -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 version included above. */ -- cgit 1.4.1