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

Diff of /code/trunk/pcre_exec.c

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

revision 1248 by ph10, Wed Feb 13 17:36:38 2013 UTC revision 1257 by ph10, Fri Feb 22 20:20:30 2013 UTC
# Line 6  Line 6 
6  and semantics are as close as possible to those of the Perl 5 language.  and semantics are as close as possible to those of the Perl 5 language.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2012 University of Cambridge             Copyright (c) 1997-2013 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 233  if (caseless) Line 233  if (caseless)
233      {      {
234      while (length-- > 0)      while (length-- > 0)
235        {        {
236        pcre_uchar cc, cp;        pcre_uint32 cc, cp;
237        if (eptr >= md->end_subject) return -2;   /* Partial match */        if (eptr >= md->end_subject) return -2;   /* Partial match */
238        cc = RAWUCHARTEST(eptr);        cc = RAWUCHARTEST(eptr);
239        cp = RAWUCHARTEST(p);        cp = RAWUCHARTEST(p);
# Line 3215  for (;;) Line 3215  for (;;)
3215    
3216        if (fc < 128)        if (fc < 128)
3217          {          {
3218          pcre_uchar cc = RAWUCHAR(eptr);          pcre_uint32 cc = RAWUCHAR(eptr);
3219          if (md->lcc[fc] != TABLE_GET(cc, md->lcc, cc)) RRETURN(MATCH_NOMATCH);          if (md->lcc[fc] != TABLE_GET(cc, md->lcc, cc)) RRETURN(MATCH_NOMATCH);
3220          ecode++;          ecode++;
3221          eptr++;          eptr++;
# Line 4452  for (;;) Line 4452  for (;;)
4452          case OP_DIGIT:          case OP_DIGIT:
4453          for (i = 1; i <= min; i++)          for (i = 1; i <= min; i++)
4454            {            {
4455            pcre_uchar cc;            pcre_uint32 cc;
   
4456            if (eptr >= md->end_subject)            if (eptr >= md->end_subject)
4457              {              {
4458              SCHECK_PARTIAL();              SCHECK_PARTIAL();
# Line 4470  for (;;) Line 4469  for (;;)
4469          case OP_NOT_WHITESPACE:          case OP_NOT_WHITESPACE:
4470          for (i = 1; i <= min; i++)          for (i = 1; i <= min; i++)
4471            {            {
4472            pcre_uchar cc;            pcre_uint32 cc;
   
4473            if (eptr >= md->end_subject)            if (eptr >= md->end_subject)
4474              {              {
4475              SCHECK_PARTIAL();              SCHECK_PARTIAL();
# Line 4488  for (;;) Line 4486  for (;;)
4486          case OP_WHITESPACE:          case OP_WHITESPACE:
4487          for (i = 1; i <= min; i++)          for (i = 1; i <= min; i++)
4488            {            {
4489            pcre_uchar cc;            pcre_uint32 cc;
   
4490            if (eptr >= md->end_subject)            if (eptr >= md->end_subject)
4491              {              {
4492              SCHECK_PARTIAL();              SCHECK_PARTIAL();
# Line 4506  for (;;) Line 4503  for (;;)
4503          case OP_NOT_WORDCHAR:          case OP_NOT_WORDCHAR:
4504          for (i = 1; i <= min; i++)          for (i = 1; i <= min; i++)
4505            {            {
4506            pcre_uchar cc;            pcre_uint32 cc;
   
4507            if (eptr >= md->end_subject)            if (eptr >= md->end_subject)
4508              {              {
4509              SCHECK_PARTIAL();              SCHECK_PARTIAL();
# Line 4524  for (;;) Line 4520  for (;;)
4520          case OP_WORDCHAR:          case OP_WORDCHAR:
4521          for (i = 1; i <= min; i++)          for (i = 1; i <= min; i++)
4522            {            {
4523            pcre_uchar cc;            pcre_uint32 cc;
   
4524            if (eptr >= md->end_subject)            if (eptr >= md->end_subject)
4525              {              {
4526              SCHECK_PARTIAL();              SCHECK_PARTIAL();
# Line 6286  const pcre_uint8 *start_bits = NULL; Line 6281  const pcre_uint8 *start_bits = NULL;
6281  PCRE_PUCHAR start_match = (PCRE_PUCHAR)subject + start_offset;  PCRE_PUCHAR start_match = (PCRE_PUCHAR)subject + start_offset;
6282  PCRE_PUCHAR end_subject;  PCRE_PUCHAR end_subject;
6283  PCRE_PUCHAR start_partial = NULL;  PCRE_PUCHAR start_partial = NULL;
6284    PCRE_PUCHAR match_partial;
6285  PCRE_PUCHAR req_char_ptr = start_match - 1;  PCRE_PUCHAR req_char_ptr = start_match - 1;
6286    
6287  const pcre_study_data *study;  const pcre_study_data *study;
# Line 6837  for(;;) Line 6833  for(;;)
6833    md->match_function_type = 0;    md->match_function_type = 0;
6834    md->end_offset_top = 0;    md->end_offset_top = 0;
6835    rc = match(start_match, md->start_code, start_match, 2, md, NULL, 0);    rc = match(start_match, md->start_code, start_match, 2, md, NULL, 0);
6836    if (md->hitend && start_partial == NULL) start_partial = md->start_used_ptr;    if (md->hitend && start_partial == NULL)
6837        {
6838        start_partial = md->start_used_ptr;
6839        match_partial = start_match;
6840        }
6841    
6842    switch(rc)    switch(rc)
6843      {      {
# Line 7045  if (start_partial != NULL) Line 7045  if (start_partial != NULL)
7045      {      {
7046      offsets[0] = (int)(start_partial - (PCRE_PUCHAR)subject);      offsets[0] = (int)(start_partial - (PCRE_PUCHAR)subject);
7047      offsets[1] = (int)(end_subject - (PCRE_PUCHAR)subject);      offsets[1] = (int)(end_subject - (PCRE_PUCHAR)subject);
7048        if (offsetcount > 2)
7049          offsets[2] = (int)(match_partial - (PCRE_PUCHAR)subject);
7050      }      }
7051    rc = PCRE_ERROR_PARTIAL;    rc = PCRE_ERROR_PARTIAL;
7052    }    }

Legend:
Removed from v.1248  
changed lines
  Added in v.1257

  ViewVC Help
Powered by ViewVC 1.1.5