/[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 336 by ph10, Sat Apr 12 15:59:03 2008 UTC revision 340 by ph10, Fri Apr 18 20:00:21 2008 UTC
# Line 1008  for (; *ptr != 0; ptr++) Line 1008  for (; *ptr != 0; ptr++)
1008      continue;      continue;
1009      }      }
1010    
1011    /* Skip over character classes */    /* Skip over character classes; this logic must be similar to the way they
1012      are handled for real. If the first character is '^', skip it. Also, if the
1013      first few characters (either before or after ^) are \Q\E or \E we skip them
1014      too. This makes for compatibility with Perl. */
1015    
1016    if (*ptr == '[')    if (*ptr == '[')
1017      {      {
1018        BOOL negate_class = FALSE;
1019        for (;;)
1020          {
1021          int c = *(++ptr);
1022          if (c == '\\')
1023            {
1024            if (ptr[1] == 'E') ptr++;
1025              else if (strncmp((const char *)ptr+1, "Q\\E", 3) == 0) ptr += 3;
1026                else break;
1027            }
1028          else if (!negate_class && c == '^')
1029            negate_class = TRUE;
1030          else break;
1031          }
1032    
1033        /* If the next character is ']', it is a data character that must be
1034        skipped. */
1035    
1036        if (ptr[1] == ']') ptr++;
1037    
1038      while (*(++ptr) != ']')      while (*(++ptr) != ']')
1039        {        {
1040        if (*ptr == 0) return -1;        if (*ptr == 0) return -1;

Legend:
Removed from v.336  
changed lines
  Added in v.340

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12