/[pcre]/code/trunk/doc/pcredemo.3
ViewVC logotype

Diff of /code/trunk/doc/pcredemo.3

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

revision 578 by ph10, Sat Nov 6 17:10:00 2010 UTC revision 579 by ph10, Wed Nov 24 17:39:25 2010 UTC
# Line 277  if (!find_all) /* Check for -g */ Line 277  if (!find_all) /* Check for -g */
277    }    }
278    
279  /* 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
280  sequence. First, find the options with which the regex was compiled; extract  sequence. First, find the options with which the regex was compiled; extract
281  the UTF-8 state, and mask off all but the newline options. */  the UTF-8 state, and mask off all but the newline options. */
282    
283  (void)pcre_fullinfo(re, NULL, PCRE_INFO_OPTIONS, &option_bits);  (void)pcre_fullinfo(re, NULL, PCRE_INFO_OPTIONS, &option_bits);
# Line 303  if (option_bits == 0) Line 303  if (option_bits == 0)
303    
304  /* See if CRLF is a valid newline sequence. */  /* See if CRLF is a valid newline sequence. */
305    
306  crlf_is_newline =  crlf_is_newline =
307       option_bits == PCRE_NEWLINE_ANY ||       option_bits == PCRE_NEWLINE_ANY ||
308       option_bits == PCRE_NEWLINE_CRLF ||       option_bits == PCRE_NEWLINE_CRLF ||
309       option_bits == PCRE_NEWLINE_ANYCRLF;       option_bits == PCRE_NEWLINE_ANYCRLF;
# Line 362  for (;;) Line 362  for (;;)
362      else if (utf8)                              /* Otherwise, ensure we */      else if (utf8)                              /* Otherwise, ensure we */
363        {                                         /* advance a whole UTF-8 */        {                                         /* advance a whole UTF-8 */
364        while (ovector[1] < subject_length)       /* character. */        while (ovector[1] < subject_length)       /* character. */
365          {          {
366          if ((subject[ovector[1]] & 0xc0) != 0x80) break;          if ((subject[ovector[1]] & 0xc0) != 0x80) break;
367          ovector[1] += 1;          ovector[1] += 1;
368          }          }
369        }        }
370      continue;    /* Go round the loop again */      continue;    /* Go round the loop again */
371      }      }
372    

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

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12