/[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 1055 by chpe, Tue Oct 16 15:53:30 2012 UTC revision 1065 by chpe, Tue Oct 16 15:54:16 2012 UTC
# Line 749  return (*p == CHAR_RIGHT_CURLY_BRACKET); Line 749  return (*p == CHAR_RIGHT_CURLY_BRACKET);
749  *************************************************/  *************************************************/
750    
751  /* This function is called when a \ has been encountered. It either returns a  /* This function is called when a \ has been encountered. It either returns a
752  positive value for a simple escape such as \n, or a negative value which  positive value for a simple escape such as \n, or 0 for a data character
753  encodes one of the more complicated things such as \d. A backreference to group  which will be placed in chptr. A backreference to group n is returned as
754  n is returned as -(ESC_REF + n); ESC_REF is the highest ESC_xxx macro. When  negative n. When UTF-8 is enabled, a positive value greater than 255 may
755  UTF-8 is enabled, a positive value greater than 255 may be returned. On entry,  be returned in chptr.
756  ptr is pointing at the \. On exit, it is on the final character of the escape  On entry,ptr is pointing at the \. On exit, it is on the final character of the
757  sequence.  escape sequence.
758    
759  Arguments:  Arguments:
760    ptrptr         points to the pattern position pointer    ptrptr         points to the pattern position pointer
761      chptr          points to the data character
762    errorcodeptr   points to the errorcode variable    errorcodeptr   points to the errorcode variable
763    bracount       number of previous extracting brackets    bracount       number of previous extracting brackets
764    options        the options bits    options        the options bits
765    isclass        TRUE if inside a character class    isclass        TRUE if inside a character class
766    
767  Returns:         zero or positive => a data character  Returns:         zero => a data character
768                   negative => a special escape sequence                   positive => a special escape sequence
769                     negative => a back reference
770                   on error, errorcodeptr is set                   on error, errorcodeptr is set
771  */  */
772    
773  static int  static int
774  check_escape(const pcre_uchar **ptrptr, int *errorcodeptr, int bracount,  check_escape(const pcre_uchar **ptrptr, pcre_uint32 *chptr, int *errorcodeptr,
775    int options, BOOL isclass)    int bracount, int options, BOOL isclass)
776  {  {
777  /* PCRE_UTF16 has the same value as PCRE_UTF8. */  /* PCRE_UTF16 has the same value as PCRE_UTF8. */
778  BOOL utf = (options & PCRE_UTF8) != 0;  BOOL utf = (options & PCRE_UTF8) != 0;
779  const pcre_uchar *ptr = *ptrptr + 1;  const pcre_uchar *ptr = *ptrptr + 1;
780  pcre_int32 c;  pcre_uint32 c;
781    int escape = 0;
782  int i;  int i;
783    
784  GETCHARINCTEST(c, ptr);           /* Get character value, increment pointer */  GETCHARINCTEST(c, ptr);           /* Get character value, increment pointer */
# Line 792  Otherwise further processing may be requ Line 795  Otherwise further processing may be requ
795  #ifndef EBCDIC  /* ASCII/UTF-8 coding */  #ifndef EBCDIC  /* ASCII/UTF-8 coding */
796  /* Not alphanumeric */  /* Not alphanumeric */
797  else if (c < CHAR_0 || c > CHAR_z) {}  else if (c < CHAR_0 || c > CHAR_z) {}
798  else if ((i = escapes[c - CHAR_0]) != 0) c = i;  else if ((i = escapes[c - CHAR_0]) != 0) { if (i > 0) c = (pcre_uint32)i; else escape = -i; }
799    
800  #else           /* EBCDIC coding */  #else           /* EBCDIC coding */
801  /* Not alphanumeric */  /* Not alphanumeric */
802  else if (c < CHAR_a || (!MAX_255(c) || (ebcdic_chartab[c] & 0x0E) == 0)) {}  else if (c < CHAR_a || (!MAX_255(c) || (ebcdic_chartab[c] & 0x0E) == 0)) {}
803  else if ((i = escapes[c - 0x48]) != 0)  c = i;  else if ((i = escapes[c - 0x48]) != 0)  { if (i > 0) c = (pcre_uint32)i; else escape = -i; }
804  #endif  #endif
805    
806  /* Escapes that need further processing, or are illegal. */  /* Escapes that need further processing, or are illegal. */
# Line 805  else if ((i = escapes[c - 0x48]) != 0) Line 808  else if ((i = escapes[c - 0x48]) != 0)
808  else  else
809    {    {
810    const pcre_uchar *oldptr;    const pcre_uchar *oldptr;
811    BOOL braced, negated;    BOOL braced, negated, overflow;
812      int s;
813    
814    switch (c)    switch (c)
815      {      {
# Line 830  else Line 834  else
834          c = 0;          c = 0;
835          for (i = 0; i < 4; ++i)          for (i = 0; i < 4; ++i)
836            {            {
837            register int cc = *(++ptr);            register pcre_uint32 cc = *(++ptr);
838  #ifndef EBCDIC  /* ASCII/UTF-8 coding */  #ifndef EBCDIC  /* ASCII/UTF-8 coding */
839            if (cc >= CHAR_a) cc -= 32;               /* Convert to upper case */            if (cc >= CHAR_a) cc -= 32;               /* Convert to upper case */
840            c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));            c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));
# Line 877  else Line 881  else
881      (3) For Oniguruma compatibility we also support \g followed by a name or a      (3) For Oniguruma compatibility we also support \g followed by a name or a
882      number either in angle brackets or in single quotes. However, these are      number either in angle brackets or in single quotes. However, these are
883      (possibly recursive) subroutine calls, _not_ backreferences. Just return      (possibly recursive) subroutine calls, _not_ backreferences. Just return
884      the -ESC_g code (cf \k). */      the ESC_g code (cf \k). */
885    
886      case CHAR_g:      case CHAR_g:
887      if (isclass) break;      if (isclass) break;
888      if (ptr[1] == CHAR_LESS_THAN_SIGN || ptr[1] == CHAR_APOSTROPHE)      if (ptr[1] == CHAR_LESS_THAN_SIGN || ptr[1] == CHAR_APOSTROPHE)
889        {        {
890        c = -ESC_g;        escape = ESC_g;
891        break;        break;
892        }        }
893    
# Line 896  else Line 900  else
900          if (*p != CHAR_MINUS && !IS_DIGIT(*p)) break;          if (*p != CHAR_MINUS && !IS_DIGIT(*p)) break;
901        if (*p != 0 && *p != CHAR_RIGHT_CURLY_BRACKET)        if (*p != 0 && *p != CHAR_RIGHT_CURLY_BRACKET)
902          {          {
903          c = -ESC_k;          escape = ESC_k;
904          break;          break;
905          }          }
906        braced = TRUE;        braced = TRUE;
# Line 912  else Line 916  else
916      else negated = FALSE;      else negated = FALSE;
917    
918      /* The integer range is limited by the machine's int representation. */      /* The integer range is limited by the machine's int representation. */
919      c = 0;      s = 0;
920        overflow = FALSE;
921      while (IS_DIGIT(ptr[1]))      while (IS_DIGIT(ptr[1]))
922        {        {
923        if (((unsigned int)c) > INT_MAX / 10) /* Integer overflow */        if (s > INT_MAX / 10 - 1) /* Integer overflow */
924          {          {
925          c = -1;          overflow = TRUE;
926          break;          break;
927          }          }
928        c = c * 10 + *(++ptr) - CHAR_0;        s = s * 10 + (int)(*(++ptr) - CHAR_0);
929        }        }
930      if (((unsigned int)c) > INT_MAX) /* Integer overflow */      if (overflow) /* Integer overflow */
931        {        {
932        while (IS_DIGIT(ptr[1]))        while (IS_DIGIT(ptr[1]))
933          ptr++;          ptr++;
# Line 936  else Line 941  else
941        break;        break;
942        }        }
943    
944      if (c == 0)      if (s == 0)
945        {        {
946        *errorcodeptr = ERR58;        *errorcodeptr = ERR58;
947        break;        break;
# Line 944  else Line 949  else
949    
950      if (negated)      if (negated)
951        {        {
952        if (c > bracount)        if (s > bracount)
953          {          {
954          *errorcodeptr = ERR15;          *errorcodeptr = ERR15;
955          break;          break;
956          }          }
957        c = bracount - (c - 1);        s = bracount - (s - 1);
958        }        }
959    
960      c = -(ESC_REF + c);      escape = -s;
961      break;      break;
962    
963      /* The handling of escape sequences consisting of a string of digits      /* The handling of escape sequences consisting of a string of digits
# Line 974  else Line 979  else
979        {        {
980        oldptr = ptr;        oldptr = ptr;
981        /* The integer range is limited by the machine's int representation. */        /* The integer range is limited by the machine's int representation. */
982        c -= CHAR_0;        s = (int)(c -CHAR_0);
983          overflow = FALSE;
984        while (IS_DIGIT(ptr[1]))        while (IS_DIGIT(ptr[1]))
985          {          {
986          if (((unsigned int)c) > INT_MAX / 10) /* Integer overflow */          if (s > INT_MAX / 10 - 1) /* Integer overflow */
987            {            {
988            c = -1;            overflow = TRUE;
989            break;            break;
990            }            }
991          c = c * 10 + *(++ptr) - CHAR_0;          s = s * 10 + (int)(*(++ptr) - CHAR_0);
992          }          }
993        if (((unsigned int)c) > INT_MAX) /* Integer overflow */        if (overflow) /* Integer overflow */
994          {          {
995          while (IS_DIGIT(ptr[1]))          while (IS_DIGIT(ptr[1]))
996            ptr++;            ptr++;
997          *errorcodeptr = ERR61;          *errorcodeptr = ERR61;
998          break;          break;
999          }          }
1000        if (c < 10 || c <= bracount)        if (s < 10 || s <= bracount)
1001          {          {
1002          c = -(ESC_REF + c);          escape = -s;
1003          break;          break;
1004          }          }
1005        ptr = oldptr;      /* Put the pointer back and fall through */        ptr = oldptr;      /* Put the pointer back and fall through */
# Line 1040  else Line 1046  else
1046          c = 0;          c = 0;
1047          for (i = 0; i < 2; ++i)          for (i = 0; i < 2; ++i)
1048            {            {
1049            register int cc = *(++ptr);            register pcre_uint32 cc = *(++ptr);
1050  #ifndef EBCDIC  /* ASCII/UTF-8 coding */  #ifndef EBCDIC  /* ASCII/UTF-8 coding */
1051            if (cc >= CHAR_a) cc -= 32;               /* Convert to upper case */            if (cc >= CHAR_a) cc -= 32;               /* Convert to upper case */
1052            c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));            c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));
# Line 1058  else Line 1064  else
1064        const pcre_uchar *pt = ptr + 2;        const pcre_uchar *pt = ptr + 2;
1065    
1066        c = 0;        c = 0;
1067          overflow = FALSE;
1068        while (MAX_255(*pt) && (digitab[*pt] & ctype_xdigit) != 0)        while (MAX_255(*pt) && (digitab[*pt] & ctype_xdigit) != 0)
1069          {          {
1070          register int cc = *pt++;          register pcre_uint32 cc = *pt++;
1071          if (c == 0 && cc == CHAR_0) continue;     /* Leading zeroes */          if (c == 0 && cc == CHAR_0) continue;     /* Leading zeroes */
1072    
1073    #ifdef COMPILE_PCRE32
1074            if (c >= 0x10000000l) { overflow = TRUE; break; }
1075    #endif
1076    
1077  #ifndef EBCDIC  /* ASCII/UTF-8 coding */  #ifndef EBCDIC  /* ASCII/UTF-8 coding */
1078          if (cc >= CHAR_a) cc -= 32;               /* Convert to upper case */          if (cc >= CHAR_a) cc -= 32;               /* Convert to upper case */
1079          c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));          c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10));
# Line 1072  else Line 1083  else
1083  #endif  #endif
1084    
1085  #if defined COMPILE_PCRE8  #if defined COMPILE_PCRE8
1086          if (c > (utf ? 0x10ffff : 0xff)) { c = -1; break; }          if (c > (utf ? 0x10ffff : 0xff)) { overflow = TRUE; break; }
1087  #elif defined COMPILE_PCRE16  #elif defined COMPILE_PCRE16
1088          if (c > (utf ? 0x10ffff : 0xffff)) { c = -1; break; }          if (c > (utf ? 0x10ffff : 0xffff)) { overflow = TRUE; break; }
1089  #elif defined COMPILE_PCRE32  #elif defined COMPILE_PCRE32
1090          if (utf && c > 0x10ffff) { c = -1; break; }          if (utf && c > 0x10ffff) { overflow = TRUE; break; }
1091  #endif  #endif
1092          }          }
1093    
1094        if (c < 0)        if (overflow)
1095          {          {
1096          while (MAX_255(*pt) && (digitab[*pt] & ctype_xdigit) != 0) pt++;          while (MAX_255(*pt) && (digitab[*pt] & ctype_xdigit) != 0) pt++;
1097          *errorcodeptr = ERR34;          *errorcodeptr = ERR34;
# Line 1102  else Line 1113  else
1113      c = 0;      c = 0;
1114      while (i++ < 2 && MAX_255(ptr[1]) && (digitab[ptr[1]] & ctype_xdigit) != 0)      while (i++ < 2 && MAX_255(ptr[1]) && (digitab[ptr[1]] & ctype_xdigit) != 0)
1115        {        {
1116        int cc;                                  /* Some compilers don't like */        pcre_uint32 cc;                          /* Some compilers don't like */
1117        cc = *(++ptr);                           /* ++ in initializers */        cc = *(++ptr);                           /* ++ in initializers */
1118  #ifndef EBCDIC  /* ASCII/UTF-8 coding */  #ifndef EBCDIC  /* ASCII/UTF-8 coding */
1119        if (cc >= CHAR_a) cc -= 32;              /* Convert to upper case */        if (cc >= CHAR_a) cc -= 32;              /* Convert to upper case */
# Line 1161  else Line 1172  else
1172  newline". PCRE does not support \N{name}. However, it does support  newline". PCRE does not support \N{name}. However, it does support
1173  quantification such as \N{2,3}. */  quantification such as \N{2,3}. */
1174    
1175  if (c == -ESC_N && ptr[1] == CHAR_LEFT_CURLY_BRACKET &&  if (escape == ESC_N && ptr[1] == CHAR_LEFT_CURLY_BRACKET &&
1176       !is_counted_repeat(ptr+2))       !is_counted_repeat(ptr+2))
1177    *errorcodeptr = ERR37;    *errorcodeptr = ERR37;
1178    
1179  /* If PCRE_UCP is set, we change the values for \d etc. */  /* If PCRE_UCP is set, we change the values for \d etc. */
1180    
1181  if ((options & PCRE_UCP) != 0 && c <= -ESC_D && c >= -ESC_w)  if ((options & PCRE_UCP) != 0 && escape >= ESC_D && escape <= ESC_w)
1182    c -= (ESC_DU - ESC_D);    escape += (ESC_DU - ESC_D);
1183    
1184  /* Set the pointer to the final character before returning. */  /* Set the pointer to the final character before returning. */
1185    
1186  *ptrptr = ptr;  *ptrptr = ptr;
1187  return c;  *chptr = c;
1188    return escape;
1189  }  }
1190    
   
   
1191  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
1192  /*************************************************  /*************************************************
1193  *               Handle \P and \p                 *  *               Handle \P and \p                 *
# Line 1200  Returns:         type value from ucp_typ Line 1210  Returns:         type value from ucp_typ
1210  static int  static int
1211  get_ucp(const pcre_uchar **ptrptr, BOOL *negptr, int *dptr, int *errorcodeptr)  get_ucp(const pcre_uchar **ptrptr, BOOL *negptr, int *dptr, int *errorcodeptr)
1212  {  {
1213  int c, i, bot, top;  pcre_uchar c;
1214    int i, bot, top;
1215  const pcre_uchar *ptr = *ptrptr;  const pcre_uchar *ptr = *ptrptr;
1216  pcre_uchar name[32];  pcre_uchar name[32];
1217    
# Line 1247  top = PRIV(utt_size); Line 1258  top = PRIV(utt_size);
1258    
1259  while (bot < top)  while (bot < top)
1260    {    {
1261      int r;
1262    i = (bot + top) >> 1;    i = (bot + top) >> 1;
1263    c = STRCMP_UC_C8(name, PRIV(utt_names) + PRIV(utt)[i].name_offset);    r = STRCMP_UC_C8(name, PRIV(utt_names) + PRIV(utt)[i].name_offset);
1264    if (c == 0)    if (r == 0)
1265      {      {
1266      *dptr = PRIV(utt)[i].value;      *dptr = PRIV(utt)[i].value;
1267      return PRIV(utt)[i].type;      return PRIV(utt)[i].type;
1268      }      }
1269    if (c > 0) bot = i + 1; else top = i;    if (r > 0) bot = i + 1; else top = i;
1270    }    }
1271    
1272  *errorcodeptr = ERR47;  *errorcodeptr = ERR47;
# Line 2897  Yield:        -1 when no more Line 2909  Yield:        -1 when no more
2909  */  */
2910    
2911  static int  static int
2912  get_othercase_range(unsigned int *cptr, unsigned int d, unsigned int *ocptr,  get_othercase_range(pcre_uint32 *cptr, pcre_uint32 d, pcre_uint32 *ocptr,
2913    unsigned int *odptr)    pcre_uint32 *odptr)
2914  {  {
2915  unsigned int c, othercase, next;  pcre_uint32 c, othercase, next;
2916  int co;  int co;
2917    
2918  /* Find the first character that has an other case. If it has multiple other  /* Find the first character that has an other case. If it has multiple other
# Line 2952  Returns:       TRUE if auto-possessifyin Line 2964  Returns:       TRUE if auto-possessifyin
2964  */  */
2965    
2966  static BOOL  static BOOL
2967  check_char_prop(int c, int ptype, int pdata, BOOL negated)  check_char_prop(pcre_uint32 c, int ptype, int pdata, BOOL negated)
2968  {  {
2969  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
2970  const pcre_uint32 *p;  const pcre_uint32 *p;
# Line 3038  static BOOL Line 3050  static BOOL
3050  check_auto_possessive(const pcre_uchar *previous, BOOL utf,  check_auto_possessive(const pcre_uchar *previous, BOOL utf,
3051    const pcre_uchar *ptr, int options, compile_data *cd)    const pcre_uchar *ptr, int options, compile_data *cd)
3052  {  {
3053  pcre_int32 c = NOTACHAR;  pcre_uint32 c = NOTACHAR;
3054  pcre_int32 next;  pcre_uint32 next;
3055    int escape;
3056  int op_code = *previous++;  int op_code = *previous++;
3057    
3058  /* Skip whitespace and comments in extended mode */  /* Skip whitespace and comments in extended mode */
# Line 3071  value is a character, a negative value i Line 3084  value is a character, a negative value i
3084  if (*ptr == CHAR_BACKSLASH)  if (*ptr == CHAR_BACKSLASH)
3085    {    {
3086    int temperrorcode = 0;    int temperrorcode = 0;
3087    next = check_escape(&ptr, &temperrorcode, cd->bracount, options, FALSE);    escape = check_escape(&ptr, &next, &temperrorcode, cd->bracount, options, FALSE);
3088    if (temperrorcode != 0) return FALSE;    if (temperrorcode != 0) return FALSE;
3089    ptr++;    /* Point after the escape sequence */    ptr++;    /* Point after the escape sequence */
3090    }    }
3091  else if (!MAX_255(*ptr) || (cd->ctypes[*ptr] & ctype_meta) == 0)  else if (!MAX_255(*ptr) || (cd->ctypes[*ptr] & ctype_meta) == 0)
3092    {    {
3093      escape = 0;
3094  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
3095    if (utf) { GETCHARINC(next, ptr); } else    if (utf) { GETCHARINC(next, ptr); } else
3096  #endif  #endif
# Line 3117  if (*ptr == CHAR_ASTERISK || *ptr == CHA Line 3131  if (*ptr == CHAR_ASTERISK || *ptr == CHA
3131    
3132  if (op_code == OP_CHAR || op_code == OP_CHARI ||  if (op_code == OP_CHAR || op_code == OP_CHARI ||
3133      op_code == OP_NOT || op_code == OP_NOTI)      op_code == OP_NOT || op_code == OP_NOTI)
3134      //if (escape == 0) switch(op_code)
3135    {    {
3136  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
3137    GETCHARTEST(c, previous);    GETCHARTEST(c, previous);
# Line 3128  if (op_code == OP_CHAR || op_code == OP_ Line 3143  if (op_code == OP_CHAR || op_code == OP_
3143  /* Now compare the next item with the previous opcode. First, handle cases when  /* Now compare the next item with the previous opcode. First, handle cases when
3144  the next item is a character. */  the next item is a character. */
3145    
3146  if (next >= 0)  if (escape == 0)
3147    {    {
3148    /* For a caseless UTF match, the next character may have more than one other    /* For a caseless UTF match, the next character may have more than one other
3149    case, which maps to the special PT_CLIST property. Check this first. */    case, which maps to the special PT_CLIST property. Check this first. */
3150    
3151  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
3152    if (utf && (unsigned int)c != NOTACHAR && (options & PCRE_CASELESS) != 0)    if (utf && c != NOTACHAR && (options & PCRE_CASELESS) != 0)
3153      {      {
3154      int ocs = UCD_CASESET(next);      int ocs = UCD_CASESET(next);
3155      if (ocs > 0) return check_char_prop(c, PT_CLIST, ocs, op_code >= OP_NOT);      if (ocs > 0) return check_char_prop(c, PT_CLIST, ocs, op_code >= OP_NOT);
# Line 3156  if (next >= 0) Line 3171  if (next >= 0)
3171  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
3172      if (utf)      if (utf)
3173        {        {
3174        unsigned int othercase;        pcre_uint32 othercase;
3175        if (next < 128) othercase = cd->fcc[next]; else        if (next < 128) othercase = cd->fcc[next]; else
3176  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
3177        othercase = UCD_OTHERCASE((unsigned int)next);        othercase = UCD_OTHERCASE(next);
3178  #else  #else
3179        othercase = NOTACHAR;        othercase = NOTACHAR;
3180  #endif  #endif
3181        return (unsigned int)c != othercase;        return c != othercase;
3182        }        }
3183      else      else
3184  #endif  /* SUPPORT_UTF */  #endif  /* SUPPORT_UTF */
3185      return (c != TABLE_GET((unsigned int)next, cd->fcc, next));  /* Not UTF */      return (c != TABLE_GET(next, cd->fcc, next));  /* Not UTF */
3186    
3187      case OP_NOT:      case OP_NOT:
3188      return c == next;      return c == next;
# Line 3177  if (next >= 0) Line 3192  if (next >= 0)
3192  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
3193      if (utf)      if (utf)
3194        {        {
3195        unsigned int othercase;        pcre_uint32 othercase;
3196        if (next < 128) othercase = cd->fcc[next]; else        if (next < 128) othercase = cd->fcc[next]; else
3197  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
3198        othercase = UCD_OTHERCASE((unsigned int)next);        othercase = UCD_OTHERCASE(next);
3199  #else  #else
3200        othercase = NOTACHAR;        othercase = NOTACHAR;
3201  #endif  #endif
3202        return (unsigned int)c == othercase;        return c == othercase;
3203        }        }
3204      else      else
3205  #endif  /* SUPPORT_UTF */  #endif  /* SUPPORT_UTF */
3206      return (c == TABLE_GET((unsigned int)next, cd->fcc, next));  /* Not UTF */      return (c == TABLE_GET(next, cd->fcc, next));  /* Not UTF */
3207    
3208      /* Note that OP_DIGIT etc. are generated only when PCRE_UCP is *not* set.      /* Note that OP_DIGIT etc. are generated only when PCRE_UCP is *not* set.
3209      When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */      When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */
# Line 3257  switch(op_code) Line 3272  switch(op_code)
3272    {    {
3273    case OP_CHAR:    case OP_CHAR:
3274    case OP_CHARI:    case OP_CHARI:
3275    switch(-next)    switch(escape)
3276      {      {
3277      case ESC_d:      case ESC_d:
3278      return c > 255 || (cd->ctypes[c] & ctype_digit) == 0;      return c > 255 || (cd->ctypes[c] & ctype_digit) == 0;
# Line 3282  switch(op_code) Line 3297  switch(op_code)
3297      switch(c)      switch(c)
3298        {        {
3299        HSPACE_CASES:        HSPACE_CASES:
3300        return -next != ESC_h;        return escape != ESC_h;
3301    
3302        default:        default:
3303        return -next == ESC_h;        return escape == ESC_h;
3304        }        }
3305    
3306      case ESC_v:      case ESC_v:
# Line 3293  switch(op_code) Line 3308  switch(op_code)
3308      switch(c)      switch(c)
3309        {        {
3310        VSPACE_CASES:        VSPACE_CASES:
3311        return -next != ESC_v;        return escape != ESC_v;
3312    
3313        default:        default:
3314        return -next == ESC_v;        return escape == ESC_v;
3315        }        }
3316    
3317      /* When PCRE_UCP is set, these values get generated for \d etc. Find      /* When PCRE_UCP is set, these values get generated for \d etc. Find
3318      their substitutions and process them. The result will always be either      their substitutions and process them. The result will always be either
3319      -ESC_p or -ESC_P. Then fall through to process those values. */      ESC_p or ESC_P. Then fall through to process those values. */
3320    
3321  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
3322      case ESC_du:      case ESC_du:
# Line 3312  switch(op_code) Line 3327  switch(op_code)
3327      case ESC_SU:      case ESC_SU:
3328        {        {
3329        int temperrorcode = 0;        int temperrorcode = 0;
3330        ptr = substitutes[-next - ESC_DU];        ptr = substitutes[escape - ESC_DU];
3331        next = check_escape(&ptr, &temperrorcode, 0, options, FALSE);        escape = check_escape(&ptr, &next, &temperrorcode, 0, options, FALSE);
3332        if (temperrorcode != 0) return FALSE;        if (temperrorcode != 0) return FALSE;
3333        ptr++;    /* For compatibility */        ptr++;    /* For compatibility */
3334        }        }
# Line 3340  switch(op_code) Line 3355  switch(op_code)
3355    
3356        /* Do the property check. */        /* Do the property check. */
3357    
3358        return check_char_prop(c, ptype, pdata, (next == -ESC_P) != negated);        return check_char_prop(c, ptype, pdata, (escape == ESC_P) != negated);
3359        }        }
3360  #endif  #endif
3361    
# Line 3355  switch(op_code) Line 3370  switch(op_code)
3370    these op-codes are never generated.) */    these op-codes are never generated.) */
3371    
3372    case OP_DIGIT:    case OP_DIGIT:
3373    return next == -ESC_D || next == -ESC_s || next == -ESC_W ||    return escape == ESC_D || escape == ESC_s || escape == ESC_W ||
3374           next == -ESC_h || next == -ESC_v || next == -ESC_R;           escape == ESC_h || escape == ESC_v || escape == ESC_R;
3375    
3376    case OP_NOT_DIGIT:    case OP_NOT_DIGIT:
3377    return next == -ESC_d;    return escape == ESC_d;
3378    
3379    case OP_WHITESPACE:    case OP_WHITESPACE:
3380    return next == -ESC_S || next == -ESC_d || next == -ESC_w;    return escape == ESC_S || escape == ESC_d || escape == ESC_w;
3381    
3382    case OP_NOT_WHITESPACE:    case OP_NOT_WHITESPACE:
3383    return next == -ESC_s || next == -ESC_h || next == -ESC_v || next == -ESC_R;    return escape == ESC_s || escape == ESC_h || escape == ESC_v || escape == ESC_R;
3384    
3385    case OP_HSPACE:    case OP_HSPACE:
3386    return next == -ESC_S || next == -ESC_H || next == -ESC_d ||    return escape == ESC_S || escape == ESC_H || escape == ESC_d ||
3387           next == -ESC_w || next == -ESC_v || next == -ESC_R;           escape == ESC_w || escape == ESC_v || escape == ESC_R;
3388    
3389    case OP_NOT_HSPACE:    case OP_NOT_HSPACE:
3390    return next == -ESC_h;    return escape == ESC_h;
3391    
3392    /* Can't have \S in here because VT matches \S (Perl anomaly) */    /* Can't have \S in here because VT matches \S (Perl anomaly) */
3393    case OP_ANYNL:    case OP_ANYNL:
3394    case OP_VSPACE:    case OP_VSPACE:
3395    return next == -ESC_V || next == -ESC_d || next == -ESC_w;    return escape == ESC_V || escape == ESC_d || escape == ESC_w;
3396    
3397    case OP_NOT_VSPACE:    case OP_NOT_VSPACE:
3398    return next == -ESC_v || next == -ESC_R;    return escape == ESC_v || escape == ESC_R;
3399    
3400    case OP_WORDCHAR:    case OP_WORDCHAR:
3401    return next == -ESC_W || next == -ESC_s || next == -ESC_h ||    return escape == ESC_W || escape == ESC_s || escape == ESC_h ||
3402           next == -ESC_v || next == -ESC_R;           escape == ESC_v || escape == ESC_R;
3403    
3404    case OP_NOT_WORDCHAR:    case OP_NOT_WORDCHAR:
3405    return next == -ESC_w || next == -ESC_d;    return escape == ESC_w || escape == ESC_d;
3406    
3407    default:    default:
3408    return FALSE;    return FALSE;
# Line 3421  Returns:        the number of < 256 char Line 3436  Returns:        the number of < 256 char
3436    
3437  static int  static int
3438  add_to_class(pcre_uint8 *classbits, pcre_uchar **uchardptr, int options,  add_to_class(pcre_uint8 *classbits, pcre_uchar **uchardptr, int options,
3439    compile_data *cd, unsigned int start, unsigned int end)    compile_data *cd, pcre_uint32 start, pcre_uint32 end)
3440  {  {
3441  unsigned int c;  pcre_uint32 c;
3442  int n8 = 0;  int n8 = 0;
3443    
3444  /* If caseless matching is required, scan the range and process alternate  /* If caseless matching is required, scan the range and process alternate
# Line 3437  if ((options & PCRE_CASELESS) != 0) Line 3452  if ((options & PCRE_CASELESS) != 0)
3452    if ((options & PCRE_UTF8) != 0)    if ((options & PCRE_UTF8) != 0)
3453      {      {
3454      int rc;      int rc;
3455      unsigned int oc, od;      pcre_uint32 oc, od;
3456    
3457      options &= ~PCRE_CASELESS;   /* Remove for recursive calls */      options &= ~PCRE_CASELESS;   /* Remove for recursive calls */
3458      c = start;      c = start;
# Line 3490  in all cases. */ Line 3505  in all cases. */
3505  #endif  #endif
3506    if (end > 0xffff) end = 0xffff;    if (end > 0xffff) end = 0xffff;
3507    
3508  #elif defined COMPILE_PCRE32  #endif /* COMPILE_PCRE[8|16] */
 #ifdef SUPPORT_UTF  
   if ((options & PCRE_UTF32) == 0)  
     if (end > 0xffffu) end = 0xffffu; // FIXMEchpe rebase fix this  
 #endif  
 #endif /* COMPILE_PCRE[8|16|32] */  
3509    
3510  /* If all characters are less than 256, use the bit map. Otherwise use extra  /* If all characters are less than 256, use the bit map. Otherwise use extra
3511  data. */  data. */
# Line 3625  static int Line 3635  static int
3635  add_not_list_to_class(pcre_uint8 *classbits, pcre_uchar **uchardptr,  add_not_list_to_class(pcre_uint8 *classbits, pcre_uchar **uchardptr,
3636    int options, compile_data *cd, const pcre_uint32 *p)    int options, compile_data *cd, const pcre_uint32 *p)
3637  {  {
3638    BOOL utf = (options & PCRE_UTF8) != 0;
3639  int n8 = 0;  int n8 = 0;
3640  if (p[0] > 0)  if (p[0] > 0)
3641    n8 += add_to_class(classbits, uchardptr, options, cd, 0, p[0] - 1);    n8 += add_to_class(classbits, uchardptr, options, cd, 0, p[0] - 1);
3642  while (p[0] < NOTACHAR)  while (p[0] < NOTACHAR)
3643    {    {
3644    while (p[1] == p[0] + 1) p++;    while (p[1] == p[0] + 1) p++;
3645    n8 += add_to_class(classbits, uchardptr, options, cd, p[0] + 1,    n8 += add_to_class(classbits, uchardptr, options, cd, p[0] + 1,
3646      (p[1] == NOTACHAR)? 0x10ffff : p[1] - 1);      (p[1] == NOTACHAR) ? (utf ? 0x10ffffu : 0xffffffffu) : p[1] - 1);
3647    p++;    p++;
3648    }    }
3649  return n8;  return n8;
# Line 3683  pcre_int32 req_caseopt, reqvary, tempreq Line 3694  pcre_int32 req_caseopt, reqvary, tempreq
3694  int options = *optionsptr;               /* May change dynamically */  int options = *optionsptr;               /* May change dynamically */
3695  int after_manual_callout = 0;  int after_manual_callout = 0;
3696  int length_prevgroup = 0;  int length_prevgroup = 0;
3697  register int c;  register pcre_uint32 c;
3698    int escape;
3699  register pcre_uchar *code = *codeptr;  register pcre_uchar *code = *codeptr;
3700  pcre_uchar *last_code = code;  pcre_uchar *last_code = code;
3701  pcre_uchar *orig_code = code;  pcre_uchar *orig_code = code;
# Line 3703  must not do this for other options (e.g. Line 3715  must not do this for other options (e.g.
3715  dynamically as we process the pattern. */  dynamically as we process the pattern. */
3716    
3717  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
3718  /* PCRE_UTF(16|32) have the same value as PCRE_UTF8. */  /* PCRE_UTF[16|32] have the same value as PCRE_UTF8. */
3719  BOOL utf = (options & PCRE_UTF8) != 0;  BOOL utf = (options & PCRE_UTF8) != 0;
3720  pcre_uchar utf_chars[6];  pcre_uchar utf_chars[6];
3721  #else  #else
# Line 3771  for (;; ptr++) Line 3783  for (;; ptr++)
3783    int terminator;    int terminator;
3784    int mclength;    int mclength;
3785    int tempbracount;    int tempbracount;
3786      int ec; // FIXMEchpe pcre_uint32
3787    pcre_uchar mcbuffer[8];    pcre_uchar mcbuffer[8];
3788    
3789    /* Get next character in the pattern */    /* Get next character in the pattern */
# Line 4240  for (;; ptr++) Line 4253  for (;; ptr++)
4253    
4254        if (c == CHAR_BACKSLASH)        if (c == CHAR_BACKSLASH)
4255          {          {
4256          c = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE);          escape = check_escape(&ptr, &ec, errorcodeptr, cd->bracount, options, TRUE);
4257    
4258          if (*errorcodeptr != 0) goto FAILED;          if (*errorcodeptr != 0) goto FAILED;
4259    
4260          if (-c == ESC_b) c = CHAR_BS;    /* \b is backspace in a class */          if (escape == 0)
4261          else if (-c == ESC_N)            /* \N is not supported in a class */            c = ec;
4262            else if (escape == ESC_b) c = CHAR_BS; /* \b is backspace in a class */
4263            else if (escape == ESC_N)            /* \N is not supported in a class */
4264            {            {
4265            *errorcodeptr = ERR71;            *errorcodeptr = ERR71;
4266            goto FAILED;            goto FAILED;
4267            }            }
4268          else if (-c == ESC_Q)            /* Handle start of quoted string */          else if (escape == ESC_Q)            /* Handle start of quoted string */
4269            {            {
4270            if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)            if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
4271              {              {
# Line 4258  for (;; ptr++) Line 4274  for (;; ptr++)
4274            else inescq = TRUE;            else inescq = TRUE;
4275            continue;            continue;
4276            }            }
4277          else if (-c == ESC_E) continue;  /* Ignore orphan \E */          else if (escape == ESC_E) continue;  /* Ignore orphan \E */
4278    
4279          if (c < 0)          else
4280            {            {
4281            register const pcre_uint8 *cbits = cd->cbits;            register const pcre_uint8 *cbits = cd->cbits;
4282            /* Every class contains at least two < 256 characters. */            /* Every class contains at least two < 256 characters. */
# Line 4268  for (;; ptr++) Line 4284  for (;; ptr++)
4284            /* Every class contains at least two characters. */            /* Every class contains at least two characters. */
4285            class_one_char += 2;            class_one_char += 2;
4286    
4287            switch (-c)            switch (escape)
4288              {              {
4289  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
4290              case ESC_du:     /* These are the values given for \d etc */              case ESC_du:     /* These are the values given for \d etc */
# Line 4278  for (;; ptr++) Line 4294  for (;; ptr++)
4294              case ESC_su:     /* of the default ASCII testing. */              case ESC_su:     /* of the default ASCII testing. */
4295              case ESC_SU:              case ESC_SU:
4296              nestptr = ptr;              nestptr = ptr;
4297              ptr = substitutes[-c - ESC_DU] - 1;  /* Just before substitute */              ptr = substitutes[escape - ESC_DU] - 1;  /* Just before substitute */
4298              class_has_8bitchar--;                /* Undo! */              class_has_8bitchar--;                /* Undo! */
4299              continue;              continue;
4300  #endif  #endif
# Line 4347  for (;; ptr++) Line 4363  for (;; ptr++)
4363                int pdata;                int pdata;
4364                int ptype = get_ucp(&ptr, &negated, &pdata, errorcodeptr);                int ptype = get_ucp(&ptr, &negated, &pdata, errorcodeptr);
4365                if (ptype < 0) goto FAILED;                if (ptype < 0) goto FAILED;
4366                *class_uchardata++ = ((-c == ESC_p) != negated)?                *class_uchardata++ = ((escape == ESC_p) != negated)?
4367                  XCL_PROP : XCL_NOTPROP;                  XCL_PROP : XCL_NOTPROP;
4368                *class_uchardata++ = ptype;                *class_uchardata++ = ptype;
4369                *class_uchardata++ = pdata;                *class_uchardata++ = pdata;
# Line 4375  for (;; ptr++) Line 4391  for (;; ptr++)
4391          /* Fall through if the escape just defined a single character (c >= 0).          /* Fall through if the escape just defined a single character (c >= 0).
4392          This may be greater than 256. */          This may be greater than 256. */
4393    
4394            escape = 0;
4395    
4396          }   /* End of backslash handling */          }   /* End of backslash handling */
4397    
4398        /* A character may be followed by '-' to form a range. However, Perl does        /* A character may be followed by '-' to form a range. However, Perl does
# Line 4440  for (;; ptr++) Line 4458  for (;; ptr++)
4458    
4459          if (!inescq && d == CHAR_BACKSLASH)          if (!inescq && d == CHAR_BACKSLASH)
4460            {            {
4461            d = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE);            int descape;
4462              descape = check_escape(&ptr, &d, errorcodeptr, cd->bracount, options, TRUE);
4463            if (*errorcodeptr != 0) goto FAILED;            if (*errorcodeptr != 0) goto FAILED;
4464    
4465            /* \b is backspace; any other special means the '-' was literal. */            /* \b is backspace; any other special means the '-' was literal. */
4466    
4467            if (d < 0)            if (descape != 0)
4468              {              {
4469              if (d == -ESC_b) d = CHAR_BS; else              if (descape == ESC_b) d = CHAR_BS; else
4470                {                {
4471                ptr = oldptr;                ptr = oldptr;
4472                goto CLASS_SINGLE_CHARACTER;  /* A few lines below */                goto CLASS_SINGLE_CHARACTER;  /* A few lines below */
# Line 6659  for (;; ptr++) Line 6678  for (;; ptr++)
6678      /* Handle metasequences introduced by \. For ones like \d, the ESC_ values      /* Handle metasequences introduced by \. For ones like \d, the ESC_ values
6679      are arranged to be the negation of the corresponding OP_values in the      are arranged to be the negation of the corresponding OP_values in the
6680      default case when PCRE_UCP is not set. For the back references, the values      default case when PCRE_UCP is not set. For the back references, the values
6681      are ESC_REF plus the reference number. Only back references and those types      are negative the reference number. Only back references and those types
6682      that consume a character may be repeated. We can test for values between      that consume a character may be repeated. We can test for values between
6683      ESC_b and ESC_Z for the latter; this may have to change if any new ones are      ESC_b and ESC_Z for the latter; this may have to change if any new ones are
6684      ever created. */      ever created. */
6685    
6686      case CHAR_BACKSLASH:      case CHAR_BACKSLASH:
6687      tempptr = ptr;      tempptr = ptr;
6688      c = check_escape(&ptr, errorcodeptr, cd->bracount, options, FALSE);      escape = check_escape(&ptr, &ec, errorcodeptr, cd->bracount, options, FALSE);
6689    
6690      if (*errorcodeptr != 0) goto FAILED;      if (*errorcodeptr != 0) goto FAILED;
6691    
6692      if (c < 0)      if (escape == 0)
6693          c = ec;
6694        else
6695        {        {
6696        if (-c == ESC_Q)            /* Handle start of quoted string */        if (escape == ESC_Q)            /* Handle start of quoted string */
6697          {          {
6698          if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)          if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
6699            ptr += 2;               /* avoid empty string */            ptr += 2;               /* avoid empty string */
# Line 6679  for (;; ptr++) Line 6701  for (;; ptr++)
6701          continue;          continue;
6702          }          }
6703    
6704        if (-c == ESC_E) continue;  /* Perl ignores an orphan \E */        if (escape == ESC_E) continue;  /* Perl ignores an orphan \E */
6705    
6706        /* For metasequences that actually match a character, we disable the        /* For metasequences that actually match a character, we disable the
6707        setting of a first character if it hasn't already been set. */        setting of a first character if it hasn't already been set. */
6708    
6709        if (firstchar == REQ_UNSET && -c > ESC_b && -c < ESC_Z)        if (firstchar == REQ_UNSET && escape > ESC_b && escape < ESC_Z)
6710          firstchar = REQ_NONE;          firstchar = REQ_NONE;
6711    
6712        /* Set values to reset to if this is followed by a zero repeat. */        /* Set values to reset to if this is followed by a zero repeat. */
# Line 6694  for (;; ptr++) Line 6716  for (;; ptr++)
6716    
6717        /* \g<name> or \g'name' is a subroutine call by name and \g<n> or \g'n'        /* \g<name> or \g'name' is a subroutine call by name and \g<n> or \g'n'
6718        is a subroutine call by number (Oniguruma syntax). In fact, the value        is a subroutine call by number (Oniguruma syntax). In fact, the value
6719        -ESC_g is returned only for these cases. So we don't need to check for <        ESC_g is returned only for these cases. So we don't need to check for <
6720        or ' if the value is -ESC_g. For the Perl syntax \g{n} the value is        or ' if the value is ESC_g. For the Perl syntax \g{n} the value is
6721        -ESC_REF+n, and for the Perl syntax \g{name} the result is -ESC_k (as        -n, and for the Perl syntax \g{name} the result is ESC_k (as
6722        that is a synonym for a named back reference). */        that is a synonym for a named back reference). */
6723    
6724        if (-c == ESC_g)        if (escape == ESC_g)
6725          {          {
6726          const pcre_uchar *p;          const pcre_uchar *p;
6727          save_hwm = cd->hwm;   /* Normally this is set when '(' is read */          save_hwm = cd->hwm;   /* Normally this is set when '(' is read */
# Line 6755  for (;; ptr++) Line 6777  for (;; ptr++)
6777        /* \k<name> or \k'name' is a back reference by name (Perl syntax).        /* \k<name> or \k'name' is a back reference by name (Perl syntax).
6778        We also support \k{name} (.NET syntax).  */        We also support \k{name} (.NET syntax).  */
6779    
6780        if (-c == ESC_k)        if (escape == ESC_k)
6781          {          {
6782          if ((ptr[1] != CHAR_LESS_THAN_SIGN &&          if ((ptr[1] != CHAR_LESS_THAN_SIGN &&
6783            ptr[1] != CHAR_APOSTROPHE && ptr[1] != CHAR_LEFT_CURLY_BRACKET))            ptr[1] != CHAR_APOSTROPHE && ptr[1] != CHAR_LEFT_CURLY_BRACKET))
# Line 6774  for (;; ptr++) Line 6796  for (;; ptr++)
6796        not set to cope with cases like (?=(\w+))\1: which would otherwise set        not set to cope with cases like (?=(\w+))\1: which would otherwise set
6797        ':' later. */        ':' later. */
6798    
6799        if (-c >= ESC_REF)        if (escape < 0)
6800          {          {
6801          open_capitem *oc;          open_capitem *oc;
6802          recno = -c - ESC_REF;          recno = -escape;
6803    
6804          HANDLE_REFERENCE:    /* Come here from named backref handling */          HANDLE_REFERENCE:    /* Come here from named backref handling */
6805          if (firstchar == REQ_UNSET) firstchar = REQ_NONE;          if (firstchar == REQ_UNSET) firstchar = REQ_NONE;
# Line 6804  for (;; ptr++) Line 6826  for (;; ptr++)
6826        /* So are Unicode property matches, if supported. */        /* So are Unicode property matches, if supported. */
6827    
6828  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
6829        else if (-c == ESC_P || -c == ESC_p)        else if (escape == ESC_P || escape == ESC_p)
6830          {          {
6831          BOOL negated;          BOOL negated;
6832          int pdata;          int pdata;
6833          int ptype = get_ucp(&ptr, &negated, &pdata, errorcodeptr);          int ptype = get_ucp(&ptr, &negated, &pdata, errorcodeptr);
6834          if (ptype < 0) goto FAILED;          if (ptype < 0) goto FAILED;
6835          previous = code;          previous = code;
6836          *code++ = ((-c == ESC_p) != negated)? OP_PROP : OP_NOTPROP;          *code++ = ((escape == ESC_p) != negated)? OP_PROP : OP_NOTPROP;
6837          *code++ = ptype;          *code++ = ptype;
6838          *code++ = pdata;          *code++ = pdata;
6839          }          }
# Line 6820  for (;; ptr++) Line 6842  for (;; ptr++)
6842        /* If Unicode properties are not supported, \X, \P, and \p are not        /* If Unicode properties are not supported, \X, \P, and \p are not
6843        allowed. */        allowed. */
6844    
6845        else if (-c == ESC_X || -c == ESC_P || -c == ESC_p)        else if (escape == ESC_X || escape == ESC_P || escape == ESC_p)
6846          {          {
6847          *errorcodeptr = ERR45;          *errorcodeptr = ERR45;
6848          goto FAILED;          goto FAILED;
# Line 6835  for (;; ptr++) Line 6857  for (;; ptr++)
6857    
6858        else        else
6859          {          {
6860          if ((-c == ESC_b || -c == ESC_B) && cd->max_lookbehind == 0)          if ((escape == ESC_b || escape == ESC_B) && cd->max_lookbehind == 0)
6861            cd->max_lookbehind = 1;            cd->max_lookbehind = 1;
6862  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
6863          if (-c >= ESC_DU && -c <= ESC_wu)          if (escape >= ESC_DU && escape <= ESC_wu)
6864            {            {
6865            nestptr = ptr + 1;                   /* Where to resume */            nestptr = ptr + 1;                   /* Where to resume */
6866            ptr = substitutes[-c - ESC_DU] - 1;  /* Just before substitute */            ptr = substitutes[escape - ESC_DU] - 1;  /* Just before substitute */
6867            }            }
6868          else          else
6869  #endif  #endif
# Line 6849  for (;; ptr++) Line 6871  for (;; ptr++)
6871          so that it works in DFA mode and in lookbehinds. */          so that it works in DFA mode and in lookbehinds. */
6872    
6873            {            {
6874            previous = (-c > ESC_b && -c < ESC_Z)? code : NULL;            previous = (escape > ESC_b && escape < ESC_Z)? code : NULL;
6875            *code++ = (!utf && c == -ESC_C)? OP_ALLANY : -c;            *code++ = (!utf && escape == ESC_C)? OP_ALLANY : escape;
6876            }            }
6877          }          }
6878        continue;        continue;

Legend:
Removed from v.1055  
changed lines
  Added in v.1065

  ViewVC Help
Powered by ViewVC 1.1.5