/[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 364 by ph10, Fri Jul 11 14:53:41 2008 UTC
# Line 4695  for(;;) Line 4695  for(;;)
4695    
4696    if (firstline)    if (firstline)
4697      {      {
4698      USPTR t = start_match;      USPTR *t = start_match;
4699    #ifdef SUPPORT_UTF8
4700        if (utf8)
4701          {
4702          while (t < md->end_subject && !IS_NEWLINE(t))
4703            {
4704            t++;
4705            while (t < end_subject && (*t & 0xc0) == 0x80) t++;
4706            }
4707          }
4708        else
4709    #endif
4710      while (t < md->end_subject && !IS_NEWLINE(t)) t++;      while (t < md->end_subject && !IS_NEWLINE(t)) t++;
4711      end_subject = t;      end_subject = t;
4712      }      }
4713    
4714    /* Now test for a unique first byte */    /* Now advance to a unique first byte if there is one. */
4715    
4716    if (first_byte >= 0)    if (first_byte >= 0)
4717      {      {
4718      if (first_byte_caseless)      if (first_byte_caseless)
4719        while (start_match < end_subject &&        {
4720               md->lcc[*start_match] != first_byte)  #ifdef SUPPORT_UTF8
4721          { NEXTCHAR(start_match); }        if (utf8)
4722      else          {
4723            while (start_match < end_subject && md->lcc[*start_match] != first_byte)
4724              {
4725              start_match++;
4726              while(start_match < end_subject && (*start_match & 0xc0) == 0x80)
4727                start_match++;
4728              }
4729            }
4730          else
4731    #endif
4732          while (start_match < end_subject && md->lcc[*start_match] != first_byte)
4733            start_match++;
4734          }
4735        else    /* Caseful case */
4736          {
4737    #ifdef SUPPORT_UTF8
4738          if (utf8)
4739            {
4740            while (start_match < end_subject && *start_match != first_byte)
4741              {
4742              start_match++;
4743              while(start_match < end_subject && (*start_match & 0xc0) == 0x80)
4744                start_match++;
4745              }
4746            }
4747          else
4748    #endif
4749        while (start_match < end_subject && *start_match != first_byte)        while (start_match < end_subject && *start_match != first_byte)
4750          { NEXTCHAR(start_match); }          start_match++;
4751          }
4752      }      }
4753    
4754    /* Or to just after a linebreak for a multiline match if possible */    /* Or to just after a linebreak for a multiline match */
4755    
4756    else if (startline)    else if (startline)
4757      {      {
4758      if (start_match > md->start_subject + start_offset)      if (start_match > md->start_subject + start_offset)
4759        {        {
4760    #ifdef SUPPORT_UTF8
4761          if (utf8)
4762            {
4763            while (start_match < end_subject && !WAS_NEWLINE(start_match))
4764              {
4765              start_match++;
4766              while(start_match < end_subject && (*start_match & 0xc0) == 0x80)
4767                start_match++;
4768              }
4769            }
4770          else
4771    #endif
4772        while (start_match < end_subject && !WAS_NEWLINE(start_match))        while (start_match < end_subject && !WAS_NEWLINE(start_match))
4773          { NEXTCHAR(start_match); }          start_match++;
4774    
4775        /* 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,
4776        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.
# Line 4734  for(;;) Line 4784  for(;;)
4784        }        }
4785      }      }
4786    
4787    /* Or to a non-unique first char after study */    /* Or to a non-unique first byte after study */
4788    
4789    else if (start_bits != NULL)    else if (start_bits != NULL)
4790      {      {
4791    #ifdef SUPPORT_UTF8
4792        if (utf8)
4793          {
4794          while (start_match < end_subject)
4795            {
4796            register unsigned int c = *start_match;
4797            if ((start_bits[c/8] & (1 << (c&7))) == 0)
4798              {
4799              start_match++;
4800              while(start_match < end_subject && (*start_match & 0xc0) == 0x80)
4801                start_match++;
4802              }
4803            else break;
4804            }
4805          }
4806        else
4807    #endif
4808      while (start_match < end_subject)      while (start_match < end_subject)
4809        {        {
4810        register unsigned int c = *start_match;        register unsigned int c = *start_match;
4811        if ((start_bits[c/8] & (1 << (c&7))) == 0)        if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++;
4812          { NEXTCHAR(start_match); }          else break;
       else break;  
4813        }        }
4814      }      }
4815    

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

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12