--- code/trunk/pcre_newline.c 2007/04/16 15:28:08 149 +++ code/trunk/pcre_newline.c 2008/01/20 20:07:32 305 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2007 University of Cambridge + Copyright (c) 1997-2008 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -38,15 +38,19 @@ */ -/* This module contains internal functions for testing newlines when more than +/* This module contains internal functions for testing newlines when more than one kind of newline is to be recognized. When a newline is found, its length is -returned. In principle, we could implement several newline "types", each -referring to a different set of newline characters. At present, PCRE supports +returned. In principle, we could implement several newline "types", each +referring to a different set of newline characters. At present, PCRE supports only NLTYPE_FIXED, which gets handled without these functions, NLTYPE_ANYCRLF, and NLTYPE_ANY. The full list of Unicode newline characters is taken from http://unicode.org/unicode/reports/tr18/. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "pcre_internal.h" @@ -69,7 +73,7 @@ */ BOOL -_pcre_is_newline(const uschar *ptr, int type, const uschar *endptr, +_pcre_is_newline(const uschar *ptr, int type, const uschar *endptr, int *lenptr, BOOL utf8) { int c; @@ -119,17 +123,21 @@ */ BOOL -_pcre_was_newline(const uschar *ptr, int type, const uschar *startptr, +_pcre_was_newline(const uschar *ptr, int type, const uschar *startptr, int *lenptr, BOOL utf8) { int c; ptr--; +#ifdef SUPPORT_UTF8 if (utf8) { BACKCHAR(ptr); GETCHAR(c, ptr); } else c = *ptr; +#else /* no UTF-8 support */ +c = *ptr; +#endif /* SUPPORT_UTF8 */ if (type == NLTYPE_ANYCRLF) switch(c) {