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

Diff of /code/trunk/pcredemo.c

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

revision 566 by ph10, Wed Nov 3 18:32:55 2010 UTC revision 579 by ph10, Wed Nov 24 17:39:25 2010 UTC
# Line 260  if (!find_all)     /* Check for -g */ Line 260  if (!find_all)     /* Check for -g */
260    }    }
261    
262  /* Before running the loop, check for UTF-8 and whether CRLF is a valid newline  /* Before running the loop, check for UTF-8 and whether CRLF is a valid newline
263  sequence. First, find the options with which the regex was compiled; extract  sequence. First, find the options with which the regex was compiled; extract
264  the UTF-8 state, and mask off all but the newline options. */  the UTF-8 state, and mask off all but the newline options. */
265    
266  (void)pcre_fullinfo(re, NULL, PCRE_INFO_OPTIONS, &option_bits);  (void)pcre_fullinfo(re, NULL, PCRE_INFO_OPTIONS, &option_bits);
# Line 286  if (option_bits == 0) Line 286  if (option_bits == 0)
286    
287  /* See if CRLF is a valid newline sequence. */  /* See if CRLF is a valid newline sequence. */
288    
289  crlf_is_newline =  crlf_is_newline =
290       option_bits == PCRE_NEWLINE_ANY ||       option_bits == PCRE_NEWLINE_ANY ||
291       option_bits == PCRE_NEWLINE_CRLF ||       option_bits == PCRE_NEWLINE_CRLF ||
292       option_bits == PCRE_NEWLINE_ANYCRLF;       option_bits == PCRE_NEWLINE_ANYCRLF;
# Line 345  for (;;) Line 345  for (;;)
345      else if (utf8)                              /* Otherwise, ensure we */      else if (utf8)                              /* Otherwise, ensure we */
346        {                                         /* advance a whole UTF-8 */        {                                         /* advance a whole UTF-8 */
347        while (ovector[1] < subject_length)       /* character. */        while (ovector[1] < subject_length)       /* character. */
348          {          {
349          if ((subject[ovector[1]] & 0xc0) != 0x80) break;          if ((subject[ovector[1]] & 0xc0) != 0x80) break;
350          ovector[1] += 1;          ovector[1] += 1;
351          }          }
352        }        }
353      continue;    /* Go round the loop again */      continue;    /* Go round the loop again */
354      }      }
355    

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

  ViewVC Help
Powered by ViewVC 1.1.5