/[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 361 by ph10, Thu Jul 10 16:03:28 2008 UTC revision 371 by ph10, Mon Aug 25 18:28:05 2008 UTC
# Line 2609  for (;;) Line 2609  for (;;)
2609              {              {
2610              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28);              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28);
2611              if (rrc != MATCH_NOMATCH) RRETURN(rrc);              if (rrc != MATCH_NOMATCH) RRETURN(rrc);
2612                if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
2613              GETCHARINC(d, eptr);              GETCHARINC(d, eptr);
2614              if (d < 256) d = md->lcc[d];              if (d < 256) d = md->lcc[d];
2615              if (fi >= max || eptr >= md->end_subject || fc == d)              if (fc == d) RRETURN(MATCH_NOMATCH);
2616                RRETURN(MATCH_NOMATCH);  
2617              }              }
2618            }            }
2619          else          else
# Line 2718  for (;;) Line 2719  for (;;)
2719              {              {
2720              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32);              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32);
2721              if (rrc != MATCH_NOMATCH) RRETURN(rrc);              if (rrc != MATCH_NOMATCH) RRETURN(rrc);
2722                if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
2723              GETCHARINC(d, eptr);              GETCHARINC(d, eptr);
2724              if (fi >= max || eptr >= md->end_subject || fc == d)              if (fc == d) RRETURN(MATCH_NOMATCH);
               RRETURN(MATCH_NOMATCH);  
2725              }              }
2726            }            }
2727          else          else
# Line 4696  for(;;) Line 4697  for(;;)
4697    if (firstline)    if (firstline)
4698      {      {
4699      USPTR t = start_match;      USPTR t = start_match;
4700    #ifdef SUPPORT_UTF8
4701        if (utf8)
4702          {
4703          while (t < md->end_subject && !IS_NEWLINE(t))
4704            {
4705            t++;
4706            while (t < end_subject && (*t & 0xc0) == 0x80) t++;
4707            }
4708          }
4709        else
4710    #endif
4711      while (t < md->end_subject && !IS_NEWLINE(t)) t++;      while (t < md->end_subject && !IS_NEWLINE(t)) t++;
4712      end_subject = t;      end_subject = t;
4713      }      }
4714    
4715    /* Now test for a unique first byte */    /* Now advance to a unique first byte if there is one. */
4716    
4717    if (first_byte >= 0)    if (first_byte >= 0)
4718      {      {
4719      if (first_byte_caseless)      if (first_byte_caseless)
4720        while (start_match < end_subject &&        while (start_match < end_subject && md->lcc[*start_match] != first_byte)
4721               md->lcc[*start_match] != first_byte)          start_match++;
         { NEXTCHAR(start_match); }  
4722      else      else
4723        while (start_match < end_subject && *start_match != first_byte)        while (start_match < end_subject && *start_match != first_byte)
4724          { NEXTCHAR(start_match); }          start_match++;
4725      }      }
4726    
4727    /* Or to just after a linebreak for a multiline match if possible */    /* Or to just after a linebreak for a multiline match */
4728    
4729    else if (startline)    else if (startline)
4730      {      {
4731      if (start_match > md->start_subject + start_offset)      if (start_match > md->start_subject + start_offset)
4732        {        {
4733    #ifdef SUPPORT_UTF8
4734          if (utf8)
4735            {
4736            while (start_match < end_subject && !WAS_NEWLINE(start_match))
4737              {
4738              start_match++;
4739              while(start_match < end_subject && (*start_match & 0xc0) == 0x80)
4740                start_match++;
4741              }
4742            }
4743          else
4744    #endif
4745        while (start_match < end_subject && !WAS_NEWLINE(start_match))        while (start_match < end_subject && !WAS_NEWLINE(start_match))
4746          { NEXTCHAR(start_match); }          start_match++;
4747    
4748        /* If we have just passed a CR and the newline option is ANY or ANYCRLF,        /* If we have just passed a CR and the newline option is ANY or ANYCRLF,
4749        and we are now at a LF, advance the match position by one more character.        and we are now at a LF, advance the match position by one more character.
4750        */        */
# Line 4734  for(;;) Line 4757  for(;;)
4757        }        }
4758      }      }
4759    
4760    /* Or to a non-unique first char after study */    /* Or to a non-unique first byte after study */
4761    
4762    else if (start_bits != NULL)    else if (start_bits != NULL)
4763      {      {
4764      while (start_match < end_subject)      while (start_match < end_subject)
4765        {        {
4766        register unsigned int c = *start_match;        register unsigned int c = *start_match;
4767        if ((start_bits[c/8] & (1 << (c&7))) == 0)        if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++;
4768          { NEXTCHAR(start_match); }          else break;
       else break;  
4769        }        }
4770      }      }
4771    
# Line 4818  for(;;) Line 4840  for(;;)
4840      }      }
4841    
4842    /* OK, we can now run the match. */    /* OK, we can now run the match. */
4843    
4844    md->start_match_ptr = start_match;    md->start_match_ptr = start_match;
4845    md->match_call_count = 0;    md->match_call_count = 0;
4846    rc = match(start_match, md->start_code, start_match, 2, md, ims, NULL, 0, 0);    rc = match(start_match, md->start_code, start_match, 2, md, ims, NULL, 0, 0);

Legend:
Removed from v.361  
changed lines
  Added in v.371

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12