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

Diff of /code/trunk/pcre.c

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

revision 9 by nigel, Sat Feb 24 21:38:13 2007 UTC revision 19 by nigel, Sat Feb 24 21:38:33 2007 UTC
# Line 9  the file Tech.Notes for some information Line 9  the file Tech.Notes for some information
9    
10  Written by: Philip Hazel <ph10@cam.ac.uk>  Written by: Philip Hazel <ph10@cam.ac.uk>
11    
12             Copyright (c) 1997 University of Cambridge             Copyright (c) 1998 University of Cambridge
13    
14  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
15  Permission is granted to anyone to use this software for any purpose on any  Permission is granted to anyone to use this software for any purpose on any
# Line 49  the external pcre header. */ Line 49  the external pcre header. */
49  #include "internal.h"  #include "internal.h"
50    
51    
52    /* Allow compilation as C++ source code, should anybody want to do that. */
53    
54    #ifdef __cplusplus
55    #define class pcre_class
56    #endif
57    
58    
59  /* Min and max values for the common repeats; for the maxima, 0 => infinity */  /* Min and max values for the common repeats; for the maxima, 0 => infinity */
60    
61  static char rep_min[] = { 0, 0, 1, 1, 0, 0 };  static const char rep_min[] = { 0, 0, 1, 1, 0, 0 };
62  static char rep_max[] = { 0, 0, 0, 0, 1, 1 };  static const char rep_max[] = { 0, 0, 0, 0, 1, 1 };
63    
64  /* Text forms of OP_ values and things, for debugging */  /* Text forms of OP_ values and things, for debugging (not all used) */
65    
66  #ifdef DEBUG  #ifdef DEBUG
67  static const char *OP_names[] = {  static const char *OP_names[] = {
# Line 65  static const char *OP_names[] = { Line 72  static const char *OP_names[] = {
72    "*", "*?", "+", "+?", "?", "??", "{", "{", "{",    "*", "*?", "+", "+?", "?", "??", "{", "{", "{",
73    "*", "*?", "+", "+?", "?", "??", "{", "{", "{",    "*", "*?", "+", "+?", "?", "??", "{", "{", "{",
74    "*", "*?", "+", "+?", "?", "??", "{", "{",    "*", "*?", "+", "+?", "?", "??", "{", "{",
75    "class", "Ref",    "class", "negclass", "Ref",
76    "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not", "Once",    "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not", "Once",
77    "Brazero", "Braminzero", "Bra"    "Brazero", "Braminzero", "Bra"
78  };  };
# Line 76  are simple data values; negative values Line 83  are simple data values; negative values
83  on. Zero means further processing is needed (for things like \x), or the escape  on. Zero means further processing is needed (for things like \x), or the escape
84  is invalid. */  is invalid. */
85    
86  static short int escapes[] = {  static const short int escapes[] = {
87      0,      0,      0,      0,      0,      0,      0,      0,   /* 0 - 7 */      0,      0,      0,      0,      0,      0,      0,      0,   /* 0 - 7 */
88      0,      0,    ':',    ';',    '<',    '=',    '>',    '?',   /* 8 - ? */      0,      0,    ':',    ';',    '<',    '=',    '>',    '?',   /* 8 - ? */
89    '@', -ESC_A, -ESC_B,      0, -ESC_D,      0,      0,      0,   /* @ - G */    '@', -ESC_A, -ESC_B,      0, -ESC_D,      0,      0,      0,   /* @ - G */
# Line 91  static short int escapes[] = { Line 98  static short int escapes[] = {
98    
99  /* Definition to allow mutual recursion */  /* Definition to allow mutual recursion */
100    
101  static BOOL compile_regex(int, int *, uschar **, const uschar **, const char **);  static BOOL
102      compile_regex(int, int *, uschar **, const uschar **, const char **);
103    
104  /* Structure for passing "static" information around between the functions  /* Structure for passing "static" information around between the functions
105  doing the matching, so that they are thread-safe. */  doing the matching, so that they are thread-safe. */
# Line 256  do { Line 264  do {
264        case OP_KETRMIN:        case OP_KETRMIN:
265        return TRUE;        return TRUE;
266    
267          /* Skip over entire bracket groups with zero lower bound */
268    
269          case OP_BRAZERO:
270          case OP_BRAMINZERO:
271          cc++;
272          /* Fall through */
273    
274        /* Skip over assertive subpatterns */        /* Skip over assertive subpatterns */
275    
276        case OP_ASSERT:        case OP_ASSERT:
# Line 270  do { Line 285  do {
285        case OP_EOD:        case OP_EOD:
286        case OP_CIRC:        case OP_CIRC:
287        case OP_DOLL:        case OP_DOLL:
       case OP_BRAZERO:  
       case OP_BRAMINZERO:  
288        case OP_NOT_WORD_BOUNDARY:        case OP_NOT_WORD_BOUNDARY:
289        case OP_WORD_BOUNDARY:        case OP_WORD_BOUNDARY:
290        cc++;        cc++;
# Line 306  do { Line 319  do {
319        /* Check a class or a back reference for a zero minimum */        /* Check a class or a back reference for a zero minimum */
320    
321        case OP_CLASS:        case OP_CLASS:
322          case OP_NEGCLASS:
323        case OP_REF:        case OP_REF:
324        cc += (*cc == OP_REF)? 2 : 33;        cc += (*cc == OP_REF)? 2 : 33;
325    
# Line 609  compile_branch(int options, int *bracket Line 623  compile_branch(int options, int *bracket
623  int repeat_type, op_type;  int repeat_type, op_type;
624  int repeat_min, repeat_max;  int repeat_min, repeat_max;
625  int bravalue, length;  int bravalue, length;
626    int greedy_default, greedy_non_default;
627  register int c;  register int c;
628  register uschar *code = *codeptr;  register uschar *code = *codeptr;
629  const uschar *ptr = *ptrptr;  const uschar *ptr = *ptrptr;
# Line 616  const uschar *oldptr; Line 631  const uschar *oldptr;
631  uschar *previous = NULL;  uschar *previous = NULL;
632  uschar class[32];  uschar class[32];
633    
634    /* Set up the default and non-default settings for greediness */
635    
636    greedy_default = ((options & PCRE_UNGREEDY) != 0);
637    greedy_non_default = greedy_default ^ 1;
638    
639  /* Switch on next character until the end of the branch */  /* Switch on next character until the end of the branch */
640    
641  for (;; ptr++)  for (;; ptr++)
# Line 670  for (;; ptr++) Line 690  for (;; ptr++)
690    
691      case '[':      case '[':
692      previous = code;      previous = code;
     *code++ = OP_CLASS;  
693    
694      /* If the first character is '^', set the negation flag */      /* If the first character is '^', set the negation flag, and use a
695        different opcode. This only matters if caseless matching is specified at
696        runtime. */
697    
698      if ((c = *(++ptr)) == '^')      if ((c = *(++ptr)) == '^')
699        {        {
700        negate_class = TRUE;        negate_class = TRUE;
701          *code++ = OP_NEGCLASS;
702        c = *(++ptr);        c = *(++ptr);
703        }        }
704      else negate_class = FALSE;      else
705          {
706          negate_class = FALSE;
707          *code++ = OP_CLASS;
708          }
709    
710      /* Keep a count of chars so that we can optimize the case of just a single      /* Keep a count of chars so that we can optimize the case of just a single
711      character. */      character. */
# Line 887  for (;; ptr++) Line 913  for (;; ptr++)
913        goto FAILED;        goto FAILED;
914        }        }
915    
916      /* If the next character is '?' this is a minimizing repeat. Advance to the      /* If the next character is '?' this is a minimizing repeat, by default,
917        but if PCRE_UNGREEDY is set, it works the other way round. Advance to the
918      next character. */      next character. */
919    
920      if (ptr[1] == '?') { repeat_type = 1; ptr++; } else repeat_type = 0;      if (ptr[1] == '?')
921          { repeat_type = greedy_non_default; ptr++; }
922        else repeat_type = greedy_default;
923    
924      /* If the maximum is zero then the minimum must also be zero; Perl allows      /* If the maximum is zero then the minimum must also be zero; Perl allows
925      this case, so we do too - by simply omitting the item altogether. */      this case, so we do too - by simply omitting the item altogether. */
# Line 1015  for (;; ptr++) Line 1044  for (;; ptr++)
1044      /* If previous was a character class or a back reference, we put the repeat      /* If previous was a character class or a back reference, we put the repeat
1045      stuff after it. */      stuff after it. */
1046    
1047      else if (*previous == OP_CLASS || *previous == OP_REF)      else if (*previous == OP_CLASS || *previous == OP_NEGCLASS ||
1048                 *previous == OP_REF)
1049        {        {
1050        if (repeat_min == 0 && repeat_max == -1)        if (repeat_min == 0 && repeat_max == -1)
1051          *code++ = OP_CRSTAR + repeat_type;          *code++ = OP_CRSTAR + repeat_type;
# Line 1128  for (;; ptr++) Line 1158  for (;; ptr++)
1158          case 'm':          case 'm':
1159          case 's':          case 's':
1160          case 'x':          case 'x':
1161            case 'U':
1162            case 'X':
1163          ptr++;          ptr++;
1164          while (*ptr != ')') ptr++;          while (*ptr != ')') ptr++;
1165          previous = NULL;          previous = NULL;
# Line 1287  for (;; ptr++) Line 1319  for (;; ptr++)
1319      the next state. */      the next state. */
1320    
1321      previous[1] = length;      previous[1] = length;
1322      ptr--;      if (length < 255) ptr--;
1323      break;      break;
1324      }      }
1325    }                   /* end of big loop */    }                   /* end of big loop */
# Line 1731  while ((c = *(++ptr)) != 0) Line 1763  while ((c = *(++ptr)) != 0)
1763          ptr += 2;          ptr += 2;
1764          break;          break;
1765          }          }
1766        /* Else fall thourh */        /* Else fall through */
1767    
1768        /* Else loop setting valid options until ) is met. Anything else is an        /* Else loop setting valid options until ) is met. Anything else is an
1769        error. */        error. */
# Line 1761  while ((c = *(++ptr)) != 0) Line 1793  while ((c = *(++ptr)) != 0)
1793            length -= spaces;          /* Already counted spaces */            length -= spaces;          /* Already counted spaces */
1794            continue;            continue;
1795            }            }
1796            else if (c == 'X')
1797              {
1798              options |= PCRE_EXTRA;
1799              continue;
1800              }
1801            else if (c == 'U')
1802              {
1803              options |= PCRE_UNGREEDY;
1804              continue;
1805              }
1806          else if (c == ')') break;          else if (c == ')') break;
1807    
1808          *errorptr = ERR12;          *errorptr = ERR12;
# Line 1966  printf("Length = %d top_bracket = %d top Line 2008  printf("Length = %d top_bracket = %d top
2008    
2009  if (re->options != 0)  if (re->options != 0)
2010    {    {
2011    printf("%s%s%s%s%s%s%s\n",    printf("%s%s%s%s%s%s%s%s\n",
2012      ((re->options & PCRE_ANCHORED) != 0)? "anchored " : "",      ((re->options & PCRE_ANCHORED) != 0)? "anchored " : "",
2013      ((re->options & PCRE_CASELESS) != 0)? "caseless " : "",      ((re->options & PCRE_CASELESS) != 0)? "caseless " : "",
2014      ((re->options & PCRE_EXTENDED) != 0)? "extended " : "",      ((re->options & PCRE_EXTENDED) != 0)? "extended " : "",
2015      ((re->options & PCRE_MULTILINE) != 0)? "multiline " : "",      ((re->options & PCRE_MULTILINE) != 0)? "multiline " : "",
2016      ((re->options & PCRE_DOTALL) != 0)? "dotall " : "",      ((re->options & PCRE_DOTALL) != 0)? "dotall " : "",
2017      ((re->options & PCRE_DOLLAR_ENDONLY) != 0)? "endonly " : "",      ((re->options & PCRE_DOLLAR_ENDONLY) != 0)? "endonly " : "",
2018      ((re->options & PCRE_EXTRA) != 0)? "extra " : "");      ((re->options & PCRE_EXTRA) != 0)? "extra " : "",
2019        ((re->options & PCRE_UNGREEDY) != 0)? "ungreedy " : "");
2020    }    }
2021    
2022  if ((re->options & PCRE_FIRSTSET) != 0)  if ((re->options & PCRE_FIRSTSET) != 0)
# Line 2041  while (code < code_end) Line 2084  while (code < code_end)
2084      case OP_MINUPTO:      case OP_MINUPTO:
2085      if (isprint(c = code[3])) printf("    %c{", c);      if (isprint(c = code[3])) printf("    %c{", c);
2086        else printf("    \\x%02x{", c);        else printf("    \\x%02x{", c);
2087      if (*code != OP_EXACT) printf(",");      if (*code != OP_EXACT) printf("0,");
2088      printf("%d}", (code[1] << 8) + code[2]);      printf("%d}", (code[1] << 8) + code[2]);
2089      if (*code == OP_MINUPTO) printf("?");      if (*code == OP_MINUPTO) printf("?");
2090      code += 3;      code += 3;
# Line 2090  while (code < code_end) Line 2133  while (code < code_end)
2133      goto CLASS_REF_REPEAT;      goto CLASS_REF_REPEAT;
2134    
2135      case OP_CLASS:      case OP_CLASS:
2136        case OP_NEGCLASS:
2137        {        {
2138        int i, min, max;        int i, min, max;
2139    
2140        code++;        if (*code++ == OP_CLASS) printf("    [");
2141        printf("    [");          else printf("   ^[");
2142    
2143        for (i = 0; i < 256; i++)        for (i = 0; i < 256; i++)
2144          {          {
# Line 2714  for (;;) Line 2758  for (;;)
2758      item to see if there is repeat information following. Then obey similar      item to see if there is repeat information following. Then obey similar
2759      code to character type repeats - written out again for speed. If caseless      code to character type repeats - written out again for speed. If caseless
2760      matching was set at runtime but not at compile time, we have to check both      matching was set at runtime but not at compile time, we have to check both
2761      versions of a character. */      versions of a character, and we have to behave differently for positive and
2762        negative classes. This is the only time where OP_CLASS and OP_NEGCLASS are
2763        treated differently. */
2764    
2765      case OP_CLASS:      case OP_CLASS:
2766        case OP_NEGCLASS:
2767        {        {
2768          BOOL nasty_case = *ecode == OP_NEGCLASS && md->runtime_caseless;
2769        const uschar *data = ecode + 1;  /* Save for matching */        const uschar *data = ecode + 1;  /* Save for matching */
2770        ecode += 33;                     /* Advance past the item */        ecode += 33;                     /* Advance past the item */
2771    
# Line 2746  for (;;) Line 2794  for (;;)
2794          break;          break;
2795    
2796          default:               /* No repeat follows */          default:               /* No repeat follows */
2797          if (eptr >= md->end_subject) return FALSE;          min = max = 1;
2798          c = *eptr++;          break;
         if ((data[c/8] & (1 << (c&7))) != 0) continue;    /* With main loop */  
         if (md->runtime_caseless)  
           {  
           c = pcre_fcc[c];  
           if ((data[c/8] & (1 << (c&7))) != 0) continue;  /* With main loop */  
           }  
         return FALSE;  
2799          }          }
2800    
2801        /* First, ensure the minimum number of matches are present. */        /* First, ensure the minimum number of matches are present. */
# Line 2763  for (;;) Line 2804  for (;;)
2804          {          {
2805          if (eptr >= md->end_subject) return FALSE;          if (eptr >= md->end_subject) return FALSE;
2806          c = *eptr++;          c = *eptr++;
2807          if ((data[c/8] & (1 << (c&7))) != 0) continue;  
2808          if (md->runtime_caseless)          /* Either not runtime caseless, or it was a positive class. For
2809            runtime caseless, continue if either case is in the map. */
2810    
2811            if (!nasty_case)
2812            {            {
2813              if ((data[c/8] & (1 << (c&7))) != 0) continue;
2814              if (md->runtime_caseless)
2815                {
2816                c = pcre_fcc[c];
2817                if ((data[c/8] & (1 << (c&7))) != 0) continue;
2818                }
2819              }
2820    
2821            /* Runtime caseless and it was a negative class. Continue only if
2822            both cases are in the map. */
2823    
2824            else
2825              {
2826              if ((data[c/8] & (1 << (c&7))) == 0) return FALSE;
2827            c = pcre_fcc[c];            c = pcre_fcc[c];
2828            if ((data[c/8] & (1 << (c&7))) != 0) continue;            if ((data[c/8] & (1 << (c&7))) != 0) continue;
2829            }            }
2830    
2831          return FALSE;          return FALSE;
2832          }          }
2833    
# Line 2787  for (;;) Line 2846  for (;;)
2846            if (match(eptr, ecode, offset_top, md)) return TRUE;            if (match(eptr, ecode, offset_top, md)) return TRUE;
2847            if (i >= max || eptr >= md->end_subject) return FALSE;            if (i >= max || eptr >= md->end_subject) return FALSE;
2848            c = *eptr++;            c = *eptr++;
2849            if ((data[c/8] & (1 << (c&7))) != 0) continue;  
2850            if (md->runtime_caseless)            /* Either not runtime caseless, or it was a positive class. For
2851              runtime caseless, continue if either case is in the map. */
2852    
2853              if (!nasty_case)
2854              {              {
2855                if ((data[c/8] & (1 << (c&7))) != 0) continue;
2856                if (md->runtime_caseless)
2857                  {
2858                  c = pcre_fcc[c];
2859                  if ((data[c/8] & (1 << (c&7))) != 0) continue;
2860                  }
2861                }
2862    
2863              /* Runtime caseless and it was a negative class. Continue only if
2864              both cases are in the map. */
2865    
2866              else
2867                {
2868                if ((data[c/8] & (1 << (c&7))) == 0) return FALSE;
2869              c = pcre_fcc[c];              c = pcre_fcc[c];
2870              if ((data[c/8] & (1 << (c&7))) != 0) continue;              if ((data[c/8] & (1 << (c&7))) != 0) continue;
2871              }              }
2872    
2873            return FALSE;            return FALSE;
2874            }            }
2875          /* Control never gets here */          /* Control never gets here */
# Line 2807  for (;;) Line 2884  for (;;)
2884            {            {
2885            if (eptr >= md->end_subject) break;            if (eptr >= md->end_subject) break;
2886            c = *eptr;            c = *eptr;
2887            if ((data[c/8] & (1 << (c&7))) != 0) continue;  
2888            if (md->runtime_caseless)            /* Either not runtime caseless, or it was a positive class. For
2889              runtime caseless, continue if either case is in the map. */
2890    
2891              if (!nasty_case)
2892                {
2893                if ((data[c/8] & (1 << (c&7))) != 0) continue;
2894                if (md->runtime_caseless)
2895                  {
2896                  c = pcre_fcc[c];
2897                  if ((data[c/8] & (1 << (c&7))) != 0) continue;
2898                  }
2899                }
2900    
2901              /* Runtime caseless and it was a negative class. Continue only if
2902              both cases are in the map. */
2903    
2904              else
2905              {              {
2906                if ((data[c/8] & (1 << (c&7))) == 0) break;
2907              c = pcre_fcc[c];              c = pcre_fcc[c];
2908              if ((data[c/8] & (1 << (c&7))) != 0) continue;              if ((data[c/8] & (1 << (c&7))) != 0) continue;
2909              }              }
2910    
2911            break;            break;
2912            }            }
2913    
# Line 3299  hide it in a separate function. This is Line 3394  hide it in a separate function. This is
3394  since it's needed only for the extension \X option, and with any luck, a good  since it's needed only for the extension \X option, and with any luck, a good
3395  compiler will spot the tail recursion and compile it efficiently.  compiler will spot the tail recursion and compile it efficiently.
3396    
3397  Arguments:    The block containing the match data  Arguments:
3398  Returns:      The return from setjump()     eptr        pointer in subject
3399       ecode       position in code
3400       offset_top  current top pointer
3401       md          pointer to "static" info for the match
3402    
3403    Returns:       TRUE if matched
3404  */  */
3405    
3406  static int  static BOOL
3407  my_setjmp(match_data *match_block)  match_with_setjmp(const uschar *eptr, const uschar *ecode, int offset_top,
3408      match_data *match_block)
3409  {  {
3410  return setjmp(match_block->fail_env);  return setjmp(match_block->fail_env) == 0 &&
3411          match(eptr, ecode, offset_top, match_block);
3412  }  }
3413    
3414    
# Line 3338  int Line 3440  int
3440  pcre_exec(const pcre *external_re, const pcre_extra *external_extra,  pcre_exec(const pcre *external_re, const pcre_extra *external_extra,
3441    const char *subject, int length, int options, int *offsets, int offsetcount)    const char *subject, int length, int options, int *offsets, int offsetcount)
3442  {  {
3443  int resetcount;  int resetcount, ocount;
 int ocount = offsetcount;  
3444  int first_char = -1;  int first_char = -1;
3445  match_data match_block;  match_data match_block;
3446  const uschar *start_bits = NULL;  const uschar *start_bits = NULL;
# Line 3347  const uschar *start_match = (const uscha Line 3448  const uschar *start_match = (const uscha
3448  const uschar *end_subject;  const uschar *end_subject;
3449  const real_pcre *re = (const real_pcre *)external_re;  const real_pcre *re = (const real_pcre *)external_re;
3450  const real_pcre_extra *extra = (const real_pcre_extra *)external_extra;  const real_pcre_extra *extra = (const real_pcre_extra *)external_extra;
3451    BOOL using_temporary_offsets = FALSE;
3452  BOOL anchored = ((re->options | options) & PCRE_ANCHORED) != 0;  BOOL anchored = ((re->options | options) & PCRE_ANCHORED) != 0;
3453  BOOL startline = (re->options & PCRE_STARTLINE) != 0;  BOOL startline = (re->options & PCRE_STARTLINE) != 0;
3454    
# Line 3375  match_block.errorcode = PCRE_ERROR_NOMAT Line 3477  match_block.errorcode = PCRE_ERROR_NOMAT
3477    
3478  /* If the expression has got more back references than the offsets supplied can  /* If the expression has got more back references than the offsets supplied can
3479  hold, we get a temporary bit of working store to use during the matching.  hold, we get a temporary bit of working store to use during the matching.
3480  Otherwise, we can use the vector supplied, rounding down the size of it to a  Otherwise, we can use the vector supplied, rounding down its size to a multiple
3481  multiple of 2. */  of 2. */
3482    
3483  ocount &= (-2);  ocount = offsetcount & (-2);
3484  if (re->top_backref > 0 && re->top_backref + 1 >= ocount/2)  if (re->top_backref > 0 && re->top_backref >= ocount/2)
3485    {    {
3486    ocount = re->top_backref * 2 + 2;    ocount = re->top_backref * 2 + 2;
3487    match_block.offset_vector = (pcre_malloc)(ocount * sizeof(int));    match_block.offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int));
3488    if (match_block.offset_vector == NULL) return PCRE_ERROR_NOMEMORY;    if (match_block.offset_vector == NULL) return PCRE_ERROR_NOMEMORY;
3489      using_temporary_offsets = TRUE;
3490    DPRINTF(("Got memory to hold back references\n"));    DPRINTF(("Got memory to hold back references\n"));
3491    }    }
3492  else match_block.offset_vector = offsets;  else match_block.offset_vector = offsets;
# Line 3498  do Line 3601  do
3601    it unless PCRE_EXTRA is set, since only in that case is the "cut" operation    it unless PCRE_EXTRA is set, since only in that case is the "cut" operation
3602    enabled. */    enabled. */
3603    
3604    if (((re->options & PCRE_EXTRA) != 0 && my_setjmp(&match_block) != 0) ||    if ((re->options & PCRE_EXTRA) != 0)
3605        !match(start_match, re->code, 2, &match_block))      {
3606      continue;      if (!match_with_setjmp(start_match, re->code, 2, &match_block))
3607          continue;
3608        }
3609      else if (!match(start_match, re->code, 2, &match_block)) continue;
3610    
3611    /* Copy the offset information from temporary store if necessary */    /* Copy the offset information from temporary store if necessary */
3612    
3613    if (ocount != offsetcount)    if (using_temporary_offsets)
3614      {      {
3615      if (offsetcount >= 4)      if (offsetcount >= 4)
3616        {        {
3617        memcpy(offsets + 2, match_block.offset_vector + 2,        memcpy(offsets + 2, match_block.offset_vector + 2,
3618          (offsetcount - 2) * sizeof(int));          (offsetcount - 2) * sizeof(int));
3619        DPRINTF(("Copied offsets; freeing temporary memory\n"));        DPRINTF(("Copied offsets from temporary memory\n"));
3620        }        }
3621      if (match_block.end_offset_top > offsetcount)      if (match_block.end_offset_top > offsetcount)
3622        match_block.offset_overflow = TRUE;        match_block.offset_overflow = TRUE;
# Line 3534  while (!anchored && Line 3640  while (!anchored &&
3640         match_block.errorcode == PCRE_ERROR_NOMATCH &&         match_block.errorcode == PCRE_ERROR_NOMATCH &&
3641         start_match++ < end_subject);         start_match++ < end_subject);
3642    
3643    if (using_temporary_offsets)
3644      {
3645      DPRINTF(("Freeing temporary memory\n"));
3646      (pcre_free)(match_block.offset_vector);
3647      }
3648    
3649  DPRINTF((">>>> returning %d\n", match_block.errorcode));  DPRINTF((">>>> returning %d\n", match_block.errorcode));
3650    
3651  return match_block.errorcode;  return match_block.errorcode;

Legend:
Removed from v.9  
changed lines
  Added in v.19

  ViewVC Help
Powered by ViewVC 1.1.5