Blob Blame History Raw
From 686660568dde71f9a7f8791cbb8a77702b3ea820 Mon Sep 17 00:00:00 2001
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
Date: Wed, 22 Feb 2017 17:37:47 +0000
Subject: [PATCH] Check character < 256 for isprint() in pcretest.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1685 2f5784b3-3f2a-0410-8824-cb99058d5e15

Petr Písař: Ported to 8.40.

diff --git a/pcretest.c b/pcretest.c
index 5b73a91..797f99c 100644
--- a/pcretest.c
+++ b/pcretest.c
@@ -177,7 +177,7 @@ that differ in their output from isprint() even in the "C" locale. */
 #define PRINTABLE(c) ((c) >= 32 && (c) < 127)
 #endif
 
-#define PRINTOK(c) (locale_set? isprint(c) : PRINTABLE(c))
+#define PRINTOK(c) (locale_set? (((c) < 256) && isprint(c)) : PRINTABLE(c))
 
 /* Posix support is disabled in 16 or 32 bit only mode. */
 #if !defined SUPPORT_PCRE8 && !defined NOPOSIX
diff --git a/testdata/testinput15 b/testdata/testinput15
index 83e2677..c065105 100644
--- a/testdata/testinput15
+++ b/testdata/testinput15
@@ -363,4 +363,7 @@ correctly, but that messes up comparisons). --/
 
 /abc/89
 
+//8+L
+    \xf1\xad\xae\xae
+
 /-- End of testinput15 --/
diff --git a/testdata/testoutput15 b/testdata/testoutput15
index bad2807..e4e123c 100644
--- a/testdata/testoutput15
+++ b/testdata/testoutput15
@@ -1136,4 +1136,9 @@ Failed: setting UTF is disabled by the application at offset 0
 /abc/89
 Failed: setting UTF is disabled by the application at offset 0
 
+//8+L
+    \xf1\xad\xae\xae
+ 0: 
+ 0+ \x{6dbae}
+
 /-- End of testinput15 --/
-- 
2.7.4