/[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 349 by ph10, Wed Jul 2 18:42:11 2008 UTC revision 361 by ph10, Thu Jul 10 16:03:28 2008 UTC
# Line 158  printf("\n"); Line 158  printf("\n");
158    
159  if (length > md->end_subject - eptr) return FALSE;  if (length > md->end_subject - eptr) return FALSE;
160    
161  /* Separate the caselesss case for speed */  /* Separate the caseless case for speed. In UTF-8 mode we can only do this
162    properly if Unicode properties are supported. Otherwise, we can check only
163    ASCII characters. */
164    
165  if ((ims & PCRE_CASELESS) != 0)  if ((ims & PCRE_CASELESS) != 0)
166    {    {
167    #ifdef SUPPORT_UTF8
168    #ifdef SUPPORT_UCP
169      if (md->utf8)
170        {
171        USPTR endptr = eptr + length;
172        while (eptr < endptr)
173          {
174          int c, d;
175          GETCHARINC(c, eptr);
176          GETCHARINC(d, p);
177          if (c != d && c != UCD_OTHERCASE(d)) return FALSE;
178          }
179        }
180      else
181    #endif
182    #endif
183    
184      /* The same code works when not in UTF-8 mode and in UTF-8 mode when there
185      is no UCP support. */
186    
187    while (length-- > 0)    while (length-- > 0)
188      if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE;      { if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE; }
189    }    }
190    
191    /* In the caseful case, we can just compare the bytes, whether or not we
192    are in UTF-8 mode. */
193    
194  else  else
195    { while (length-- > 0) if (*p++ != *eptr++) return FALSE; }    { while (length-- > 0) if (*p++ != *eptr++) return FALSE; }
196    
# Line 1669  for (;;) Line 1695  for (;;)
1695           break;           break;
1696    
1697          case PT_GC:          case PT_GC:
1698          if ((ecode[2] != ucp_gentype[prop->chartype]) == (op == OP_PROP))          if ((ecode[2] != _pcre_ucp_gentype[prop->chartype]) == (op == OP_PROP))
1699            RRETURN(MATCH_NOMATCH);            RRETURN(MATCH_NOMATCH);
1700          break;          break;
1701    
# Line 4358  Returns:          > 0 => success; value Line 4384  Returns:          > 0 => success; value
4384                   < -1 => some kind of unexpected problem                   < -1 => some kind of unexpected problem
4385  */  */
4386    
4387  PCRE_EXP_DEFN int  PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
4388  pcre_exec(const pcre *argument_re, const pcre_extra *extra_data,  pcre_exec(const pcre *argument_re, const pcre_extra *extra_data,
4389    PCRE_SPTR subject, int length, int start_offset, int options, int *offsets,    PCRE_SPTR subject, int length, int start_offset, int options, int *offsets,
4390    int offsetcount)    int offsetcount)
# Line 4693  for(;;) Line 4719  for(;;)
4719      {      {
4720      if (start_match > md->start_subject + start_offset)      if (start_match > md->start_subject + start_offset)
4721        {        {
4722        while (start_match <= end_subject && !WAS_NEWLINE(start_match))        while (start_match < end_subject && !WAS_NEWLINE(start_match))
4723          { NEXTCHAR(start_match); }          { NEXTCHAR(start_match); }
4724    
4725        /* 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,
4726        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.
4727        */        */
# Line 4792  for(;;) Line 4818  for(;;)
4818      }      }
4819    
4820    /* OK, we can now run the match. */    /* OK, we can now run the match. */
4821    
4822    md->start_match_ptr = start_match;    md->start_match_ptr = start_match;
4823    md->match_call_count = 0;    md->match_call_count = 0;
4824    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.349  
changed lines
  Added in v.361

  ViewVC Help
Powered by ViewVC 1.1.5