summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2016-10-06 16:32:46 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2016-10-06 16:32:46 +0000
commit74599ddaf3dfb11277401eb6279dd32371f54e18 (patch)
treee4d1f1da7c1388dbcdc26b1c9f92407f89a08877
parent1767e8be04f300ad10f2b358c281a23f0759e3d3 (diff)
downloadpcre-74599ddaf3dfb11277401eb6279dd32371f54e18.tar.gz
Fix pcretest callout display bug
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1665 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog4
-rw-r--r--pcretest.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d6f8a56..b2ed364 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,10 @@ Version 8.40 xx-xxxx-2016
should cause all characters greater than 255 to match, whatever else is in
the class. There was a bug that caused this not to happen if a Unicode
property item was added to such a class, for example [\D\P{Nd}] or [\W\pL].
+
+7. When pcretest was outputing information from a callout, the caret indicator
+ for the current position in the subject line was incorrect if it was after
+ an escape sequence for a character whose code point was greater than \x{ff}.
Version 8.39 14-June-2016
diff --git a/pcretest.c b/pcretest.c
index 5748c55..5b73a91 100644
--- a/pcretest.c
+++ b/pcretest.c
@@ -1982,6 +1982,7 @@ return(result);
static int pchar(pcre_uint32 c, FILE *f)
{
int n = 0;
+char tempbuffer[16];
if (PRINTOK(c))
{
if (f != NULL) fprintf(f, "%c", c);
@@ -2003,6 +2004,8 @@ if (c < 0x100)
}
if (f != NULL) n = fprintf(f, "\\x{%02x}", c);
+ else n = sprintf(tempbuffer, "\\x{%02x}", c);
+
return n >= 0 ? n : 0;
}