Fix callout display bug in pcre2test.

This commit is contained in:
Philip.Hazel 2016-10-05 16:53:34 +00:00
parent 7fd341c384
commit 1d28e047f3
4 changed files with 28 additions and 8 deletions

View File

@ -54,6 +54,10 @@ not recognize this syntax.
7. Automatic callouts are no longer generated before and after callouts in the
pattern.
8. When pcre2test 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 10.22 29-July-2016
--------------------------

View File

@ -2528,6 +2528,8 @@ static int
pchar(uint32_t c, BOOL utf, FILE *f)
{
int n = 0;
char tempbuffer[16];
if (PRINTOK(c))
{
if (f != NULL) fprintf(f, "%c", c);
@ -2549,6 +2551,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;
}

3
testdata/testinput5 vendored
View File

@ -1733,4 +1733,7 @@
/ab(?<=A\RB)/utf
/../utf,auto_callout
\n\x{123}\x{123}\x{123}\x{123}
# End of testinput5

View File

@ -4171,4 +4171,13 @@ Failed: error 125 at offset 1: lookbehind assertion is not fixed length
/ab(?<=A\RB)/utf
Failed: error 125 at offset 2: lookbehind assertion is not fixed length
/../utf,auto_callout
\n\x{123}\x{123}\x{123}\x{123}
--->\x{0a}\x{123}\x{123}\x{123}\x{123}
+0 ^ .
+0 ^ .
+1 ^ ^ .
+2 ^ ^
0: \x{123}\x{123}
# End of testinput5