[Pcre-svn] [1665] code/trunk: Fix pcretest callout display b…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1665] code/trunk: Fix pcretest callout display bug
Revision: 1665
          http://vcs.pcre.org/viewvc?view=rev&revision=1665
Author:   ph10
Date:     2016-10-06 17:32:46 +0100 (Thu, 06 Oct 2016)
Log Message:
-----------
Fix pcretest callout display bug


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcretest.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2016-08-04 17:15:38 UTC (rev 1664)
+++ code/trunk/ChangeLog    2016-10-06 16:32:46 UTC (rev 1665)
@@ -24,6 +24,10 @@
    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

Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2016-08-04 17:15:38 UTC (rev 1664)
+++ code/trunk/pcretest.c    2016-10-06 16:32:46 UTC (rev 1665)
@@ -1982,6 +1982,7 @@
 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 (f != NULL) n = fprintf(f, "\\x{%02x}", c);
+ else n = sprintf(tempbuffer, "\\x{%02x}", c);
+
return n >= 0 ? n : 0;
}