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

Diff of /code/trunk/pcretest.c

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

revision 576 by ph10, Sun Nov 21 18:45:10 2010 UTC revision 579 by ph10, Wed Nov 24 17:39:25 2010 UTC
# Line 2134  while (!done) Line 2134  while (!done)
2134      int getlist = 0;      int getlist = 0;
2135      int gmatched = 0;      int gmatched = 0;
2136      int start_offset = 0;      int start_offset = 0;
2137      int start_offset_sign = 1;      int start_offset_sign = 1;
2138      int g_notempty = 0;      int g_notempty = 0;
2139      int use_dfa = 0;      int use_dfa = 0;
2140    
# Line 2267  while (!done) Line 2267  while (!done)
2267          continue;          continue;
2268    
2269          case '>':          case '>':
2270          if (*p == '-')          if (*p == '-')
2271            {            {
2272            start_offset_sign = -1;            start_offset_sign = -1;
2273            p++;            p++;
2274            }            }
2275          while(isdigit(*p)) start_offset = start_offset * 10 + *p++ - '0';          while(isdigit(*p)) start_offset = start_offset * 10 + *p++ - '0';
2276          start_offset *= start_offset_sign;          start_offset *= start_offset_sign;
2277          continue;          continue;
2278    
2279          case 'A':  /* Option setting */          case 'A':  /* Option setting */
# Line 2801  while (!done) Line 2801  while (!done)
2801        string - that was checked before setting g_notempty.        string - that was checked before setting g_notempty.
2802    
2803        Complication arises in the case when the newline convention is "any",        Complication arises in the case when the newline convention is "any",
2804        "crlf", or "anycrlf". If the previous match was at the end of a line        "crlf", or "anycrlf". If the previous match was at the end of a line
2805        terminated by CRLF, an advance of one character just passes the \r,        terminated by CRLF, an advance of one character just passes the \r,
2806        whereas we should prefer the longer newline sequence, as does the code in        whereas we should prefer the longer newline sequence, as does the code in
2807        pcre_exec(). Fudge the offset value to achieve this. We check for a        pcre_exec(). Fudge the offset value to achieve this. We check for a
2808        newline setting in the pattern; if none was set, use pcre_config() to        newline setting in the pattern; if none was set, use pcre_config() to
2809        find the default.        find the default.
2810    
2811        Otherwise, in the case of UTF-8 matching, the advance must be one        Otherwise, in the case of UTF-8 matching, the advance must be one
# Line 2843  while (!done) Line 2843  while (!done)
2843              while (start_offset + onechar < len)              while (start_offset + onechar < len)
2844                {                {
2845                if ((bptr[start_offset+onechar] & 0xc0) != 0x80) break;                if ((bptr[start_offset+onechar] & 0xc0) != 0x80) break;
2846                onechar++;                onechar++;
2847                }                }
2848              }              }
2849            use_offsets[1] = start_offset + onechar;            use_offsets[1] = start_offset + onechar;

Legend:
Removed from v.576  
changed lines
  Added in v.579

  ViewVC Help
Powered by ViewVC 1.1.5