cvs: php-src(PHP_5_3) / NEWS /ext/pcre config.w32 config0.m4 /ext/pcre/pcrelib ChangeLog NEWS NON-UNIX-USE README config.h pcre.h pcre_compile.c
pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_info.c pcre_internal.h pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_ucd.c
pcre_ucp_searchfuncs.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c pcreposix.c ucp.h ucpinternal.h ucptable.h /ext/pcre/pcrelib/doc pcre.txt
/ext/pcre/pcrelib/testdata testinput1 testinput2 testinput4 testinput5 testinput6 testinput7 testinput8 testinput9 testoutput1 testoutput2 testoutput4
testoutput5 testoutput6 testoutput7 testoutput8 testoutput9
| From: | Nuno Lopes | Date: | Tue, 09 Sep 2008 07:55:11 +0000 |
| Subject: | cvs: php-src(PHP_5_3) / NEWS /ext/pcre config.w32 config0.m4 /ext/pcre/pcrelib ChangeLog NEWS NON-UNIX-USE README config.h pcre.h pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_info.c pcre_internal.h pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_ucd.c pcre_ucp_searchfuncs.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c pcreposix.c ucp.h ucpinternal.h ucptable.h /ext/pcre/pcrelib/doc pcre.txt /ext/pcre/pcrelib/testdata testinput1 testinput2 testinput4 testinput5 testinput6 testinput7 testinput8 testinput9 testoutput1 testoutput2 testoutput4 testoutput5 testoutput6 testoutput7 testoutput8 testoutput9 |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-53002@lists.php.net to get a copy of this message | ||
nlopess Tue Sep 9 07:55:11 2008 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/pcre/pcrelib pcre_ucd.c
Removed files:
/php-src/ext/pcre/pcrelib pcre_ucp_searchfuncs.c ucpinternal.h
ucptable.h
Modified files:
/php-src NEWS
/php-src/ext/pcre config.w32 config0.m4
/php-src/ext/pcre/pcrelib ChangeLog NEWS NON-UNIX-USE README
config.h pcre.h pcre_compile.c
pcre_config.c pcre_exec.c pcre_fullinfo.c
pcre_get.c pcre_info.c pcre_internal.h
pcre_ord2utf8.c pcre_refcount.c
pcre_study.c pcre_tables.c
pcre_valid_utf8.c pcre_version.c
pcre_xclass.c pcreposix.c ucp.h
/php-src/ext/pcre/pcrelib/doc pcre.txt
/php-src/ext/pcre/pcrelib/testdata testinput1 testinput2 testinput4
testinput5 testinput6 testinput7
testinput8 testinput9
testoutput1 testoutput2
testoutput4 testoutput5
testoutput6 testoutput7
testoutput8 testoutput9
Log:
upgrade to PCRE 7.8. this includes a security improvement. I'll upgrade HEAD later (not
urgent..)
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.310&r2=1.2027.2.547.2.965.2.311&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.310 php-src/NEWS:1.2027.2.547.2.965.2.311 --- php-src/NEWS:1.2027.2.547.2.965.2.310 Sun Sep 7 23:08:20 2008 +++ php-src/NEWS Tue Sep 9 07:55:07 2008 @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 200?, PHP 5.3.0 Alpha 3 +- Upgraded bundled PCRE to version 7.8. (Nuno) - Changed Soap methods error level, now it is no longer E_ERROR. (Felipe) - Fixed bug #45911 (Cannot disable ext/hash). (Arnaud) http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/config.w32?r1=1.4.2.5.2.7.2.2&r2=1.4.2.5.2.7.2.3&diff_format=u Index: php-src/ext/pcre/config.w32 diff -u php-src/ext/pcre/config.w32:1.4.2.5.2.7.2.2 php-src/ext/pcre/config.w32:1.4.2.5.2.7.2.3 --- php-src/ext/pcre/config.w32:1.4.2.5.2.7.2.2 Mon Jun 23 10:22:40 2008 +++ php-src/ext/pcre/config.w32 Tue Sep 9 07:55:07 2008 @@ -1,11 +1,11 @@ -// $Id: config.w32,v 1.4.2.5.2.7.2.2 2008/06/23 10:22:40 pajoye Exp $ +// $Id: config.w32,v 1.4.2.5.2.7.2.3 2008/09/09 07:55:07 nlopess Exp $ // vim:ft=javascript EXTENSION("pcre", "php_pcre.c", false /* never shared */, "-DNO_RECURSE -Iext/pcre/pcrelib"); -ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_ucp_searchfuncs.c pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_info.c pcre_maketables.c pcre_newline.c pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_try_flipped.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c", "pcre"); +ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_ucd.c pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_info.c pcre_maketables.c pcre_newline.c pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_try_flipped.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c", "pcre"); ADD_DEF_FILE("ext\\pcre\\php_pcre.def"); AC_DEFINE('HAVE_BUNDLED_PCRE', 1, 'Using bundled PCRE library'); AC_DEFINE('HAVE_PCRE', 1, 'Have PCRE library'); -PHP_PCRE="yes"; \ No newline at end of file +PHP_PCRE="yes"; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/config0.m4?r1=1.38.2.3.2.10.2.3&r2=1.38.2.3.2.10.2.4&diff_format=u Index: php-src/ext/pcre/config0.m4 diff -u php-src/ext/pcre/config0.m4:1.38.2.3.2.10.2.3 php-src/ext/pcre/config0.m4:1.38.2.3.2.10.2.4 --- php-src/ext/pcre/config0.m4:1.38.2.3.2.10.2.3 Mon Jun 2 14:12:20 2008 +++ php-src/ext/pcre/config0.m4 Tue Sep 9 07:55:07 2008 @@ -1,5 +1,5 @@ dnl -dnl $Id: config0.m4,v 1.38.2.3.2.10.2.3 2008/06/02 14:12:20 jani Exp $ +dnl $Id: config0.m4,v 1.38.2.3.2.10.2.4 2008/09/09 07:55:07 nlopess Exp $ dnl dnl By default we'll compile and link against the bundled PCRE library @@ -52,7 +52,7 @@ else AC_MSG_CHECKING([for PCRE library to use]) AC_MSG_RESULT([bundled]) - pcrelib_sources="pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.c \ + pcrelib_sources="pcrelib/pcre_chartables.c pcrelib/pcre_ucd.c \ pcrelib/pcre_compile.c pcrelib/pcre_config.c pcrelib/pcre_exec.c \ pcrelib/pcre_fullinfo.c pcrelib/pcre_get.c pcrelib/pcre_globals.c \ pcrelib/pcre_info.c pcrelib/pcre_maketables.c pcrelib/pcre_newline.c \ http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/ChangeLog?r1=1.12.2.1.2.5.2.4&r2=1.12.2.1.2.5.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/ChangeLog diff -u php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.5.2.4 php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.5.2.5 --- php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.5.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/ChangeLog Tue Sep 9 07:55:07 2008 @@ -1,6 +1,84 @@ ChangeLog for PCRE ------------------ +Version 7.8 05-Sep-08 +--------------------- + +1. Replaced UCP searching code with optimized version as implemented for Ad + Muncher (http://www.admuncher.com/) by Peter Kankowski. This uses a two- + stage table and inline lookup instead of a function, giving speed ups of 2 + to 5 times on some simple patterns that I tested. Permission was given to + distribute the MultiStage2.py script that generates the tables (it's not in + the tarball, but is in the Subversion repository). + +2. Updated the Unicode datatables to Unicode 5.1.0. This adds yet more + scripts. + +3. Change 12 for 7.7 introduced a bug in pcre_study() when a pattern contained + a group with a zero qualifier. The result of the study could be incorrect, + or the function might crash, depending on the pattern. + +4. Caseless matching was not working for non-ASCII characters in back + references. For example, /(\x{de})\1/8i was not matching \x{de}\x{fe}. + It now works when Unicode Property Support is available. + +5. In pcretest, an escape such as \x{de} in the data was always generating + a UTF-8 string, even in non-UTF-8 mode. Now it generates a single byte in + non-UTF-8 mode. If the value is greater than 255, it gives a warning about + truncation. + +6. Minor bugfix in pcrecpp.cc (change "" == ... to NULL == ...). + +7. Added two (int) casts to pcregrep when printing the difference of two + pointers, in case they are 64-bit values. + +8. Added comments about Mac OS X stack usage to the pcrestack man page and to + test 2 if it fails. + +9. Added PCRE_CALL_CONVENTION just before the names of all exported functions, + and a #define of that name to empty if it is not externally set. This is to + allow users of MSVC to set it if necessary. + +10. The PCRE_EXP_DEFN macro which precedes exported functions was missing from + the convenience functions in the pcre_get.c source file. + +11. An option change at the start of a pattern that had top-level alternatives + could cause overwriting and/or a crash. This command provoked a crash in + some environments: + + printf "/(?i)[\xc3\xa9\xc3\xbd]|[\xc3\xa9\xc3\xbdA]/8\n" | pcretest + + This potential security problem was recorded as CVE-2008-2371. + +12. For a pattern where the match had to start at the beginning or immediately + after a newline (e.g /.*anything/ without the DOTALL flag), pcre_exec() and + pcre_dfa_exec() could read past the end of the passed subject if there was + no match. To help with detecting such bugs (e.g. with valgrind), I modified + pcretest so that it places the subject at the end of its malloc-ed buffer. + +13. The change to pcretest in 12 above threw up a couple more cases when pcre_ + exec() might read past the end of the data buffer in UTF-8 mode. + +14. A similar bug to 7.3/2 existed when the PCRE_FIRSTLINE option was set and + the data contained the byte 0x85 as part of a UTF-8 character within its + first line. This applied both to normal and DFA matching. + +15. Lazy qualifiers were not working in some cases in UTF-8 mode. For example, + /^[^d]*?$/8 failed to match "abc". + +16. Added a missing copyright notice to pcrecpp_internal.h. + +17. Make it more clear in the documentation that values returned from + pcre_exec() in ovector are byte offsets, not character counts. + +18. Tidied a few places to stop certain compilers from issuing warnings. + +19. Updated the Virtual Pascal + BCC files to compile the latest v7.7, as + supplied by Stefan Weber. I made a further small update for 7.8 because + there is a change of source arrangements: the pcre_searchfuncs.c module is + replaced by pcre_ucd.c. + + Version 7.7 07-May-08 --------------------- http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/NEWS?r1=1.7.2.1.2.5.2.4&r2=1.7.2.1.2.5.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/NEWS diff -u php-src/ext/pcre/pcrelib/NEWS:1.7.2.1.2.5.2.4 php-src/ext/pcre/pcrelib/NEWS:1.7.2.1.2.5.2.5 --- php-src/ext/pcre/pcrelib/NEWS:1.7.2.1.2.5.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/NEWS Tue Sep 9 07:55:07 2008 @@ -2,6 +2,13 @@ ------------------------ +Release 7.8 05-Sep-08 +--------------------- + +More bug fixes, plus a performance improvement in Unicode character property +lookup. + + Release 7.7 07-May-08 --------------------- http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/NON-UNIX-USE?r1=1.7.2.1.2.3.2.3&r2=1.7.2.1.2.3.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/NON-UNIX-USE diff -u php-src/ext/pcre/pcrelib/NON-UNIX-USE:1.7.2.1.2.3.2.3 php-src/ext/pcre/pcrelib/NON-UNIX-USE:1.7.2.1.2.3.2.4 --- php-src/ext/pcre/pcrelib/NON-UNIX-USE:1.7.2.1.2.3.2.3 Tue Jan 29 20:18:01 2008 +++ php-src/ext/pcre/pcrelib/NON-UNIX-USE Tue Sep 9 07:55:07 2008 @@ -85,8 +85,6 @@ pcre_internal.h ucp.h - ucpinternal.h - ucptable.h (5) Also ensure that you have the following file, which is #included as source when building a debugging version of PCRE, and is also used by pcretest. @@ -113,7 +111,7 @@ pcre_study.c pcre_tables.c pcre_try_flipped.c - pcre_ucp_searchfuncs.c + pcre_ucd.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c @@ -190,6 +188,17 @@ __declspec(dllimport), with unwanted results. +CALLING CONVENTIONS IN WINDOWS ENVIRONMENTS + +It is possible to compile programs to use different calling conventions using +MSVC. Search the web for "calling conventions" for more information. To make it +easier to change the calling convention for the exported functions in the +PCRE library, the macro PCRE_CALL_CONVENTION is present in all the external +definitions. It can be set externally when compiling (e.g. in CFLAGS). If it is +not set, it defaults to empty; the default calling convention is then used +(which is what is wanted most of the time). + + COMMENTS ABOUT WIN32 BUILDS (see also "BUILDING PCRE WITH CMAKE" below) There are two ways of building PCRE using the "configure, make, make install" @@ -428,5 +437,5 @@ $! ========================= -Last Updated: 25 January 2008 +Last Updated: 05 September 2008 **** http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/README?r1=1.11.2.1.2.3.2.4&r2=1.11.2.1.2.3.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/README diff -u php-src/ext/pcre/pcrelib/README:1.11.2.1.2.3.2.4 php-src/ext/pcre/pcrelib/README:1.11.2.1.2.3.2.5 --- php-src/ext/pcre/pcrelib/README:1.11.2.1.2.3.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/README Tue Sep 9 07:55:08 2008 @@ -1,9 +1,12 @@ README file for PCRE (Perl-compatible regular expression library) ----------------------------------------------------------------- -The latest release of PCRE is always available from +The latest release of PCRE is always available in three alternative formats +from: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.gz + ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.bz2 + ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.zip There is a mailing list for discussion about the development of PCRE at @@ -640,7 +643,7 @@ pcre_study.c ) pcre_tables.c ) pcre_try_flipped.c ) - pcre_ucp_searchfuncs.c ) + pcre_ucd.c ) pcre_valid_utf8.c ) pcre_version.c ) pcre_xclass.c ) @@ -649,9 +652,7 @@ pcre.h.in template for pcre.h when built by "configure" pcreposix.h header for the external POSIX wrapper API pcre_internal.h header for internal use - ucp.h ) headers concerned with - ucpinternal.h ) Unicode property handling - ucptable.h ) (this one is the data table) + ucp.h header for Unicode property handling config.h.in template for config.h, which is built by "configure" @@ -725,6 +726,9 @@ (D) Auxiliary files for cmake support + cmake/COPYING-CMAKE-SCRIPTS + cmake/FindPackageHandleStandardArgs.cmake + cmake/FindReadline.cmake CMakeLists.txt config-cmake.h.in @@ -749,4 +753,4 @@ Philip Hazel Email local part: ph10 Email domain: cam.ac.uk -Last updated: 13 April 2008 +Last updated: 05 September 2008 http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/config.h?r1=1.2.2.4.2.4&r2=1.2.2.4.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/config.h diff -u php-src/ext/pcre/pcrelib/config.h:1.2.2.4.2.4 php-src/ext/pcre/pcrelib/config.h:1.2.2.4.2.5 --- php-src/ext/pcre/pcrelib/config.h:1.2.2.4.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/config.h Tue Sep 9 07:55:08 2008 @@ -249,13 +249,13 @@ #define PACKAGE_NAME "PCRE" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "PCRE 7.7" +#define PACKAGE_STRING "PCRE 7.8" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "pcre" /* Define to the version of this package. */ -#define PACKAGE_VERSION "7.7" +#define PACKAGE_VERSION "7.8" /* If you are compiling for a system other than a Unix-like system or @@ -308,7 +308,7 @@ /* Version number of package */ #ifndef VERSION -#define VERSION "7.7" +#define VERSION "7.8" #endif /* Define to empty if `const' does not conform to ANSI C. */ http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre.h?r1=1.18.2.1.2.7.2.4&r2=1.18.2.1.2.7.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre.h diff -u php-src/ext/pcre/pcrelib/pcre.h:1.18.2.1.2.7.2.4 php-src/ext/pcre/pcrelib/pcre.h:1.18.2.1.2.7.2.5 --- php-src/ext/pcre/pcrelib/pcre.h:1.18.2.1.2.7.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/pcre.h Tue Sep 9 07:55:08 2008 @@ -42,9 +42,9 @@ /* The current PCRE version information. */ #define PCRE_MAJOR 7 -#define PCRE_MINOR 7 +#define PCRE_MINOR 8 #define PCRE_PRERELEASE -#define PCRE_DATE 2008-05-07 +#define PCRE_DATE 2008-09-05 /* When an application links to a PCRE DLL in Windows, the symbols that are imported have to be identified as such. When building PCRE, the appropriate http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_compile.c?r1=1.1.2.1.2.6.2.5&r2=1.1.2.1.2.6.2.6&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_compile.c diff -u php-src/ext/pcre/pcrelib/pcre_compile.c:1.1.2.1.2.6.2.5 php-src/ext/pcre/pcrelib/pcre_compile.c:1.1.2.1.2.6.2.6 --- php-src/ext/pcre/pcrelib/pcre_compile.c:1.1.2.1.2.6.2.5 Sun Jul 6 15:23:31 2008 +++ php-src/ext/pcre/pcrelib/pcre_compile.c Tue Sep 9 07:55:08 2008 @@ -453,7 +453,7 @@ find_error_text(int n) { const char *s = error_texts; -for (; n > 0; n--) while (*s++ != 0); +for (; n > 0; n--) while (*s++ != 0) {}; return s; } @@ -1000,7 +1000,7 @@ if (*(++ptr) == 0) return -1; if (*ptr == 'Q') for (;;) { - while (*(++ptr) != 0 && *ptr != '\\'); + while (*(++ptr) != 0 && *ptr != '\\') {}; if (*ptr == 0) return -1; if (*(++ptr) == 'E') break; } @@ -1043,7 +1043,7 @@ if (*(++ptr) == 0) return -1; if (*ptr == 'Q') for (;;) { - while (*(++ptr) != 0 && *ptr != '\\'); + while (*(++ptr) != 0 && *ptr != '\\') {}; if (*ptr == 0) return -1; if (*(++ptr) == 'E') break; } @@ -1057,7 +1057,7 @@ if (xmode && *ptr == '#') { - while (*(++ptr) != 0 && *ptr != '\n'); + while (*(++ptr) != 0 && *ptr != '\n') {}; if (*ptr == 0) return -1; continue; } @@ -1448,6 +1448,8 @@ if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f]; break; } +#else + (void)(utf8); /* Keep compiler happy by referencing function argument */ #endif } } @@ -1541,6 +1543,8 @@ if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f]; break; } +#else + (void)(utf8); /* Keep compiler happy by referencing function argument */ #endif } } @@ -2013,7 +2017,7 @@ unsigned int c, othercase, next; for (c = *cptr; c <= d; c++) - { if ((othercase = _pcre_ucp_othercase(c)) != NOTACHAR) break; } + { if ((othercase = UCD_OTHERCASE(c)) != c) break; } if (c > d) return FALSE; @@ -2022,7 +2026,7 @@ for (++c; c <= d; c++) { - if (_pcre_ucp_othercase(c) != next) break; + if (UCD_OTHERCASE(c) != next) break; next++; } @@ -2132,6 +2136,8 @@ case OP_CHAR: #ifdef SUPPORT_UTF8 if (utf8 && item > 127) { GETCHAR(item, utf8_char); } +#else + (void)(utf8_char); /* Keep compiler happy by referencing function argument */ #endif return item != next; @@ -2150,7 +2156,7 @@ unsigned int othercase; if (next < 128) othercase = cd->fcc[next]; else #ifdef SUPPORT_UCP - othercase = _pcre_ucp_othercase((unsigned int)next); + othercase = UCD_OTHERCASE((unsigned int)next); #else othercase = NOTACHAR; #endif @@ -2171,7 +2177,7 @@ unsigned int othercase; if (next < 128) othercase = cd->fcc[next]; else #ifdef SUPPORT_UCP - othercase = _pcre_ucp_othercase(next); + othercase = UCD_OTHERCASE(next); #else othercase = NOTACHAR; #endif @@ -3337,7 +3343,7 @@ if ((options & PCRE_CASELESS) != 0) { unsigned int othercase; - if ((othercase = _pcre_ucp_othercase(c)) != NOTACHAR) + if ((othercase = UCD_OTHERCASE(c)) != c) { *class_utf8data++ = XCL_SINGLE; class_utf8data += _pcre_ord2utf8(othercase, class_utf8data); @@ -4214,7 +4220,7 @@ const char *vn = verbnames; const uschar *name = ++ptr; previous = NULL; - while ((cd->ctypes[*++ptr] & ctype_letter) != 0); + while ((cd->ctypes[*++ptr] & ctype_letter) != 0) {}; if (*ptr == ':') { *errorcodeptr = ERR59; /* Not supported */ @@ -4918,10 +4924,8 @@ both phases. If we are not at the pattern start, compile code to change the ims - options if this setting actually changes any of them. We also pass the - new setting back so that it can be put at the start of any following - branches, and when this group ends (if we are in a group), a resetting - item can be compiled. */ + options if this setting actually changes any of them, and reset the + greedy defaults and the case value for firstbyte and reqbyte. */ if (*ptr == ')') { @@ -4929,7 +4933,6 @@ (lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE)) { cd->external_options = newoptions; - options = *optionsptr = newoptions; } else { @@ -4938,17 +4941,17 @@ *code++ = OP_OPT; *code++ = newoptions & PCRE_IMS; } - - /* Change options at this level, and pass them back for use - in subsequent branches. Reset the greedy defaults and the case - value for firstbyte and reqbyte. */ - - *optionsptr = options = newoptions; greedy_default = ((newoptions & PCRE_UNGREEDY) != 0); greedy_non_default = greedy_default ^ 1; - req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0; + req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS : 0; } + /* Change options at this level, and pass them back for use + in subsequent branches. When not at the start of the pattern, this + information is also necessary so that a resetting item can be + compiled at the end of a group (if we are in a group). */ + + *optionsptr = options = newoptions; previous = NULL; /* This item can't be repeated */ continue; /* It is complete */ } @@ -5942,7 +5945,7 @@ with errorptr and erroroffset set */ -PCRE_EXP_DEFN pcre * +PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION pcre_compile(const char *pattern, int options, const char **errorptr, int *erroroffset, const unsigned char *tables) { @@ -5950,7 +5953,7 @@ } -PCRE_EXP_DEFN pcre * +PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION pcre_compile2(const char *pattern, int options, int *errorcodeptr, const char **errorptr, int *erroroffset, const unsigned char *tables) { http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_config.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_config.c diff -u php-src/ext/pcre/pcrelib/pcre_config.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_config.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_config.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_config.c Tue Sep 9 07:55:08 2008 @@ -60,7 +60,7 @@ Returns: 0 if data returned, negative on error */ -PCRE_EXP_DEFN int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_config(int what, void *where) { switch (what) http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_exec.c?r1=1.1.2.1.2.7.2.4&r2=1.1.2.1.2.7.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_exec.c diff -u php-src/ext/pcre/pcrelib/pcre_exec.c:1.1.2.1.2.7.2.4 php-src/ext/pcre/pcrelib/pcre_exec.c:1.1.2.1.2.7.2.5 --- php-src/ext/pcre/pcrelib/pcre_exec.c:1.1.2.1.2.7.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/pcre_exec.c Tue Sep 9 07:55:08 2008 @@ -156,13 +156,39 @@ if (length > md->end_subject - eptr) return FALSE; -/* Separate the caselesss case for speed */ +/* Separate the caseless case for speed. In UTF-8 mode we can only do this +properly if Unicode properties are supported. Otherwise, we can check only +ASCII characters. */ if ((ims & PCRE_CASELESS) != 0) { +#ifdef SUPPORT_UTF8 +#ifdef SUPPORT_UCP + if (md->utf8) + { + USPTR endptr = eptr + length; + while (eptr < endptr) + { + int c, d; + GETCHARINC(c, eptr); + GETCHARINC(d, p); + if (c != d && c != UCD_OTHERCASE(d)) return FALSE; + } + } + else +#endif +#endif + + /* The same code works when not in UTF-8 mode and in UTF-8 mode when there + is no UCP support. */ + while (length-- > 0) - if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE; + { if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE; } } + +/* In the caseful case, we can just compare the bytes, whether or not we +are in UTF-8 mode. */ + else { while (length-- > 0) if (*p++ != *eptr++) return FALSE; } @@ -1651,8 +1677,7 @@ if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); { - int chartype, script; - int category = _pcre_ucp_findprop(c, &chartype, &script); + const ucd_record * prop = GET_UCD(c); switch(ecode[1]) { @@ -1661,24 +1686,24 @@ break; case PT_LAMP: - if ((chartype == ucp_Lu || - chartype == ucp_Ll || - chartype == ucp_Lt) == (op == OP_NOTPROP)) + if ((prop->chartype == ucp_Lu || + prop->chartype == ucp_Ll || + prop->chartype == ucp_Lt) == (op == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); break; case PT_GC: - if ((ecode[2] != category) == (op == OP_PROP)) + if ((ecode[2] != _pcre_ucp_gentype[prop->chartype]) == (op == OP_PROP)) RRETURN(MATCH_NOMATCH); break; case PT_PC: - if ((ecode[2] != chartype) == (op == OP_PROP)) + if ((ecode[2] != prop->chartype) == (op == OP_PROP)) RRETURN(MATCH_NOMATCH); break; case PT_SC: - if ((ecode[2] != script) == (op == OP_PROP)) + if ((ecode[2] != prop->script) == (op == OP_PROP)) RRETURN(MATCH_NOMATCH); break; @@ -1697,8 +1722,7 @@ if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); { - int chartype, script; - int category = _pcre_ucp_findprop(c, &chartype, &script); + int category = UCD_CATEGORY(c); if (category == ucp_M) RRETURN(MATCH_NOMATCH); while (eptr < md->end_subject) { @@ -1707,7 +1731,7 @@ { GETCHARLEN(c, eptr, len); } - category = _pcre_ucp_findprop(c, &chartype, &script); + category = UCD_CATEGORY(c); if (category != ucp_M) break; eptr += len; } @@ -2172,7 +2196,7 @@ if (fc != dc) { #ifdef SUPPORT_UCP - if (dc != _pcre_ucp_othercase(fc)) + if (dc != UCD_OTHERCASE(fc)) #endif RRETURN(MATCH_NOMATCH); } @@ -2263,7 +2287,7 @@ #ifdef SUPPORT_UCP unsigned int othercase; if ((ims & PCRE_CASELESS) != 0 && - (othercase = _pcre_ucp_othercase(fc)) != NOTACHAR) + (othercase = UCD_OTHERCASE(fc)) != fc) oclength = _pcre_ord2utf8(othercase, occhars); else oclength = 0; #endif /* SUPPORT_UCP */ @@ -2583,10 +2607,11 @@ { RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28); if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(d, eptr); if (d < 256) d = md->lcc[d]; - if (fi >= max || eptr >= md->end_subject || fc == d) - RRETURN(MATCH_NOMATCH); + if (fc == d) RRETURN(MATCH_NOMATCH); + } } else @@ -2692,9 +2717,9 @@ { RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32); if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(d, eptr); - if (fi >= max || eptr >= md->end_subject || fc == d) - RRETURN(MATCH_NOMATCH); + if (fc == d) RRETURN(MATCH_NOMATCH); } } else @@ -2868,7 +2893,7 @@ { if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == ucp_Lu || prop_chartype == ucp_Ll || prop_chartype == ucp_Lt) == prop_fail_result) @@ -2881,7 +2906,7 @@ { if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if ((prop_category == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -2892,7 +2917,7 @@ { if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -2903,7 +2928,7 @@ { if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_script = UCD_SCRIPT(c); if ((prop_script == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -2922,7 +2947,7 @@ for (i = 1; i <= min; i++) { GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); while (eptr < md->end_subject) { @@ -2931,7 +2956,7 @@ { GETCHARLEN(c, eptr, len); } - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category != ucp_M) break; eptr += len; } @@ -3347,7 +3372,7 @@ if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == ucp_Lu || prop_chartype == ucp_Ll || prop_chartype == ucp_Lt) == prop_fail_result) @@ -3362,7 +3387,7 @@ if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if ((prop_category == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -3375,7 +3400,7 @@ if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -3388,7 +3413,7 @@ if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_script = UCD_SCRIPT(c); if ((prop_script == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -3410,7 +3435,7 @@ if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); while (eptr < md->end_subject) { @@ -3419,7 +3444,7 @@ { GETCHARLEN(c, eptr, len); } - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category != ucp_M) break; eptr += len; } @@ -3737,7 +3762,7 @@ int len = 1; if (eptr >= md->end_subject) break; GETCHARLEN(c, eptr, len); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == ucp_Lu || prop_chartype == ucp_Ll || prop_chartype == ucp_Lt) == prop_fail_result) @@ -3752,7 +3777,7 @@ int len = 1; if (eptr >= md->end_subject) break; GETCHARLEN(c, eptr, len); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if ((prop_category == prop_value) == prop_fail_result) break; eptr+= len; @@ -3765,7 +3790,7 @@ int len = 1; if (eptr >= md->end_subject) break; GETCHARLEN(c, eptr, len); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == prop_value) == prop_fail_result) break; eptr+= len; @@ -3778,7 +3803,7 @@ int len = 1; if (eptr >= md->end_subject) break; GETCHARLEN(c, eptr, len); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_script = UCD_SCRIPT(c); if ((prop_script == prop_value) == prop_fail_result) break; eptr+= len; @@ -3807,7 +3832,7 @@ { if (eptr >= md->end_subject) break; GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category == ucp_M) break; while (eptr < md->end_subject) { @@ -3816,7 +3841,7 @@ { GETCHARLEN(c, eptr, len); } - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category != ucp_M) break; eptr += len; } @@ -3838,7 +3863,7 @@ BACKCHAR(eptr); GETCHARLEN(c, eptr, len); } - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category != ucp_M) break; eptr--; } @@ -4358,7 +4383,7 @@ < -1 => some kind of unexpected problem */ -PCRE_EXP_DEFN int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, PCRE_SPTR subject, int length, int start_offset, int options, int *offsets, int offsetcount) @@ -4670,31 +4695,53 @@ if (firstline) { USPTR t = start_match; +#ifdef SUPPORT_UTF8 + if (utf8) + { + while (t < md->end_subject && !IS_NEWLINE(t)) + { + t++; + while (t < end_subject && (*t & 0xc0) == 0x80) t++; + } + } + else +#endif while (t < md->end_subject && !IS_NEWLINE(t)) t++; end_subject = t; } - /* Now test for a unique first byte */ + /* Now advance to a unique first byte if there is one. */ if (first_byte >= 0) { if (first_byte_caseless) - while (start_match < end_subject && - md->lcc[*start_match] != first_byte) - { NEXTCHAR(start_match); } + while (start_match < end_subject && md->lcc[*start_match] != first_byte) + start_match++; else while (start_match < end_subject && *start_match != first_byte) - { NEXTCHAR(start_match); } + start_match++; } - /* Or to just after a linebreak for a multiline match if possible */ + /* Or to just after a linebreak for a multiline match */ else if (startline) { if (start_match > md->start_subject + start_offset) { - while (start_match <= end_subject && !WAS_NEWLINE(start_match)) - { NEXTCHAR(start_match); } +#ifdef SUPPORT_UTF8 + if (utf8) + { + while (start_match < end_subject && !WAS_NEWLINE(start_match)) + { + start_match++; + while(start_match < end_subject && (*start_match & 0xc0) == 0x80) + start_match++; + } + } + else +#endif + while (start_match < end_subject && !WAS_NEWLINE(start_match)) + start_match++; /* If we have just passed a CR and the newline option is ANY or ANYCRLF, and we are now at a LF, advance the match position by one more character. @@ -4708,16 +4755,15 @@ } } - /* Or to a non-unique first char after study */ + /* Or to a non-unique first byte after study */ else if (start_bits != NULL) { while (start_match < end_subject) { register unsigned int c = *start_match; - if ((start_bits[c/8] & (1 << (c&7))) == 0) - { NEXTCHAR(start_match); } - else break; + if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++; + else break; } } http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_fullinfo.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_fullinfo.c diff -u php-src/ext/pcre/pcrelib/pcre_fullinfo.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_fullinfo.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_fullinfo.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_fullinfo.c Tue Sep 9 07:55:08 2008 @@ -63,7 +63,7 @@ Returns: 0 if data returned, negative on error */ -PCRE_EXP_DEFN int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what, void *where) { http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_get.c?r1=1.1.2.1.2.6.2.2&r2=1.1.2.1.2.6.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_get.c diff -u php-src/ext/pcre/pcrelib/pcre_get.c:1.1.2.1.2.6.2.2 php-src/ext/pcre/pcrelib/pcre_get.c:1.1.2.1.2.6.2.3 --- php-src/ext/pcre/pcrelib/pcre_get.c:1.1.2.1.2.6.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_get.c Tue Sep 9 07:55:08 2008 @@ -63,7 +63,7 @@ (PCRE_ERROR_NOSUBSTRING) if not found */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_stringnumber(const pcre *code, const char *stringname) { int rc; @@ -112,7 +112,7 @@ (PCRE_ERROR_NOSUBSTRING) if not found */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_stringtable_entries(const pcre *code, const char *stringname, char **firstptr, char **lastptr) { @@ -229,7 +229,7 @@ PCRE_ERROR_NOSUBSTRING (-7) no such captured substring */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int size) { @@ -274,7 +274,7 @@ PCRE_ERROR_NOSUBSTRING (-7) no such captured substring */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int size) { @@ -306,7 +306,7 @@ PCRE_ERROR_NOMEMORY (-6) failed to get store */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_substring_list(const char *subject, int *ovector, int stringcount, const char ***listptr) { @@ -351,7 +351,7 @@ Returns: nothing */ -void +PCRE_EXP_DEFN void PCRE_CALL_CONVENTION pcre_free_substring_list(const char **pointer) { (pcre_free)((void *)pointer); @@ -384,7 +384,7 @@ PCRE_ERROR_NOSUBSTRING (-7) substring not present */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_substring(const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr) { @@ -431,7 +431,7 @@ PCRE_ERROR_NOSUBSTRING (-7) no such captured substring */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, const char **stringptr) { @@ -454,7 +454,7 @@ Returns: nothing */ -void +PCRE_EXP_DEFN void PCRE_CALL_CONVENTION pcre_free_substring(const char *pointer) { (pcre_free)((void *)pointer); http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_info.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_info.c diff -u php-src/ext/pcre/pcrelib/pcre_info.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_info.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_info.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_info.c Tue Sep 9 07:55:08 2008 @@ -70,7 +70,7 @@ or negative values on error */ -PCRE_EXP_DEFN int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_info(const pcre *argument_re, int *optptr, int *first_byte) { real_pcre internal_re; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_internal.h?r1=1.1.2.1.2.5.2.4&r2=1.1.2.1.2.5.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_internal.h diff -u php-src/ext/pcre/pcrelib/pcre_internal.h:1.1.2.1.2.5.2.4 php-src/ext/pcre/pcrelib/pcre_internal.h:1.1.2.1.2.5.2.5 --- php-src/ext/pcre/pcrelib/pcre_internal.h:1.1.2.1.2.5.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/pcre_internal.h Tue Sep 9 07:55:08 2008 @@ -132,6 +132,20 @@ # endif #endif +/* When compiling with the MSVC compiler, it is sometimes necessary to include +a "calling convention" before exported function names. (This is secondhand +information; I know nothing about MSVC myself). For example, something like + + void __cdecl function(....) + +might be needed. In order so make this easy, all the exported functions have +PCRE_CALL_CONVENTION just before their names. It is rarely needed; if not +set, we ensure here that it has no effect. */ + +#ifndef PCRE_CALL_CONVENTION +#define PCRE_CALL_CONVENTION +#endif + /* We need to have types that specify unsigned 16-bit and 32-bit integers. We cannot determine these outside the compilation (e.g. by running a program as part of "configure") because PCRE is often cross-compiled for use on other @@ -140,16 +154,20 @@ #if USHRT_MAX == 65535 typedef unsigned short pcre_uint16; + typedef short pcre_int16; #elif UINT_MAX == 65535 typedef unsigned int pcre_uint16; + typedef int pcre_int16; #else #error Cannot determine a type for 16-bit unsigned integers #endif #if UINT_MAX == 4294967295 typedef unsigned int pcre_uint32; + typedef int pcre_int32; #elif ULONG_MAX == 4294967295 typedef unsigned long int pcre_uint32; + typedef long int pcre_int32; #else #error Cannot determine a type for 32-bit unsigned integers #endif @@ -363,7 +381,6 @@ support is omitted, we don't even define it. */ #ifndef SUPPORT_UTF8 -#define NEXTCHAR(p) p++; #define GETCHAR(c, eptr) c = *eptr; #define GETCHARTEST(c, eptr) c = *eptr; #define GETCHARINC(c, eptr) c = *eptr++; @@ -373,13 +390,6 @@ #else /* SUPPORT_UTF8 */ -/* Advance a character pointer one byte in non-UTF-8 mode and by one character -in UTF-8 mode. */ - -#define NEXTCHAR(p) \ - p++; \ - if (utf8) { while((*p & 0xc0) == 0x80) p++; } - /* Get the next UTF-8 character, not advancing the pointer. This is called when we know we are in UTF-8 mode. */ @@ -549,12 +559,15 @@ #define REQ_CASELESS 0x0100 /* indicates caselessness */ #define REQ_VARY 0x0200 /* reqbyte followed non-literal item */ -/* Miscellaneous definitions */ +/* Miscellaneous definitions. The #ifndef is to pacify compiler warnings in +environments where these macros are defined elsewhere. */ +#ifndef FALSE typedef int BOOL; #define FALSE 0 #define TRUE 1 +#endif /* Escape items that are just an encoding of a particular data value. */ @@ -1126,13 +1139,38 @@ extern int _pcre_ord2utf8(int, uschar *); extern real_pcre *_pcre_try_flipped(const real_pcre *, real_pcre *, const pcre_study_data *, pcre_study_data *); -extern int _pcre_ucp_findprop(const unsigned int, int *, int *); -extern unsigned int _pcre_ucp_othercase(const unsigned int); extern int _pcre_valid_utf8(const uschar *, int); extern BOOL _pcre_was_newline(const uschar *, int, const uschar *, int *, BOOL); extern BOOL _pcre_xclass(int, const uschar *); + +/* Unicode character database (UCD) */ + +typedef struct { + uschar script; + uschar chartype; + pcre_int32 other_case; +} ucd_record; + +extern const ucd_record _pcre_ucd_records[]; +extern const uschar _pcre_ucd_stage1[]; +extern const pcre_uint16 _pcre_ucd_stage2[]; +extern const int _pcre_ucp_gentype[]; + + +/* UCD access macros */ + +#define UCD_BLOCK_SIZE 128 +#define GET_UCD(ch) (_pcre_ucd_records + \ + _pcre_ucd_stage2[_pcre_ucd_stage1[(ch) / UCD_BLOCK_SIZE] * \ + UCD_BLOCK_SIZE + ch % UCD_BLOCK_SIZE]) + +#define UCD_CHARTYPE(ch) GET_UCD(ch)->chartype +#define UCD_SCRIPT(ch) GET_UCD(ch)->script +#define UCD_CATEGORY(ch) _pcre_ucp_gentype[UCD_CHARTYPE(ch)] +#define UCD_OTHERCASE(ch) (ch + GET_UCD(ch)->other_case) + #endif /* End of pcre_internal.h */ http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_ord2utf8.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_ord2utf8.c diff -u php-src/ext/pcre/pcrelib/pcre_ord2utf8.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_ord2utf8.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_ord2utf8.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_ord2utf8.c Tue Sep 9 07:55:08 2008 @@ -76,8 +76,10 @@ *buffer = _pcre_utf8_table2[i] | cvalue; return i + 1; #else -return 0; /* Keep compiler happy; this function won't ever be */ -#endif /* called when SUPPORT_UTF8 is not defined. */ +(void)(cvalue); /* Keep compiler happy; this function won't ever be */ +(void)(buffer); /* called when SUPPORT_UTF8 is not defined. */ +return 0; +#endif } /* End of pcre_ord2utf8.c */ http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_refcount.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_refcount.c diff -u php-src/ext/pcre/pcrelib/pcre_refcount.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_refcount.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_refcount.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_refcount.c Tue Sep 9 07:55:08 2008 @@ -66,7 +66,7 @@ a negative error number */ -PCRE_EXP_DEFN int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_refcount(pcre *argument_re, int adjust) { real_pcre *re = (real_pcre *)argument_re; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_study.c?r1=1.1.2.1.2.6.2.3&r2=1.1.2.1.2.6.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_study.c diff -u php-src/ext/pcre/pcrelib/pcre_study.c:1.1.2.1.2.6.2.3 php-src/ext/pcre/pcrelib/pcre_study.c:1.1.2.1.2.6.2.4 --- php-src/ext/pcre/pcrelib/pcre_study.c:1.1.2.1.2.6.2.3 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/pcre_study.c Tue Sep 9 07:55:08 2008 @@ -218,6 +218,7 @@ /* SKIPZERO skips the bracket. */ case OP_SKIPZERO: + tcode++; do tcode += GET(tcode,1); while (*tcode == OP_ALT); tcode += 1 + LINK_SIZE; break; @@ -501,7 +502,7 @@ NULL on error or if no optimization possible */ -PCRE_EXP_DEFN pcre_extra * +PCRE_EXP_DEFN pcre_extra * PCRE_CALL_CONVENTION pcre_study(const pcre *external_re, int options, const char **errorptr) { uschar start_bits[32]; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_tables.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_tables.c diff -u php-src/ext/pcre/pcrelib/pcre_tables.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_tables.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_tables.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_tables.c Tue Sep 9 07:55:08 2008 @@ -85,6 +85,19 @@ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; +/* Table to translate from particular type value to the general value. */ + +const int _pcre_ucp_gentype[] = { + ucp_C, ucp_C, ucp_C, ucp_C, ucp_C, /* Cc, Cf, Cn, Co, Cs */ + ucp_L, ucp_L, ucp_L, ucp_L, ucp_L, /* Ll, Lu, Lm, Lo, Lt */ + ucp_M, ucp_M, ucp_M, /* Mc, Me, Mn */ + ucp_N, ucp_N, ucp_N, /* Nd, Nl, No */ + ucp_P, ucp_P, ucp_P, ucp_P, ucp_P, /* Pc, Pd, Pe, Pf, Pi */ + ucp_P, ucp_P, /* Ps, Po */ + ucp_S, ucp_S, ucp_S, ucp_S, /* Sc, Sk, Sm, So */ + ucp_Z, ucp_Z, ucp_Z /* Zl, Zp, Zs */ +}; + /* The pcre_utt[] table below translates Unicode property names into type and code values. It is searched by binary chop, so must be in collating sequence of name. Originally, the table contained pointers to the name strings in the first @@ -92,7 +105,10 @@ a shared library is dynamically loaded. A significant reduction is made by putting all the names into a single, large string and then using offsets in the table itself. Maintenance is more error-prone, but frequent changes to this -data is unlikely. */ +data are unlikely. + +July 2008: There is now a script called maint/GenerateUtt.py which can be used +to generate this data instead of maintaining it entirely by hand. */ const char _pcre_utt_names[] = "Any\0" @@ -106,8 +122,10 @@ "Buhid\0" "C\0" "Canadian_Aboriginal\0" + "Carian\0" "Cc\0" "Cf\0" + "Cham\0" "Cherokee\0" "Cn\0" "Co\0" @@ -134,12 +152,14 @@ "Inherited\0" "Kannada\0" "Katakana\0" + "Kayah_Li\0" "Kharoshthi\0" "Khmer\0" "L\0" "L&\0" "Lao\0" "Latin\0" + "Lepcha\0" "Limbu\0" "Linear_B\0" "Ll\0" @@ -147,6 +167,8 @@ "Lo\0" "Lt\0" "Lu\0" + "Lycian\0" + "Lydian\0" "M\0" "Malayalam\0" "Mc\0" @@ -161,6 +183,7 @@ "Nl\0" "No\0" "Ogham\0" + "Ol_Chiki\0" "Old_Italic\0" "Old_Persian\0" "Oriya\0" @@ -175,14 +198,17 @@ "Pi\0" "Po\0" "Ps\0" + "Rejang\0" "Runic\0" "S\0" + "Saurashtra\0" "Sc\0" "Shavian\0" "Sinhala\0" "Sk\0" "Sm\0" "So\0" + "Sundanese\0" "Syloti_Nagri\0" "Syriac\0" "Tagalog\0" @@ -195,6 +221,7 @@ "Tibetan\0" "Tifinagh\0" "Ugaritic\0" + "Vai\0" "Yi\0" "Z\0" "Zl\0" @@ -202,111 +229,122 @@ "Zs\0"; const ucp_type_table _pcre_utt[] = { - { 0, PT_ANY, 0 }, - { 4, PT_SC, ucp_Arabic }, - { 11, PT_SC, ucp_Armenian }, - { 20, PT_SC, ucp_Balinese }, - { 29, PT_SC, ucp_Bengali }, - { 37, PT_SC, ucp_Bopomofo }, - { 46, PT_SC, ucp_Braille }, - { 54, PT_SC, ucp_Buginese }, - { 63, PT_SC, ucp_Buhid }, - { 69, PT_GC, ucp_C }, - { 71, PT_SC, ucp_Canadian_Aboriginal }, - { 91, PT_PC, ucp_Cc }, - { 94, PT_PC, ucp_Cf }, - { 97, PT_SC, ucp_Cherokee }, - { 106, PT_PC, ucp_Cn }, - { 109, PT_PC, ucp_Co }, - { 112, PT_SC, ucp_Common }, - { 119, PT_SC, ucp_Coptic }, - { 126, PT_PC, ucp_Cs }, - { 129, PT_SC, ucp_Cuneiform }, - { 139, PT_SC, ucp_Cypriot }, - { 147, PT_SC, ucp_Cyrillic }, - { 156, PT_SC, ucp_Deseret }, - { 164, PT_SC, ucp_Devanagari }, - { 175, PT_SC, ucp_Ethiopic }, - { 184, PT_SC, ucp_Georgian }, - { 193, PT_SC, ucp_Glagolitic }, - { 204, PT_SC, ucp_Gothic }, - { 211, PT_SC, ucp_Greek }, - { 217, PT_SC, ucp_Gujarati }, - { 226, PT_SC, ucp_Gurmukhi }, - { 235, PT_SC, ucp_Han }, - { 239, PT_SC, ucp_Hangul }, - { 246, PT_SC, ucp_Hanunoo }, - { 254, PT_SC, ucp_Hebrew }, - { 261, PT_SC, ucp_Hiragana }, - { 270, PT_SC, ucp_Inherited }, - { 280, PT_SC, ucp_Kannada }, - { 288, PT_SC, ucp_Katakana }, - { 297, PT_SC, ucp_Kharoshthi }, - { 308, PT_SC, ucp_Khmer }, - { 314, PT_GC, ucp_L }, - { 316, PT_LAMP, 0 }, - { 319, PT_SC, ucp_Lao }, - { 323, PT_SC, ucp_Latin }, - { 329, PT_SC, ucp_Limbu }, - { 335, PT_SC, ucp_Linear_B }, - { 344, PT_PC, ucp_Ll }, - { 347, PT_PC, ucp_Lm }, - { 350, PT_PC, ucp_Lo }, - { 353, PT_PC, ucp_Lt }, - { 356, PT_PC, ucp_Lu }, - { 359, PT_GC, ucp_M }, - { 361, PT_SC, ucp_Malayalam }, - { 371, PT_PC, ucp_Mc }, - { 374, PT_PC, ucp_Me }, - { 377, PT_PC, ucp_Mn }, - { 380, PT_SC, ucp_Mongolian }, - { 390, PT_SC, ucp_Myanmar }, - { 398, PT_GC, ucp_N }, - { 400, PT_PC, ucp_Nd }, - { 403, PT_SC, ucp_New_Tai_Lue }, - { 415, PT_SC, ucp_Nko }, - { 419, PT_PC, ucp_Nl }, - { 422, PT_PC, ucp_No }, - { 425, PT_SC, ucp_Ogham }, - { 431, PT_SC, ucp_Old_Italic }, - { 442, PT_SC, ucp_Old_Persian }, - { 454, PT_SC, ucp_Oriya }, - { 460, PT_SC, ucp_Osmanya }, - { 468, PT_GC, ucp_P }, - { 470, PT_PC, ucp_Pc }, - { 473, PT_PC, ucp_Pd }, - { 476, PT_PC, ucp_Pe }, - { 479, PT_PC, ucp_Pf }, - { 482, PT_SC, ucp_Phags_Pa }, - { 491, PT_SC, ucp_Phoenician }, - { 502, PT_PC, ucp_Pi }, - { 505, PT_PC, ucp_Po }, - { 508, PT_PC, ucp_Ps }, - { 511, PT_SC, ucp_Runic }, - { 517, PT_GC, ucp_S }, - { 519, PT_PC, ucp_Sc }, - { 522, PT_SC, ucp_Shavian }, - { 530, PT_SC, ucp_Sinhala }, - { 538, PT_PC, ucp_Sk }, - { 541, PT_PC, ucp_Sm }, - { 544, PT_PC, ucp_So }, - { 547, PT_SC, ucp_Syloti_Nagri }, - { 560, PT_SC, ucp_Syriac }, - { 567, PT_SC, ucp_Tagalog }, - { 575, PT_SC, ucp_Tagbanwa }, - { 584, PT_SC, ucp_Tai_Le }, - { 591, PT_SC, ucp_Tamil }, - { 597, PT_SC, ucp_Telugu }, - { 604, PT_SC, ucp_Thaana }, - { 611, PT_SC, ucp_Thai }, - { 616, PT_SC, ucp_Tibetan }, - { 624, PT_SC, ucp_Tifinagh }, - { 633, PT_SC, ucp_Ugaritic }, - { 642, PT_SC, ucp_Yi }, - { 645, PT_GC, ucp_Z }, - { 647, PT_PC, ucp_Zl }, - { 650, PT_PC, ucp_Zp }, - { 653, PT_PC, ucp_Zs } + { 0, PT_ANY, 0 }, + { 4, PT_SC, ucp_Arabic }, + { 11, PT_SC, ucp_Armenian }, + { 20, PT_SC, ucp_Balinese }, + { 29, PT_SC, ucp_Bengali }, + { 37, PT_SC, ucp_Bopomofo }, + { 46, PT_SC, ucp_Braille }, + { 54, PT_SC, ucp_Buginese }, + { 63, PT_SC, ucp_Buhid }, + { 69, PT_GC, ucp_C }, + { 71, PT_SC, ucp_Canadian_Aboriginal }, + { 91, PT_SC, ucp_Carian }, + { 98, PT_PC, ucp_Cc }, + { 101, PT_PC, ucp_Cf }, + { 104, PT_SC, ucp_Cham }, + { 109, PT_SC, ucp_Cherokee }, + { 118, PT_PC, ucp_Cn }, + { 121, PT_PC, ucp_Co }, + { 124, PT_SC, ucp_Common }, + { 131, PT_SC, ucp_Coptic }, + { 138, PT_PC, ucp_Cs }, + { 141, PT_SC, ucp_Cuneiform }, + { 151, PT_SC, ucp_Cypriot }, + { 159, PT_SC, ucp_Cyrillic }, + { 168, PT_SC, ucp_Deseret }, + { 176, PT_SC, ucp_Devanagari }, + { 187, PT_SC, ucp_Ethiopic }, + { 196, PT_SC, ucp_Georgian }, + { 205, PT_SC, ucp_Glagolitic }, + { 216, PT_SC, ucp_Gothic }, + { 223, PT_SC, ucp_Greek }, + { 229, PT_SC, ucp_Gujarati }, + { 238, PT_SC, ucp_Gurmukhi }, + { 247, PT_SC, ucp_Han }, + { 251, PT_SC, ucp_Hangul }, + { 258, PT_SC, ucp_Hanunoo }, + { 266, PT_SC, ucp_Hebrew }, + { 273, PT_SC, ucp_Hiragana }, + { 282, PT_SC, ucp_Inherited }, + { 292, PT_SC, ucp_Kannada }, + { 300, PT_SC, ucp_Katakana }, + { 309, PT_SC, ucp_Kayah_Li }, + { 318, PT_SC, ucp_Kharoshthi }, + { 329, PT_SC, ucp_Khmer }, + { 335, PT_GC, ucp_L }, + { 337, PT_LAMP, 0 }, + { 340, PT_SC, ucp_Lao }, + { 344, PT_SC, ucp_Latin }, + { 350, PT_SC, ucp_Lepcha }, + { 357, PT_SC, ucp_Limbu }, + { 363, PT_SC, ucp_Linear_B }, + { 372, PT_PC, ucp_Ll }, + { 375, PT_PC, ucp_Lm }, + { 378, PT_PC, ucp_Lo }, + { 381, PT_PC, ucp_Lt }, + { 384, PT_PC, ucp_Lu }, + { 387, PT_SC, ucp_Lycian }, + { 394, PT_SC, ucp_Lydian }, + { 401, PT_GC, ucp_M }, + { 403, PT_SC, ucp_Malayalam }, + { 413, PT_PC, ucp_Mc }, + { 416, PT_PC, ucp_Me }, + { 419, PT_PC, ucp_Mn }, + { 422, PT_SC, ucp_Mongolian }, + { 432, PT_SC, ucp_Myanmar }, + { 440, PT_GC, ucp_N }, + { 442, PT_PC, ucp_Nd }, + { 445, PT_SC, ucp_New_Tai_Lue }, + { 457, PT_SC, ucp_Nko }, + { 461, PT_PC, ucp_Nl }, + { 464, PT_PC, ucp_No }, + { 467, PT_SC, ucp_Ogham }, + { 473, PT_SC, ucp_Ol_Chiki }, + { 482, PT_SC, ucp_Old_Italic }, + { 493, PT_SC, ucp_Old_Persian }, + { 505, PT_SC, ucp_Oriya }, + { 511, PT_SC, ucp_Osmanya }, + { 519, PT_GC, ucp_P }, + { 521, PT_PC, ucp_Pc }, + { 524, PT_PC, ucp_Pd }, + { 527, PT_PC, ucp_Pe }, + { 530, PT_PC, ucp_Pf }, + { 533, PT_SC, ucp_Phags_Pa }, + { 542, PT_SC, ucp_Phoenician }, + { 553, PT_PC, ucp_Pi }, + { 556, PT_PC, ucp_Po }, + { 559, PT_PC, ucp_Ps }, + { 562, PT_SC, ucp_Rejang }, + { 569, PT_SC, ucp_Runic }, + { 575, PT_GC, ucp_S }, + { 577, PT_SC, ucp_Saurashtra }, + { 588, PT_PC, ucp_Sc }, + { 591, PT_SC, ucp_Shavian }, + { 599, PT_SC, ucp_Sinhala }, + { 607, PT_PC, ucp_Sk }, + { 610, PT_PC, ucp_Sm }, + { 613, PT_PC, ucp_So }, + { 616, PT_SC, ucp_Sundanese }, + { 626, PT_SC, ucp_Syloti_Nagri }, + { 639, PT_SC, ucp_Syriac }, + { 646, PT_SC, ucp_Tagalog }, + { 654, PT_SC, ucp_Tagbanwa }, + { 663, PT_SC, ucp_Tai_Le }, + { 670, PT_SC, ucp_Tamil }, + { 676, PT_SC, ucp_Telugu }, + { 683, PT_SC, ucp_Thaana }, + { 690, PT_SC, ucp_Thai }, + { 695, PT_SC, ucp_Tibetan }, + { 703, PT_SC, ucp_Tifinagh }, + { 712, PT_SC, ucp_Ugaritic }, + { 721, PT_SC, ucp_Vai }, + { 725, PT_SC, ucp_Yi }, + { 728, PT_GC, ucp_Z }, + { 730, PT_PC, ucp_Zl }, + { 733, PT_PC, ucp_Zp }, + { 736, PT_PC, ucp_Zs } }; const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table); http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_valid_utf8.c?r1=1.1.2.1.2.5.2.3&r2=1.1.2.1.2.5.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_valid_utf8.c diff -u php-src/ext/pcre/pcrelib/pcre_valid_utf8.c:1.1.2.1.2.5.2.3 php-src/ext/pcre/pcrelib/pcre_valid_utf8.c:1.1.2.1.2.5.2.4 --- php-src/ext/pcre/pcrelib/pcre_valid_utf8.c:1.1.2.1.2.5.2.3 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_valid_utf8.c Tue Sep 9 07:55:08 2008 @@ -152,6 +152,9 @@ if ((*(++p) & 0xc0) != 0x80) return p - string; } } +#else +(void)(string); /* Keep picky compilers happy */ +(void)(length); #endif return -1; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_version.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_version.c diff -u php-src/ext/pcre/pcrelib/pcre_version.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_version.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_version.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_version.c Tue Sep 9 07:55:08 2008 @@ -77,7 +77,7 @@ pre-processor time. This hack uses a standard trick for avoiding calling the STRING macro with an empty argument when doing the test. */ -PCRE_EXP_DEFN const char * +PCRE_EXP_DEFN const char * PCRE_CALL_CONVENTION pcre_version(void) { return (XSTRING(Z PCRE_PRERELEASE)[1] == 0)? http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_xclass.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_xclass.c diff -u php-src/ext/pcre/pcrelib/pcre_xclass.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_xclass.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_xclass.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_xclass.c Tue Sep 9 07:55:08 2008 @@ -102,8 +102,7 @@ #ifdef SUPPORT_UCP else /* XCL_PROP & XCL_NOTPROP */ { - int chartype, script; - int category = _pcre_ucp_findprop(c, &chartype, &script); + const ucd_record * prop = GET_UCD(c); switch(*data) { @@ -112,20 +111,20 @@ break; case PT_LAMP: - if ((chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == + if ((prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt) == (t == XCL_PROP)) return !negated; break; case PT_GC: - if ((data[1] == category) == (t == XCL_PROP)) return !negated; + if ((data[1] == _pcre_ucp_gentype[prop->chartype]) == (t == XCL_PROP)) return !negated; break; case PT_PC: - if ((data[1] == chartype) == (t == XCL_PROP)) return !negated; + if ((data[1] == prop->chartype) == (t == XCL_PROP)) return !negated; break; case PT_SC: - if ((data[1] == script) == (t == XCL_PROP)) return !negated; + if ((data[1] == prop->script) == (t == XCL_PROP)) return !negated; break; /* This should never occur, but compilers may mutter if there is no http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcreposix.c?r1=1.15.2.1.2.7.2.4&r2=1.15.2.1.2.7.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/pcreposix.c diff -u php-src/ext/pcre/pcrelib/pcreposix.c:1.15.2.1.2.7.2.4 php-src/ext/pcre/pcrelib/pcreposix.c:1.15.2.1.2.7.2.5 --- php-src/ext/pcre/pcrelib/pcreposix.c:1.15.2.1.2.7.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/pcreposix.c Tue Sep 9 07:55:08 2008 @@ -158,7 +158,7 @@ * Translate error code to string * *************************************************/ -PCREPOSIX_EXP_DEFN size_t +PCREPOSIX_EXP_DEFN size_t PCRE_CALL_CONVENTION regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) { const char *message, *addmessage; @@ -193,7 +193,7 @@ * Free store held by a regex * *************************************************/ -PCREPOSIX_EXP_DEFN void +PCREPOSIX_EXP_DEFN void PCRE_CALL_CONVENTION regfree(regex_t *preg) { (pcre_free)(preg->re_pcre); @@ -216,7 +216,7 @@ various non-zero codes on failure */ -PCREPOSIX_EXP_DEFN int +PCREPOSIX_EXP_DEFN int PCRE_CALL_CONVENTION regcomp(regex_t *preg, const char *pattern, int cflags) { const char *errorptr; @@ -258,7 +258,7 @@ be set. When this is the case, the nmatch and pmatch arguments are ignored, and the only result is yes/no/error. */ -PCREPOSIX_EXP_DEFN int +PCREPOSIX_EXP_DEFN int PCRE_CALL_CONVENTION regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags) { http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/ucp.h?r1=1.2.2.1.2.1&r2=1.2.2.1.2.1.2.1&diff_format=u Index: php-src/ext/pcre/pcrelib/ucp.h diff -u php-src/ext/pcre/pcrelib/ucp.h:1.2.2.1.2.1 php-src/ext/pcre/pcrelib/ucp.h:1.2.2.1.2.1.2.1 --- php-src/ext/pcre/pcrelib/ucp.h:1.2.2.1.2.1 Fri Feb 9 19:48:47 2007 +++ php-src/ext/pcre/pcrelib/ucp.h Tue Sep 9 07:55:08 2008 @@ -121,11 +121,24 @@ ucp_Tifinagh, ucp_Ugaritic, ucp_Yi, - ucp_Balinese, /* New for Unicode 5.0.0 */ - ucp_Cuneiform, /* New for Unicode 5.0.0 */ - ucp_Nko, /* New for Unicode 5.0.0 */ - ucp_Phags_Pa, /* New for Unicode 5.0.0 */ - ucp_Phoenician /* New for Unicode 5.0.0 */ + /* New for Unicode 5.0: */ + ucp_Balinese, + ucp_Cuneiform, + ucp_Nko, + ucp_Phags_Pa, + ucp_Phoenician, + /* New for Unicode 5.1: */ + ucp_Carian, + ucp_Cham, + ucp_Kayah_Li, + ucp_Lepcha, + ucp_Lycian, + ucp_Lydian, + ucp_Ol_Chiki, + ucp_Rejang, + ucp_Saurashtra, + ucp_Sundanese, + ucp_Vai }; #endif http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/doc/pcre.txt?r1=1.9.2.1.2.5.2.2&r2=1.9.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/doc/pcre.txt diff -u php-src/ext/pcre/pcrelib/doc/pcre.txt:1.9.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/doc/pcre.txt:1.9.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/doc/pcre.txt:1.9.2.1.2.5.2.2 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/doc/pcre.txt Tue Sep 9 07:55:08 2008 @@ -2047,83 +2047,87 @@ The string to be matched by pcre_exec() The subject string is passed to pcre_exec() as a pointer in subject, a - length in length, and a starting byte offset in startoffset. In UTF-8 - mode, the byte offset must point to the start of a UTF-8 character. - Unlike the pattern string, the subject may contain binary zero bytes. - When the starting offset is zero, the search for a match starts at the - beginning of the subject, and this is by far the most common case. - - A non-zero starting offset is useful when searching for another match - in the same subject by calling pcre_exec() again after a previous suc- - cess. Setting startoffset differs from just passing over a shortened - string and setting PCRE_NOTBOL in the case of a pattern that begins + length (in bytes) in length, and a starting byte offset in startoffset. + In UTF-8 mode, the byte offset must point to the start of a UTF-8 char- + acter. Unlike the pattern string, the subject may contain binary zero + bytes. When the starting offset is zero, the search for a match starts + at the beginning of the subject, and this is by far the most common + case. + + A non-zero starting offset is useful when searching for another match + in the same subject by calling pcre_exec() again after a previous suc- + cess. Setting startoffset differs from just passing over a shortened + string and setting PCRE_NOTBOL in the case of a pattern that begins with any kind of lookbehind. For example, consider the pattern \Biss\B - which finds occurrences of "iss" in the middle of words. (\B matches - only if the current position in the subject is not a word boundary.) - When applied to the string "Mississipi" the first call to pcre_exec() - finds the first occurrence. If pcre_exec() is called again with just - the remainder of the subject, namely "issipi", it does not match, + which finds occurrences of "iss" in the middle of words. (\B matches + only if the current position in the subject is not a word boundary.) + When applied to the string "Mississipi" the first call to pcre_exec() + finds the first occurrence. If pcre_exec() is called again with just + the remainder of the subject, namely "issipi", it does not match, because \B is always false at the start of the subject, which is deemed - to be a word boundary. However, if pcre_exec() is passed the entire + to be a word boundary. However, if pcre_exec() is passed the entire string again, but with startoffset set to 4, it finds the second occur- - rence of "iss" because it is able to look behind the starting point to + rence of "iss" because it is able to look behind the starting point to discover that it is preceded by a letter. - If a non-zero starting offset is passed when the pattern is anchored, + If a non-zero starting offset is passed when the pattern is anchored, one attempt to match at the given offset is made. This can only succeed - if the pattern does not require the match to be at the start of the + if the pattern does not require the match to be at the start of the subject. How pcre_exec() returns captured substrings - In general, a pattern matches a certain portion of the subject, and in - addition, further substrings from the subject may be picked out by - parts of the pattern. Following the usage in Jeffrey Friedl's book, - this is called "capturing" in what follows, and the phrase "capturing - subpattern" is used for a fragment of a pattern that picks out a sub- - string. PCRE supports several other kinds of parenthesized subpattern + In general, a pattern matches a certain portion of the subject, and in + addition, further substrings from the subject may be picked out by + parts of the pattern. Following the usage in Jeffrey Friedl's book, + this is called "capturing" in what follows, and the phrase "capturing + subpattern" is used for a fragment of a pattern that picks out a sub- + string. PCRE supports several other kinds of parenthesized subpattern that do not cause substrings to be captured. - Captured substrings are returned to the caller via a vector of integer - offsets whose address is passed in ovector. The number of elements in - the vector is passed in ovecsize, which must be a non-negative number. - Note: this argument is NOT the size of ovector in bytes. - - The first two-thirds of the vector is used to pass back captured sub- - strings, each substring using a pair of integers. The remaining third - of the vector is used as workspace by pcre_exec() while matching cap- - turing subpatterns, and is not available for passing back information. - The length passed in ovecsize should always be a multiple of three. If + Captured substrings are returned to the caller via a vector of integers + whose address is passed in ovector. The number of elements in the vec- + tor is passed in ovecsize, which must be a non-negative number. Note: + this argument is NOT the size of ovector in bytes. + + The first two-thirds of the vector is used to pass back captured sub- + strings, each substring using a pair of integers. The remaining third + of the vector is used as workspace by pcre_exec() while matching cap- + turing subpatterns, and is not available for passing back information. + The number passed in ovecsize should always be a multiple of three. If it is not, it is rounded down. - When a match is successful, information about captured substrings is - returned in pairs of integers, starting at the beginning of ovector, - and continuing up to two-thirds of its length at the most. The first - element of a pair is set to the offset of the first character in a sub- - string, and the second is set to the offset of the first character - after the end of a substring. The first pair, ovector[0] and ovec- - tor[1], identify the portion of the subject string matched by the - entire pattern. The next pair is used for the first capturing subpat- - tern, and so on. The value returned by pcre_exec() is one more than the - highest numbered pair that has been set. For example, if two substrings - have been captured, the returned value is 3. If there are no capturing - subpatterns, the return value from a successful match is 1, indicating - that just the first pair of offsets has been set. + When a match is successful, information about captured substrings is + returned in pairs of integers, starting at the beginning of ovector, + and continuing up to two-thirds of its length at the most. The first + element of each pair is set to the byte offset of the first character + in a substring, and the second is set to the byte offset of the first + character after the end of a substring. Note: these values are always + byte offsets, even in UTF-8 mode. They are not character counts. + + The first pair of integers, ovector[0] and ovector[1], identify the + portion of the subject string matched by the entire pattern. The next + pair is used for the first capturing subpattern, and so on. The value + returned by pcre_exec() is one more than the highest numbered pair that + has been set. For example, if two substrings have been captured, the + returned value is 3. If there are no capturing subpatterns, the return + value from a successful match is 1, indicating that just the first pair + of offsets has been set. If a capturing subpattern is matched repeatedly, it is the last portion of the string that it matched that is returned. If the vector is too small to hold all the captured substring offsets, it is used as far as possible (up to two-thirds of its length), and the - function returns a value of zero. In particular, if the substring off- - sets are not of interest, pcre_exec() may be called with ovector passed - as NULL and ovecsize as zero. However, if the pattern contains back - references and the ovector is not big enough to remember the related - substrings, PCRE has to get additional memory for use during matching. - Thus it is usually advisable to supply an ovector. + function returns a value of zero. If the substring offsets are not of + interest, pcre_exec() may be called with ovector passed as NULL and + ovecsize as zero. However, if the pattern contains back references and + the ovector is not big enough to remember the related substrings, PCRE + has to get additional memory for use during matching. Thus it is usu- + ally advisable to supply an ovector. The pcre_info() function can be used to find out how many capturing subpatterns there are in a compiled pattern. The smallest size for @@ -2604,7 +2608,7 @@ REVISION - Last updated: 12 April 2008 + Last updated: 24 August 2008 Copyright (c) 1997-2008 University of Cambridge. ------------------------------------------------------------------------------ @@ -6536,6 +6540,8 @@ ing long subject strings is to write repeated parenthesized subpatterns to match more than one character whenever possible. + Compiling PCRE to use heap instead of stack + In environments where stack memory is constrained, you might want to compile PCRE to use heap memory instead of stack for remembering back- up points. This makes it run a lot more slowly, however. Details of how @@ -6548,6 +6554,24 @@ freed in reverse order, it may be possible to implement customized mem- ory handlers that are more efficient than the standard functions. + Limiting PCRE's stack usage + + PCRE has an internal counter that can be used to limit the depth of + recursion, and thus cause pcre_exec() to give an error code before it + runs out of stack. By default, the limit is very large, and unlikely + ever to operate. It can be changed when PCRE is built, and it can also + be set when pcre_exec() is called. For details of these interfaces, see + the pcrebuild and pcreapi documentation. + + As a very rough rule of thumb, you should reckon on about 500 bytes per + recursion. Thus, if you want to limit your stack usage to 8Mb, you + should set the limit at 16000 recursions. A 64Mb stack, on the other + hand, can support around 128000 recursions. The pcretest test program + has a command line option (-S) that can be used to increase the size of + its stack. + + Changing stack size in Unix-like systems + In Unix-like environments, there is not often a problem with the stack unless very long strings are involved, though the default limit on stack size varies from system to system. Values from 8Mb to 64Mb are @@ -6568,19 +6592,12 @@ attempts to increase the soft limit to 100Mb using setrlimit(). You must do this before calling pcre_exec(). - PCRE has an internal counter that can be used to limit the depth of - recursion, and thus cause pcre_exec() to give an error code before it - runs out of stack. By default, the limit is very large, and unlikely - ever to operate. It can be changed when PCRE is built, and it can also - be set when pcre_exec() is called. For details of these interfaces, see - the pcrebuild and pcreapi documentation. + Changing stack size in Mac OS X - As a very rough rule of thumb, you should reckon on about 500 bytes per - recursion. Thus, if you want to limit your stack usage to 8Mb, you - should set the limit at 16000 recursions. A 64Mb stack, on the other - hand, can support around 128000 recursions. The pcretest test program - has a command line option (-S) that can be used to increase the size of - its stack. + Using setrlimit(), as described above, should also work on Mac OS X. It + is also possible to set a stack size when linking a program. There is a + discussion about stack sizes in Mac OS X at this web site: + http://developer.apple.com/qa/qa2005/qa1419.html. AUTHOR @@ -6592,8 +6609,8 @@ REVISION - Last updated: 05 June 2007 - Copyright (c) 1997-2007 University of Cambridge. + Last updated: 09 July 2008 + Copyright (c) 1997-2008 University of Cambridge. ------------------------------------------------------------------------------ http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput1?r1=1.5.4.4.2.1&r2=1.5.4.4.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput1 diff -u php-src/ext/pcre/pcrelib/testdata/testinput1:1.5.4.4.2.1 php-src/ext/pcre/pcrelib/testdata/testinput1:1.5.4.4.2.2 --- php-src/ext/pcre/pcrelib/testdata/testinput1:1.5.4.4.2.1 Sun Jan 13 12:44:56 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput1 Tue Sep 9 07:55:09 2008 @@ -4036,4 +4036,7 @@ ] p +/.*[op][xyz]/ + fooabcfoo + / End of testinput1 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput2?r1=1.5.2.1.2.4.2.3&r2=1.5.2.1.2.4.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput2 diff -u php-src/ext/pcre/pcrelib/testdata/testinput2:1.5.2.1.2.4.2.3 php-src/ext/pcre/pcrelib/testdata/testinput2:1.5.2.1.2.4.2.4 --- php-src/ext/pcre/pcrelib/testdata/testinput2:1.5.2.1.2.4.2.3 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput2 Tue Sep 9 07:55:09 2008 @@ -1988,10 +1988,10 @@ a\rb\<anycrlf> /^abc./mgx<any> - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 \x{2028}abc8 \x{2029}abc9 JUNK + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK /abc.$/mgx<any> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9 /a/<cr><any> @@ -2147,7 +2147,7 @@ abc\r\n\r\n /abc.$/mgx<anycrlf> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 /^X/m XABC @@ -2724,4 +2724,6 @@ /a(*FAIL)+b/ +/(abc|pqr|123){0}[xyz]/SI + / End of testinput2 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput4?r1=1.4.2.1.2.3.2.2&r2=1.4.2.1.2.3.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput4 diff -u php-src/ext/pcre/pcrelib/testdata/testinput4:1.4.2.1.2.3.2.2 php-src/ext/pcre/pcrelib/testdata/testinput4:1.4.2.1.2.3.2.3 --- php-src/ext/pcre/pcrelib/testdata/testinput4:1.4.2.1.2.3.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput4 Tue Sep 9 07:55:09 2008 @@ -609,4 +609,18 @@ /[^ABCDEFGHIJKLMNOPQRSTUVWXYZÃÃÃÃÃà ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Ä¢Ä¤Ä¦Ä¨ÄªÄ¬Ä®Ä°Ä²Ä´Ä¶Ä¹Ä»Ä½Ä¿ÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅ Å¢Å¤Å¦Å¨ÅªÅ¬Å®Å°Å²Å´Å¶Å¸Å¹Å»Å½ÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆ Æ¢Æ¤Æ¦Æ§Æ©Æ¬Æ®Æ¯Æ±Æ²Æ³ÆµÆ·Æ¸Æ¼ÇÇÇÇÇÇÇÇÇÇÇÇÇ Ç¢Ç¤Ç¦Ç¨ÇªÇ¬Ç®Ç±Ç´Ç¶Ç·Ç¸ÇºÇ¼Ç¾ÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈ È¢È¤È¦È¨ÈªÈ¬È®È°È²ÈºÈ»È½È¾ÉÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎΠΡΣΤΥΦΧΨΩΪΫÏÏÏÏÏÏÏÏ Ï¢Ï¤Ï¦Ï¨ÏªÏ¬Ï®Ï´Ï·Ï¹ÏºÏ½Ï¾Ï¿ÐÐÐÐÐÐ ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐРСТУФХЦЧШЩЪЫЬÐÐ®Ð¯Ñ Ñ¢Ñ¤Ñ¦Ñ¨ÑªÑ¬Ñ®Ñ°Ñ²Ñ´Ñ¶Ñ¸ÑºÑ¼Ñ¾ÒÒÒÒÒÒÒÒÒÒÒÒÒ Ò¢Ò¤Ò¦Ò¨ÒªÒ¬Ò®Ò°Ò²Ò´Ò¶Ò¸ÒºÒ¼Ò¾ÓÓÓÓ ÓÓÓÓÓÓÓÓÓÓÓÓÓ Ó¢Ó¤Ó¦Ó¨ÓªÓ¬Ó®Ó°Ó²Ó´Ó¶Ó¸ÔÔÔÔÔÔÔÔÔ±Ô²Ô³Ô´ÔµÔ¶Ô·Ô¸Ô¹ÔºÔ»Ô¼Ô½Ô¾Ô¿ÕÕÕÕÕÕ ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕá á¡á¢á£á¤á¥á¦á§á¨á©áªá«á¬áá®á¯á°á±á²á³á´áµá¶á·á¸á¹áºá»á¼á½á¾á¿áááááá á¸á¸á¸á¸á¸á¸á¸á¸á! ¸á¸á¸á¸á¸á¸á¸á¸á¸ ḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾá¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹ ṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾáºáºáºáºáºáºáºáºáºáºáºáº ẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾá»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á» ỢỤỦỨỪỬỮỰỲỴỶỸá¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼¨á¼©á¼ªá¼«á¼¬á¼á¼®á¼¯á¼¸á¼¹á¼ºá¼»á¼¼á¼½á¼¾á¼¿á½á½á½á½á½á½á½á½á½á½á½¨á½©á½ªá½«á½¬á½á½®á½¯á¾¸á¾¹á¾ºá¾»á¿á¿á¿á¿á¿á¿á¿á¿á¿¨á¿©á¿ªá¿«á¿¬á¿¸á¿¹á¿ºá¿»abcdefghijklmnopqrstuvwxyzªµºÃà áâãäåæçèéêëìÃîïðñòóôõöøùúûüýþÿÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄġģĥħĩīÄįıijĵķĸĺļľÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅšţťŧũūÅÅ¯Å±Å³ÅµÅ·ÅºÅ¼Å¾Å¿ÆÆÆ ÆÆÆÆÆÆÆÆÆÆ¡Æ£Æ¥Æ¨ÆªÆ«ÆÆ°Æ´Æ¶Æ¹ÆºÆ½Æ¾Æ¿ÇÇÇÇÇÇÇÇÇÇÇÇÇǡǣǥǧǩǫÇǯǰdzǵǹǻǽǿÈÈÈ ÈÈÈÈÈÈÈÈÈÈÈÈÈȡȣȥȧȩȫÈȯȱȳȴȵȶȷȸȹȼȿÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ É¡É¢É£! ɤɥɦɧɨɩɪɫɬÉɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿÊÊÊÊÊÊ Ê ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê¡Ê¢Ê£Ê¤Ê¥Ê¦Ê§Ê¨Ê©ÊªÊ«Ê¬ÊʮʯÎάÎήίΰαβγδεζηθικλμνξοÏÏÏÏÏÏ ÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏϡϣϥϧϩϫÏϯϰϱϲϳϵϸϻϼабвгдежзийклмнопÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑѡѣѥѧѩѫÑѯѱѳѵѷѹѻѽѿÒÒÒÒÒÒÒÒÒÒÒÒÒ¡Ò£Ò¥Ò§Ò©Ò«ÒÒ¯Ò±Ò³ÒµÒ·Ò¹Ò»Ò½Ò¿ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ¡Ó£Ó¥Ó§Ó©Ó«ÓÓ¯Ó±Ó³ÓµÓ·Ó¹ÔÔÔ ÔÔÔÔÔÕ¡Õ¢Õ£Õ¤Õ¥Õ¦Õ§Õ¨Õ©ÕªÕ«Õ¬ÕÕ®Õ¯Õ°Õ±Õ²Õ³Õ´ÕµÕ¶Õ·Õ¸Õ¹ÕºÕ»Õ¼Õ½Õ¾Õ¿ÖÖÖÖÖÖ ÖÖá´á´á´á´á´á´ á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´ ᴡᴢᴣᴤᴥᴦᴧᴨᴩᴪᴫᵢᵣᵤᵥᵦᵧᵨᵩᵪᵫᵬáµáµ®áµ¯áµ°áµ±áµ²áµ³áµ´áµµáµ¶áµ·áµ¹áµºáµ»áµ¼áµ½áµ¾áµ¿á¶á¶á¶á¶á¶á¶ á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¸á¸á¸ á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸¡á¸£á¸¥á¸§á¸©á¸«á¸á¸¯á¸±á¸³á¸µá¸·á¸¹á¸»á¸½á¸¿á¹á¹á¹ á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹¡á¹£á! ¹¥á¹§á¹©á¹«á¹á¹¯á¹±á¹³á¹µá¹·á¹¹á¹»á¹½á¹¿áºáºáº áºáºáºáºáºáºáºáºáºáºáºáºáºáºáº¡áº£áº¥áº§áº©áº«áºáº¯áº±áº³áºµáº·áº¹áº»áº½áº¿á»á»á» á»á»á»á»á»á»á»á»á»á»á»á»á»á»¡á»£á»¥á»§á»©á»«á»á»¯á»±á»³á»µá»·á»¹á¼á¼á¼á¼á¼á¼ á¼á¼á¼á¼á¼á¼á¼á¼á¼ ἡἢἣἤἥἦἧἰἱἲἳἴἵἶἷá½á½á½á½á½á½ á½á½á½á½á½á½á½á½á½ ὡὢὣὤὥὦὧὰάὲέὴήὶίὸόὺύὼώá¾á¾á¾á¾á¾á¾ á¾á¾á¾á¾á¾á¾á¾á¾á¾á¾á¾ ᾡᾢᾣᾤᾥᾦᾧᾰᾱᾲᾳᾴᾶᾷιá¿á¿á¿á¿á¿á¿á¿á¿á¿á¿á¿á¿ ῡῢΰῤῥῦῧῲῳῴῶῷâ²â²â² â²â²â²â²â²â²â²â²â²â²â²â²â²â²¡â²£â²¥â²§â²©â²«â²â²¯â²±â²³â²µâ²·â²¹â²»â²½â²¿â³â³â³ â³â³â³â³â³â³â³â³â³â³â³â³â³â³¡â³£â³¤â´â´â´â´â´â´ â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´ ⴡⴢⴣⴤⴥï¬ï¬ï¬ï¬ï¬ï¬ ï¬ï¬ï¬ï¬ï¬ï¬\d-_^]/8 +/^[^d]*?$/ + abc + +/^[^d]*?$/8 + abc + +/^[^d]*?$/i + abc + +/^[^d]*?$/8i + abc + +/(?i)[\xc3\xa9\xc3\xbd]|[\xc3\xa9\xc3\xbdA]/8 + / End of testinput4 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput5?r1=1.3.2.1.2.4.2.3&r2=1.3.2.1.2.4.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput5 diff -u php-src/ext/pcre/pcrelib/testdata/testinput5:1.3.2.1.2.4.2.3 php-src/ext/pcre/pcrelib/testdata/testinput5:1.3.2.1.2.4.2.4 --- php-src/ext/pcre/pcrelib/testdata/testinput5:1.3.2.1.2.4.2.3 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput5 Tue Sep 9 07:55:09 2008 @@ -473,4 +473,11 @@ ** Failers ab +/(\x{de})\1/ + \x{de}\x{de} + \x{123} + +/X/8f<any> + A\x{1ec5}ABCXYZ + / End of testinput5 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput6?r1=1.3.2.1.2.5.2.1&r2=1.3.2.1.2.5.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput6 diff -u php-src/ext/pcre/pcrelib/testdata/testinput6:1.3.2.1.2.5.2.1 php-src/ext/pcre/pcrelib/testdata/testinput6:1.3.2.1.2.5.2.2 --- php-src/ext/pcre/pcrelib/testdata/testinput6:1.3.2.1.2.5.2.1 Sun Jan 13 12:44:56 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput6 Tue Sep 9 07:55:09 2008 @@ -763,7 +763,7 @@ \x{1b00}\x{12000}\x{7c0}\x{a840}\x{10900} /The next two are special cases where the lengths of the different cases of the -same character differ. The first went wrong with heap fram storage; the 2nd +same character differ. The first went wrong with heap frame storage; the 2nd was broken in all cases./ /^\x{023a}+?(\x{0130}+)/8i @@ -907,4 +907,40 @@ /\p{Cc}{2}+/8BZ +/\x{c0}+\x{116}+/8i + \x{c0}\x{e0}\x{116}\x{117} + +/[\x{c0}\x{116}]+/8i + \x{c0}\x{e0}\x{116}\x{117} + +/\p{Carian}\p{Cham}\p{Kayah_Li}\p{Lepcha}\p{Lycian}\p{Lydian}\p{Ol_Chiki}\p{Rejang}\p{Saurashtra}\p{Sundanese}\p{Vai}/8 + \x{102A4}\x{AA52}\x{A91D}\x{1C46}\x{10283}\x{1092E}\x{1C6B}\x{A93B}\x{A8BF}\x{1BA0}\x{A50A}==== + +/\x{a77d}\x{1d79}/8i + \x{a77d}\x{1d79} + \x{1d79}\x{a77d} + +/\x{a77d}\x{1d79}/8 + \x{a77d}\x{1d79} + ** Failers + \x{1d79}\x{a77d} + +/(A)\1/8i + AA + Aa + aa + aA + +/(\x{de})\1/8i + \x{de}\x{de} + \x{de}\x{fe} + \x{fe}\x{fe} + \x{fe}\x{de} + +/(\x{10a})\1/8i + \x{10a}\x{10a} + \x{10a}\x{10b} + \x{10b}\x{10b} + \x{10b}\x{10a} + / End of testinput6 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput7?r1=1.1.2.1.2.4.2.2&r2=1.1.2.1.2.4.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput7 diff -u php-src/ext/pcre/pcrelib/testdata/testinput7:1.1.2.1.2.4.2.2 php-src/ext/pcre/pcrelib/testdata/testinput7:1.1.2.1.2.4.2.3 --- php-src/ext/pcre/pcrelib/testdata/testinput7:1.1.2.1.2.4.2.2 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput7 Tue Sep 9 07:55:09 2008 @@ -4151,10 +4151,10 @@ a\rb\<any> /^abc./mgx<any> - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 \x{2028}abc8 \x{2029}abc9 JUNK + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK /abc.$/mgx<any> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 /^a\Rb/<bsr_unicode> a\nb http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput8?r1=1.1.8.2.2.1&r2=1.1.8.2.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput8 diff -u php-src/ext/pcre/pcrelib/testdata/testinput8:1.1.8.2.2.1 php-src/ext/pcre/pcrelib/testdata/testinput8:1.1.8.2.2.2 --- php-src/ext/pcre/pcrelib/testdata/testinput8:1.1.8.2.2.1 Sun Oct 7 10:35:03 2007 +++ php-src/ext/pcre/pcrelib/testdata/testinput8 Tue Sep 9 07:55:09 2008 @@ -664,4 +664,7 @@ a\x{85}b\<bsr_anycrlf> a\x0bb\<bsr_anycrlf> +/X/8f<any> + A\x{1ec5}ABCXYZ + / End of testinput 8 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput9?r1=1.1.2.1.2.3&r2=1.1.2.1.2.3.2.1&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput9 diff -u php-src/ext/pcre/pcrelib/testdata/testinput9:1.1.2.1.2.3 php-src/ext/pcre/pcrelib/testdata/testinput9:1.1.2.1.2.3.2.1 --- php-src/ext/pcre/pcrelib/testdata/testinput9:1.1.2.1.2.3 Sat Sep 1 17:48:43 2007 +++ php-src/ext/pcre/pcrelib/testdata/testinput9 Tue Sep 9 07:55:09 2008 @@ -819,10 +819,28 @@ /^\x{023a}+([^X])/8i \x{023a}\x{2c65}X +/\x{c0}+\x{116}+/8i + \x{c0}\x{e0}\x{116}\x{117} + +/[\x{c0}\x{116}]+/8i + \x{c0}\x{e0}\x{116}\x{117} + /Check property support in non-UTF-8 mode/ /\p{L}{4}/ 123abcdefg 123abc\xc4\xc5zz +/\p{Carian}\p{Cham}\p{Kayah_Li}\p{Lepcha}\p{Lycian}\p{Lydian}\p{Ol_Chiki}\p{Rejang}\p{Saurashtra}\p{Sundanese}\p{Vai}/8 + \x{102A4}\x{AA52}\x{A91D}\x{1C46}\x{10283}\x{1092E}\x{1C6B}\x{A93B}\x{A8BF}\x{1BA0}\x{A50A}==== + +/\x{a77d}\x{1d79}/8i + \x{a77d}\x{1d79} + \x{1d79}\x{a77d} + +/\x{a77d}\x{1d79}/8 + \x{a77d}\x{1d79} + ** Failers + \x{1d79}\x{a77d} + / End / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput1?r1=1.6.2.1.2.4.2.1&r2=1.6.2.1.2.4.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput1 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput1:1.6.2.1.2.4.2.1 php-src/ext/pcre/pcrelib/testdata/testoutput1:1.6.2.1.2.4.2.2 --- php-src/ext/pcre/pcrelib/testdata/testoutput1:1.6.2.1.2.4.2.1 Sun Jan 13 12:44:56 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput1 Tue Sep 9 07:55:09 2008 @@ -6605,4 +6605,8 @@ p 0: p +/.*[op][xyz]/ + fooabcfoo +No match + / End of testinput1 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput2?r1=1.6.2.1.2.4.2.3&r2=1.6.2.1.2.4.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput2 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput2:1.6.2.1.2.4.2.3 php-src/ext/pcre/pcrelib/testdata/testoutput2:1.6.2.1.2.4.2.4 --- php-src/ext/pcre/pcrelib/testdata/testoutput2:1.6.2.1.2.4.2.3 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput2 Tue Sep 9 07:55:09 2008 @@ -7851,7 +7851,7 @@ No match /^abc./mgx<any> - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 \x{2028}abc8 \x{2029}abc9 JUNK + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK 0: abc1 0: abc2 0: abc3 @@ -7861,7 +7861,7 @@ 0: abc7 /abc.$/mgx<any> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9 0: abc1 0: abc2 0: abc3 @@ -8163,7 +8163,7 @@ 0+ /abc.$/mgx<anycrlf> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 0: abc1 0: abc4 0: abc5 @@ -9631,4 +9631,11 @@ /a(*FAIL)+b/ Failed: nothing to repeat at offset 8 +/(abc|pqr|123){0}[xyz]/SI +Capturing subpattern count = 1 +No options +No first char +No need char +Starting byte set: x y z + / End of testinput2 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput4?r1=1.6.2.1.2.3.2.2&r2=1.6.2.1.2.3.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput4 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput4:1.6.2.1.2.3.2.2 php-src/ext/pcre/pcrelib/testdata/testoutput4:1.6.2.1.2.3.2.3 --- php-src/ext/pcre/pcrelib/testdata/testoutput4:1.6.2.1.2.3.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput4 Tue Sep 9 07:55:10 2008 @@ -1071,4 +1071,22 @@ /[^ABCDEFGHIJKLMNOPQRSTUVWXYZÃÃÃÃÃà ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Ä¢Ä¤Ä¦Ä¨ÄªÄ¬Ä®Ä°Ä²Ä´Ä¶Ä¹Ä»Ä½Ä¿ÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅ Å¢Å¤Å¦Å¨ÅªÅ¬Å®Å°Å²Å´Å¶Å¸Å¹Å»Å½ÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆ Æ¢Æ¤Æ¦Æ§Æ©Æ¬Æ®Æ¯Æ±Æ²Æ³ÆµÆ·Æ¸Æ¼ÇÇÇÇÇÇÇÇÇÇÇÇÇ Ç¢Ç¤Ç¦Ç¨ÇªÇ¬Ç®Ç±Ç´Ç¶Ç·Ç¸ÇºÇ¼Ç¾ÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈ È¢È¤È¦È¨ÈªÈ¬È®È°È²ÈºÈ»È½È¾ÉÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎΠΡΣΤΥΦΧΨΩΪΫÏÏÏÏÏÏÏÏ Ï¢Ï¤Ï¦Ï¨ÏªÏ¬Ï®Ï´Ï·Ï¹ÏºÏ½Ï¾Ï¿ÐÐÐÐÐÐ ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐРСТУФХЦЧШЩЪЫЬÐÐ®Ð¯Ñ Ñ¢Ñ¤Ñ¦Ñ¨ÑªÑ¬Ñ®Ñ°Ñ²Ñ´Ñ¶Ñ¸ÑºÑ¼Ñ¾ÒÒÒÒÒÒÒÒÒÒÒÒÒ Ò¢Ò¤Ò¦Ò¨ÒªÒ¬Ò®Ò°Ò²Ò´Ò¶Ò¸ÒºÒ¼Ò¾ÓÓÓÓ ÓÓÓÓÓÓÓÓÓÓÓÓÓ Ó¢Ó¤Ó¦Ó¨ÓªÓ¬Ó®Ó°Ó²Ó´Ó¶Ó¸ÔÔÔÔÔÔÔÔÔ±Ô²Ô³Ô´ÔµÔ¶Ô·Ô¸Ô¹ÔºÔ»Ô¼Ô½Ô¾Ô¿ÕÕÕÕÕÕ ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕá á¡á¢á£á¤á¥á¦á§á¨á©áªá«á¬áá®á¯á°á±á²á³á´áµá¶á·á¸á¹áºá»á¼á½á¾á¿áááááá á¸á¸á¸á¸á¸á¸á¸á¸á! ¸á¸á¸á¸á¸á¸á¸á¸á¸ ḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾá¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹ ṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾáºáºáºáºáºáºáºáºáºáºáºáº ẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾá»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á» ỢỤỦỨỪỬỮỰỲỴỶỸá¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼¨á¼©á¼ªá¼«á¼¬á¼á¼®á¼¯á¼¸á¼¹á¼ºá¼»á¼¼á¼½á¼¾á¼¿á½á½á½á½á½á½á½á½á½á½á½¨á½©á½ªá½«á½¬á½á½®á½¯á¾¸á¾¹á¾ºá¾»á¿á¿á¿á¿á¿á¿á¿á¿á¿¨á¿©á¿ªá¿«á¿¬á¿¸á¿¹á¿ºá¿»abcdefghijklmnopqrstuvwxyzªµºÃà áâãäåæçèéêëìÃîïðñòóôõöøùúûüýþÿÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄġģĥħĩīÄįıijĵķĸĺļľÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅšţťŧũūÅÅ¯Å±Å³ÅµÅ·ÅºÅ¼Å¾Å¿ÆÆÆ ÆÆÆÆÆÆÆÆÆÆ¡Æ£Æ¥Æ¨ÆªÆ«ÆÆ°Æ´Æ¶Æ¹ÆºÆ½Æ¾Æ¿ÇÇÇÇÇÇÇÇÇÇÇÇÇǡǣǥǧǩǫÇǯǰdzǵǹǻǽǿÈÈÈ ÈÈÈÈÈÈÈÈÈÈÈÈÈȡȣȥȧȩȫÈȯȱȳȴȵȶȷȸȹȼȿÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ É¡É¢É£! ɤɥɦɧɨɩɪɫɬÉɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿÊÊÊÊÊÊ Ê ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê¡Ê¢Ê£Ê¤Ê¥Ê¦Ê§Ê¨Ê©ÊªÊ«Ê¬ÊʮʯÎάÎήίΰαβγδεζηθικλμνξοÏÏÏÏÏÏ ÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏϡϣϥϧϩϫÏϯϰϱϲϳϵϸϻϼабвгдежзийклмнопÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑѡѣѥѧѩѫÑѯѱѳѵѷѹѻѽѿÒÒÒÒÒÒÒÒÒÒÒÒÒ¡Ò£Ò¥Ò§Ò©Ò«ÒÒ¯Ò±Ò³ÒµÒ·Ò¹Ò»Ò½Ò¿ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ¡Ó£Ó¥Ó§Ó©Ó«ÓÓ¯Ó±Ó³ÓµÓ·Ó¹ÔÔÔ ÔÔÔÔÔÕ¡Õ¢Õ£Õ¤Õ¥Õ¦Õ§Õ¨Õ©ÕªÕ«Õ¬ÕÕ®Õ¯Õ°Õ±Õ²Õ³Õ´ÕµÕ¶Õ·Õ¸Õ¹ÕºÕ»Õ¼Õ½Õ¾Õ¿ÖÖÖÖÖÖ ÖÖá´á´á´á´á´á´ á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´ ᴡᴢᴣᴤᴥᴦᴧᴨᴩᴪᴫᵢᵣᵤᵥᵦᵧᵨᵩᵪᵫᵬáµáµ®áµ¯áµ°áµ±áµ²áµ³áµ´áµµáµ¶áµ·áµ¹áµºáµ»áµ¼áµ½áµ¾áµ¿á¶á¶á¶á¶á¶á¶ á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¸á¸á¸ á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸¡á¸£á¸¥á¸§á¸©á¸«á¸á¸¯á¸±á¸³á¸µá¸·á¸¹á¸»á¸½á¸¿á¹á¹á¹ á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹¡á¹£á! ¹¥á¹§á¹©á¹«á¹á¹¯á¹±á¹³á¹µá¹·á¹¹á¹»á¹½á¹¿áºáºáº áºáºáºáºáºáºáºáºáºáºáºáºáºáºáº¡áº£áº¥áº§áº©áº«áºáº¯áº±áº³áºµáº·áº¹áº»áº½áº¿á»á»á» á»á»á»á»á»á»á»á»á»á»á»á»á»á»¡á»£á»¥á»§á»©á»«á»á»¯á»±á»³á»µá»·á»¹á¼á¼á¼á¼á¼á¼ á¼á¼á¼á¼á¼á¼á¼á¼á¼ ἡἢἣἤἥἦἧἰἱἲἳἴἵἶἷá½á½á½á½á½á½ á½á½á½á½á½á½á½á½á½ ὡὢὣὤὥὦὧὰάὲέὴήὶίὸόὺύὼώá¾á¾á¾á¾á¾á¾ á¾á¾á¾á¾á¾á¾á¾á¾á¾á¾á¾ ᾡᾢᾣᾤᾥᾦᾧᾰᾱᾲᾳᾴᾶᾷιá¿á¿á¿á¿á¿á¿á¿á¿á¿á¿á¿á¿ ῡῢΰῤῥῦῧῲῳῴῶῷâ²â²â² â²â²â²â²â²â²â²â²â²â²â²â²â²â²¡â²£â²¥â²§â²©â²«â²â²¯â²±â²³â²µâ²·â²¹â²»â²½â²¿â³â³â³ â³â³â³â³â³â³â³â³â³â³â³â³â³â³¡â³£â³¤â´â´â´â´â´â´ â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´ ⴡⴢⴣⴤⴥï¬ï¬ï¬ï¬ï¬ï¬ ï¬ï¬ï¬ï¬ï¬ï¬\d-_^]/8 +/^[^d]*?$/ + abc + 0: abc + +/^[^d]*?$/8 + abc + 0: abc + +/^[^d]*?$/i + abc + 0: abc + +/^[^d]*?$/8i + abc + 0: abc + +/(?i)[\xc3\xa9\xc3\xbd]|[\xc3\xa9\xc3\xbdA]/8 + / End of testinput4 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput5?r1=1.4.2.1.2.4.2.3&r2=1.4.2.1.2.4.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput5 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput5:1.4.2.1.2.4.2.3 php-src/ext/pcre/pcrelib/testdata/testoutput5:1.4.2.1.2.4.2.4 --- php-src/ext/pcre/pcrelib/testdata/testoutput5:1.4.2.1.2.4.2.3 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput5 Tue Sep 9 07:55:10 2008 @@ -1628,4 +1628,17 @@ ab No match +/(\x{de})\1/ + \x{de}\x{de} + 0: \xde\xde + 1: \xde + \x{123} +** Character \x{123} is greater than 255 and UTF-8 mode is not enabled. +** Truncation will probably give the wrong result. +No match + +/X/8f<any> + A\x{1ec5}ABCXYZ + 0: X + / End of testinput5 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput6?r1=1.3.2.1.2.5.2.1&r2=1.3.2.1.2.5.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput6 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput6:1.3.2.1.2.5.2.1 php-src/ext/pcre/pcrelib/testdata/testoutput6:1.3.2.1.2.5.2.2 --- php-src/ext/pcre/pcrelib/testdata/testoutput6:1.3.2.1.2.5.2.1 Sun Jan 13 12:44:57 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput6 Tue Sep 9 07:55:10 2008 @@ -1431,7 +1431,7 @@ 0: \x{1b00}\x{12000}\x{7c0}\x{a840}\x{10900} /The next two are special cases where the lengths of the different cases of the -same character differ. The first went wrong with heap fram storage; the 2nd +same character differ. The first went wrong with heap frame storage; the 2nd was broken in all cases./ /^\x{023a}+?(\x{0130}+)/8i @@ -1679,4 +1679,72 @@ End ------------------------------------------------------------------ +/\x{c0}+\x{116}+/8i + \x{c0}\x{e0}\x{116}\x{117} + 0: \x{c0}\x{e0}\x{116}\x{117} + +/[\x{c0}\x{116}]+/8i + \x{c0}\x{e0}\x{116}\x{117} + 0: \x{c0}\x{e0}\x{116}\x{117} + +/\p{Carian}\p{Cham}\p{Kayah_Li}\p{Lepcha}\p{Lycian}\p{Lydian}\p{Ol_Chiki}\p{Rejang}\p{Saurashtra}\p{Sundanese}\p{Vai}/8 + \x{102A4}\x{AA52}\x{A91D}\x{1C46}\x{10283}\x{1092E}\x{1C6B}\x{A93B}\x{A8BF}\x{1BA0}\x{A50A}==== + 0: \x{102a4}\x{aa52}\x{a91d}\x{1c46}\x{10283}\x{1092e}\x{1c6b}\x{a93b}\x{a8bf}\x{1ba0}\x{a50a} + +/\x{a77d}\x{1d79}/8i + \x{a77d}\x{1d79} + 0: \x{a77d}\x{1d79} + \x{1d79}\x{a77d} + 0: \x{1d79}\x{a77d} + +/\x{a77d}\x{1d79}/8 + \x{a77d}\x{1d79} + 0: \x{a77d}\x{1d79} + ** Failers +No match + \x{1d79}\x{a77d} +No match + +/(A)\1/8i + AA + 0: AA + 1: A + Aa + 0: Aa + 1: A + aa + 0: aa + 1: a + aA + 0: aA + 1: a + +/(\x{de})\1/8i + \x{de}\x{de} + 0: \x{de}\x{de} + 1: \x{de} + \x{de}\x{fe} + 0: \x{de}\x{fe} + 1: \x{de} + \x{fe}\x{fe} + 0: \x{fe}\x{fe} + 1: \x{fe} + \x{fe}\x{de} + 0: \x{fe}\x{de} + 1: \x{fe} + +/(\x{10a})\1/8i + \x{10a}\x{10a} + 0: \x{10a}\x{10a} + 1: \x{10a} + \x{10a}\x{10b} + 0: \x{10a}\x{10b} + 1: \x{10a} + \x{10b}\x{10b} + 0: \x{10b}\x{10b} + 1: \x{10b} + \x{10b}\x{10a} + 0: \x{10b}\x{10a} + 1: \x{10b} + / End of testinput6 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput7?r1=1.1.2.1.2.4.2.2&r2=1.1.2.1.2.4.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput7 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput7:1.1.2.1.2.4.2.2 php-src/ext/pcre/pcrelib/testdata/testoutput7:1.1.2.1.2.4.2.3 --- php-src/ext/pcre/pcrelib/testdata/testoutput7:1.1.2.1.2.4.2.2 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput7 Tue Sep 9 07:55:10 2008 @@ -6805,7 +6805,7 @@ No match /^abc./mgx<any> - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 \x{2028}abc8 \x{2029}abc9 JUNK + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK 0: abc1 0: abc2 0: abc3 @@ -6815,7 +6815,7 @@ 0: abc7 /abc.$/mgx<any> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 0: abc1 0: abc2 0: abc3 http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput8?r1=1.1.2.1.2.2.2.1&r2=1.1.2.1.2.2.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput8 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput8:1.1.2.1.2.2.2.1 php-src/ext/pcre/pcrelib/testdata/testoutput8:1.1.2.1.2.2.2.2 --- php-src/ext/pcre/pcrelib/testdata/testoutput8:1.1.2.1.2.2.2.1 Sun Oct 7 10:35:03 2007 +++ php-src/ext/pcre/pcrelib/testdata/testoutput8 Tue Sep 9 07:55:10 2008 @@ -1284,4 +1284,8 @@ a\x0bb\<bsr_anycrlf> No match +/X/8f<any> + A\x{1ec5}ABCXYZ + 0: X + / End of testinput 8 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput9?r1=1.1.2.1.2.3&r2=1.1.2.1.2.3.2.1&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput9 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput9:1.1.2.1.2.3 php-src/ext/pcre/pcrelib/testdata/testoutput9:1.1.2.1.2.3.2.1 --- php-src/ext/pcre/pcrelib/testdata/testoutput9:1.1.2.1.2.3 Sat Sep 1 17:48:43 2007 +++ php-src/ext/pcre/pcrelib/testdata/testoutput9 Tue Sep 9 07:55:10 2008 @@ -1632,6 +1632,18 @@ \x{023a}\x{2c65}X 0: \x{23a}\x{2c65} +/\x{c0}+\x{116}+/8i + \x{c0}\x{e0}\x{116}\x{117} + 0: \x{c0}\x{e0}\x{116}\x{117} + 1: \x{c0}\x{e0}\x{116} + +/[\x{c0}\x{116}]+/8i + \x{c0}\x{e0}\x{116}\x{117} + 0: \x{c0}\x{e0}\x{116}\x{117} + 1: \x{c0}\x{e0}\x{116} + 2: \x{c0}\x{e0} + 3: \x{c0} + /Check property support in non-UTF-8 mode/ /\p{L}{4}/ @@ -1640,4 +1652,22 @@ 123abc\xc4\xc5zz 0: abc\xc4 +/\p{Carian}\p{Cham}\p{Kayah_Li}\p{Lepcha}\p{Lycian}\p{Lydian}\p{Ol_Chiki}\p{Rejang}\p{Saurashtra}\p{Sundanese}\p{Vai}/8 + \x{102A4}\x{AA52}\x{A91D}\x{1C46}\x{10283}\x{1092E}\x{1C6B}\x{A93B}\x{A8BF}\x{1BA0}\x{A50A}==== + 0: \x{102a4}\x{aa52}\x{a91d}\x{1c46}\x{10283}\x{1092e}\x{1c6b}\x{a93b}\x{a8bf}\x{1ba0}\x{a50a} + +/\x{a77d}\x{1d79}/8i + \x{a77d}\x{1d79} + 0: \x{a77d}\x{1d79} + \x{1d79}\x{a77d} + 0: \x{1d79}\x{a77d} + +/\x{a77d}\x{1d79}/8 + \x{a77d}\x{1d79} + 0: \x{a77d}\x{1d79} + ** Failers +No match + \x{1d79}\x{a77d} +No match + / End / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_ucd.c?view=markup&rev=1.1 Index: php-src/ext/pcre/pcrelib/pcre_ucd.c +++ php-src/ext/pcre/pcrelib/pcre_ucd.c
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.310&r2=1.2027.2.547.2.965.2.311&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.310 php-src/NEWS:1.2027.2.547.2.965.2.311 --- php-src/NEWS:1.2027.2.547.2.965.2.310 Sun Sep 7 23:08:20 2008 +++ php-src/NEWS Tue Sep 9 07:55:07 2008 @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 200?, PHP 5.3.0 Alpha 3 +- Upgraded bundled PCRE to version 7.8. (Nuno) - Changed Soap methods error level, now it is no longer E_ERROR. (Felipe) - Fixed bug #45911 (Cannot disable ext/hash). (Arnaud) http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/config.w32?r1=1.4.2.5.2.7.2.2&r2=1.4.2.5.2.7.2.3&diff_format=u Index: php-src/ext/pcre/config.w32 diff -u php-src/ext/pcre/config.w32:1.4.2.5.2.7.2.2 php-src/ext/pcre/config.w32:1.4.2.5.2.7.2.3 --- php-src/ext/pcre/config.w32:1.4.2.5.2.7.2.2 Mon Jun 23 10:22:40 2008 +++ php-src/ext/pcre/config.w32 Tue Sep 9 07:55:07 2008 @@ -1,11 +1,11 @@ -// $Id: config.w32,v 1.4.2.5.2.7.2.2 2008/06/23 10:22:40 pajoye Exp $ +// $Id: config.w32,v 1.4.2.5.2.7.2.3 2008/09/09 07:55:07 nlopess Exp $ // vim:ft=javascript EXTENSION("pcre", "php_pcre.c", false /* never shared */, "-DNO_RECURSE -Iext/pcre/pcrelib"); -ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_ucp_searchfuncs.c pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_info.c pcre_maketables.c pcre_newline.c pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_try_flipped.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c", "pcre"); +ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_ucd.c pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_info.c pcre_maketables.c pcre_newline.c pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_try_flipped.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c", "pcre"); ADD_DEF_FILE("ext\\pcre\\php_pcre.def"); AC_DEFINE('HAVE_BUNDLED_PCRE', 1, 'Using bundled PCRE library'); AC_DEFINE('HAVE_PCRE', 1, 'Have PCRE library'); -PHP_PCRE="yes"; \ No newline at end of file +PHP_PCRE="yes"; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/config0.m4?r1=1.38.2.3.2.10.2.3&r2=1.38.2.3.2.10.2.4&diff_format=u Index: php-src/ext/pcre/config0.m4 diff -u php-src/ext/pcre/config0.m4:1.38.2.3.2.10.2.3 php-src/ext/pcre/config0.m4:1.38.2.3.2.10.2.4 --- php-src/ext/pcre/config0.m4:1.38.2.3.2.10.2.3 Mon Jun 2 14:12:20 2008 +++ php-src/ext/pcre/config0.m4 Tue Sep 9 07:55:07 2008 @@ -1,5 +1,5 @@ dnl -dnl $Id: config0.m4,v 1.38.2.3.2.10.2.3 2008/06/02 14:12:20 jani Exp $ +dnl $Id: config0.m4,v 1.38.2.3.2.10.2.4 2008/09/09 07:55:07 nlopess Exp $ dnl dnl By default we'll compile and link against the bundled PCRE library @@ -52,7 +52,7 @@ else AC_MSG_CHECKING([for PCRE library to use]) AC_MSG_RESULT([bundled]) - pcrelib_sources="pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.c \ + pcrelib_sources="pcrelib/pcre_chartables.c pcrelib/pcre_ucd.c \ pcrelib/pcre_compile.c pcrelib/pcre_config.c pcrelib/pcre_exec.c \ pcrelib/pcre_fullinfo.c pcrelib/pcre_get.c pcrelib/pcre_globals.c \ pcrelib/pcre_info.c pcrelib/pcre_maketables.c pcrelib/pcre_newline.c \ http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/ChangeLog?r1=1.12.2.1.2.5.2.4&r2=1.12.2.1.2.5.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/ChangeLog diff -u php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.5.2.4 php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.5.2.5 --- php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.5.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/ChangeLog Tue Sep 9 07:55:07 2008 @@ -1,6 +1,84 @@ ChangeLog for PCRE ------------------ +Version 7.8 05-Sep-08 +--------------------- + +1. Replaced UCP searching code with optimized version as implemented for Ad + Muncher (http://www.admuncher.com/) by Peter Kankowski. This uses a two- + stage table and inline lookup instead of a function, giving speed ups of 2 + to 5 times on some simple patterns that I tested. Permission was given to + distribute the MultiStage2.py script that generates the tables (it's not in + the tarball, but is in the Subversion repository). + +2. Updated the Unicode datatables to Unicode 5.1.0. This adds yet more + scripts. + +3. Change 12 for 7.7 introduced a bug in pcre_study() when a pattern contained + a group with a zero qualifier. The result of the study could be incorrect, + or the function might crash, depending on the pattern. + +4. Caseless matching was not working for non-ASCII characters in back + references. For example, /(\x{de})\1/8i was not matching \x{de}\x{fe}. + It now works when Unicode Property Support is available. + +5. In pcretest, an escape such as \x{de} in the data was always generating + a UTF-8 string, even in non-UTF-8 mode. Now it generates a single byte in + non-UTF-8 mode. If the value is greater than 255, it gives a warning about + truncation. + +6. Minor bugfix in pcrecpp.cc (change "" == ... to NULL == ...). + +7. Added two (int) casts to pcregrep when printing the difference of two + pointers, in case they are 64-bit values. + +8. Added comments about Mac OS X stack usage to the pcrestack man page and to + test 2 if it fails. + +9. Added PCRE_CALL_CONVENTION just before the names of all exported functions, + and a #define of that name to empty if it is not externally set. This is to + allow users of MSVC to set it if necessary. + +10. The PCRE_EXP_DEFN macro which precedes exported functions was missing from + the convenience functions in the pcre_get.c source file. + +11. An option change at the start of a pattern that had top-level alternatives + could cause overwriting and/or a crash. This command provoked a crash in + some environments: + + printf "/(?i)[\xc3\xa9\xc3\xbd]|[\xc3\xa9\xc3\xbdA]/8\n" | pcretest + + This potential security problem was recorded as CVE-2008-2371. + +12. For a pattern where the match had to start at the beginning or immediately + after a newline (e.g /.*anything/ without the DOTALL flag), pcre_exec() and + pcre_dfa_exec() could read past the end of the passed subject if there was + no match. To help with detecting such bugs (e.g. with valgrind), I modified + pcretest so that it places the subject at the end of its malloc-ed buffer. + +13. The change to pcretest in 12 above threw up a couple more cases when pcre_ + exec() might read past the end of the data buffer in UTF-8 mode. + +14. A similar bug to 7.3/2 existed when the PCRE_FIRSTLINE option was set and + the data contained the byte 0x85 as part of a UTF-8 character within its + first line. This applied both to normal and DFA matching. + +15. Lazy qualifiers were not working in some cases in UTF-8 mode. For example, + /^[^d]*?$/8 failed to match "abc". + +16. Added a missing copyright notice to pcrecpp_internal.h. + +17. Make it more clear in the documentation that values returned from + pcre_exec() in ovector are byte offsets, not character counts. + +18. Tidied a few places to stop certain compilers from issuing warnings. + +19. Updated the Virtual Pascal + BCC files to compile the latest v7.7, as + supplied by Stefan Weber. I made a further small update for 7.8 because + there is a change of source arrangements: the pcre_searchfuncs.c module is + replaced by pcre_ucd.c. + + Version 7.7 07-May-08 --------------------- http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/NEWS?r1=1.7.2.1.2.5.2.4&r2=1.7.2.1.2.5.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/NEWS diff -u php-src/ext/pcre/pcrelib/NEWS:1.7.2.1.2.5.2.4 php-src/ext/pcre/pcrelib/NEWS:1.7.2.1.2.5.2.5 --- php-src/ext/pcre/pcrelib/NEWS:1.7.2.1.2.5.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/NEWS Tue Sep 9 07:55:07 2008 @@ -2,6 +2,13 @@ ------------------------ +Release 7.8 05-Sep-08 +--------------------- + +More bug fixes, plus a performance improvement in Unicode character property +lookup. + + Release 7.7 07-May-08 --------------------- http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/NON-UNIX-USE?r1=1.7.2.1.2.3.2.3&r2=1.7.2.1.2.3.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/NON-UNIX-USE diff -u php-src/ext/pcre/pcrelib/NON-UNIX-USE:1.7.2.1.2.3.2.3 php-src/ext/pcre/pcrelib/NON-UNIX-USE:1.7.2.1.2.3.2.4 --- php-src/ext/pcre/pcrelib/NON-UNIX-USE:1.7.2.1.2.3.2.3 Tue Jan 29 20:18:01 2008 +++ php-src/ext/pcre/pcrelib/NON-UNIX-USE Tue Sep 9 07:55:07 2008 @@ -85,8 +85,6 @@ pcre_internal.h ucp.h - ucpinternal.h - ucptable.h (5) Also ensure that you have the following file, which is #included as source when building a debugging version of PCRE, and is also used by pcretest. @@ -113,7 +111,7 @@ pcre_study.c pcre_tables.c pcre_try_flipped.c - pcre_ucp_searchfuncs.c + pcre_ucd.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c @@ -190,6 +188,17 @@ __declspec(dllimport), with unwanted results. +CALLING CONVENTIONS IN WINDOWS ENVIRONMENTS + +It is possible to compile programs to use different calling conventions using +MSVC. Search the web for "calling conventions" for more information. To make it +easier to change the calling convention for the exported functions in the +PCRE library, the macro PCRE_CALL_CONVENTION is present in all the external +definitions. It can be set externally when compiling (e.g. in CFLAGS). If it is +not set, it defaults to empty; the default calling convention is then used +(which is what is wanted most of the time). + + COMMENTS ABOUT WIN32 BUILDS (see also "BUILDING PCRE WITH CMAKE" below) There are two ways of building PCRE using the "configure, make, make install" @@ -428,5 +437,5 @@ $! ========================= -Last Updated: 25 January 2008 +Last Updated: 05 September 2008 **** http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/README?r1=1.11.2.1.2.3.2.4&r2=1.11.2.1.2.3.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/README diff -u php-src/ext/pcre/pcrelib/README:1.11.2.1.2.3.2.4 php-src/ext/pcre/pcrelib/README:1.11.2.1.2.3.2.5 --- php-src/ext/pcre/pcrelib/README:1.11.2.1.2.3.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/README Tue Sep 9 07:55:08 2008 @@ -1,9 +1,12 @@ README file for PCRE (Perl-compatible regular expression library) ----------------------------------------------------------------- -The latest release of PCRE is always available from +The latest release of PCRE is always available in three alternative formats +from: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.gz + ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.bz2 + ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.zip There is a mailing list for discussion about the development of PCRE at @@ -640,7 +643,7 @@ pcre_study.c ) pcre_tables.c ) pcre_try_flipped.c ) - pcre_ucp_searchfuncs.c ) + pcre_ucd.c ) pcre_valid_utf8.c ) pcre_version.c ) pcre_xclass.c ) @@ -649,9 +652,7 @@ pcre.h.in template for pcre.h when built by "configure" pcreposix.h header for the external POSIX wrapper API pcre_internal.h header for internal use - ucp.h ) headers concerned with - ucpinternal.h ) Unicode property handling - ucptable.h ) (this one is the data table) + ucp.h header for Unicode property handling config.h.in template for config.h, which is built by "configure" @@ -725,6 +726,9 @@ (D) Auxiliary files for cmake support + cmake/COPYING-CMAKE-SCRIPTS + cmake/FindPackageHandleStandardArgs.cmake + cmake/FindReadline.cmake CMakeLists.txt config-cmake.h.in @@ -749,4 +753,4 @@ Philip Hazel Email local part: ph10 Email domain: cam.ac.uk -Last updated: 13 April 2008 +Last updated: 05 September 2008 http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/config.h?r1=1.2.2.4.2.4&r2=1.2.2.4.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/config.h diff -u php-src/ext/pcre/pcrelib/config.h:1.2.2.4.2.4 php-src/ext/pcre/pcrelib/config.h:1.2.2.4.2.5 --- php-src/ext/pcre/pcrelib/config.h:1.2.2.4.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/config.h Tue Sep 9 07:55:08 2008 @@ -249,13 +249,13 @@ #define PACKAGE_NAME "PCRE" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "PCRE 7.7" +#define PACKAGE_STRING "PCRE 7.8" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "pcre" /* Define to the version of this package. */ -#define PACKAGE_VERSION "7.7" +#define PACKAGE_VERSION "7.8" /* If you are compiling for a system other than a Unix-like system or @@ -308,7 +308,7 @@ /* Version number of package */ #ifndef VERSION -#define VERSION "7.7" +#define VERSION "7.8" #endif /* Define to empty if `const' does not conform to ANSI C. */ http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre.h?r1=1.18.2.1.2.7.2.4&r2=1.18.2.1.2.7.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre.h diff -u php-src/ext/pcre/pcrelib/pcre.h:1.18.2.1.2.7.2.4 php-src/ext/pcre/pcrelib/pcre.h:1.18.2.1.2.7.2.5 --- php-src/ext/pcre/pcrelib/pcre.h:1.18.2.1.2.7.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/pcre.h Tue Sep 9 07:55:08 2008 @@ -42,9 +42,9 @@ /* The current PCRE version information. */ #define PCRE_MAJOR 7 -#define PCRE_MINOR 7 +#define PCRE_MINOR 8 #define PCRE_PRERELEASE -#define PCRE_DATE 2008-05-07 +#define PCRE_DATE 2008-09-05 /* When an application links to a PCRE DLL in Windows, the symbols that are imported have to be identified as such. When building PCRE, the appropriate http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_compile.c?r1=1.1.2.1.2.6.2.5&r2=1.1.2.1.2.6.2.6&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_compile.c diff -u php-src/ext/pcre/pcrelib/pcre_compile.c:1.1.2.1.2.6.2.5 php-src/ext/pcre/pcrelib/pcre_compile.c:1.1.2.1.2.6.2.6 --- php-src/ext/pcre/pcrelib/pcre_compile.c:1.1.2.1.2.6.2.5 Sun Jul 6 15:23:31 2008 +++ php-src/ext/pcre/pcrelib/pcre_compile.c Tue Sep 9 07:55:08 2008 @@ -453,7 +453,7 @@ find_error_text(int n) { const char *s = error_texts; -for (; n > 0; n--) while (*s++ != 0); +for (; n > 0; n--) while (*s++ != 0) {}; return s; } @@ -1000,7 +1000,7 @@ if (*(++ptr) == 0) return -1; if (*ptr == 'Q') for (;;) { - while (*(++ptr) != 0 && *ptr != '\\'); + while (*(++ptr) != 0 && *ptr != '\\') {}; if (*ptr == 0) return -1; if (*(++ptr) == 'E') break; } @@ -1043,7 +1043,7 @@ if (*(++ptr) == 0) return -1; if (*ptr == 'Q') for (;;) { - while (*(++ptr) != 0 && *ptr != '\\'); + while (*(++ptr) != 0 && *ptr != '\\') {}; if (*ptr == 0) return -1; if (*(++ptr) == 'E') break; } @@ -1057,7 +1057,7 @@ if (xmode && *ptr == '#') { - while (*(++ptr) != 0 && *ptr != '\n'); + while (*(++ptr) != 0 && *ptr != '\n') {}; if (*ptr == 0) return -1; continue; } @@ -1448,6 +1448,8 @@ if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f]; break; } +#else + (void)(utf8); /* Keep compiler happy by referencing function argument */ #endif } } @@ -1541,6 +1543,8 @@ if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f]; break; } +#else + (void)(utf8); /* Keep compiler happy by referencing function argument */ #endif } } @@ -2013,7 +2017,7 @@ unsigned int c, othercase, next; for (c = *cptr; c <= d; c++) - { if ((othercase = _pcre_ucp_othercase(c)) != NOTACHAR) break; } + { if ((othercase = UCD_OTHERCASE(c)) != c) break; } if (c > d) return FALSE; @@ -2022,7 +2026,7 @@ for (++c; c <= d; c++) { - if (_pcre_ucp_othercase(c) != next) break; + if (UCD_OTHERCASE(c) != next) break; next++; } @@ -2132,6 +2136,8 @@ case OP_CHAR: #ifdef SUPPORT_UTF8 if (utf8 && item > 127) { GETCHAR(item, utf8_char); } +#else + (void)(utf8_char); /* Keep compiler happy by referencing function argument */ #endif return item != next; @@ -2150,7 +2156,7 @@ unsigned int othercase; if (next < 128) othercase = cd->fcc[next]; else #ifdef SUPPORT_UCP - othercase = _pcre_ucp_othercase((unsigned int)next); + othercase = UCD_OTHERCASE((unsigned int)next); #else othercase = NOTACHAR; #endif @@ -2171,7 +2177,7 @@ unsigned int othercase; if (next < 128) othercase = cd->fcc[next]; else #ifdef SUPPORT_UCP - othercase = _pcre_ucp_othercase(next); + othercase = UCD_OTHERCASE(next); #else othercase = NOTACHAR; #endif @@ -3337,7 +3343,7 @@ if ((options & PCRE_CASELESS) != 0) { unsigned int othercase; - if ((othercase = _pcre_ucp_othercase(c)) != NOTACHAR) + if ((othercase = UCD_OTHERCASE(c)) != c) { *class_utf8data++ = XCL_SINGLE; class_utf8data += _pcre_ord2utf8(othercase, class_utf8data); @@ -4214,7 +4220,7 @@ const char *vn = verbnames; const uschar *name = ++ptr; previous = NULL; - while ((cd->ctypes[*++ptr] & ctype_letter) != 0); + while ((cd->ctypes[*++ptr] & ctype_letter) != 0) {}; if (*ptr == ':') { *errorcodeptr = ERR59; /* Not supported */ @@ -4918,10 +4924,8 @@ both phases. If we are not at the pattern start, compile code to change the ims - options if this setting actually changes any of them. We also pass the - new setting back so that it can be put at the start of any following - branches, and when this group ends (if we are in a group), a resetting - item can be compiled. */ + options if this setting actually changes any of them, and reset the + greedy defaults and the case value for firstbyte and reqbyte. */ if (*ptr == ')') { @@ -4929,7 +4933,6 @@ (lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE)) { cd->external_options = newoptions; - options = *optionsptr = newoptions; } else { @@ -4938,17 +4941,17 @@ *code++ = OP_OPT; *code++ = newoptions & PCRE_IMS; } - - /* Change options at this level, and pass them back for use - in subsequent branches. Reset the greedy defaults and the case - value for firstbyte and reqbyte. */ - - *optionsptr = options = newoptions; greedy_default = ((newoptions & PCRE_UNGREEDY) != 0); greedy_non_default = greedy_default ^ 1; - req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0; + req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS : 0; } + /* Change options at this level, and pass them back for use + in subsequent branches. When not at the start of the pattern, this + information is also necessary so that a resetting item can be + compiled at the end of a group (if we are in a group). */ + + *optionsptr = options = newoptions; previous = NULL; /* This item can't be repeated */ continue; /* It is complete */ } @@ -5942,7 +5945,7 @@ with errorptr and erroroffset set */ -PCRE_EXP_DEFN pcre * +PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION pcre_compile(const char *pattern, int options, const char **errorptr, int *erroroffset, const unsigned char *tables) { @@ -5950,7 +5953,7 @@ } -PCRE_EXP_DEFN pcre * +PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION pcre_compile2(const char *pattern, int options, int *errorcodeptr, const char **errorptr, int *erroroffset, const unsigned char *tables) { http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_config.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_config.c diff -u php-src/ext/pcre/pcrelib/pcre_config.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_config.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_config.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_config.c Tue Sep 9 07:55:08 2008 @@ -60,7 +60,7 @@ Returns: 0 if data returned, negative on error */ -PCRE_EXP_DEFN int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_config(int what, void *where) { switch (what) http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_exec.c?r1=1.1.2.1.2.7.2.4&r2=1.1.2.1.2.7.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_exec.c diff -u php-src/ext/pcre/pcrelib/pcre_exec.c:1.1.2.1.2.7.2.4 php-src/ext/pcre/pcrelib/pcre_exec.c:1.1.2.1.2.7.2.5 --- php-src/ext/pcre/pcrelib/pcre_exec.c:1.1.2.1.2.7.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/pcre_exec.c Tue Sep 9 07:55:08 2008 @@ -156,13 +156,39 @@ if (length > md->end_subject - eptr) return FALSE; -/* Separate the caselesss case for speed */ +/* Separate the caseless case for speed. In UTF-8 mode we can only do this +properly if Unicode properties are supported. Otherwise, we can check only +ASCII characters. */ if ((ims & PCRE_CASELESS) != 0) { +#ifdef SUPPORT_UTF8 +#ifdef SUPPORT_UCP + if (md->utf8) + { + USPTR endptr = eptr + length; + while (eptr < endptr) + { + int c, d; + GETCHARINC(c, eptr); + GETCHARINC(d, p); + if (c != d && c != UCD_OTHERCASE(d)) return FALSE; + } + } + else +#endif +#endif + + /* The same code works when not in UTF-8 mode and in UTF-8 mode when there + is no UCP support. */ + while (length-- > 0) - if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE; + { if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE; } } + +/* In the caseful case, we can just compare the bytes, whether or not we +are in UTF-8 mode. */ + else { while (length-- > 0) if (*p++ != *eptr++) return FALSE; } @@ -1651,8 +1677,7 @@ if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); { - int chartype, script; - int category = _pcre_ucp_findprop(c, &chartype, &script); + const ucd_record * prop = GET_UCD(c); switch(ecode[1]) { @@ -1661,24 +1686,24 @@ break; case PT_LAMP: - if ((chartype == ucp_Lu || - chartype == ucp_Ll || - chartype == ucp_Lt) == (op == OP_NOTPROP)) + if ((prop->chartype == ucp_Lu || + prop->chartype == ucp_Ll || + prop->chartype == ucp_Lt) == (op == OP_NOTPROP)) RRETURN(MATCH_NOMATCH); break; case PT_GC: - if ((ecode[2] != category) == (op == OP_PROP)) + if ((ecode[2] != _pcre_ucp_gentype[prop->chartype]) == (op == OP_PROP)) RRETURN(MATCH_NOMATCH); break; case PT_PC: - if ((ecode[2] != chartype) == (op == OP_PROP)) + if ((ecode[2] != prop->chartype) == (op == OP_PROP)) RRETURN(MATCH_NOMATCH); break; case PT_SC: - if ((ecode[2] != script) == (op == OP_PROP)) + if ((ecode[2] != prop->script) == (op == OP_PROP)) RRETURN(MATCH_NOMATCH); break; @@ -1697,8 +1722,7 @@ if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); { - int chartype, script; - int category = _pcre_ucp_findprop(c, &chartype, &script); + int category = UCD_CATEGORY(c); if (category == ucp_M) RRETURN(MATCH_NOMATCH); while (eptr < md->end_subject) { @@ -1707,7 +1731,7 @@ { GETCHARLEN(c, eptr, len); } - category = _pcre_ucp_findprop(c, &chartype, &script); + category = UCD_CATEGORY(c); if (category != ucp_M) break; eptr += len; } @@ -2172,7 +2196,7 @@ if (fc != dc) { #ifdef SUPPORT_UCP - if (dc != _pcre_ucp_othercase(fc)) + if (dc != UCD_OTHERCASE(fc)) #endif RRETURN(MATCH_NOMATCH); } @@ -2263,7 +2287,7 @@ #ifdef SUPPORT_UCP unsigned int othercase; if ((ims & PCRE_CASELESS) != 0 && - (othercase = _pcre_ucp_othercase(fc)) != NOTACHAR) + (othercase = UCD_OTHERCASE(fc)) != fc) oclength = _pcre_ord2utf8(othercase, occhars); else oclength = 0; #endif /* SUPPORT_UCP */ @@ -2583,10 +2607,11 @@ { RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28); if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(d, eptr); if (d < 256) d = md->lcc[d]; - if (fi >= max || eptr >= md->end_subject || fc == d) - RRETURN(MATCH_NOMATCH); + if (fc == d) RRETURN(MATCH_NOMATCH); + } } else @@ -2692,9 +2717,9 @@ { RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32); if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(d, eptr); - if (fi >= max || eptr >= md->end_subject || fc == d) - RRETURN(MATCH_NOMATCH); + if (fc == d) RRETURN(MATCH_NOMATCH); } } else @@ -2868,7 +2893,7 @@ { if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == ucp_Lu || prop_chartype == ucp_Ll || prop_chartype == ucp_Lt) == prop_fail_result) @@ -2881,7 +2906,7 @@ { if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if ((prop_category == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -2892,7 +2917,7 @@ { if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -2903,7 +2928,7 @@ { if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_script = UCD_SCRIPT(c); if ((prop_script == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -2922,7 +2947,7 @@ for (i = 1; i <= min; i++) { GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); while (eptr < md->end_subject) { @@ -2931,7 +2956,7 @@ { GETCHARLEN(c, eptr, len); } - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category != ucp_M) break; eptr += len; } @@ -3347,7 +3372,7 @@ if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == ucp_Lu || prop_chartype == ucp_Ll || prop_chartype == ucp_Lt) == prop_fail_result) @@ -3362,7 +3387,7 @@ if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if ((prop_category == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -3375,7 +3400,7 @@ if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -3388,7 +3413,7 @@ if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_script = UCD_SCRIPT(c); if ((prop_script == prop_value) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -3410,7 +3435,7 @@ if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); while (eptr < md->end_subject) { @@ -3419,7 +3444,7 @@ { GETCHARLEN(c, eptr, len); } - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category != ucp_M) break; eptr += len; } @@ -3737,7 +3762,7 @@ int len = 1; if (eptr >= md->end_subject) break; GETCHARLEN(c, eptr, len); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == ucp_Lu || prop_chartype == ucp_Ll || prop_chartype == ucp_Lt) == prop_fail_result) @@ -3752,7 +3777,7 @@ int len = 1; if (eptr >= md->end_subject) break; GETCHARLEN(c, eptr, len); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if ((prop_category == prop_value) == prop_fail_result) break; eptr+= len; @@ -3765,7 +3790,7 @@ int len = 1; if (eptr >= md->end_subject) break; GETCHARLEN(c, eptr, len); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_chartype = UCD_CHARTYPE(c); if ((prop_chartype == prop_value) == prop_fail_result) break; eptr+= len; @@ -3778,7 +3803,7 @@ int len = 1; if (eptr >= md->end_subject) break; GETCHARLEN(c, eptr, len); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_script = UCD_SCRIPT(c); if ((prop_script == prop_value) == prop_fail_result) break; eptr+= len; @@ -3807,7 +3832,7 @@ { if (eptr >= md->end_subject) break; GETCHARINCTEST(c, eptr); - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category == ucp_M) break; while (eptr < md->end_subject) { @@ -3816,7 +3841,7 @@ { GETCHARLEN(c, eptr, len); } - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category != ucp_M) break; eptr += len; } @@ -3838,7 +3863,7 @@ BACKCHAR(eptr); GETCHARLEN(c, eptr, len); } - prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); + prop_category = UCD_CATEGORY(c); if (prop_category != ucp_M) break; eptr--; } @@ -4358,7 +4383,7 @@ < -1 => some kind of unexpected problem */ -PCRE_EXP_DEFN int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, PCRE_SPTR subject, int length, int start_offset, int options, int *offsets, int offsetcount) @@ -4670,31 +4695,53 @@ if (firstline) { USPTR t = start_match; +#ifdef SUPPORT_UTF8 + if (utf8) + { + while (t < md->end_subject && !IS_NEWLINE(t)) + { + t++; + while (t < end_subject && (*t & 0xc0) == 0x80) t++; + } + } + else +#endif while (t < md->end_subject && !IS_NEWLINE(t)) t++; end_subject = t; } - /* Now test for a unique first byte */ + /* Now advance to a unique first byte if there is one. */ if (first_byte >= 0) { if (first_byte_caseless) - while (start_match < end_subject && - md->lcc[*start_match] != first_byte) - { NEXTCHAR(start_match); } + while (start_match < end_subject && md->lcc[*start_match] != first_byte) + start_match++; else while (start_match < end_subject && *start_match != first_byte) - { NEXTCHAR(start_match); } + start_match++; } - /* Or to just after a linebreak for a multiline match if possible */ + /* Or to just after a linebreak for a multiline match */ else if (startline) { if (start_match > md->start_subject + start_offset) { - while (start_match <= end_subject && !WAS_NEWLINE(start_match)) - { NEXTCHAR(start_match); } +#ifdef SUPPORT_UTF8 + if (utf8) + { + while (start_match < end_subject && !WAS_NEWLINE(start_match)) + { + start_match++; + while(start_match < end_subject && (*start_match & 0xc0) == 0x80) + start_match++; + } + } + else +#endif + while (start_match < end_subject && !WAS_NEWLINE(start_match)) + start_match++; /* If we have just passed a CR and the newline option is ANY or ANYCRLF, and we are now at a LF, advance the match position by one more character. @@ -4708,16 +4755,15 @@ } } - /* Or to a non-unique first char after study */ + /* Or to a non-unique first byte after study */ else if (start_bits != NULL) { while (start_match < end_subject) { register unsigned int c = *start_match; - if ((start_bits[c/8] & (1 << (c&7))) == 0) - { NEXTCHAR(start_match); } - else break; + if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++; + else break; } } http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_fullinfo.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_fullinfo.c diff -u php-src/ext/pcre/pcrelib/pcre_fullinfo.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_fullinfo.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_fullinfo.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_fullinfo.c Tue Sep 9 07:55:08 2008 @@ -63,7 +63,7 @@ Returns: 0 if data returned, negative on error */ -PCRE_EXP_DEFN int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what, void *where) { http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_get.c?r1=1.1.2.1.2.6.2.2&r2=1.1.2.1.2.6.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_get.c diff -u php-src/ext/pcre/pcrelib/pcre_get.c:1.1.2.1.2.6.2.2 php-src/ext/pcre/pcrelib/pcre_get.c:1.1.2.1.2.6.2.3 --- php-src/ext/pcre/pcrelib/pcre_get.c:1.1.2.1.2.6.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_get.c Tue Sep 9 07:55:08 2008 @@ -63,7 +63,7 @@ (PCRE_ERROR_NOSUBSTRING) if not found */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_stringnumber(const pcre *code, const char *stringname) { int rc; @@ -112,7 +112,7 @@ (PCRE_ERROR_NOSUBSTRING) if not found */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_stringtable_entries(const pcre *code, const char *stringname, char **firstptr, char **lastptr) { @@ -229,7 +229,7 @@ PCRE_ERROR_NOSUBSTRING (-7) no such captured substring */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int size) { @@ -274,7 +274,7 @@ PCRE_ERROR_NOSUBSTRING (-7) no such captured substring */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int size) { @@ -306,7 +306,7 @@ PCRE_ERROR_NOMEMORY (-6) failed to get store */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_substring_list(const char *subject, int *ovector, int stringcount, const char ***listptr) { @@ -351,7 +351,7 @@ Returns: nothing */ -void +PCRE_EXP_DEFN void PCRE_CALL_CONVENTION pcre_free_substring_list(const char **pointer) { (pcre_free)((void *)pointer); @@ -384,7 +384,7 @@ PCRE_ERROR_NOSUBSTRING (-7) substring not present */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_substring(const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr) { @@ -431,7 +431,7 @@ PCRE_ERROR_NOSUBSTRING (-7) no such captured substring */ -int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, const char **stringptr) { @@ -454,7 +454,7 @@ Returns: nothing */ -void +PCRE_EXP_DEFN void PCRE_CALL_CONVENTION pcre_free_substring(const char *pointer) { (pcre_free)((void *)pointer); http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_info.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_info.c diff -u php-src/ext/pcre/pcrelib/pcre_info.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_info.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_info.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_info.c Tue Sep 9 07:55:08 2008 @@ -70,7 +70,7 @@ or negative values on error */ -PCRE_EXP_DEFN int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_info(const pcre *argument_re, int *optptr, int *first_byte) { real_pcre internal_re; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_internal.h?r1=1.1.2.1.2.5.2.4&r2=1.1.2.1.2.5.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_internal.h diff -u php-src/ext/pcre/pcrelib/pcre_internal.h:1.1.2.1.2.5.2.4 php-src/ext/pcre/pcrelib/pcre_internal.h:1.1.2.1.2.5.2.5 --- php-src/ext/pcre/pcrelib/pcre_internal.h:1.1.2.1.2.5.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/pcre_internal.h Tue Sep 9 07:55:08 2008 @@ -132,6 +132,20 @@ # endif #endif +/* When compiling with the MSVC compiler, it is sometimes necessary to include +a "calling convention" before exported function names. (This is secondhand +information; I know nothing about MSVC myself). For example, something like + + void __cdecl function(....) + +might be needed. In order so make this easy, all the exported functions have +PCRE_CALL_CONVENTION just before their names. It is rarely needed; if not +set, we ensure here that it has no effect. */ + +#ifndef PCRE_CALL_CONVENTION +#define PCRE_CALL_CONVENTION +#endif + /* We need to have types that specify unsigned 16-bit and 32-bit integers. We cannot determine these outside the compilation (e.g. by running a program as part of "configure") because PCRE is often cross-compiled for use on other @@ -140,16 +154,20 @@ #if USHRT_MAX == 65535 typedef unsigned short pcre_uint16; + typedef short pcre_int16; #elif UINT_MAX == 65535 typedef unsigned int pcre_uint16; + typedef int pcre_int16; #else #error Cannot determine a type for 16-bit unsigned integers #endif #if UINT_MAX == 4294967295 typedef unsigned int pcre_uint32; + typedef int pcre_int32; #elif ULONG_MAX == 4294967295 typedef unsigned long int pcre_uint32; + typedef long int pcre_int32; #else #error Cannot determine a type for 32-bit unsigned integers #endif @@ -363,7 +381,6 @@ support is omitted, we don't even define it. */ #ifndef SUPPORT_UTF8 -#define NEXTCHAR(p) p++; #define GETCHAR(c, eptr) c = *eptr; #define GETCHARTEST(c, eptr) c = *eptr; #define GETCHARINC(c, eptr) c = *eptr++; @@ -373,13 +390,6 @@ #else /* SUPPORT_UTF8 */ -/* Advance a character pointer one byte in non-UTF-8 mode and by one character -in UTF-8 mode. */ - -#define NEXTCHAR(p) \ - p++; \ - if (utf8) { while((*p & 0xc0) == 0x80) p++; } - /* Get the next UTF-8 character, not advancing the pointer. This is called when we know we are in UTF-8 mode. */ @@ -549,12 +559,15 @@ #define REQ_CASELESS 0x0100 /* indicates caselessness */ #define REQ_VARY 0x0200 /* reqbyte followed non-literal item */ -/* Miscellaneous definitions */ +/* Miscellaneous definitions. The #ifndef is to pacify compiler warnings in +environments where these macros are defined elsewhere. */ +#ifndef FALSE typedef int BOOL; #define FALSE 0 #define TRUE 1 +#endif /* Escape items that are just an encoding of a particular data value. */ @@ -1126,13 +1139,38 @@ extern int _pcre_ord2utf8(int, uschar *); extern real_pcre *_pcre_try_flipped(const real_pcre *, real_pcre *, const pcre_study_data *, pcre_study_data *); -extern int _pcre_ucp_findprop(const unsigned int, int *, int *); -extern unsigned int _pcre_ucp_othercase(const unsigned int); extern int _pcre_valid_utf8(const uschar *, int); extern BOOL _pcre_was_newline(const uschar *, int, const uschar *, int *, BOOL); extern BOOL _pcre_xclass(int, const uschar *); + +/* Unicode character database (UCD) */ + +typedef struct { + uschar script; + uschar chartype; + pcre_int32 other_case; +} ucd_record; + +extern const ucd_record _pcre_ucd_records[]; +extern const uschar _pcre_ucd_stage1[]; +extern const pcre_uint16 _pcre_ucd_stage2[]; +extern const int _pcre_ucp_gentype[]; + + +/* UCD access macros */ + +#define UCD_BLOCK_SIZE 128 +#define GET_UCD(ch) (_pcre_ucd_records + \ + _pcre_ucd_stage2[_pcre_ucd_stage1[(ch) / UCD_BLOCK_SIZE] * \ + UCD_BLOCK_SIZE + ch % UCD_BLOCK_SIZE]) + +#define UCD_CHARTYPE(ch) GET_UCD(ch)->chartype +#define UCD_SCRIPT(ch) GET_UCD(ch)->script +#define UCD_CATEGORY(ch) _pcre_ucp_gentype[UCD_CHARTYPE(ch)] +#define UCD_OTHERCASE(ch) (ch + GET_UCD(ch)->other_case) + #endif /* End of pcre_internal.h */ http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_ord2utf8.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_ord2utf8.c diff -u php-src/ext/pcre/pcrelib/pcre_ord2utf8.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_ord2utf8.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_ord2utf8.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_ord2utf8.c Tue Sep 9 07:55:08 2008 @@ -76,8 +76,10 @@ *buffer = _pcre_utf8_table2[i] | cvalue; return i + 1; #else -return 0; /* Keep compiler happy; this function won't ever be */ -#endif /* called when SUPPORT_UTF8 is not defined. */ +(void)(cvalue); /* Keep compiler happy; this function won't ever be */ +(void)(buffer); /* called when SUPPORT_UTF8 is not defined. */ +return 0; +#endif } /* End of pcre_ord2utf8.c */ http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_refcount.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_refcount.c diff -u php-src/ext/pcre/pcrelib/pcre_refcount.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_refcount.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_refcount.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_refcount.c Tue Sep 9 07:55:08 2008 @@ -66,7 +66,7 @@ a negative error number */ -PCRE_EXP_DEFN int +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_refcount(pcre *argument_re, int adjust) { real_pcre *re = (real_pcre *)argument_re; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_study.c?r1=1.1.2.1.2.6.2.3&r2=1.1.2.1.2.6.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_study.c diff -u php-src/ext/pcre/pcrelib/pcre_study.c:1.1.2.1.2.6.2.3 php-src/ext/pcre/pcrelib/pcre_study.c:1.1.2.1.2.6.2.4 --- php-src/ext/pcre/pcrelib/pcre_study.c:1.1.2.1.2.6.2.3 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/pcre_study.c Tue Sep 9 07:55:08 2008 @@ -218,6 +218,7 @@ /* SKIPZERO skips the bracket. */ case OP_SKIPZERO: + tcode++; do tcode += GET(tcode,1); while (*tcode == OP_ALT); tcode += 1 + LINK_SIZE; break; @@ -501,7 +502,7 @@ NULL on error or if no optimization possible */ -PCRE_EXP_DEFN pcre_extra * +PCRE_EXP_DEFN pcre_extra * PCRE_CALL_CONVENTION pcre_study(const pcre *external_re, int options, const char **errorptr) { uschar start_bits[32]; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_tables.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_tables.c diff -u php-src/ext/pcre/pcrelib/pcre_tables.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_tables.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_tables.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_tables.c Tue Sep 9 07:55:08 2008 @@ -85,6 +85,19 @@ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; +/* Table to translate from particular type value to the general value. */ + +const int _pcre_ucp_gentype[] = { + ucp_C, ucp_C, ucp_C, ucp_C, ucp_C, /* Cc, Cf, Cn, Co, Cs */ + ucp_L, ucp_L, ucp_L, ucp_L, ucp_L, /* Ll, Lu, Lm, Lo, Lt */ + ucp_M, ucp_M, ucp_M, /* Mc, Me, Mn */ + ucp_N, ucp_N, ucp_N, /* Nd, Nl, No */ + ucp_P, ucp_P, ucp_P, ucp_P, ucp_P, /* Pc, Pd, Pe, Pf, Pi */ + ucp_P, ucp_P, /* Ps, Po */ + ucp_S, ucp_S, ucp_S, ucp_S, /* Sc, Sk, Sm, So */ + ucp_Z, ucp_Z, ucp_Z /* Zl, Zp, Zs */ +}; + /* The pcre_utt[] table below translates Unicode property names into type and code values. It is searched by binary chop, so must be in collating sequence of name. Originally, the table contained pointers to the name strings in the first @@ -92,7 +105,10 @@ a shared library is dynamically loaded. A significant reduction is made by putting all the names into a single, large string and then using offsets in the table itself. Maintenance is more error-prone, but frequent changes to this -data is unlikely. */ +data are unlikely. + +July 2008: There is now a script called maint/GenerateUtt.py which can be used +to generate this data instead of maintaining it entirely by hand. */ const char _pcre_utt_names[] = "Any\0" @@ -106,8 +122,10 @@ "Buhid\0" "C\0" "Canadian_Aboriginal\0" + "Carian\0" "Cc\0" "Cf\0" + "Cham\0" "Cherokee\0" "Cn\0" "Co\0" @@ -134,12 +152,14 @@ "Inherited\0" "Kannada\0" "Katakana\0" + "Kayah_Li\0" "Kharoshthi\0" "Khmer\0" "L\0" "L&\0" "Lao\0" "Latin\0" + "Lepcha\0" "Limbu\0" "Linear_B\0" "Ll\0" @@ -147,6 +167,8 @@ "Lo\0" "Lt\0" "Lu\0" + "Lycian\0" + "Lydian\0" "M\0" "Malayalam\0" "Mc\0" @@ -161,6 +183,7 @@ "Nl\0" "No\0" "Ogham\0" + "Ol_Chiki\0" "Old_Italic\0" "Old_Persian\0" "Oriya\0" @@ -175,14 +198,17 @@ "Pi\0" "Po\0" "Ps\0" + "Rejang\0" "Runic\0" "S\0" + "Saurashtra\0" "Sc\0" "Shavian\0" "Sinhala\0" "Sk\0" "Sm\0" "So\0" + "Sundanese\0" "Syloti_Nagri\0" "Syriac\0" "Tagalog\0" @@ -195,6 +221,7 @@ "Tibetan\0" "Tifinagh\0" "Ugaritic\0" + "Vai\0" "Yi\0" "Z\0" "Zl\0" @@ -202,111 +229,122 @@ "Zs\0"; const ucp_type_table _pcre_utt[] = { - { 0, PT_ANY, 0 }, - { 4, PT_SC, ucp_Arabic }, - { 11, PT_SC, ucp_Armenian }, - { 20, PT_SC, ucp_Balinese }, - { 29, PT_SC, ucp_Bengali }, - { 37, PT_SC, ucp_Bopomofo }, - { 46, PT_SC, ucp_Braille }, - { 54, PT_SC, ucp_Buginese }, - { 63, PT_SC, ucp_Buhid }, - { 69, PT_GC, ucp_C }, - { 71, PT_SC, ucp_Canadian_Aboriginal }, - { 91, PT_PC, ucp_Cc }, - { 94, PT_PC, ucp_Cf }, - { 97, PT_SC, ucp_Cherokee }, - { 106, PT_PC, ucp_Cn }, - { 109, PT_PC, ucp_Co }, - { 112, PT_SC, ucp_Common }, - { 119, PT_SC, ucp_Coptic }, - { 126, PT_PC, ucp_Cs }, - { 129, PT_SC, ucp_Cuneiform }, - { 139, PT_SC, ucp_Cypriot }, - { 147, PT_SC, ucp_Cyrillic }, - { 156, PT_SC, ucp_Deseret }, - { 164, PT_SC, ucp_Devanagari }, - { 175, PT_SC, ucp_Ethiopic }, - { 184, PT_SC, ucp_Georgian }, - { 193, PT_SC, ucp_Glagolitic }, - { 204, PT_SC, ucp_Gothic }, - { 211, PT_SC, ucp_Greek }, - { 217, PT_SC, ucp_Gujarati }, - { 226, PT_SC, ucp_Gurmukhi }, - { 235, PT_SC, ucp_Han }, - { 239, PT_SC, ucp_Hangul }, - { 246, PT_SC, ucp_Hanunoo }, - { 254, PT_SC, ucp_Hebrew }, - { 261, PT_SC, ucp_Hiragana }, - { 270, PT_SC, ucp_Inherited }, - { 280, PT_SC, ucp_Kannada }, - { 288, PT_SC, ucp_Katakana }, - { 297, PT_SC, ucp_Kharoshthi }, - { 308, PT_SC, ucp_Khmer }, - { 314, PT_GC, ucp_L }, - { 316, PT_LAMP, 0 }, - { 319, PT_SC, ucp_Lao }, - { 323, PT_SC, ucp_Latin }, - { 329, PT_SC, ucp_Limbu }, - { 335, PT_SC, ucp_Linear_B }, - { 344, PT_PC, ucp_Ll }, - { 347, PT_PC, ucp_Lm }, - { 350, PT_PC, ucp_Lo }, - { 353, PT_PC, ucp_Lt }, - { 356, PT_PC, ucp_Lu }, - { 359, PT_GC, ucp_M }, - { 361, PT_SC, ucp_Malayalam }, - { 371, PT_PC, ucp_Mc }, - { 374, PT_PC, ucp_Me }, - { 377, PT_PC, ucp_Mn }, - { 380, PT_SC, ucp_Mongolian }, - { 390, PT_SC, ucp_Myanmar }, - { 398, PT_GC, ucp_N }, - { 400, PT_PC, ucp_Nd }, - { 403, PT_SC, ucp_New_Tai_Lue }, - { 415, PT_SC, ucp_Nko }, - { 419, PT_PC, ucp_Nl }, - { 422, PT_PC, ucp_No }, - { 425, PT_SC, ucp_Ogham }, - { 431, PT_SC, ucp_Old_Italic }, - { 442, PT_SC, ucp_Old_Persian }, - { 454, PT_SC, ucp_Oriya }, - { 460, PT_SC, ucp_Osmanya }, - { 468, PT_GC, ucp_P }, - { 470, PT_PC, ucp_Pc }, - { 473, PT_PC, ucp_Pd }, - { 476, PT_PC, ucp_Pe }, - { 479, PT_PC, ucp_Pf }, - { 482, PT_SC, ucp_Phags_Pa }, - { 491, PT_SC, ucp_Phoenician }, - { 502, PT_PC, ucp_Pi }, - { 505, PT_PC, ucp_Po }, - { 508, PT_PC, ucp_Ps }, - { 511, PT_SC, ucp_Runic }, - { 517, PT_GC, ucp_S }, - { 519, PT_PC, ucp_Sc }, - { 522, PT_SC, ucp_Shavian }, - { 530, PT_SC, ucp_Sinhala }, - { 538, PT_PC, ucp_Sk }, - { 541, PT_PC, ucp_Sm }, - { 544, PT_PC, ucp_So }, - { 547, PT_SC, ucp_Syloti_Nagri }, - { 560, PT_SC, ucp_Syriac }, - { 567, PT_SC, ucp_Tagalog }, - { 575, PT_SC, ucp_Tagbanwa }, - { 584, PT_SC, ucp_Tai_Le }, - { 591, PT_SC, ucp_Tamil }, - { 597, PT_SC, ucp_Telugu }, - { 604, PT_SC, ucp_Thaana }, - { 611, PT_SC, ucp_Thai }, - { 616, PT_SC, ucp_Tibetan }, - { 624, PT_SC, ucp_Tifinagh }, - { 633, PT_SC, ucp_Ugaritic }, - { 642, PT_SC, ucp_Yi }, - { 645, PT_GC, ucp_Z }, - { 647, PT_PC, ucp_Zl }, - { 650, PT_PC, ucp_Zp }, - { 653, PT_PC, ucp_Zs } + { 0, PT_ANY, 0 }, + { 4, PT_SC, ucp_Arabic }, + { 11, PT_SC, ucp_Armenian }, + { 20, PT_SC, ucp_Balinese }, + { 29, PT_SC, ucp_Bengali }, + { 37, PT_SC, ucp_Bopomofo }, + { 46, PT_SC, ucp_Braille }, + { 54, PT_SC, ucp_Buginese }, + { 63, PT_SC, ucp_Buhid }, + { 69, PT_GC, ucp_C }, + { 71, PT_SC, ucp_Canadian_Aboriginal }, + { 91, PT_SC, ucp_Carian }, + { 98, PT_PC, ucp_Cc }, + { 101, PT_PC, ucp_Cf }, + { 104, PT_SC, ucp_Cham }, + { 109, PT_SC, ucp_Cherokee }, + { 118, PT_PC, ucp_Cn }, + { 121, PT_PC, ucp_Co }, + { 124, PT_SC, ucp_Common }, + { 131, PT_SC, ucp_Coptic }, + { 138, PT_PC, ucp_Cs }, + { 141, PT_SC, ucp_Cuneiform }, + { 151, PT_SC, ucp_Cypriot }, + { 159, PT_SC, ucp_Cyrillic }, + { 168, PT_SC, ucp_Deseret }, + { 176, PT_SC, ucp_Devanagari }, + { 187, PT_SC, ucp_Ethiopic }, + { 196, PT_SC, ucp_Georgian }, + { 205, PT_SC, ucp_Glagolitic }, + { 216, PT_SC, ucp_Gothic }, + { 223, PT_SC, ucp_Greek }, + { 229, PT_SC, ucp_Gujarati }, + { 238, PT_SC, ucp_Gurmukhi }, + { 247, PT_SC, ucp_Han }, + { 251, PT_SC, ucp_Hangul }, + { 258, PT_SC, ucp_Hanunoo }, + { 266, PT_SC, ucp_Hebrew }, + { 273, PT_SC, ucp_Hiragana }, + { 282, PT_SC, ucp_Inherited }, + { 292, PT_SC, ucp_Kannada }, + { 300, PT_SC, ucp_Katakana }, + { 309, PT_SC, ucp_Kayah_Li }, + { 318, PT_SC, ucp_Kharoshthi }, + { 329, PT_SC, ucp_Khmer }, + { 335, PT_GC, ucp_L }, + { 337, PT_LAMP, 0 }, + { 340, PT_SC, ucp_Lao }, + { 344, PT_SC, ucp_Latin }, + { 350, PT_SC, ucp_Lepcha }, + { 357, PT_SC, ucp_Limbu }, + { 363, PT_SC, ucp_Linear_B }, + { 372, PT_PC, ucp_Ll }, + { 375, PT_PC, ucp_Lm }, + { 378, PT_PC, ucp_Lo }, + { 381, PT_PC, ucp_Lt }, + { 384, PT_PC, ucp_Lu }, + { 387, PT_SC, ucp_Lycian }, + { 394, PT_SC, ucp_Lydian }, + { 401, PT_GC, ucp_M }, + { 403, PT_SC, ucp_Malayalam }, + { 413, PT_PC, ucp_Mc }, + { 416, PT_PC, ucp_Me }, + { 419, PT_PC, ucp_Mn }, + { 422, PT_SC, ucp_Mongolian }, + { 432, PT_SC, ucp_Myanmar }, + { 440, PT_GC, ucp_N }, + { 442, PT_PC, ucp_Nd }, + { 445, PT_SC, ucp_New_Tai_Lue }, + { 457, PT_SC, ucp_Nko }, + { 461, PT_PC, ucp_Nl }, + { 464, PT_PC, ucp_No }, + { 467, PT_SC, ucp_Ogham }, + { 473, PT_SC, ucp_Ol_Chiki }, + { 482, PT_SC, ucp_Old_Italic }, + { 493, PT_SC, ucp_Old_Persian }, + { 505, PT_SC, ucp_Oriya }, + { 511, PT_SC, ucp_Osmanya }, + { 519, PT_GC, ucp_P }, + { 521, PT_PC, ucp_Pc }, + { 524, PT_PC, ucp_Pd }, + { 527, PT_PC, ucp_Pe }, + { 530, PT_PC, ucp_Pf }, + { 533, PT_SC, ucp_Phags_Pa }, + { 542, PT_SC, ucp_Phoenician }, + { 553, PT_PC, ucp_Pi }, + { 556, PT_PC, ucp_Po }, + { 559, PT_PC, ucp_Ps }, + { 562, PT_SC, ucp_Rejang }, + { 569, PT_SC, ucp_Runic }, + { 575, PT_GC, ucp_S }, + { 577, PT_SC, ucp_Saurashtra }, + { 588, PT_PC, ucp_Sc }, + { 591, PT_SC, ucp_Shavian }, + { 599, PT_SC, ucp_Sinhala }, + { 607, PT_PC, ucp_Sk }, + { 610, PT_PC, ucp_Sm }, + { 613, PT_PC, ucp_So }, + { 616, PT_SC, ucp_Sundanese }, + { 626, PT_SC, ucp_Syloti_Nagri }, + { 639, PT_SC, ucp_Syriac }, + { 646, PT_SC, ucp_Tagalog }, + { 654, PT_SC, ucp_Tagbanwa }, + { 663, PT_SC, ucp_Tai_Le }, + { 670, PT_SC, ucp_Tamil }, + { 676, PT_SC, ucp_Telugu }, + { 683, PT_SC, ucp_Thaana }, + { 690, PT_SC, ucp_Thai }, + { 695, PT_SC, ucp_Tibetan }, + { 703, PT_SC, ucp_Tifinagh }, + { 712, PT_SC, ucp_Ugaritic }, + { 721, PT_SC, ucp_Vai }, + { 725, PT_SC, ucp_Yi }, + { 728, PT_GC, ucp_Z }, + { 730, PT_PC, ucp_Zl }, + { 733, PT_PC, ucp_Zp }, + { 736, PT_PC, ucp_Zs } }; const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table); http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_valid_utf8.c?r1=1.1.2.1.2.5.2.3&r2=1.1.2.1.2.5.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_valid_utf8.c diff -u php-src/ext/pcre/pcrelib/pcre_valid_utf8.c:1.1.2.1.2.5.2.3 php-src/ext/pcre/pcrelib/pcre_valid_utf8.c:1.1.2.1.2.5.2.4 --- php-src/ext/pcre/pcrelib/pcre_valid_utf8.c:1.1.2.1.2.5.2.3 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_valid_utf8.c Tue Sep 9 07:55:08 2008 @@ -152,6 +152,9 @@ if ((*(++p) & 0xc0) != 0x80) return p - string; } } +#else +(void)(string); /* Keep picky compilers happy */ +(void)(length); #endif return -1; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_version.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_version.c diff -u php-src/ext/pcre/pcrelib/pcre_version.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_version.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_version.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_version.c Tue Sep 9 07:55:08 2008 @@ -77,7 +77,7 @@ pre-processor time. This hack uses a standard trick for avoiding calling the STRING macro with an empty argument when doing the test. */ -PCRE_EXP_DEFN const char * +PCRE_EXP_DEFN const char * PCRE_CALL_CONVENTION pcre_version(void) { return (XSTRING(Z PCRE_PRERELEASE)[1] == 0)? http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_xclass.c?r1=1.1.2.1.2.5.2.2&r2=1.1.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_xclass.c diff -u php-src/ext/pcre/pcrelib/pcre_xclass.c:1.1.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/pcre_xclass.c:1.1.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/pcre_xclass.c:1.1.2.1.2.5.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/pcre_xclass.c Tue Sep 9 07:55:08 2008 @@ -102,8 +102,7 @@ #ifdef SUPPORT_UCP else /* XCL_PROP & XCL_NOTPROP */ { - int chartype, script; - int category = _pcre_ucp_findprop(c, &chartype, &script); + const ucd_record * prop = GET_UCD(c); switch(*data) { @@ -112,20 +111,20 @@ break; case PT_LAMP: - if ((chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == + if ((prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt) == (t == XCL_PROP)) return !negated; break; case PT_GC: - if ((data[1] == category) == (t == XCL_PROP)) return !negated; + if ((data[1] == _pcre_ucp_gentype[prop->chartype]) == (t == XCL_PROP)) return !negated; break; case PT_PC: - if ((data[1] == chartype) == (t == XCL_PROP)) return !negated; + if ((data[1] == prop->chartype) == (t == XCL_PROP)) return !negated; break; case PT_SC: - if ((data[1] == script) == (t == XCL_PROP)) return !negated; + if ((data[1] == prop->script) == (t == XCL_PROP)) return !negated; break; /* This should never occur, but compilers may mutter if there is no http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcreposix.c?r1=1.15.2.1.2.7.2.4&r2=1.15.2.1.2.7.2.5&diff_format=u Index: php-src/ext/pcre/pcrelib/pcreposix.c diff -u php-src/ext/pcre/pcrelib/pcreposix.c:1.15.2.1.2.7.2.4 php-src/ext/pcre/pcrelib/pcreposix.c:1.15.2.1.2.7.2.5 --- php-src/ext/pcre/pcrelib/pcreposix.c:1.15.2.1.2.7.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/pcreposix.c Tue Sep 9 07:55:08 2008 @@ -158,7 +158,7 @@ * Translate error code to string * *************************************************/ -PCREPOSIX_EXP_DEFN size_t +PCREPOSIX_EXP_DEFN size_t PCRE_CALL_CONVENTION regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) { const char *message, *addmessage; @@ -193,7 +193,7 @@ * Free store held by a regex * *************************************************/ -PCREPOSIX_EXP_DEFN void +PCREPOSIX_EXP_DEFN void PCRE_CALL_CONVENTION regfree(regex_t *preg) { (pcre_free)(preg->re_pcre); @@ -216,7 +216,7 @@ various non-zero codes on failure */ -PCREPOSIX_EXP_DEFN int +PCREPOSIX_EXP_DEFN int PCRE_CALL_CONVENTION regcomp(regex_t *preg, const char *pattern, int cflags) { const char *errorptr; @@ -258,7 +258,7 @@ be set. When this is the case, the nmatch and pmatch arguments are ignored, and the only result is yes/no/error. */ -PCREPOSIX_EXP_DEFN int +PCREPOSIX_EXP_DEFN int PCRE_CALL_CONVENTION regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags) { http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/ucp.h?r1=1.2.2.1.2.1&r2=1.2.2.1.2.1.2.1&diff_format=u Index: php-src/ext/pcre/pcrelib/ucp.h diff -u php-src/ext/pcre/pcrelib/ucp.h:1.2.2.1.2.1 php-src/ext/pcre/pcrelib/ucp.h:1.2.2.1.2.1.2.1 --- php-src/ext/pcre/pcrelib/ucp.h:1.2.2.1.2.1 Fri Feb 9 19:48:47 2007 +++ php-src/ext/pcre/pcrelib/ucp.h Tue Sep 9 07:55:08 2008 @@ -121,11 +121,24 @@ ucp_Tifinagh, ucp_Ugaritic, ucp_Yi, - ucp_Balinese, /* New for Unicode 5.0.0 */ - ucp_Cuneiform, /* New for Unicode 5.0.0 */ - ucp_Nko, /* New for Unicode 5.0.0 */ - ucp_Phags_Pa, /* New for Unicode 5.0.0 */ - ucp_Phoenician /* New for Unicode 5.0.0 */ + /* New for Unicode 5.0: */ + ucp_Balinese, + ucp_Cuneiform, + ucp_Nko, + ucp_Phags_Pa, + ucp_Phoenician, + /* New for Unicode 5.1: */ + ucp_Carian, + ucp_Cham, + ucp_Kayah_Li, + ucp_Lepcha, + ucp_Lycian, + ucp_Lydian, + ucp_Ol_Chiki, + ucp_Rejang, + ucp_Saurashtra, + ucp_Sundanese, + ucp_Vai }; #endif http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/doc/pcre.txt?r1=1.9.2.1.2.5.2.2&r2=1.9.2.1.2.5.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/doc/pcre.txt diff -u php-src/ext/pcre/pcrelib/doc/pcre.txt:1.9.2.1.2.5.2.2 php-src/ext/pcre/pcrelib/doc/pcre.txt:1.9.2.1.2.5.2.3 --- php-src/ext/pcre/pcrelib/doc/pcre.txt:1.9.2.1.2.5.2.2 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/doc/pcre.txt Tue Sep 9 07:55:08 2008 @@ -2047,83 +2047,87 @@ The string to be matched by pcre_exec() The subject string is passed to pcre_exec() as a pointer in subject, a - length in length, and a starting byte offset in startoffset. In UTF-8 - mode, the byte offset must point to the start of a UTF-8 character. - Unlike the pattern string, the subject may contain binary zero bytes. - When the starting offset is zero, the search for a match starts at the - beginning of the subject, and this is by far the most common case. - - A non-zero starting offset is useful when searching for another match - in the same subject by calling pcre_exec() again after a previous suc- - cess. Setting startoffset differs from just passing over a shortened - string and setting PCRE_NOTBOL in the case of a pattern that begins + length (in bytes) in length, and a starting byte offset in startoffset. + In UTF-8 mode, the byte offset must point to the start of a UTF-8 char- + acter. Unlike the pattern string, the subject may contain binary zero + bytes. When the starting offset is zero, the search for a match starts + at the beginning of the subject, and this is by far the most common + case. + + A non-zero starting offset is useful when searching for another match + in the same subject by calling pcre_exec() again after a previous suc- + cess. Setting startoffset differs from just passing over a shortened + string and setting PCRE_NOTBOL in the case of a pattern that begins with any kind of lookbehind. For example, consider the pattern \Biss\B - which finds occurrences of "iss" in the middle of words. (\B matches - only if the current position in the subject is not a word boundary.) - When applied to the string "Mississipi" the first call to pcre_exec() - finds the first occurrence. If pcre_exec() is called again with just - the remainder of the subject, namely "issipi", it does not match, + which finds occurrences of "iss" in the middle of words. (\B matches + only if the current position in the subject is not a word boundary.) + When applied to the string "Mississipi" the first call to pcre_exec() + finds the first occurrence. If pcre_exec() is called again with just + the remainder of the subject, namely "issipi", it does not match, because \B is always false at the start of the subject, which is deemed - to be a word boundary. However, if pcre_exec() is passed the entire + to be a word boundary. However, if pcre_exec() is passed the entire string again, but with startoffset set to 4, it finds the second occur- - rence of "iss" because it is able to look behind the starting point to + rence of "iss" because it is able to look behind the starting point to discover that it is preceded by a letter. - If a non-zero starting offset is passed when the pattern is anchored, + If a non-zero starting offset is passed when the pattern is anchored, one attempt to match at the given offset is made. This can only succeed - if the pattern does not require the match to be at the start of the + if the pattern does not require the match to be at the start of the subject. How pcre_exec() returns captured substrings - In general, a pattern matches a certain portion of the subject, and in - addition, further substrings from the subject may be picked out by - parts of the pattern. Following the usage in Jeffrey Friedl's book, - this is called "capturing" in what follows, and the phrase "capturing - subpattern" is used for a fragment of a pattern that picks out a sub- - string. PCRE supports several other kinds of parenthesized subpattern + In general, a pattern matches a certain portion of the subject, and in + addition, further substrings from the subject may be picked out by + parts of the pattern. Following the usage in Jeffrey Friedl's book, + this is called "capturing" in what follows, and the phrase "capturing + subpattern" is used for a fragment of a pattern that picks out a sub- + string. PCRE supports several other kinds of parenthesized subpattern that do not cause substrings to be captured. - Captured substrings are returned to the caller via a vector of integer - offsets whose address is passed in ovector. The number of elements in - the vector is passed in ovecsize, which must be a non-negative number. - Note: this argument is NOT the size of ovector in bytes. - - The first two-thirds of the vector is used to pass back captured sub- - strings, each substring using a pair of integers. The remaining third - of the vector is used as workspace by pcre_exec() while matching cap- - turing subpatterns, and is not available for passing back information. - The length passed in ovecsize should always be a multiple of three. If + Captured substrings are returned to the caller via a vector of integers + whose address is passed in ovector. The number of elements in the vec- + tor is passed in ovecsize, which must be a non-negative number. Note: + this argument is NOT the size of ovector in bytes. + + The first two-thirds of the vector is used to pass back captured sub- + strings, each substring using a pair of integers. The remaining third + of the vector is used as workspace by pcre_exec() while matching cap- + turing subpatterns, and is not available for passing back information. + The number passed in ovecsize should always be a multiple of three. If it is not, it is rounded down. - When a match is successful, information about captured substrings is - returned in pairs of integers, starting at the beginning of ovector, - and continuing up to two-thirds of its length at the most. The first - element of a pair is set to the offset of the first character in a sub- - string, and the second is set to the offset of the first character - after the end of a substring. The first pair, ovector[0] and ovec- - tor[1], identify the portion of the subject string matched by the - entire pattern. The next pair is used for the first capturing subpat- - tern, and so on. The value returned by pcre_exec() is one more than the - highest numbered pair that has been set. For example, if two substrings - have been captured, the returned value is 3. If there are no capturing - subpatterns, the return value from a successful match is 1, indicating - that just the first pair of offsets has been set. + When a match is successful, information about captured substrings is + returned in pairs of integers, starting at the beginning of ovector, + and continuing up to two-thirds of its length at the most. The first + element of each pair is set to the byte offset of the first character + in a substring, and the second is set to the byte offset of the first + character after the end of a substring. Note: these values are always + byte offsets, even in UTF-8 mode. They are not character counts. + + The first pair of integers, ovector[0] and ovector[1], identify the + portion of the subject string matched by the entire pattern. The next + pair is used for the first capturing subpattern, and so on. The value + returned by pcre_exec() is one more than the highest numbered pair that + has been set. For example, if two substrings have been captured, the + returned value is 3. If there are no capturing subpatterns, the return + value from a successful match is 1, indicating that just the first pair + of offsets has been set. If a capturing subpattern is matched repeatedly, it is the last portion of the string that it matched that is returned. If the vector is too small to hold all the captured substring offsets, it is used as far as possible (up to two-thirds of its length), and the - function returns a value of zero. In particular, if the substring off- - sets are not of interest, pcre_exec() may be called with ovector passed - as NULL and ovecsize as zero. However, if the pattern contains back - references and the ovector is not big enough to remember the related - substrings, PCRE has to get additional memory for use during matching. - Thus it is usually advisable to supply an ovector. + function returns a value of zero. If the substring offsets are not of + interest, pcre_exec() may be called with ovector passed as NULL and + ovecsize as zero. However, if the pattern contains back references and + the ovector is not big enough to remember the related substrings, PCRE + has to get additional memory for use during matching. Thus it is usu- + ally advisable to supply an ovector. The pcre_info() function can be used to find out how many capturing subpatterns there are in a compiled pattern. The smallest size for @@ -2604,7 +2608,7 @@ REVISION - Last updated: 12 April 2008 + Last updated: 24 August 2008 Copyright (c) 1997-2008 University of Cambridge. ------------------------------------------------------------------------------ @@ -6536,6 +6540,8 @@ ing long subject strings is to write repeated parenthesized subpatterns to match more than one character whenever possible. + Compiling PCRE to use heap instead of stack + In environments where stack memory is constrained, you might want to compile PCRE to use heap memory instead of stack for remembering back- up points. This makes it run a lot more slowly, however. Details of how @@ -6548,6 +6554,24 @@ freed in reverse order, it may be possible to implement customized mem- ory handlers that are more efficient than the standard functions. + Limiting PCRE's stack usage + + PCRE has an internal counter that can be used to limit the depth of + recursion, and thus cause pcre_exec() to give an error code before it + runs out of stack. By default, the limit is very large, and unlikely + ever to operate. It can be changed when PCRE is built, and it can also + be set when pcre_exec() is called. For details of these interfaces, see + the pcrebuild and pcreapi documentation. + + As a very rough rule of thumb, you should reckon on about 500 bytes per + recursion. Thus, if you want to limit your stack usage to 8Mb, you + should set the limit at 16000 recursions. A 64Mb stack, on the other + hand, can support around 128000 recursions. The pcretest test program + has a command line option (-S) that can be used to increase the size of + its stack. + + Changing stack size in Unix-like systems + In Unix-like environments, there is not often a problem with the stack unless very long strings are involved, though the default limit on stack size varies from system to system. Values from 8Mb to 64Mb are @@ -6568,19 +6592,12 @@ attempts to increase the soft limit to 100Mb using setrlimit(). You must do this before calling pcre_exec(). - PCRE has an internal counter that can be used to limit the depth of - recursion, and thus cause pcre_exec() to give an error code before it - runs out of stack. By default, the limit is very large, and unlikely - ever to operate. It can be changed when PCRE is built, and it can also - be set when pcre_exec() is called. For details of these interfaces, see - the pcrebuild and pcreapi documentation. + Changing stack size in Mac OS X - As a very rough rule of thumb, you should reckon on about 500 bytes per - recursion. Thus, if you want to limit your stack usage to 8Mb, you - should set the limit at 16000 recursions. A 64Mb stack, on the other - hand, can support around 128000 recursions. The pcretest test program - has a command line option (-S) that can be used to increase the size of - its stack. + Using setrlimit(), as described above, should also work on Mac OS X. It + is also possible to set a stack size when linking a program. There is a + discussion about stack sizes in Mac OS X at this web site: + http://developer.apple.com/qa/qa2005/qa1419.html. AUTHOR @@ -6592,8 +6609,8 @@ REVISION - Last updated: 05 June 2007 - Copyright (c) 1997-2007 University of Cambridge. + Last updated: 09 July 2008 + Copyright (c) 1997-2008 University of Cambridge. ------------------------------------------------------------------------------ http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput1?r1=1.5.4.4.2.1&r2=1.5.4.4.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput1 diff -u php-src/ext/pcre/pcrelib/testdata/testinput1:1.5.4.4.2.1 php-src/ext/pcre/pcrelib/testdata/testinput1:1.5.4.4.2.2 --- php-src/ext/pcre/pcrelib/testdata/testinput1:1.5.4.4.2.1 Sun Jan 13 12:44:56 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput1 Tue Sep 9 07:55:09 2008 @@ -4036,4 +4036,7 @@ ] p +/.*[op][xyz]/ + fooabcfoo + / End of testinput1 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput2?r1=1.5.2.1.2.4.2.3&r2=1.5.2.1.2.4.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput2 diff -u php-src/ext/pcre/pcrelib/testdata/testinput2:1.5.2.1.2.4.2.3 php-src/ext/pcre/pcrelib/testdata/testinput2:1.5.2.1.2.4.2.4 --- php-src/ext/pcre/pcrelib/testdata/testinput2:1.5.2.1.2.4.2.3 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput2 Tue Sep 9 07:55:09 2008 @@ -1988,10 +1988,10 @@ a\rb\<anycrlf> /^abc./mgx<any> - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 \x{2028}abc8 \x{2029}abc9 JUNK + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK /abc.$/mgx<any> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9 /a/<cr><any> @@ -2147,7 +2147,7 @@ abc\r\n\r\n /abc.$/mgx<anycrlf> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 /^X/m XABC @@ -2724,4 +2724,6 @@ /a(*FAIL)+b/ +/(abc|pqr|123){0}[xyz]/SI + / End of testinput2 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput4?r1=1.4.2.1.2.3.2.2&r2=1.4.2.1.2.3.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput4 diff -u php-src/ext/pcre/pcrelib/testdata/testinput4:1.4.2.1.2.3.2.2 php-src/ext/pcre/pcrelib/testdata/testinput4:1.4.2.1.2.3.2.3 --- php-src/ext/pcre/pcrelib/testdata/testinput4:1.4.2.1.2.3.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput4 Tue Sep 9 07:55:09 2008 @@ -609,4 +609,18 @@ /[^ABCDEFGHIJKLMNOPQRSTUVWXYZÃÃÃÃÃà ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Ä¢Ä¤Ä¦Ä¨ÄªÄ¬Ä®Ä°Ä²Ä´Ä¶Ä¹Ä»Ä½Ä¿ÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅ Å¢Å¤Å¦Å¨ÅªÅ¬Å®Å°Å²Å´Å¶Å¸Å¹Å»Å½ÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆ Æ¢Æ¤Æ¦Æ§Æ©Æ¬Æ®Æ¯Æ±Æ²Æ³ÆµÆ·Æ¸Æ¼ÇÇÇÇÇÇÇÇÇÇÇÇÇ Ç¢Ç¤Ç¦Ç¨ÇªÇ¬Ç®Ç±Ç´Ç¶Ç·Ç¸ÇºÇ¼Ç¾ÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈ È¢È¤È¦È¨ÈªÈ¬È®È°È²ÈºÈ»È½È¾ÉÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎΠΡΣΤΥΦΧΨΩΪΫÏÏÏÏÏÏÏÏ Ï¢Ï¤Ï¦Ï¨ÏªÏ¬Ï®Ï´Ï·Ï¹ÏºÏ½Ï¾Ï¿ÐÐÐÐÐÐ ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐРСТУФХЦЧШЩЪЫЬÐÐ®Ð¯Ñ Ñ¢Ñ¤Ñ¦Ñ¨ÑªÑ¬Ñ®Ñ°Ñ²Ñ´Ñ¶Ñ¸ÑºÑ¼Ñ¾ÒÒÒÒÒÒÒÒÒÒÒÒÒ Ò¢Ò¤Ò¦Ò¨ÒªÒ¬Ò®Ò°Ò²Ò´Ò¶Ò¸ÒºÒ¼Ò¾ÓÓÓÓ ÓÓÓÓÓÓÓÓÓÓÓÓÓ Ó¢Ó¤Ó¦Ó¨ÓªÓ¬Ó®Ó°Ó²Ó´Ó¶Ó¸ÔÔÔÔÔÔÔÔÔ±Ô²Ô³Ô´ÔµÔ¶Ô·Ô¸Ô¹ÔºÔ»Ô¼Ô½Ô¾Ô¿ÕÕÕÕÕÕ ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕá á¡á¢á£á¤á¥á¦á§á¨á©áªá«á¬áá®á¯á°á±á²á³á´áµá¶á·á¸á¹áºá»á¼á½á¾á¿áááááá á¸á¸á¸á¸á¸á¸á¸á¸á! ¸á¸á¸á¸á¸á¸á¸á¸á¸ ḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾá¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹ ṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾáºáºáºáºáºáºáºáºáºáºáºáº ẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾá»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á» ỢỤỦỨỪỬỮỰỲỴỶỸá¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼¨á¼©á¼ªá¼«á¼¬á¼á¼®á¼¯á¼¸á¼¹á¼ºá¼»á¼¼á¼½á¼¾á¼¿á½á½á½á½á½á½á½á½á½á½á½¨á½©á½ªá½«á½¬á½á½®á½¯á¾¸á¾¹á¾ºá¾»á¿á¿á¿á¿á¿á¿á¿á¿á¿¨á¿©á¿ªá¿«á¿¬á¿¸á¿¹á¿ºá¿»abcdefghijklmnopqrstuvwxyzªµºÃà áâãäåæçèéêëìÃîïðñòóôõöøùúûüýþÿÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄġģĥħĩīÄįıijĵķĸĺļľÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅšţťŧũūÅÅ¯Å±Å³ÅµÅ·ÅºÅ¼Å¾Å¿ÆÆÆ ÆÆÆÆÆÆÆÆÆÆ¡Æ£Æ¥Æ¨ÆªÆ«ÆÆ°Æ´Æ¶Æ¹ÆºÆ½Æ¾Æ¿ÇÇÇÇÇÇÇÇÇÇÇÇÇǡǣǥǧǩǫÇǯǰdzǵǹǻǽǿÈÈÈ ÈÈÈÈÈÈÈÈÈÈÈÈÈȡȣȥȧȩȫÈȯȱȳȴȵȶȷȸȹȼȿÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ É¡É¢É£! ɤɥɦɧɨɩɪɫɬÉɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿÊÊÊÊÊÊ Ê ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê¡Ê¢Ê£Ê¤Ê¥Ê¦Ê§Ê¨Ê©ÊªÊ«Ê¬ÊʮʯÎάÎήίΰαβγδεζηθικλμνξοÏÏÏÏÏÏ ÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏϡϣϥϧϩϫÏϯϰϱϲϳϵϸϻϼабвгдежзийклмнопÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑѡѣѥѧѩѫÑѯѱѳѵѷѹѻѽѿÒÒÒÒÒÒÒÒÒÒÒÒÒ¡Ò£Ò¥Ò§Ò©Ò«ÒÒ¯Ò±Ò³ÒµÒ·Ò¹Ò»Ò½Ò¿ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ¡Ó£Ó¥Ó§Ó©Ó«ÓÓ¯Ó±Ó³ÓµÓ·Ó¹ÔÔÔ ÔÔÔÔÔÕ¡Õ¢Õ£Õ¤Õ¥Õ¦Õ§Õ¨Õ©ÕªÕ«Õ¬ÕÕ®Õ¯Õ°Õ±Õ²Õ³Õ´ÕµÕ¶Õ·Õ¸Õ¹ÕºÕ»Õ¼Õ½Õ¾Õ¿ÖÖÖÖÖÖ ÖÖá´á´á´á´á´á´ á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´ ᴡᴢᴣᴤᴥᴦᴧᴨᴩᴪᴫᵢᵣᵤᵥᵦᵧᵨᵩᵪᵫᵬáµáµ®áµ¯áµ°áµ±áµ²áµ³áµ´áµµáµ¶áµ·áµ¹áµºáµ»áµ¼áµ½áµ¾áµ¿á¶á¶á¶á¶á¶á¶ á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¸á¸á¸ á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸¡á¸£á¸¥á¸§á¸©á¸«á¸á¸¯á¸±á¸³á¸µá¸·á¸¹á¸»á¸½á¸¿á¹á¹á¹ á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹¡á¹£á! ¹¥á¹§á¹©á¹«á¹á¹¯á¹±á¹³á¹µá¹·á¹¹á¹»á¹½á¹¿áºáºáº áºáºáºáºáºáºáºáºáºáºáºáºáºáºáº¡áº£áº¥áº§áº©áº«áºáº¯áº±áº³áºµáº·áº¹áº»áº½áº¿á»á»á» á»á»á»á»á»á»á»á»á»á»á»á»á»á»¡á»£á»¥á»§á»©á»«á»á»¯á»±á»³á»µá»·á»¹á¼á¼á¼á¼á¼á¼ á¼á¼á¼á¼á¼á¼á¼á¼á¼ ἡἢἣἤἥἦἧἰἱἲἳἴἵἶἷá½á½á½á½á½á½ á½á½á½á½á½á½á½á½á½ ὡὢὣὤὥὦὧὰάὲέὴήὶίὸόὺύὼώá¾á¾á¾á¾á¾á¾ á¾á¾á¾á¾á¾á¾á¾á¾á¾á¾á¾ ᾡᾢᾣᾤᾥᾦᾧᾰᾱᾲᾳᾴᾶᾷιá¿á¿á¿á¿á¿á¿á¿á¿á¿á¿á¿á¿ ῡῢΰῤῥῦῧῲῳῴῶῷâ²â²â² â²â²â²â²â²â²â²â²â²â²â²â²â²â²¡â²£â²¥â²§â²©â²«â²â²¯â²±â²³â²µâ²·â²¹â²»â²½â²¿â³â³â³ â³â³â³â³â³â³â³â³â³â³â³â³â³â³¡â³£â³¤â´â´â´â´â´â´ â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´ ⴡⴢⴣⴤⴥï¬ï¬ï¬ï¬ï¬ï¬ ï¬ï¬ï¬ï¬ï¬ï¬\d-_^]/8 +/^[^d]*?$/ + abc + +/^[^d]*?$/8 + abc + +/^[^d]*?$/i + abc + +/^[^d]*?$/8i + abc + +/(?i)[\xc3\xa9\xc3\xbd]|[\xc3\xa9\xc3\xbdA]/8 + / End of testinput4 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput5?r1=1.3.2.1.2.4.2.3&r2=1.3.2.1.2.4.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput5 diff -u php-src/ext/pcre/pcrelib/testdata/testinput5:1.3.2.1.2.4.2.3 php-src/ext/pcre/pcrelib/testdata/testinput5:1.3.2.1.2.4.2.4 --- php-src/ext/pcre/pcrelib/testdata/testinput5:1.3.2.1.2.4.2.3 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput5 Tue Sep 9 07:55:09 2008 @@ -473,4 +473,11 @@ ** Failers ab +/(\x{de})\1/ + \x{de}\x{de} + \x{123} + +/X/8f<any> + A\x{1ec5}ABCXYZ + / End of testinput5 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput6?r1=1.3.2.1.2.5.2.1&r2=1.3.2.1.2.5.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput6 diff -u php-src/ext/pcre/pcrelib/testdata/testinput6:1.3.2.1.2.5.2.1 php-src/ext/pcre/pcrelib/testdata/testinput6:1.3.2.1.2.5.2.2 --- php-src/ext/pcre/pcrelib/testdata/testinput6:1.3.2.1.2.5.2.1 Sun Jan 13 12:44:56 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput6 Tue Sep 9 07:55:09 2008 @@ -763,7 +763,7 @@ \x{1b00}\x{12000}\x{7c0}\x{a840}\x{10900} /The next two are special cases where the lengths of the different cases of the -same character differ. The first went wrong with heap fram storage; the 2nd +same character differ. The first went wrong with heap frame storage; the 2nd was broken in all cases./ /^\x{023a}+?(\x{0130}+)/8i @@ -907,4 +907,40 @@ /\p{Cc}{2}+/8BZ +/\x{c0}+\x{116}+/8i + \x{c0}\x{e0}\x{116}\x{117} + +/[\x{c0}\x{116}]+/8i + \x{c0}\x{e0}\x{116}\x{117} + +/\p{Carian}\p{Cham}\p{Kayah_Li}\p{Lepcha}\p{Lycian}\p{Lydian}\p{Ol_Chiki}\p{Rejang}\p{Saurashtra}\p{Sundanese}\p{Vai}/8 + \x{102A4}\x{AA52}\x{A91D}\x{1C46}\x{10283}\x{1092E}\x{1C6B}\x{A93B}\x{A8BF}\x{1BA0}\x{A50A}==== + +/\x{a77d}\x{1d79}/8i + \x{a77d}\x{1d79} + \x{1d79}\x{a77d} + +/\x{a77d}\x{1d79}/8 + \x{a77d}\x{1d79} + ** Failers + \x{1d79}\x{a77d} + +/(A)\1/8i + AA + Aa + aa + aA + +/(\x{de})\1/8i + \x{de}\x{de} + \x{de}\x{fe} + \x{fe}\x{fe} + \x{fe}\x{de} + +/(\x{10a})\1/8i + \x{10a}\x{10a} + \x{10a}\x{10b} + \x{10b}\x{10b} + \x{10b}\x{10a} + / End of testinput6 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput7?r1=1.1.2.1.2.4.2.2&r2=1.1.2.1.2.4.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput7 diff -u php-src/ext/pcre/pcrelib/testdata/testinput7:1.1.2.1.2.4.2.2 php-src/ext/pcre/pcrelib/testdata/testinput7:1.1.2.1.2.4.2.3 --- php-src/ext/pcre/pcrelib/testdata/testinput7:1.1.2.1.2.4.2.2 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testinput7 Tue Sep 9 07:55:09 2008 @@ -4151,10 +4151,10 @@ a\rb\<any> /^abc./mgx<any> - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 \x{2028}abc8 \x{2029}abc9 JUNK + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK /abc.$/mgx<any> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 /^a\Rb/<bsr_unicode> a\nb http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput8?r1=1.1.8.2.2.1&r2=1.1.8.2.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput8 diff -u php-src/ext/pcre/pcrelib/testdata/testinput8:1.1.8.2.2.1 php-src/ext/pcre/pcrelib/testdata/testinput8:1.1.8.2.2.2 --- php-src/ext/pcre/pcrelib/testdata/testinput8:1.1.8.2.2.1 Sun Oct 7 10:35:03 2007 +++ php-src/ext/pcre/pcrelib/testdata/testinput8 Tue Sep 9 07:55:09 2008 @@ -664,4 +664,7 @@ a\x{85}b\<bsr_anycrlf> a\x0bb\<bsr_anycrlf> +/X/8f<any> + A\x{1ec5}ABCXYZ + / End of testinput 8 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testinput9?r1=1.1.2.1.2.3&r2=1.1.2.1.2.3.2.1&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testinput9 diff -u php-src/ext/pcre/pcrelib/testdata/testinput9:1.1.2.1.2.3 php-src/ext/pcre/pcrelib/testdata/testinput9:1.1.2.1.2.3.2.1 --- php-src/ext/pcre/pcrelib/testdata/testinput9:1.1.2.1.2.3 Sat Sep 1 17:48:43 2007 +++ php-src/ext/pcre/pcrelib/testdata/testinput9 Tue Sep 9 07:55:09 2008 @@ -819,10 +819,28 @@ /^\x{023a}+([^X])/8i \x{023a}\x{2c65}X +/\x{c0}+\x{116}+/8i + \x{c0}\x{e0}\x{116}\x{117} + +/[\x{c0}\x{116}]+/8i + \x{c0}\x{e0}\x{116}\x{117} + /Check property support in non-UTF-8 mode/ /\p{L}{4}/ 123abcdefg 123abc\xc4\xc5zz +/\p{Carian}\p{Cham}\p{Kayah_Li}\p{Lepcha}\p{Lycian}\p{Lydian}\p{Ol_Chiki}\p{Rejang}\p{Saurashtra}\p{Sundanese}\p{Vai}/8 + \x{102A4}\x{AA52}\x{A91D}\x{1C46}\x{10283}\x{1092E}\x{1C6B}\x{A93B}\x{A8BF}\x{1BA0}\x{A50A}==== + +/\x{a77d}\x{1d79}/8i + \x{a77d}\x{1d79} + \x{1d79}\x{a77d} + +/\x{a77d}\x{1d79}/8 + \x{a77d}\x{1d79} + ** Failers + \x{1d79}\x{a77d} + / End / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput1?r1=1.6.2.1.2.4.2.1&r2=1.6.2.1.2.4.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput1 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput1:1.6.2.1.2.4.2.1 php-src/ext/pcre/pcrelib/testdata/testoutput1:1.6.2.1.2.4.2.2 --- php-src/ext/pcre/pcrelib/testdata/testoutput1:1.6.2.1.2.4.2.1 Sun Jan 13 12:44:56 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput1 Tue Sep 9 07:55:09 2008 @@ -6605,4 +6605,8 @@ p 0: p +/.*[op][xyz]/ + fooabcfoo +No match + / End of testinput1 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput2?r1=1.6.2.1.2.4.2.3&r2=1.6.2.1.2.4.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput2 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput2:1.6.2.1.2.4.2.3 php-src/ext/pcre/pcrelib/testdata/testoutput2:1.6.2.1.2.4.2.4 --- php-src/ext/pcre/pcrelib/testdata/testoutput2:1.6.2.1.2.4.2.3 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput2 Tue Sep 9 07:55:09 2008 @@ -7851,7 +7851,7 @@ No match /^abc./mgx<any> - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 \x{2028}abc8 \x{2029}abc9 JUNK + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK 0: abc1 0: abc2 0: abc3 @@ -7861,7 +7861,7 @@ 0: abc7 /abc.$/mgx<any> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9 0: abc1 0: abc2 0: abc3 @@ -8163,7 +8163,7 @@ 0+ /abc.$/mgx<anycrlf> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 0: abc1 0: abc4 0: abc5 @@ -9631,4 +9631,11 @@ /a(*FAIL)+b/ Failed: nothing to repeat at offset 8 +/(abc|pqr|123){0}[xyz]/SI +Capturing subpattern count = 1 +No options +No first char +No need char +Starting byte set: x y z + / End of testinput2 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput4?r1=1.6.2.1.2.3.2.2&r2=1.6.2.1.2.3.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput4 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput4:1.6.2.1.2.3.2.2 php-src/ext/pcre/pcrelib/testdata/testoutput4:1.6.2.1.2.3.2.3 --- php-src/ext/pcre/pcrelib/testdata/testoutput4:1.6.2.1.2.3.2.2 Tue Jan 29 20:18:02 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput4 Tue Sep 9 07:55:10 2008 @@ -1071,4 +1071,22 @@ /[^ABCDEFGHIJKLMNOPQRSTUVWXYZÃÃÃÃÃà ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Ä¢Ä¤Ä¦Ä¨ÄªÄ¬Ä®Ä°Ä²Ä´Ä¶Ä¹Ä»Ä½Ä¿ÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅ Å¢Å¤Å¦Å¨ÅªÅ¬Å®Å°Å²Å´Å¶Å¸Å¹Å»Å½ÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆ Æ¢Æ¤Æ¦Æ§Æ©Æ¬Æ®Æ¯Æ±Æ²Æ³ÆµÆ·Æ¸Æ¼ÇÇÇÇÇÇÇÇÇÇÇÇÇ Ç¢Ç¤Ç¦Ç¨ÇªÇ¬Ç®Ç±Ç´Ç¶Ç·Ç¸ÇºÇ¼Ç¾ÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈ È¢È¤È¦È¨ÈªÈ¬È®È°È²ÈºÈ»È½È¾ÉÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎΠΡΣΤΥΦΧΨΩΪΫÏÏÏÏÏÏÏÏ Ï¢Ï¤Ï¦Ï¨ÏªÏ¬Ï®Ï´Ï·Ï¹ÏºÏ½Ï¾Ï¿ÐÐÐÐÐÐ ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐРСТУФХЦЧШЩЪЫЬÐÐ®Ð¯Ñ Ñ¢Ñ¤Ñ¦Ñ¨ÑªÑ¬Ñ®Ñ°Ñ²Ñ´Ñ¶Ñ¸ÑºÑ¼Ñ¾ÒÒÒÒÒÒÒÒÒÒÒÒÒ Ò¢Ò¤Ò¦Ò¨ÒªÒ¬Ò®Ò°Ò²Ò´Ò¶Ò¸ÒºÒ¼Ò¾ÓÓÓÓ ÓÓÓÓÓÓÓÓÓÓÓÓÓ Ó¢Ó¤Ó¦Ó¨ÓªÓ¬Ó®Ó°Ó²Ó´Ó¶Ó¸ÔÔÔÔÔÔÔÔÔ±Ô²Ô³Ô´ÔµÔ¶Ô·Ô¸Ô¹ÔºÔ»Ô¼Ô½Ô¾Ô¿ÕÕÕÕÕÕ ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕá á¡á¢á£á¤á¥á¦á§á¨á©áªá«á¬áá®á¯á°á±á²á³á´áµá¶á·á¸á¹áºá»á¼á½á¾á¿áááááá á¸á¸á¸á¸á¸á¸á¸á¸á! ¸á¸á¸á¸á¸á¸á¸á¸á¸ ḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾá¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹ ṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾáºáºáºáºáºáºáºáºáºáºáºáº ẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾá»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á» ỢỤỦỨỪỬỮỰỲỴỶỸá¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼á¼¨á¼©á¼ªá¼«á¼¬á¼á¼®á¼¯á¼¸á¼¹á¼ºá¼»á¼¼á¼½á¼¾á¼¿á½á½á½á½á½á½á½á½á½á½á½¨á½©á½ªá½«á½¬á½á½®á½¯á¾¸á¾¹á¾ºá¾»á¿á¿á¿á¿á¿á¿á¿á¿á¿¨á¿©á¿ªá¿«á¿¬á¿¸á¿¹á¿ºá¿»abcdefghijklmnopqrstuvwxyzªµºÃà áâãäåæçèéêëìÃîïðñòóôõöøùúûüýþÿÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄġģĥħĩīÄįıijĵķĸĺļľÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅšţťŧũūÅÅ¯Å±Å³ÅµÅ·ÅºÅ¼Å¾Å¿ÆÆÆ ÆÆÆÆÆÆÆÆÆÆ¡Æ£Æ¥Æ¨ÆªÆ«ÆÆ°Æ´Æ¶Æ¹ÆºÆ½Æ¾Æ¿ÇÇÇÇÇÇÇÇÇÇÇÇÇǡǣǥǧǩǫÇǯǰdzǵǹǻǽǿÈÈÈ ÈÈÈÈÈÈÈÈÈÈÈÈÈȡȣȥȧȩȫÈȯȱȳȴȵȶȷȸȹȼȿÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ É¡É¢É£! ɤɥɦɧɨɩɪɫɬÉɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿÊÊÊÊÊÊ Ê ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê¡Ê¢Ê£Ê¤Ê¥Ê¦Ê§Ê¨Ê©ÊªÊ«Ê¬ÊʮʯÎάÎήίΰαβγδεζηθικλμνξοÏÏÏÏÏÏ ÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏϡϣϥϧϩϫÏϯϰϱϲϳϵϸϻϼабвгдежзийклмнопÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑѡѣѥѧѩѫÑѯѱѳѵѷѹѻѽѿÒÒÒÒÒÒÒÒÒÒÒÒÒ¡Ò£Ò¥Ò§Ò©Ò«ÒÒ¯Ò±Ò³ÒµÒ·Ò¹Ò»Ò½Ò¿ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ¡Ó£Ó¥Ó§Ó©Ó«ÓÓ¯Ó±Ó³ÓµÓ·Ó¹ÔÔÔ ÔÔÔÔÔÕ¡Õ¢Õ£Õ¤Õ¥Õ¦Õ§Õ¨Õ©ÕªÕ«Õ¬ÕÕ®Õ¯Õ°Õ±Õ²Õ³Õ´ÕµÕ¶Õ·Õ¸Õ¹ÕºÕ»Õ¼Õ½Õ¾Õ¿ÖÖÖÖÖÖ ÖÖá´á´á´á´á´á´ á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´á´ ᴡᴢᴣᴤᴥᴦᴧᴨᴩᴪᴫᵢᵣᵤᵥᵦᵧᵨᵩᵪᵫᵬáµáµ®áµ¯áµ°áµ±áµ²áµ³áµ´áµµáµ¶áµ·áµ¹áµºáµ»áµ¼áµ½áµ¾áµ¿á¶á¶á¶á¶á¶á¶ á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¶á¸á¸á¸ á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸á¸¡á¸£á¸¥á¸§á¸©á¸«á¸á¸¯á¸±á¸³á¸µá¸·á¸¹á¸»á¸½á¸¿á¹á¹á¹ á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹á¹¡á¹£á! ¹¥á¹§á¹©á¹«á¹á¹¯á¹±á¹³á¹µá¹·á¹¹á¹»á¹½á¹¿áºáºáº áºáºáºáºáºáºáºáºáºáºáºáºáºáºáº¡áº£áº¥áº§áº©áº«áºáº¯áº±áº³áºµáº·áº¹áº»áº½áº¿á»á»á» á»á»á»á»á»á»á»á»á»á»á»á»á»á»¡á»£á»¥á»§á»©á»«á»á»¯á»±á»³á»µá»·á»¹á¼á¼á¼á¼á¼á¼ á¼á¼á¼á¼á¼á¼á¼á¼á¼ ἡἢἣἤἥἦἧἰἱἲἳἴἵἶἷá½á½á½á½á½á½ á½á½á½á½á½á½á½á½á½ ὡὢὣὤὥὦὧὰάὲέὴήὶίὸόὺύὼώá¾á¾á¾á¾á¾á¾ á¾á¾á¾á¾á¾á¾á¾á¾á¾á¾á¾ ᾡᾢᾣᾤᾥᾦᾧᾰᾱᾲᾳᾴᾶᾷιá¿á¿á¿á¿á¿á¿á¿á¿á¿á¿á¿á¿ ῡῢΰῤῥῦῧῲῳῴῶῷâ²â²â² â²â²â²â²â²â²â²â²â²â²â²â²â²â²¡â²£â²¥â²§â²©â²«â²â²¯â²±â²³â²µâ²·â²¹â²»â²½â²¿â³â³â³ â³â³â³â³â³â³â³â³â³â³â³â³â³â³¡â³£â³¤â´â´â´â´â´â´ â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´â´ ⴡⴢⴣⴤⴥï¬ï¬ï¬ï¬ï¬ï¬ ï¬ï¬ï¬ï¬ï¬ï¬\d-_^]/8 +/^[^d]*?$/ + abc + 0: abc + +/^[^d]*?$/8 + abc + 0: abc + +/^[^d]*?$/i + abc + 0: abc + +/^[^d]*?$/8i + abc + 0: abc + +/(?i)[\xc3\xa9\xc3\xbd]|[\xc3\xa9\xc3\xbdA]/8 + / End of testinput4 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput5?r1=1.4.2.1.2.4.2.3&r2=1.4.2.1.2.4.2.4&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput5 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput5:1.4.2.1.2.4.2.3 php-src/ext/pcre/pcrelib/testdata/testoutput5:1.4.2.1.2.4.2.4 --- php-src/ext/pcre/pcrelib/testdata/testoutput5:1.4.2.1.2.4.2.3 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput5 Tue Sep 9 07:55:10 2008 @@ -1628,4 +1628,17 @@ ab No match +/(\x{de})\1/ + \x{de}\x{de} + 0: \xde\xde + 1: \xde + \x{123} +** Character \x{123} is greater than 255 and UTF-8 mode is not enabled. +** Truncation will probably give the wrong result. +No match + +/X/8f<any> + A\x{1ec5}ABCXYZ + 0: X + / End of testinput5 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput6?r1=1.3.2.1.2.5.2.1&r2=1.3.2.1.2.5.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput6 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput6:1.3.2.1.2.5.2.1 php-src/ext/pcre/pcrelib/testdata/testoutput6:1.3.2.1.2.5.2.2 --- php-src/ext/pcre/pcrelib/testdata/testoutput6:1.3.2.1.2.5.2.1 Sun Jan 13 12:44:57 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput6 Tue Sep 9 07:55:10 2008 @@ -1431,7 +1431,7 @@ 0: \x{1b00}\x{12000}\x{7c0}\x{a840}\x{10900} /The next two are special cases where the lengths of the different cases of the -same character differ. The first went wrong with heap fram storage; the 2nd +same character differ. The first went wrong with heap frame storage; the 2nd was broken in all cases./ /^\x{023a}+?(\x{0130}+)/8i @@ -1679,4 +1679,72 @@ End ------------------------------------------------------------------ +/\x{c0}+\x{116}+/8i + \x{c0}\x{e0}\x{116}\x{117} + 0: \x{c0}\x{e0}\x{116}\x{117} + +/[\x{c0}\x{116}]+/8i + \x{c0}\x{e0}\x{116}\x{117} + 0: \x{c0}\x{e0}\x{116}\x{117} + +/\p{Carian}\p{Cham}\p{Kayah_Li}\p{Lepcha}\p{Lycian}\p{Lydian}\p{Ol_Chiki}\p{Rejang}\p{Saurashtra}\p{Sundanese}\p{Vai}/8 + \x{102A4}\x{AA52}\x{A91D}\x{1C46}\x{10283}\x{1092E}\x{1C6B}\x{A93B}\x{A8BF}\x{1BA0}\x{A50A}==== + 0: \x{102a4}\x{aa52}\x{a91d}\x{1c46}\x{10283}\x{1092e}\x{1c6b}\x{a93b}\x{a8bf}\x{1ba0}\x{a50a} + +/\x{a77d}\x{1d79}/8i + \x{a77d}\x{1d79} + 0: \x{a77d}\x{1d79} + \x{1d79}\x{a77d} + 0: \x{1d79}\x{a77d} + +/\x{a77d}\x{1d79}/8 + \x{a77d}\x{1d79} + 0: \x{a77d}\x{1d79} + ** Failers +No match + \x{1d79}\x{a77d} +No match + +/(A)\1/8i + AA + 0: AA + 1: A + Aa + 0: Aa + 1: A + aa + 0: aa + 1: a + aA + 0: aA + 1: a + +/(\x{de})\1/8i + \x{de}\x{de} + 0: \x{de}\x{de} + 1: \x{de} + \x{de}\x{fe} + 0: \x{de}\x{fe} + 1: \x{de} + \x{fe}\x{fe} + 0: \x{fe}\x{fe} + 1: \x{fe} + \x{fe}\x{de} + 0: \x{fe}\x{de} + 1: \x{fe} + +/(\x{10a})\1/8i + \x{10a}\x{10a} + 0: \x{10a}\x{10a} + 1: \x{10a} + \x{10a}\x{10b} + 0: \x{10a}\x{10b} + 1: \x{10a} + \x{10b}\x{10b} + 0: \x{10b}\x{10b} + 1: \x{10b} + \x{10b}\x{10a} + 0: \x{10b}\x{10a} + 1: \x{10b} + / End of testinput6 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput7?r1=1.1.2.1.2.4.2.2&r2=1.1.2.1.2.4.2.3&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput7 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput7:1.1.2.1.2.4.2.2 php-src/ext/pcre/pcrelib/testdata/testoutput7:1.1.2.1.2.4.2.3 --- php-src/ext/pcre/pcrelib/testdata/testoutput7:1.1.2.1.2.4.2.2 Sun Jul 6 15:17:25 2008 +++ php-src/ext/pcre/pcrelib/testdata/testoutput7 Tue Sep 9 07:55:10 2008 @@ -6805,7 +6805,7 @@ No match /^abc./mgx<any> - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 \x{2028}abc8 \x{2029}abc9 JUNK + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK 0: abc1 0: abc2 0: abc3 @@ -6815,7 +6815,7 @@ 0: abc7 /abc.$/mgx<any> - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7\x{2028} abc8\x{2029} abc9 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 0: abc1 0: abc2 0: abc3 http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput8?r1=1.1.2.1.2.2.2.1&r2=1.1.2.1.2.2.2.2&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput8 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput8:1.1.2.1.2.2.2.1 php-src/ext/pcre/pcrelib/testdata/testoutput8:1.1.2.1.2.2.2.2 --- php-src/ext/pcre/pcrelib/testdata/testoutput8:1.1.2.1.2.2.2.1 Sun Oct 7 10:35:03 2007 +++ php-src/ext/pcre/pcrelib/testdata/testoutput8 Tue Sep 9 07:55:10 2008 @@ -1284,4 +1284,8 @@ a\x0bb\<bsr_anycrlf> No match +/X/8f<any> + A\x{1ec5}ABCXYZ + 0: X + / End of testinput 8 / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/testdata/testoutput9?r1=1.1.2.1.2.3&r2=1.1.2.1.2.3.2.1&diff_format=u Index: php-src/ext/pcre/pcrelib/testdata/testoutput9 diff -u php-src/ext/pcre/pcrelib/testdata/testoutput9:1.1.2.1.2.3 php-src/ext/pcre/pcrelib/testdata/testoutput9:1.1.2.1.2.3.2.1 --- php-src/ext/pcre/pcrelib/testdata/testoutput9:1.1.2.1.2.3 Sat Sep 1 17:48:43 2007 +++ php-src/ext/pcre/pcrelib/testdata/testoutput9 Tue Sep 9 07:55:10 2008 @@ -1632,6 +1632,18 @@ \x{023a}\x{2c65}X 0: \x{23a}\x{2c65} +/\x{c0}+\x{116}+/8i + \x{c0}\x{e0}\x{116}\x{117} + 0: \x{c0}\x{e0}\x{116}\x{117} + 1: \x{c0}\x{e0}\x{116} + +/[\x{c0}\x{116}]+/8i + \x{c0}\x{e0}\x{116}\x{117} + 0: \x{c0}\x{e0}\x{116}\x{117} + 1: \x{c0}\x{e0}\x{116} + 2: \x{c0}\x{e0} + 3: \x{c0} + /Check property support in non-UTF-8 mode/ /\p{L}{4}/ @@ -1640,4 +1652,22 @@ 123abc\xc4\xc5zz 0: abc\xc4 +/\p{Carian}\p{Cham}\p{Kayah_Li}\p{Lepcha}\p{Lycian}\p{Lydian}\p{Ol_Chiki}\p{Rejang}\p{Saurashtra}\p{Sundanese}\p{Vai}/8 + \x{102A4}\x{AA52}\x{A91D}\x{1C46}\x{10283}\x{1092E}\x{1C6B}\x{A93B}\x{A8BF}\x{1BA0}\x{A50A}==== + 0: \x{102a4}\x{aa52}\x{a91d}\x{1c46}\x{10283}\x{1092e}\x{1c6b}\x{a93b}\x{a8bf}\x{1ba0}\x{a50a} + +/\x{a77d}\x{1d79}/8i + \x{a77d}\x{1d79} + 0: \x{a77d}\x{1d79} + \x{1d79}\x{a77d} + 0: \x{1d79}\x{a77d} + +/\x{a77d}\x{1d79}/8 + \x{a77d}\x{1d79} + 0: \x{a77d}\x{1d79} + ** Failers +No match + \x{1d79}\x{a77d} +No match + / End / http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_ucd.c?view=markup&rev=1.1 Index: php-src/ext/pcre/pcrelib/pcre_ucd.c +++ php-src/ext/pcre/pcrelib/pcre_ucd.c