/[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 544 by ph10, Tue Jun 15 17:20:55 2010 UTC revision 550 by ph10, Sun Oct 10 16:24:11 2010 UTC
# Line 1130  dealing with. The very first call may no Line 1130  dealing with. The very first call may no
1130  if (ptr[0] == CHAR_LEFT_PARENTHESIS)  if (ptr[0] == CHAR_LEFT_PARENTHESIS)
1131    {    {
1132    /* Handle specials such as (*SKIP) or (*UTF8) etc. */    /* Handle specials such as (*SKIP) or (*UTF8) etc. */
1133    
1134    if (ptr[1] == CHAR_ASTERISK) ptr += 2;    if (ptr[1] == CHAR_ASTERISK) ptr += 2;
1135    
1136    /* Handle a normal, unnamed capturing parenthesis. */    /* Handle a normal, unnamed capturing parenthesis. */
1137    
1138    else if (ptr[1] != CHAR_QUESTION_MARK)    else if (ptr[1] != CHAR_QUESTION_MARK)
# Line 1150  if (ptr[0] == CHAR_LEFT_PARENTHESIS) Line 1150  if (ptr[0] == CHAR_LEFT_PARENTHESIS)
1150      ptr += 3;      ptr += 3;
1151      dup_parens = TRUE;      dup_parens = TRUE;
1152      }      }
1153    
1154    /* Handle comments; all characters are allowed until a ket is reached. */    /* Handle comments; all characters are allowed until a ket is reached. */
1155    
1156    else if (ptr[2] == CHAR_NUMBER_SIGN)    else if (ptr[2] == CHAR_NUMBER_SIGN)
1157      {      {
1158      for (ptr += 3; *ptr != 0; ptr++) if (*ptr == CHAR_RIGHT_PARENTHESIS) break;      for (ptr += 3; *ptr != 0; ptr++) if (*ptr == CHAR_RIGHT_PARENTHESIS) break;
1159      goto FAIL_EXIT;      goto FAIL_EXIT;
1160      }      }
1161    
1162    /* Handle a condition. If it is an assertion, just carry on so that it    /* Handle a condition. If it is an assertion, just carry on so that it
1163    is processed as normal. If not, skip to the closing parenthesis of the    is processed as normal. If not, skip to the closing parenthesis of the
# Line 1295  for (; *ptr != 0; ptr++) Line 1295  for (; *ptr != 0; ptr++)
1295    else if (*ptr == CHAR_RIGHT_PARENTHESIS)    else if (*ptr == CHAR_RIGHT_PARENTHESIS)
1296      {      {
1297      if (dup_parens && *count < hwm_count) *count = hwm_count;      if (dup_parens && *count < hwm_count) *count = hwm_count;
1298      goto FAIL_EXIT;      goto FAIL_EXIT;
1299      }      }
1300    
1301    else if (*ptr == CHAR_VERTICAL_LINE && dup_parens)    else if (*ptr == CHAR_VERTICAL_LINE && dup_parens)
# Line 1724  for (;;) Line 1724  for (;;)
1724        case OP_MARK:        case OP_MARK:
1725        case OP_PRUNE_ARG:        case OP_PRUNE_ARG:
1726        case OP_SKIP_ARG:        case OP_SKIP_ARG:
       case OP_THEN_ARG:  
1727        code += code[1];        code += code[1];
1728        break;        break;
1729    
1730          case OP_THEN_ARG:
1731          code += code[1+LINK_SIZE];
1732          break;
1733        }        }
1734    
1735      /* Add in the fixed length from the table */      /* Add in the fixed length from the table */
# Line 1827  for (;;) Line 1830  for (;;)
1830        case OP_MARK:        case OP_MARK:
1831        case OP_PRUNE_ARG:        case OP_PRUNE_ARG:
1832        case OP_SKIP_ARG:        case OP_SKIP_ARG:
       case OP_THEN_ARG:  
1833        code += code[1];        code += code[1];
1834        break;        break;
1835    
1836          case OP_THEN_ARG:
1837          code += code[1+LINK_SIZE];
1838          break;
1839        }        }
1840    
1841      /* Add in the fixed length from the table */      /* Add in the fixed length from the table */
# Line 2105  for (code = first_significant_code(code Line 2111  for (code = first_significant_code(code
2111      case OP_MARK:      case OP_MARK:
2112      case OP_PRUNE_ARG:      case OP_PRUNE_ARG:
2113      case OP_SKIP_ARG:      case OP_SKIP_ARG:
     case OP_THEN_ARG:  
2114      code += code[1];      code += code[1];
2115      break;      break;
2116    
2117        case OP_THEN_ARG:
2118        code += code[1+LINK_SIZE];
2119        break;
2120    
2121      /* None of the remaining opcodes are required to match a character. */      /* None of the remaining opcodes are required to match a character. */
2122    
2123      default:      default:
# Line 4808  for (;; ptr++) Line 4817  for (;; ptr++)
4817                *errorcodeptr = ERR66;                *errorcodeptr = ERR66;
4818                goto FAILED;                goto FAILED;
4819                }                }
4820              *code++ = verbs[i].op;              *code = verbs[i].op;
4821                if (*code++ == OP_THEN)
4822                  {
4823                  PUT(code, 0, code - bcptr->current_branch - 1);
4824                  code += LINK_SIZE;
4825                  }
4826              }              }
4827    
4828            else            else
# Line 4818  for (;; ptr++) Line 4832  for (;; ptr++)
4832                *errorcodeptr = ERR59;                *errorcodeptr = ERR59;
4833                goto FAILED;                goto FAILED;
4834                }                }
4835              *code++ = verbs[i].op_arg;              *code = verbs[i].op_arg;
4836                if (*code++ == OP_THEN_ARG)
4837                  {
4838                  PUT(code, 0, code - bcptr->current_branch - 1);
4839                  code += LINK_SIZE;
4840                  }
4841              *code++ = arglen;              *code++ = arglen;
4842              memcpy(code, arg, arglen);              memcpy(code, arg, arglen);
4843              code += arglen;              code += arglen;

Legend:
Removed from v.544  
changed lines
  Added in v.550

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12