aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-08-09 14:41:48 +0100
committerRon Yorston <rmy@pobox.com>2021-08-09 14:41:48 +0100
commitdd10dfda5834b0e67ebab0425d0a48fbfc939d7f (patch)
tree5e20b8bec1d301e33355d959e5ad7f6bebc2ba43
parentc50e9e73fa54237fb78167379ccb154dd4cd3cef (diff)
downloadbusybox-w32-dd10dfda5834b0e67ebab0425d0a48fbfc939d7f.tar.gz
busybox-w32-dd10dfda5834b0e67ebab0425d0a48fbfc939d7f.tar.bz2
busybox-w32-dd10dfda5834b0e67ebab0425d0a48fbfc939d7f.zip
win32: fix fnmatch(3) handling of xdigit
The glob pattern '[[:xdigit::]]*' didn't return the matches expected. It turns out the implementation (from glibc) fails to detect 'xdigit' as a valid character class. Changing the definition of CHAR_CLASS_MAX_LENGTH to 7 fixes the problem. This was never an issue in glibc because it uses a different definition. More modern versions of fnmatch(3) in glibc and gnulib also make CHAR_CLASS_MAX_LENGTH long enough. The code for fnmatch(3) was taken from glibc at commit 7814856974388a856a575fa45f88d502c8a1ab29. This was the last version before the code was rearraged to better support multibyte characters.
-rw-r--r--win32/fnmatch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/fnmatch.c b/win32/fnmatch.c
index 5d2ea685d..0e76a7ba1 100644
--- a/win32/fnmatch.c
+++ b/win32/fnmatch.c
@@ -108,7 +108,7 @@ int index_in_strings(const char *strings, const char *key) FAST_FUNC;
108# define IS_CHAR_CLASS(string) wctype (string) 108# define IS_CHAR_CLASS(string) wctype (string)
109# endif 109# endif
110# else 110# else
111# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ 111# define CHAR_CLASS_MAX_LENGTH 7 /* Namely, `xdigit'. */
112 112
113# define IS_CHAR_CLASS(string) \ 113# define IS_CHAR_CLASS(string) \
114 (STREQ (string, "alpha") || STREQ (string, "upper") \ 114 (STREQ (string, "alpha") || STREQ (string, "upper") \