summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2017-02-22 17:37:47 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2017-02-22 17:37:47 +0000
commit686660568dde71f9a7f8791cbb8a77702b3ea820 (patch)
treed5d152c65b3dcc61933514aeb54082c80e8aa058
parent7204e99eb2643d5acca173279166b872bccbcb31 (diff)
downloadpcre-686660568dde71f9a7f8791cbb8a77702b3ea820.tar.gz
Check character < 256 for isprint() in pcretest.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1685 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog2
-rw-r--r--pcretest.c2
-rw-r--r--testdata/testinput153
-rw-r--r--testdata/testoutput155
4 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 019e0f5..7055476 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,8 @@ following '+' or '?' (example: /X+(?#comment)?Y/.
5. Avoid use of a potentially overflowing buffer in pcregrep (patch by Petr
Pisar).
+6. Check for values < 256 when calling isprint() in pcretest.
+
Version 8.40 11-January-2017
----------------------------
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 --/