summary refs log tree commit diff
path: root/Src/pattern.c
diff options
context:
space:
mode:
authorStephane Chazelas <stephane.chazelas@gmail.com>2018-05-16 22:02:51 +0100
committerOliver Kiddle <okiddle@yahoo.co.uk>2018-05-17 23:42:27 +0200
commit5ac1c6f555cff38499e0a6ac80b338df4ebe3047 (patch)
tree42db6d43f75d744f9c16092f4b6a078401deb57f /Src/pattern.c
parentafec5fb1360ea2dff19abe8ac7bfd10ccb4c5926 (diff)
downloadzsh-5ac1c6f555cff38499e0a6ac80b338df4ebe3047.tar.gz
zsh-5ac1c6f555cff38499e0a6ac80b338df4ebe3047.tar.xz
zsh-5ac1c6f555cff38499e0a6ac80b338df4ebe3047.zip
42790: make [[:blank:]] match non-ASCII blanks
Diffstat (limited to 'Src/pattern.c')
-rw-r--r--Src/pattern.c19
1 files changed, 17 insertions, 2 deletions
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: