/[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 202 by ph10, Fri Aug 3 09:44:26 2007 UTC revision 205 by ph10, Fri Aug 3 13:18:33 2007 UTC
# Line 2453  for (;; ptr++) Line 2453  for (;; ptr++)
2453        goto FAILED;        goto FAILED;
2454        }        }
2455    
2456      /* If the first character is '^', set the negation flag and skip it. */      /* If the first character is '^', set the negation flag and skip it. Also,
2457        if the first few characters (either before or after ^) are \Q\E or \E we
2458      if ((c = *(++ptr)) == '^')      skip them too. This makes for compatibility with Perl. */
2459    
2460        negate_class = FALSE;
2461        for (;;)
2462        {        {
       negate_class = TRUE;  
2463        c = *(++ptr);        c = *(++ptr);
2464        }        if (c == '\\')
2465      else          {
2466        {          if (ptr[1] == 'E') ptr++;
2467        negate_class = FALSE;            else if (strncmp((const char *)ptr+1, "Q\\E", 3) == 0) ptr += 3;
2468        }              else break;
2469            }
2470          else if (!negate_class && c == '^')
2471            negate_class = TRUE;
2472          else break;
2473          }
2474    
2475      /* Keep a count of chars with values < 256 so that we can optimize the case      /* Keep a count of chars with values < 256 so that we can optimize the case
2476      of just a single character (as long as it's < 256). However, For higher      of just a single character (as long as it's < 256). However, For higher
# Line 2603  for (;; ptr++) Line 2610  for (;; ptr++)
2610        of the specials, which just set a flag. The sequence \b is a special        of the specials, which just set a flag. The sequence \b is a special
2611        case. Inside a class (and only there) it is treated as backspace.        case. Inside a class (and only there) it is treated as backspace.
2612        Elsewhere it marks a word boundary. Other escapes have preset maps ready        Elsewhere it marks a word boundary. Other escapes have preset maps ready
2613        to or into the one we are building. We assume they have more than one        to 'or' into the one we are building. We assume they have more than one
2614        character in them, so set class_charcount bigger than one. */        character in them, so set class_charcount bigger than one. */
2615    
2616        if (c == '\\')        if (c == '\\')
# Line 3068  for (;; ptr++) Line 3075  for (;; ptr++)
3075        *errorcodeptr = ERR6;        *errorcodeptr = ERR6;
3076        goto FAILED;        goto FAILED;
3077        }        }
3078    
3079      /* If class_charcount is 1, we saw precisely one character whose value is      /* If class_charcount is 1, we saw precisely one character whose value is
3080      less than 256. In non-UTF-8 mode we can always optimize. In UTF-8 mode, we      less than 256. In non-UTF-8 mode we can always optimize. In UTF-8 mode, we
3081      can optimize the negative case only if there were no characters >= 128      can optimize the negative case only if there were no characters >= 128

Legend:
Removed from v.202  
changed lines
  Added in v.205

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12