diff options
author | ULF WENDEL <uw@php.net> | 2012-10-22 13:38:02 +0200 |
---|---|---|
committer | ULF WENDEL <uw@php.net> | 2012-10-22 13:38:02 +0200 |
commit | 77fd708a0b81bf6dfcfce6aba24eaa606b97f630 (patch) | |
tree | 08ac6b2b913d20b60c18909986d1106010b538cb /ext/pcre/pcrelib/pcre_newline.c | |
parent | c64ff20836173fc35a22092b9e586f80ac722e22 (diff) | |
parent | 7d59b2264e4ea75c34c86df756a2c2795b94753f (diff) | |
download | php-git-77fd708a0b81bf6dfcfce6aba24eaa606b97f630.tar.gz |
Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
* 'PHP-5.4' of git.php.net:php-src: (22 commits)
Re-fixed bug #60901 (Improve "tail" syntax for AIX installation)
update NEWS
updated NEWS
Fixed bug #63284 PCRE upgrade to 8.31
preg indenpent test script for #63055
Update libmagic.patch
Add fix & missing fix
Add fix & missing fix
Fixed bug #63307 (Unused variable in oci8.c)
Fixed bug #63265 (Add ORA-00028 to the PHP_OCI_HANDLE_ERROR macro)
- Updated to version 2012.7 (2012g)
SUpport newer bisons.
Merge the fix for #61964 to 5.3, which will fix #63304
indent
better fix for #63055
Fixed bug #63055 (Segfault in zend_gc with SF2 testsuite)
I forgot that inconsistent is only avaliable in debug mode
Add comments
Fixed bug #63055 (Segfault in zend_gc with SF2 testsuite)
PHP 5.3.18 NEWS
...
Diffstat (limited to 'ext/pcre/pcrelib/pcre_newline.c')
-rw-r--r-- | ext/pcre/pcrelib/pcre_newline.c | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/ext/pcre/pcrelib/pcre_newline.c b/ext/pcre/pcrelib/pcre_newline.c index 3f6160ef22..ddd7708fa0 100644 --- a/ext/pcre/pcrelib/pcre_newline.c +++ b/ext/pcre/pcrelib/pcre_newline.c @@ -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-2009 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -65,16 +65,25 @@ Arguments: type the newline type endptr pointer to the end of the string lenptr where to return the length - utf8 TRUE if in utf8 mode + utf TRUE if in utf mode Returns: TRUE or FALSE */ BOOL -_pcre_is_newline(USPTR ptr, int type, USPTR endptr, int *lenptr, BOOL utf8) +PRIV(is_newline)(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR endptr, int *lenptr, + BOOL utf) { int c; -if (utf8) { GETCHAR(c, ptr); } else c = *ptr; +(void)utf; +#ifdef SUPPORT_UTF +if (utf) + { + GETCHAR(c, ptr); + } +else +#endif /* SUPPORT_UTF */ + c = *ptr; if (type == NLTYPE_ANYCRLF) switch(c) { @@ -93,9 +102,15 @@ else switch(c) case 0x000c: *lenptr = 1; return TRUE; /* FF */ case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1; return TRUE; /* CR */ - case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */ +#ifdef COMPILE_PCRE8 + case 0x0085: *lenptr = utf? 2 : 1; return TRUE; /* NEL */ case 0x2028: /* LS */ case 0x2029: *lenptr = 3; return TRUE; /* PS */ +#else + case 0x0085: /* NEL */ + case 0x2028: /* LS */ + case 0x2029: *lenptr = 1; return TRUE; /* PS */ +#endif /* COMPILE_PCRE8 */ default: return FALSE; } } @@ -114,26 +129,27 @@ Arguments: type the newline type startptr pointer to the start of the string lenptr where to return the length - utf8 TRUE if in utf8 mode + utf TRUE if in utf mode Returns: TRUE or FALSE */ BOOL -_pcre_was_newline(USPTR ptr, int type, USPTR startptr, int *lenptr, BOOL utf8) +PRIV(was_newline)(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR startptr, int *lenptr, + BOOL utf) { int c; +(void)utf; ptr--; -#ifdef SUPPORT_UTF8 -if (utf8) +#ifdef SUPPORT_UTF +if (utf) { BACKCHAR(ptr); GETCHAR(c, ptr); } -else c = *ptr; -#else /* no UTF-8 support */ -c = *ptr; -#endif /* SUPPORT_UTF8 */ +else +#endif /* SUPPORT_UTF */ + c = *ptr; if (type == NLTYPE_ANYCRLF) switch(c) { @@ -150,9 +166,15 @@ else switch(c) case 0x000b: /* VT */ case 0x000c: /* FF */ case 0x000d: *lenptr = 1; return TRUE; /* CR */ - case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */ +#ifdef COMPILE_PCRE8 + case 0x0085: *lenptr = utf? 2 : 1; return TRUE; /* NEL */ case 0x2028: /* LS */ case 0x2029: *lenptr = 3; return TRUE; /* PS */ +#else + case 0x0085: /* NEL */ + case 0x2028: /* LS */ + case 0x2029: *lenptr = 1; return TRUE; /* PS */ +#endif /* COMPILE_PCRE8 */ default: return FALSE; } } |