From 5ac1c6f555cff38499e0a6ac80b338df4ebe3047 Mon Sep 17 00:00:00 2001 From: Stephane Chazelas Date: Wed, 16 May 2018 22:02:51 +0100 Subject: 42790: make [[:blank:]] match non-ASCII blanks --- Src/pattern.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/pattern.c b/Src/pattern.c index fc7c73739..737f5cdcb 100644 --- a/Src/pattern.c +++ b/Src/pattern.c @@ -3605,7 +3605,15 @@ mb_patmatchrange(char *range, wchar_t ch, int zmb_ind, wint_t *indptr, int *mtp) return 1; break; case PP_BLANK: - if (ch == L' ' || ch == L'\t') +#if !defined(HAVE_ISWBLANK) && !defined(iswblank) +/* + * iswblank() is GNU and C99. There's a remote chance that some + * systems still don't support it (but would support the other ones + * if MULTIBYTE_SUPPORT is enabled). + */ +#define iswblank(c) (c == L' ' || c == L'\t') +#endif + if (iswblank(ch)) return 1; break; case PP_CNTRL: @@ -3840,7 +3848,14 @@ patmatchrange(char *range, int ch, int *indptr, int *mtp) return 1; break; case PP_BLANK: - if (ch == ' ' || ch == '\t') +#if !defined(HAVE_ISBLANK) && !defined(isblank) +/* + * isblank() is GNU and C99. There's a remote chance that some + * systems still don't support it. + */ +#define isblank(c) (c == ' ' || c == '\t') +#endif + if (isblank(ch)) return 1; break; case PP_CNTRL: -- cgit 1.4.1