/[pcre]/code/trunk/pcre_compile.c
ViewVC logotype

Diff of /code/trunk/pcre_compile.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 454 by ph10, Tue Sep 22 09:42:11 2009 UTC revision 455 by ph10, Sat Sep 26 19:12:32 2009 UTC
# Line 1550  for (;;) Line 1550  for (;;)
1550    
1551  /* This little function scans through a compiled pattern until it finds a  /* This little function scans through a compiled pattern until it finds a
1552  capturing bracket with the given number, or, if the number is negative, an  capturing bracket with the given number, or, if the number is negative, an
1553  instance of OP_REVERSE for a lookbehind.  instance of OP_REVERSE for a lookbehind. The function is global in the C sense
1554    so that it can be called from pcre_study() when finding the minimum matching
1555    length.
1556    
1557  Arguments:  Arguments:
1558    code        points to start of expression    code        points to start of expression
# Line 1560  Arguments: Line 1562  Arguments:
1562  Returns:      pointer to the opcode for the bracket, or NULL if not found  Returns:      pointer to the opcode for the bracket, or NULL if not found
1563  */  */
1564    
1565  static const uschar *  const uschar *
1566  find_bracket(const uschar *code, BOOL utf8, int number)  _pcre_find_bracket(const uschar *code, BOOL utf8, int number)
1567  {  {
1568  for (;;)  for (;;)
1569    {    {
# Line 5072  we set the flag only if there is a liter Line 5074  we set the flag only if there is a liter
5074            if (lengthptr == NULL)            if (lengthptr == NULL)
5075              {              {
5076              *code = OP_END;              *code = OP_END;
5077              if (recno != 0) called = find_bracket(cd->start_code, utf8, recno);              if (recno != 0)
5078                  called = _pcre_find_bracket(cd->start_code, utf8, recno);
5079    
5080              /* Forward reference */              /* Forward reference */
5081    
# Line 6582  while (errorcode == 0 && cd->hwm > cwork Line 6585  while (errorcode == 0 && cd->hwm > cwork
6585    cd->hwm -= LINK_SIZE;    cd->hwm -= LINK_SIZE;
6586    offset = GET(cd->hwm, 0);    offset = GET(cd->hwm, 0);
6587    recno = GET(codestart, offset);    recno = GET(codestart, offset);
6588    groupptr = find_bracket(codestart, utf8, recno);    groupptr = _pcre_find_bracket(codestart, utf8, recno);
6589    if (groupptr == NULL) errorcode = ERR53;    if (groupptr == NULL) errorcode = ERR53;
6590      else PUT(((uschar *)codestart), offset, groupptr - codestart);      else PUT(((uschar *)codestart), offset, groupptr - codestart);
6591    }    }
# Line 6609  if (cd->check_lookbehind) Line 6612  if (cd->check_lookbehind)
6612    of zero, but that is a pathological case, and it does no harm.) When we find    of zero, but that is a pathological case, and it does no harm.) When we find
6613    one, we temporarily terminate the branch it is in while we scan it. */    one, we temporarily terminate the branch it is in while we scan it. */
6614    
6615    for (cc = (uschar *)find_bracket(codestart, utf8, -1);    for (cc = (uschar *)_pcre_find_bracket(codestart, utf8, -1);
6616         cc != NULL;         cc != NULL;
6617         cc = (uschar *)find_bracket(cc, utf8, -1))         cc = (uschar *)_pcre_find_bracket(cc, utf8, -1))
6618      {      {
6619      if (GET(cc, 1) == 0)      if (GET(cc, 1) == 0)
6620        {        {

Legend:
Removed from v.454  
changed lines
  Added in v.455

  ViewVC Help
Powered by ViewVC 1.1.5