[pcre-dev] [Bug 1388] PCRE_UCP seems to ruin Callout pattern…

Top Page
Delete this message
Author: Philip Hazel
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 1388] PCRE_UCP seems to ruin Callout pattern indices
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1388




--- Comment #6 from Philip Hazel <ph10@???> 2013-10-12 12:39:54 ---
On Sat, 12 Oct 2013, firas wrote:

> When will I be able to download this fix?


It will be in the next release (8.34) but that will not be out for
several weeks. You can, however, get the latest code from the Subversion
repository:

svn co svn://vcs.exim.org/pcre/code/trunk pcre

This is, I hope, a workable patch:

--- pcre-8.33/pcre_compile.c     2013-05-10 15:04:21.000000000 +0100
+++ pcre_compile.c      2013-10-11 17:57:45.397837940 +0100
@@ -3910,14 +4254,14 @@
       }
     }


-  /* Fill in length of a previous callout, except when the next thing is
-  a quantifier. */
-
   is_quantifier =
     c == CHAR_ASTERISK || c == CHAR_PLUS || c == CHAR_QUESTION_MARK ||
     (c == CHAR_LEFT_CURLY_BRACKET && is_counted_repeat(ptr+1));


-  if (!is_quantifier && previous_callout != NULL &&
+  /* Fill in length of a previous callout, except when the next thing is a
+  quantifier or when processing a property substitution string in UCP mode. */
+
+  if (!is_quantifier && previous_callout != NULL && nestptr == NULL &&
        after_manual_callout-- <= 0)
     {
     if (lengthptr == NULL)      /* Don't attempt in pre-compile phase */
@@ -3948,9 +4292,10 @@
       }
     }


- /* No auto callout for quantifiers. */
+ /* No auto callout for quantifiers, or while processing property strings
that
+ are substituted for \w etc in UCP mode. */

-  if ((options & PCRE_AUTO_CALLOUT) != 0 && !is_quantifier)
+  if ((options & PCRE_AUTO_CALLOUT) != 0 && !is_quantifier && nestptr == NULL)
     {
     previous_callout = code;
     code = auto_callout(code, ptr, cd);



Philip


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email