diff -Nru php5-5.4.4/.gdbinit php5-5.4.9/.gdbinit --- php5-5.4.4/.gdbinit 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/.gdbinit 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,19 @@ +define set_ts + set $tsrm_ls = $arg0 +end + +document set_ts + set the ts resource, it is impossible for gdb to + call ts_resource_ex while no process is running, + but we could get the resource from the argument + of frame info. +end + define ____executor_globals if basic_functions_module.zts - set $tsrm_ls = ts_resource_ex(0, 0) + if !$tsrm_ls + set $tsrm_ls = ts_resource_ex(0, 0) + end set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1]) set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1]) else @@ -38,12 +51,53 @@ set $t = $arg0 while $t printf "[%p] ", $t - if $t->function_state.function->common.function_name - if $t->function_state.arguments - set $count = (int)*($t->function_state.arguments) - printf "%s(", $t->function_state.function->common.function_name + set $fst = $t->function_state + if $fst.function->common.function_name + if $fst.arguments + set $count = (int)*($fst.arguments) + + if $t->object + if $fst.function.common.scope + printf "%s->", $fst.function.common.scope->name + else + if !$eg + ____executor_globals + end + + set $known_class = 0 + if $eg + set $handle = $t->object.value.obj.handle + set $handlers = $t->object.value.obj.handlers + set $zobj = (zend_object *)$eg.objects_store.object_buckets[$handle].bucket.obj.object + + if $handlers->get_class_entry == &zend_std_object_get_class + set $known_class = 1 + + if $handlers.get_class_name + if $handlers.get_class_name != &zend_std_object_get_class_name + set $known_class = 0 + end + end + + if $known_class + printf "%s->", $zobj->ce.name + end + end + end + + if !$known_class + printf "(Unknown)->" + end + end + else + if $fst.function.common.scope + printf "%s::", $fst.function.common.scope->name + end + end + + printf "%s(", $fst.function->common.function_name while $count > 0 - set $zvalue = *(zval **)($t->function_state.arguments - $count) + set $zvalue = *(zval **)($fst.arguments - $count) set $type = $zvalue->type if $type == 0 printf "NULL" @@ -73,7 +127,7 @@ if $type == 7 printf "resource(#%d)", $zvalue->value.lval end - if $type == 8 + if $type == 8 printf "constant" end if $type == 9 @@ -89,7 +143,7 @@ end printf ") " else - printf "%s() ", $t->function_state.function->common.function_name + printf "%s() ", $fst.function->common.function_name end else printf "??? " @@ -600,7 +654,7 @@ end end if $not_found - printf "no such block that begins at %p.\n", $aptr + printf "no such block that begins at %p.\n", $aptr end if $arg0 == 0 printf "-------------------------------------------------------------------------------\n" diff -Nru php5-5.4.4/.gitattributes php5-5.4.9/.gitattributes --- php5-5.4.4/.gitattributes 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/.gitattributes 2012-11-21 05:12:20.000000000 +0000 @@ -15,6 +15,7 @@ ext/dba/libcdb/cdb_make.c ident ext/dba/libcdb/cdb.c ident ext/filter/filter.c ident +ext/zip/php_zip.c ident README.input_filter ident run-tests.php ident sapi/nsapi/nsapi.c ident diff -Nru php5-5.4.4/.gitignore php5-5.4.9/.gitignore --- php5-5.4.4/.gitignore 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/.gitignore 2012-11-21 05:12:20.000000000 +0000 @@ -15,6 +15,7 @@ *.opt *.plg *swp +*.patch *.tgz *.tar.gz *.tar.bz2 diff -Nru php5-5.4.4/.travis.yml php5-5.4.9/.travis.yml --- php5-5.4.4/.travis.yml 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/.travis.yml 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,10 @@ +language: php + +php: + # We only specify one version so we only get one worker + - 5.4 + +notifications: + email: false + +script: exit 0 diff -Nru php5-5.4.4/CODING_STANDARDS php5-5.4.9/CODING_STANDARDS --- php5-5.4.4/CODING_STANDARDS 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/CODING_STANDARDS 2012-11-21 05:12:20.000000000 +0000 @@ -2,11 +2,11 @@ PHP Coding Standards ======================== -This file lists several standards that any programmer, adding or changing -code in PHP, should follow. Since this file was added at a very late +This file lists several standards that any programmer adding or changing +code in PHP should follow. Since this file was added at a very late stage of the development of PHP v3.0, the code base does not (yet) fully follow it, but it's going in that general direction. Since we are now -well into the version 4 releases, many sections have been recoded to use +well into version 5 releases, many sections have been recoded to use these rules. Code Implementation diff -Nru php5-5.4.4/INSTALL php5-5.4.9/INSTALL --- php5-5.4.4/INSTALL 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/INSTALL 2012-11-21 05:12:20.000000000 +0000 @@ -24,6 +24,7 @@ + Installing a PHP extension on Windows + Compiling shared PECL extensions with the pecl command + Compiling shared PECL extensions with phpize + + php-config + Compiling PECL extensions statically into PHP * Problems? + Read the FAQ @@ -83,7 +84,7 @@ With PHP you can also write desktop GUI applications using the PHP-GTK extension. This is a completely different approach than writing web pages, as you do not output any HTML, but manage windows and objects - within them. For more information about PHP-GTK, please » visit the + within them. For more information about PHP-GTK, please » visit the site dedicated to this extension. PHP-GTK is not included in the official PHP distribution. @@ -92,9 +93,9 @@ will also find information on the command line executable in the following sections. - PHP source code and binary distributions for Windows can be found at » - http://www.php.net/downloads.php. We recommend you to choose a » mirror - nearest to you for downloading the distributions. + PHP source code and binary distributions for Windows can be found at + » http://www.php.net/downloads.php. We recommend you to choose a + » mirror nearest to you for downloading the distributions. __________________________________________________________________ __________________________________________________________________ @@ -140,9 +141,9 @@ * A web server * Any module specific components (such as GD, PDF libs, etc.) - When building directly from SVN sources or after custom modifications + When building directly from Git sources or after custom modifications you might also need: - * autoconf: 2.13 + * autoconf: 2.13+ (for PHP < 5.4.0), 2.59+ (for PHP >= 5.4.0) * automake: 1.4+ * libtool: 1.4.x+ (except 1.4.2) * re2c: Version 0.13.4 or newer @@ -375,12 +376,12 @@ For information on why, read the related FAQ entry on using Apache2 with a threaded MPM - The » Apache Documentation is the most authoritative source of + The » Apache Documentation is the most authoritative source of information on the Apache 2.x server. More information about installation options for Apache may be found there. - The most recent version of Apache HTTP Server may be obtained from » - Apache download site, and a fitting PHP version from the above + The most recent version of Apache HTTP Server may be obtained from + » Apache download site, and a fitting PHP version from the above mentioned places. This quick guide covers only the basics to get started with Apache 2.x and PHP. For more information read the » Apache Documentation. The version numbers have been omitted here, to ensure @@ -498,7 +499,7 @@ This should not be undertaken without being aware of the consequences of this decision, and having at least a fair understanding of the - implications. The Apache documentation regarding » MPM-Modules + implications. The Apache documentation regarding » MPM-Modules discusses MPMs in a great deal more detail. Note: @@ -520,7 +521,7 @@ This section contains notes and hints specific to Lighttpd 1.4 installs of PHP on Unix systems. - Please use the » Lighttpd trac to learn how to install Lighttpd + Please use the » Lighttpd trac to learn how to install Lighttpd properly before continuing. Fastcgi is the preferred SAPI to connect PHP and Lighttpd. Fastcgi is @@ -627,15 +628,15 @@ current web servers read the note about subrequests. You can find more information about setting up PHP for the Netscape - Enterprise Server (NES) here: » - http://benoit.noss.free.fr/php/install-php4.html + Enterprise Server (NES) here: + » http://benoit.noss.free.fr/php/install-php4.html To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape web servers, enter the proper install directory for the --with-nsapi=[DIR] option. The default directory is usually /opt/netscape/suitespot/. Please also read /php-xxx-version/sapi/nsapi/nsapi-readme.txt. - 1. Install the following packages from » http://www.sunfreeware.com/ + 1. Install the following packages from » http://www.sunfreeware.com/ or another download site: + autoconf-2.13 + automake-1.4 @@ -837,7 +838,7 @@ Using Variables Some server supplied environment variables are not defined in the - current » CGI/1.1 specification. Only the following variables are + current » CGI/1.1 specification. Only the following variables are defined there: AUTH_TYPE, CONTENT_LENGTH, CONTENT_TYPE, GATEWAY_INTERFACE, PATH_INFO, PATH_TRANSLATED, QUERY_STRING, REMOTE_ADDR, REMOTE_HOST, REMOTE_IDENT, REMOTE_USER, REQUEST_METHOD, @@ -855,20 +856,20 @@ There are two main options for installing PHP on HP-UX systems. Either compile it, or install a pre-compiled binary. - Official pre-compiled packages are located here: » - http://software.hp.com/ + Official pre-compiled packages are located here: + » http://software.hp.com/ Until this manual section is rewritten, the documentation about compiling PHP (and related extensions) on HP-UX systems has been - removed. For now, consider reading the following external resource: » - Building Apache and PHP on HP-UX 11.11 + removed. For now, consider reading the following external resource: + » Building Apache and PHP on HP-UX 11.11 __________________________________________________________________ __________________________________________________________________ OpenBSD installation notes - This section contains notes and hints specific to installing PHP on » - OpenBSD 3.6. + This section contains notes and hints specific to installing PHP on + » OpenBSD 3.6. Using Binary Packages @@ -900,12 +901,12 @@ (install the PEAR libraries) # pkg_add php4-pear-4.3.8.tgz - Read the » packages(7) manual page for more information about binary + Read the » packages(7) manual page for more information about binary packages on OpenBSD. Using Ports - You can also compile up PHP from source using the » ports tree. + You can also compile up PHP from source using the » ports tree. However, this is only recommended for users familiar with OpenBSD. The PHP 4 port is split into two sub-directories: core and extensions. The extensions directory generates sub-packages for all of the supported @@ -926,7 +927,7 @@ automatically installs into the correct chroot directories, so no special modification is needed there. More information on the OpenBSD Apache is available in the » OpenBSD FAQ. - * The OpenBSD 3.6 package for the » gd extension requires XFree86 to + * The OpenBSD 3.6 package for the » gd extension requires XFree86 to be installed. If you do not wish to use some of the font features that require X11, install the php4-gd-4.3.8-no_x11.tgz package instead. @@ -951,18 +952,26 @@ Solaris installs often lack C compilers and their related tools. Read this FAQ for information on why using GNU versions for some of these - tools is necessary. The required software is as follows: + tools is necessary. + + For unpacking the PHP distribution you need + * tar + * gzip or + * bzip2 + + For compiling PHP you need * gcc (recommended, other C compilers may work) * make - * flex + * GNU sed + + For building extra extensions or hacking the code of PHP you might also + need + * flex (up to PHP 5.2) + * re2c * bison * m4 * autoconf * automake - * perl - * gzip - * tar - * GNU sed In addition, you will need to install (and possibly compile) any additional software specific to your configuration, such as Oracle or @@ -971,14 +980,16 @@ Using Packages You can simplify the Solaris install process by using pkgadd to install - most of your needed components. + most of your needed components. The Image Packaging System (IPS) for + Solaris 11 Express also contains most of the required components for + installation using the pkg command. __________________________________________________________________ __________________________________________________________________ Debian GNU/Linux installation notes - This section contains notes and hints specific to installing PHP on » - Debian GNU/Linux. + This section contains notes and hints specific to installing PHP on + » Debian GNU/Linux. Warning Unofficial builds from third-parties are not supported here. Any bugs @@ -1205,6 +1216,7 @@ * Installing a PHP extension on Windows * Compiling shared PECL extensions with the pecl command * Compiling shared PECL extensions with phpize + * php-config * Compiling PECL extensions statically into PHP __________________________________________________________________ @@ -1227,8 +1239,8 @@ To this php.ini file, or through the use of the dl() function. When building PHP modules, it's important to have known-good versions - of the required tools (autoconf, automake, libtool, etc.) See the » - Anonymous SVN Instructions for details on the required tools, and + of the required tools (autoconf, automake, libtool, etc.) See the + » Anonymous Git Instructions for details on the required tools, and required versions. __________________________________________________________________ __________________________________________________________________ @@ -1247,7 +1259,7 @@ the PECL web site are available for download and installation using the » pecl command. Specific revisions may also be specified. * SVN Most PECL extensions also reside in SVN. A web-based view may - be seen at » http://svn.php.net/viewvc/pecl/. To download straight + be seen at » http://svn.php.net/viewvc/pecl/. To download straight from SVN, the following sequence of commands may be used: $ svn checkout http://svn.php.net/repository/pecl/extname/trunk extname @@ -1279,7 +1291,7 @@ PHP extensions are usually called "php_*.dll" (where the star represents the name of the extension) and they are located under the - "PHP\ext" ("PHP\extensions" in PHP4) folder. + "PHP\ext" ("PHP\extensions" in PHP 4) folder. PHP ships with the extensions most useful to the majority of developers. They are called "core" extensions. @@ -1365,7 +1377,7 @@ Compiling shared PECL extensions with the pecl command - PECL makes it easy to create shared PHP extensions. Using the » pecl + PECL makes it easy to create shared PHP extensions. Using the » pecl command, do the following: $ pecl install extname @@ -1424,6 +1436,51 @@ __________________________________________________________________ __________________________________________________________________ +php-config + + php-config is a simple shell script for obtaining information about the + installed PHP configuration. + + When compiling extensions, if you have multiple PHP versions installed, + you may specify for which installation you'd like to build by using the + --with-php-config option during configuration, specifying the path of + the respective php-config script. + + The list of command line options provided by the php-config script can + be queried anytime by running php-config with the -h switch: +Usage: /usr/local/bin/php-config [OPTION] +Options: + --prefix [...] + --includes [...] + --ldflags [...] + --libs [...] + --extension-dir [...] + --include-dir [...] + --php-binary [...] + --php-sapis [...] + --configure-options [...] + --version [...] + --vernum [...] + + CAPTION: Command line options + + Option Description + --prefix Directory prefix where PHP is installed, e.g. /usr/local + --includes List of -I options with all include files + --ldflags LD Flags which PHP was compiled with + --libs Extra libraries which PHP was compiled with + --extension-dir Directory where extensions are searched by default + --include-dir Directory prefix where header files are installed by + default + --php-binary Full path to php CLI or CGI binary + --php-sapis Show all SAPI modules available + --configure-options Configure options to recreate configuration of + current PHP installation + --version PHP version + --vernum PHP version as integer + __________________________________________________________________ + __________________________________________________________________ + Compiling PECL extensions statically into PHP You might find that you need to build a PECL extension statically into @@ -1485,11 +1542,11 @@ If you are still stuck, someone on the PHP installation mailing list may be able to help you. You should check out the archive first, in case someone already answered someone else who had the same problem as - you. The archives are available from the support page on » - http://www.php.net/support.php. To subscribe to the PHP installation - mailing list, send an empty mail to » - php-install-subscribe@lists.php.net. The mailing list address is » - php-install@lists.php.net. + you. The archives are available from the support page on + » http://www.php.net/support.php. To subscribe to the PHP installation + mailing list, send an empty mail to + » php-install-subscribe@lists.php.net. The mailing list address is + » php-install@lists.php.net. If you want to get help on the mailing list, please try to be precise and give the necessary details about your environment (which operating @@ -1504,11 +1561,11 @@ If you think you have found a bug in PHP, please report it. The PHP developers probably don't know about it, and unless you report it, chances are it won't be fixed. You can report bugs using the - bug-tracking system at » http://bugs.php.net/. Please do not send bug + bug-tracking system at » http://bugs.php.net/. Please do not send bug reports in mailing list or personal letters. The bug system is also suitable to submit feature requests. - Read the » How to report a bug document before submitting any bug + Read the » How to report a bug document before submitting any bug reports! __________________________________________________________________ __________________________________________________________________ @@ -1528,14 +1585,14 @@ The configuration file (php.ini) is read when PHP starts up. For the server module versions of PHP, this happens only once when the web - server is started. For the CGI and CLI version, it happens on every + server is started. For the CGI and CLI versions, it happens on every invocation. - php.ini is searched in these locations (in order): + php.ini is searched for in these locations (in order): * SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI, php_ini parameter in NSAPI, PHP_INI_PATH environment variable in THTTPD) - * The PHPRC environment variable. Before PHP 5.2.0 this was checked + * The PHPRC environment variable. Before PHP 5.2.0, this was checked after the registry key mentioned below. * As of PHP 5.2.0, the location of the php.ini file can be set for different versions of PHP. The following registry keys are examined @@ -1543,33 +1600,33 @@ [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where x, y and z mean the PHP major, minor and release versions. If there is a value for - IniFilePath in these keys, then the first one found will be used as - the location of the php.ini (Windows only). + IniFilePath in any of these keys, the first one found will be used + as the location of the php.ini (Windows only). * [HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of IniFilePath (Windows only). - * Current working directory (except CLI) + * Current working directory (except CLI). * The web server's directory (for SAPI modules), or directory of PHP - (otherwise in Windows) + (otherwise in Windows). * Windows directory (C:\windows or C:\winnt) (for Windows), or - --with-config-file-path compile time option + --with-config-file-path compile time option. - If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is - e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini. SAPI - name can be determined by php_sapi_name(). + If php-SAPI.ini exists (where SAPI is the SAPI in use, so, for example, + php-cli.ini or php-apache.ini), it is used instead of php.ini. The SAPI + name can be determined with php_sapi_name(). Note: - The Apache web server changes the directory to root at startup + The Apache web server changes the directory to root at startup, causing PHP to attempt to read php.ini from the root filesystem if it exists. - The php.ini directives handled by extensions are documented - respectively on the pages of the extensions themselves. The list of the - core directives is available in the appendix. Probably not all PHP - directives are documented in the manual though. For a complete list of + The php.ini directives handled by extensions are documented on the + respective pages of the extensions themselves. A list of the core + directives is available in the appendix. Not all PHP directives are + necessarily documented in this manual: for a complete list of directives available in your PHP version, please read your well - commented php.ini file. Alternatively, you may find the » the latest - php.ini from SVN helpful too. + commented php.ini file. Alternatively, you may find » the latest + php.ini from Git helpful too. Example #1 php.ini example ; any text on a line after an unquoted semicolon (;) is ignored @@ -1635,12 +1692,13 @@ CAPTION: Definition of PHP_INI_* modes - Mode Value Meaning - PHP_INI_USER 1 Entry can be set in user scripts (like with ini_set()) - or in the Windows registry - PHP_INI_PERDIR 6 Entry can be set in php.ini, .htaccess or httpd.conf - PHP_INI_SYSTEM 4 Entry can be set in php.ini or httpd.conf - PHP_INI_ALL 7 Entry can be set anywhere + Mode Meaning + PHP_INI_USER Entry can be set in user scripts (like with ini_set()) or + in the Windows registry. Since PHP 5.3, entry can be set in .user.ini + PHP_INI_PERDIR Entry can be set in php.ini, .htaccess, httpd.conf or + .user.ini (since PHP 5.3) + PHP_INI_SYSTEM Entry can be set in php.ini or httpd.conf + PHP_INI_ALL Entry can be set anywhere __________________________________________________________________ __________________________________________________________________ @@ -1788,13 +1846,9 @@ each request to play in, further weaknesses are introduced into PHP's system. - If you feel you have to use a threaded MPM, look at a FastCGI + If you want to use a threaded MPM, look at a FastCGI configuration where PHP is running in its own memory space. - And finally, this warning against using a threaded MPM is not as - strong for Windows systems because most libraries on that - platform tend to be threadsafe. - Unix/Windows: Where should my php.ini file be located? By default on Unix it should be in /usr/local/lib which is /lib. Most people will want to change this at diff -Nru php5-5.4.4/NEWS php5-5.4.9/NEWS --- php5-5.4.4/NEWS 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/NEWS 2012-11-21 05:12:20.000000000 +0000 @@ -1,7 +1,374 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +22 Nov 2012, PHP 5.4.9 + +- Core: + . Fixed bug #63305 (zend_mm_heap corrupted with traits). (Dmitry, Laruence) + . Fixed bug #63369 ((un)serialize() leaves dangling pointers, causes crashes). + (Tony, Andrew Sitnikov) + . Fixed bug #63241 (PHP fails to open Windows deduplicated files). + (daniel dot stelter-gliese at innogames dot de) + . Fixed bug #62444 (Handle leak in is_readable on windows). + (krazyest at seznam dot cz) + +- Curl: + . Fixed bug #63363 (Curl silently accepts boolean true for SSL_VERIFYHOST). + Patch by John Jawed GitHub PR #221 (Anthony) + +- Fileinfo: + . Fixed bug #63248 (Load multiple magic files from a directory under Windows). + (Anatoliy) + +- Libxml + . Fixed bug #63389 (Missing context check on libxml_set_streams_context() + causes memleak). (Laruence) + +- Mbstring: + . Fixed bug #63447 (max_input_vars doesn't filter variables when + mbstring.encoding_translation = On). (Laruence) + +- OCI8: + . Fixed bug #63265 (Add ORA-00028 to the PHP_OCI_HANDLE_ERROR macro) + (Chris Jones) + +- PCRE: + . Fixed bug #63180 (Corruption of hash tables). (Dmitry) + . Fixed bug #63055 (Segfault in zend_gc with SF2 testsuite). + (Dmitry, Laruence) + . Fixed bug #63284 (Upgrade PCRE to 8.31). (Anatoliy) + +- PDO: + . Fixed bug #63235 (buffer overflow in use of SQLGetDiagRec). + (Martin Osvald, Remi) + +- PDO_pgsql: + . Fixed bug #62593 (Emulate prepares behave strangely with PARAM_BOOL). + (Will Fitch) + +- Phar: + . Fixed bug #63297 (Phar fails to write an openssl based signature). + (Anatoliy) + +- Streams: + . Fixed bug #63240 (stream_get_line() return contains delimiter string). + (Tjerk, Gustavo) + +- Reflection: + . Fixed bug #63399 (ReflectionClass::getTraitAliases() incorrectly resolves + traitnames). (Laruence) + +18 Oct 2012, PHP 5.4.8 + +- CLI server: + . Implemented FR #63242 (Default error page in PHP built-in web server uses + outdated html/css). (pascal.chevrel@free.fr) + . Changed response to unknown HTTP method to 501 according to RFC. + (Niklas Lindgren). + . Support HTTP PATCH method. Patch by Niklas Lindgren, GitHub PR #190. + (Lars) + +- Core: + . Fixed bug #63219 (Segfault when aliasing trait method when autoloader + throws excpetion). (Laruence) + . Added optional second argument for assert() to specify custom message. Patch + by Lonny Kapelushnik (lonny@lonnylot.com). (Lars) + . Support building PHP with the native client toolchain. (Stuart Langley) + . Added --offline option for tests. (Remi) + . Fixed bug #63162 (parse_url does not match password component). (husman) + . Fixed bug #63111 (is_callable() lies for abstract static method). (Dmitry) + . Fixed bug #63093 (Segfault while load extension failed in zts-build). + (Laruence) + . Fixed bug #62976 (Notice: could not be converted to int when comparing + some builtin classes). (Laruence) + . Fixed bug #62955 (Only one directive is loaded from "Per Directory Values" + Windows registry). (aserbulov at parallels dot com) + . Fixed bug #62907 (Double free when use traits). (Dmitry) + . Fixed bug #61767 (Shutdown functions not called in certain error + situation). (Dmitry) + . Fixed bug #60909 (custom error handler throwing Exception + fatal error + = no shutdown function). (Dmitry) + . Fixed bug #60723 (error_log error time has changed to UTC ignoring default + timezone). (Laruence) + +- cURL: + . Fixed bug #62085 (file_get_contents a remote file by Curl wrapper will + cause cpu Soaring). (Pierrick) + +- Date: + . Fixed bug #62896 ("DateTime->modify('+0 days')" modifies DateTime object) + (Lonny Kapelushnik) + . Fixed bug #62561 (DateTime add 'P1D' adds 25 hours). (Lonny Kapelushnik) + +- DOM: + . Fixed bug #63015 (Incorrect arginfo for DOMErrorHandler). (Rob) + +- FPM: + . Fixed bug #62954 (startup problems fpm / php-fpm). (fat) + . Fixed bug #62886 (PHP-FPM may segfault/hang on startup). (fat) + . Fixed bug #63085 (Systemd integration and daemonize). (remi, fat) + . Fixed bug #62947 (Unneccesary warnings on FPM). (fat) + . Fixed bug #62887 (Only /status?plain&full gives "last request cpu"). (fat) + . Fixed bug #62216 (Add PID to php-fpm init.d script). (fat) + +- OCI8: + . Fixed bug #60901 (Improve "tail" syntax for AIX installation) (Chris Jones) + +- OpenSSL: + . Implemented FR #61421 (OpenSSL signature verification missing RMD160, + SHA224, SHA256, SHA384, SHA512). (Mark Jones) + +- PDO: + . Fixed bug #63258 (seg fault with PDO and dblib using DBSETOPT(H->link, + DBQUOTEDIDENT, 1)). (Laruence) + . Fixed bug #63235 (buffer overflow in use of SQLGetDiagRec). + (Martin Osvald, Remi) + +- PDO Firebird: + . Fixed bug #63214 (Large PDO Firebird Queries). + (james at kenjim dot com) + +- SOAP + . Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice). + (Dmitry) + +- SPL: + . Bug #62987 (Assigning to ArrayObject[null][something] overrides all + undefined variables). (Laruence) + +- mbstring: + . Allow passing null as a default value to mb_substr() and mb_strcut(). Patch + by Alexander Moskaliov via GitHub PR #133. (Lars) + +- Filter extension: + . Bug #49510: Boolean validation fails with FILTER_NULL_ON_FAILURE with empty + string or false. (Lars) + +- Sockets + . Fixed bug #63000 (MCAST_JOIN_GROUP on OSX is broken, merge of PR 185 by + Igor Wiedler). (Lars) + +13 Sep 2012, PHP 5.4.7 + +- Core: + . Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence) + . Fixed bug #62844 (parse_url() does not recognize //). (Andrew Faulds). + . Fixed bug #62829 (stdint.h included on platform where HAVE_STDINT_H is not + set). (Felipe) + . Fixed bug #62763 (register_shutdown_function and extending class). + (Laruence) + . Fixed bug #62725 (Calling exit() in a shutdown function does not return + the exit value). (Laruence) + . Fixed bug #62744 (dangling pointers made by zend_disable_class). (Laruence) + . Fixed bug #62716 (munmap() is called with the incorrect length). + (slangley@google.com) + . Fixed bug #62358 (Segfault when using traits a lot). (Laruence) + . Fixed bug #62328 (implementing __toString and a cast to string fails) + (Laruence) + . Fixed bug #51363 (Fatal error raised by var_export() not caught by error + handler). (Lonny Kapelushnik) + . Fixed bug #40459 (Stat and Dir stream wrapper methods do not call + constructor). (Stas) + +- CURL: + . Fixed bug #62912 (CURLINFO_PRIMARY_* AND CURLINFO_LOCAL_* not exposed). + (Pierrick) + . Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick) + +- Intl: + . Fixed Spoofchecker not being registered on ICU 49.1. (Gustavo) + . Fix bug #62933 (ext/intl compilation error on icu 3.4.1). (Gustavo) + . Fix bug #62915 (defective cloning in several intl classes). (Gustavo) + +- Installation: + . Fixed bug #62460 (php binaries installed as binary.dSYM). (Reeze Xia) + +- PCRE: + . Fixed bug #55856 (preg_replace should fail on trailing garbage). + (reg dot php at alf dot nu) + +- PDO: + . Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence) + +- Reflection: + . Fixed bug #62892 (ReflectionClass::getTraitAliases crashes on importing + trait methods as private). (Felipe) + . Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong + result). (Laruence) + +- Session: + . Fixed bug (segfault due to retval is not initialized). (Laruence) + . Fixed bug (segfault due to PS(mod_user_implemented) not be reseted + when close handler call exit). (Laruence) + +- SOAP + . Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice). + (Dmitry) + +- SPL: + . Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray) + (Laruence) + . Implemented FR #62840 (Add sort flag to ArrayObject::ksort). (Laruence) + +- Standard: + . Fixed bug #62836 (Seg fault or broken object references on unserialize()). + (Laruence) + +- FPM: + . Merged PR 121 by minitux to add support for slow request counting on PHP + FPM status page. (Lars) + +16 Aug 2012, PHP 5.4.6 + +- CLI Server: + . Implemented FR #62700 (have the console output 'Listening on + http://localhost:8000'). (pascal.chevrel@free.fr) + +- Core: + . Fixed bug #62661 (Interactive php-cli crashes if include() is used in + auto_prepend_file). (Laruence) + . Fixed bug #62653: (unset($array[$float]) causes a crash). (Nikita Popov, + Laruence) + . Fixed bug #62565 (Crashes due non-initialized internal properties_table). + (Felipe) + . Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK + with run-test.php). (Laruence) + +- CURL: + . Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false). + (r.hampartsumyan@gmail.com, Laruence) + +- DateTime: + . Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence) + +- Fileinfo: + . Fixed bug #61964 (finfo_open with directory causes invalid free). + (reeze.xia@gmail.com) + +- Intl: + . Fixed bug #62564 (Extending MessageFormatter and adding property causes + crash). (Felipe) + +- MySQLnd: + . Fixed bug #62594 (segfault in mysqlnd_res_meta::set_mode). (Laruence) + +- readline: + . Fixed bug #62612 (readline extension compilation fails with + sapi/cli/cli.h: No such file). (Johannes) + +- Reflection: + . Implemented FR #61602 (Allow access to name of constant used as default + value). (reeze.xia@gmail.com) + +- SimpleXML: + . Implemented FR #55218 Get namespaces from current node. (Lonny) + +- SPL: + . Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance + gives Segmentation fault). (Laruence, Gustavo) + . Fixed bug #61527 (ArrayIterator gives misleading notice on next() when + moved to the end). (reeze.xia@gmail.com) + +- Streams: + . Fixed bug #62597 (segfault in php_stream_wrapper_log_error with ZTS build). + (Laruence) + +- Zlib: + . Fixed bug #55544 (ob_gzhandler always conflicts with + zlib.output_compression). (Laruence) + +19 Jul 2012, PHP 5.4.5 + +- Core: + . Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed + Salt). (Anthony Ferrara) + . Fixed bug #62432 (ReflectionMethod random corrupt memory on high + concurrent). (Johannes) + . Fixed bug #62373 (serialize() generates wrong reference to the object). + (Moriyoshi) + . Fixed bug #62357 (compile failure: (S) Arguments missing for built-in + function __memcmp). (Laruence) + . Fixed bug #61998 (Using traits with method aliases appears to result in + crash during execution). (Dmitry) + . Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that + includes a semi-colon). (Pierrick) + . Fixed potential overflow in _php_stream_scandir (CVE-2012-2688). + (Jason Powell, Stas) + +- EXIF: + . Fixed information leak in ext exif (discovered by Martin Noga, + Matthew "j00ru" Jurczyk, Gynvael Coldwind) + +- FPM: + . Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat) + . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat) + . Fixed bug #62153 (when using unix sockets, multiples FPM instances + . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start). + (fat) + . Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat) + . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat) + . Fixed bug #61295 (php-fpm should not fail with commented 'user' + . Fixed bug #61218 (FPM drops connection while receiving some binary values + in FastCGI requests). (fat) + . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat) + for non-root start). (fat) + . Fixed bug #61026 (FPM pools can listen on the same address). (fat) + can be launched without errors). (fat) + +- Iconv: + . Fix bug #55042 (Erealloc in iconv.c unsafe). (Stas) + +- Intl: + . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo) + . ResourceBundle constructor now accepts NULL for the first two arguments. + (Gustavo) + . Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called + twice). (Gustavo) + . Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo) + . Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks + pattern). (Gustavo) + . Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo) + +- JSON: + . Fixed bug #61359 (json_encode() calls too many reallocs). (Stas) + +- libxml: + . Fixed bug #62266 (Custom extension segfaults during xmlParseFile with FPM + SAPI). (Gustavo) + +- Phar: + . Fixed bug #62227 (Invalid phar stream path causes crash). (Felipe) + +- Readline: + . Fixed bug #62186 (readline fails to compile - void function should not + return a value). (Johannes) + +- Reflection: + . Fixed bug #62384 (Attempting to invoke a Closure more than once causes + segfault). (Felipe) + . Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks + with constant). (Laruence) + +- Sockets: + . Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe) + +- SPL: + . Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to + dot files). (Laruence) + . Fixed bug #62262 (RecursiveArrayIterator does not implement Countable). + (Nikita Popov) + +- XML Writer: + . Fixed bug #62064 (memory leak in the XML Writer module). + (jean-pierre dot lozi at lip6 dot fr) + +- Zip: + . Upgraded libzip to 0.10.1 (Anatoliy) + 14 Jun 2012, PHP 5.4.4 +- COM: + . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes) + - CLI Server: . Implemented FR #61977 (Need CLI web-server support for files with .htm & svg extensions). (Sixd, Laruence) @@ -11,9 +378,6 @@ . Fixed bug #61546 (functions related to current script failed when chdir() in cli sapi). (Laruence, reeze.xia@gmail.com) -- COM: - . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes) - - Core: . Fixed missing bound check in iptcparse(). (chris at chiappa.net) . Fixed CVE-2012-2143. (Solar Designer) @@ -28,12 +392,15 @@ . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy) . Fixed bug #61782 (__clone/__destruct do not match other methods when checking access controls). (Stas) + . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo) . Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash). (Laruence) . Fixed bug #61730 (Segfault from array_walk modifying an array passed by reference). (Laruence) . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown phase). (Laruence) + . Fixed bug #61713 (Logic error in charset detection for htmlentities). + (Anatoliy) . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov) . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables (without apache2)). (Laruence) @@ -47,31 +414,35 @@ . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction). (Laruence) -- Intl: +- Fileinfo + . Fixed bug #61812 (Uninitialised value used in libmagic). + (Laruence, Gustavo) + . Fixed bug #61566 failure caused by the posix lseek and read versions + under windows in cdf_read(). (Anatoliy) + . Fixed bug #61565 where php_stream_open_wrapper_ex tries to open a + directory descriptor under windows. (Anatoliy) + +- Intl . Fixed bug #62082 (Memory corruption in internal function get_icu_disp_value_src_php()). (Gustavo) +- Libxml: + . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)). + (Laruence) + - PDO: . Fixed bug #61755 (A parsing bug in the prepared statements can lead to access violations). (Johannes) - Phar: - . Fix bug #61065 (Secunia SA44335, CVE-2012-2386). (Rasmus) + . Fixed bug #61065 (Secunia SA44335, CVE-2012-2386). (Rasmus) - Pgsql: . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki) -- FPM - . Fixed bug #61812 (Uninitialised value used in libmagic). - (Laruence, Gustavo) - . Fixed bug #61565 where php_stream_open_wrapper_ex tries to open a - directory descriptor under windows. (Anatoliy) - . Fixed bug #61566 failure caused by the posix lseek and read versions - under windows in cdf_read(). (Anatoliy) - -- Libxml: - . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)). - (Laruence) +- Streams: + . Fixed bug #61961 (file_get_contents leaks when access empty file with + maxlen set). (Reeze) - Zlib: . Fixed bug #61820 (using ob_gzhandler will complain about headers already @@ -161,23 +532,6 @@ . Fixed bug #60948 (mysqlnd FTBFS when -Wformat-security is enabled). (Johannes) -- Readline: - . Fixed bug #61088 (Memory leak in readline_callback_handler_install). - (Nikic, Laruence) - -- Session - . Fixed bug #60634 (Segmentation fault when trying to die() in - SessionHandler::write()). (Ilia) - -- SOAP - . Fixed bug #61423 (gzip compression fails). (Ilia) - . Fixed bug #60887 (SoapClient ignores user_agent option and sends no - User-Agent header). (carloschilazo at gmail dot com) - . Fixed bug #60842, #51775 (Chunked response parsing error when - chunksize length line is > 10 bytes). (Ilia) - . Fixed bug #49853 (Soap Client stream context header option ignored). - (Dmitry) - - PDO . Fixed bug #61292 (Segfault while calling a method on an overloaded PDO object). (Laruence) @@ -195,12 +549,29 @@ . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL bytes). (Nikita Popov) +- Readline: + . Fixed bug #61088 (Memory leak in readline_callback_handler_install). + (Nikic, Laruence) + - Reflection: . Implemented FR #61602 (Allow access to the name of constant used as function/method parameter's default value). (reeze.xia@gmail.com) . Fixed bug #60968 (Late static binding doesn't work with ReflectionMethod::invokeArgs()). (Laruence) +- Session + . Fixed bug #60634 (Segmentation fault when trying to die() in + SessionHandler::write()). (Ilia) + +- SOAP + . Fixed bug #61423 (gzip compression fails). (Ilia) + . Fixed bug #60887 (SoapClient ignores user_agent option and sends no + User-Agent header). (carloschilazo at gmail dot com) + . Fixed bug #60842, #51775 (Chunked response parsing error when + chunksize length line is > 10 bytes). (Ilia) + . Fixed bug #49853 (Soap Client stream context header option ignored). + (Dmitry) + - SPL: . Fixed bug #61453 (SplObjectStorage does not identify objects correctly). (Gustavo) @@ -657,6 +1028,65 @@ . Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression). (Mike) +14 Jun 2012, PHP 5.3.14 + +- CLI SAPI: + . Fixed bug #61546 (functions related to current script failed when chdir() + in cli sapi). (Laruence, reeze.xia@gmail.com) + +- CURL: + . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction). + (Laruence) + +- COM: + . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes) + +- Core: + . Fixed CVE-2012-2143. (Solar Designer) + . Fixed missing bound check in iptcparse(). (chris at chiappa.net) + . Fixed bug #62373 (serialize() generates wrong reference to the object). + (Moriyoshi) + . Fixed bug #62005 (unexpected behavior when incrementally assigning to a + member of a null object). (Laruence) + . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy) + . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo) + . Fixed bug #61730 (Segfault from array_walk modifying an array passed by + reference). (Laruence) + . Fixed bug #61713 (Logic error in charset detection for htmlentities). + (Anatoliy) + . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename + set to null). (Anatoliy) + . Changed php://fd to be available only for CLI. + +- Fileinfo: + . Fixed bug #61812 (Uninitialised value used in libmagic). + (Laruence, Gustavo) + +- Iconv extension: + . Fixed a bug that iconv extension fails to link to the correct library + when another extension makes use of a library that links to the iconv + library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail. + (Moriyoshi) + +- Intl: + . Fixed bug #62082 (Memory corruption in internal function + get_icu_disp_value_src_php()). (Gustavo) + +- JSON + . Fixed bug #61537 (json_encode() incorrectly truncates/discards + information). (Adam) + +- PDO: + . Fixed bug #61755 (A parsing bug in the prepared statements can lead to + access violations). (Johannes) + +- Phar: + . Fix bug #61065 (Secunia SA44335). (Rasmus) + +- Streams: + . Fixed bug #61961 (file_get_contents leaks when access empty file with + maxlen set). (Reeze) + 08 May 2012, PHP 5.3.13 - CGI . Improve fix for PHP-CGI query string parameter vulnerability, CVE-2012-2311. @@ -927,6 +1357,7 @@ - Gd: . Fixed bug #60160 (imagefill() doesn't work correctly for small images). (Florian) + . Fixed potential memory leak on a png error (Rasmus, Paul Saab) - Intl: . Fixed bug #60192 (SegFault when Collator not constructed diff -Nru php5-5.4.4/README.RELEASE_PROCESS php5-5.4.9/README.RELEASE_PROCESS --- php5-5.4.4/README.RELEASE_PROCESS 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/README.RELEASE_PROCESS 2012-11-21 05:12:20.000000000 +0000 @@ -127,33 +127,34 @@ 2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``. -3. **Merge** all related sections in NEWS (f.e. merge the 4.4.1RC1 and 4.4.0 sections) +3. **Merge** all related sections in NEWS (f.e. merge the 5.4.1RC1 and 5.4.0 sections) 4. Commit those changes 5. run the "scripts/dev/credits" script in php-src and commit the changes in the credits files in ext/standard. -6. tag the repository with the version f.e. "``cvs tag php_4_4_1``" +6. tag the repository with the version f.e. "``git tag -s php-5.4.1``" (of course, you need to change that to the version you're rolling an RC for). When making 5.X release, you need to tag the Zend directory separately!! 7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate -was "4.4.1RC1" then the new one should be "4.4.1RC2-dev" - regardless if we get +was "5.4.1RC1" then the new one should be "5.4.1RC2-dev" - regardless if we get a new RC or not. This is to make sure ``version_compare()`` can correctly work. 8. Commit those changes -9. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4 -branch if you're rolling 4.4.x releases). +9. Log in onto the snaps box and go into the correct tree (f.e. the PHP-5.4 +branch if you're rolling 5.5.x releases). -10. You do not have to update the tree, but of course you can with "``cvs up -dP``". +10. You do not have to update the tree, but of course you can with "``git pull +origin ``". -11. run: ``./makedist php 4.4.1``, this will export the tree, create configure +11. run: ``./makedist php 5.4.1``, this will export the tree, create configure and build two tarballs (one gz and one bz2). -12. Commit those two tarballs to CVS (phpweb/distributions) +12. Commit those two tarballs to Git (php-distributions.git) 13. Once the release has been tagged, contact the PHP Windows development team (internals-win@lists.php.net) so that Windows binaries can be created. Once @@ -171,6 +172,9 @@ a. ``php bin/bumpRelease 5`` (or ``php bin/bumpRelease 4`` for PHP4) + b. In case multiple PHP minor versions are in active development you have + to manually copy the old information to include/releases.inc + 2. Edit ``phpweb/include/version.inc`` and change (X=major release number): a. ``$PHP_X_VERSION`` to the correct version @@ -187,7 +191,7 @@ f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows") 3. Update the ChangeLog file for the given major version -f.e. ``ChangeLog-4.php`` from the NEWS file +f.e. ``ChangeLog-5.php`` from the NEWS file a. go over the list and put every element on one line @@ -207,9 +211,9 @@ V. ``s/FR #\([0-9]\+\)/FR /`` -4. ``cp releases/4_4_0.php releases/4_4_1.php`` +4. ``cp releases/5_4_0.php releases/5_4_1.php`` -5. ``cvs add releases/4_4_1.php`` +5. ``git add releases/5_4_1.php`` 6. Update the ``releases/*.php`` file with relevant data. The release announcement file should list in detail: @@ -232,17 +236,6 @@ php-general@lists.php.net and internals@lists.php.net with a text similar to http://news.php.net/php.internals/17222. -10. Update ``php-bugs-web/include/functions.php`` to include the new version -number, and remove the RC from there. - -11. Update ``qaweb/include/release-qa.php`` - - - Update $QA_RELEASES with the appropriate information, which means bumping - the version number to an upcoming version. - - Example: If PHP 5.3.7 is being released, then PHP 5.3.8 is the next QA version, - so replace 5.3.7 with 5.3.8 within $QA_RELEASES. - Re-releasing the same version (or -pl) -------------------------------------- diff -Nru php5-5.4.4/TSRM/tsrm_virtual_cwd.c php5-5.4.9/TSRM/tsrm_virtual_cwd.c --- php5-5.4.4/TSRM/tsrm_virtual_cwd.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/TSRM/tsrm_virtual_cwd.c 2012-11-21 05:12:20.000000000 +0000 @@ -40,6 +40,10 @@ # define IO_REPARSE_TAG_SYMLINK 0xA000000C # endif +# ifndef IO_REPARSE_TAG_DEDUP +# define IO_REPARSE_TAG_DEDUP 0x80000013 +# endif + # ifndef VOLUME_NAME_NT # define VOLUME_NAME_NT 0x2 # endif @@ -945,6 +949,11 @@ return -1; }; substitutename[substitutename_len] = 0; + } + else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP) { + isabsolute = 1; + memcpy(substitutename, path, len + 1); + substitutename_len = len; } else { tsrm_free_alloca(pbuffer, use_heap_large); return -1; diff -Nru php5-5.4.4/TSRM/tsrm_win32.c php5-5.4.9/TSRM/tsrm_win32.c --- php5-5.4.4/TSRM/tsrm_win32.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/TSRM/tsrm_win32.c 2012-11-21 05:12:20.000000000 +0000 @@ -193,7 +193,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC) { time_t t; - HANDLE thread_token; + HANDLE thread_token = NULL; PSID token_sid; SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION; GENERIC_MAPPING gen_map = { FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE, FILE_ALL_ACCESS }; @@ -363,6 +363,9 @@ } Finished: + if(thread_token != NULL) { + CloseHandle(thread_token); + } if(real_path != NULL) { free(real_path); real_path = NULL; diff -Nru php5-5.4.4/UPGRADING php5-5.4.9/UPGRADING --- php5-5.4.4/UPGRADING 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/UPGRADING 2012-11-21 05:12:20.000000000 +0000 @@ -37,9 +37,9 @@ ============================= - PHP 5.4 now checks at compile time if /dev/urandom or /dev/arandom - are present. If either is available, session.entropy_file now + are present. If either is available, session.entropy_file now defaults to that file and session.entropy_length defaults to 32. - This provides non-blocking entropy to session id generation. If you + This provides non-blocking entropy to session id generation. If you do not want extra entropy for your session ids, add: session.entropy_file= @@ -89,9 +89,9 @@ session.upload_progress.min_freq - Added a zend.multibyte directive as a replacement of the PHP compile time - configuration option --enable-zend-multibyte. Now the Zend Engine always + configuration option --enable-zend-multibyte. Now the Zend Engine always contains code for multibyte support, which can be enabled or disabled at - runtime. Note: It doesn't make a lot of sense to enable this option if + runtime. Note: It doesn't make a lot of sense to enable this option if ext/mbstring is not enabled, because most functionality is implemented by mbstrings callbacks. @@ -107,7 +107,7 @@ in a stream fashion (through php://input) without having it copied in memory multiple times. -- Added windows_show_crt_warning. This directive shows the CRT warnings when +- Added windows_show_crt_warning. This directive shows the CRT warnings when enabled. These warnings were displayed by default until now. It is disabled by default. @@ -162,7 +162,7 @@ - Non-numeric string offsets, e.g. $a['foo'] where $a is a string, now return false on isset() and true on empty(), and produce warning if - trying to use them. Offsets of types double, bool and null produce + trying to use them. Offsets of types double, bool and null produce notice. Numeric strings ($a['2']) still work as before. Note that offsets like '12.3' and '5 and a half' are considered @@ -207,7 +207,7 @@ - htmlentities() and htmlspecialchars() are stricter in the code units they accept for the asian encodings. For Big5-HKSCS, the octets 0x80 and 0xFF are - rejected. For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are + rejected. For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are rejected. For SJIS, the octets 0x80, 0xA0, 0xFD, 0xFE and 0xFF are rejected, except maybe after a valid starting byte. For EUC-JP, the octets 0xA0 and 0xFF are rejected. @@ -233,7 +233,7 @@ checks on the validity of the entities. Numerical entities are checked for a valid range (0 to 0x10FFFF); if the flag ENT_DISALLOWED is given, the validity of such numerical entity in the target document type is also - checked. Named entities are checked for necessary existence in the target + checked. Named entities are checked for necessary existence in the target document type instead of only checking whether they were constituted by alphanumeric characters. @@ -341,6 +341,15 @@ - Since 5.4.4, "php://fd" stream syntax is available only in CLI build. +- Since 5.4.5, resourcebundle_create() accepts null for the first two arguments. + +- Since 5.4.6, SimpleXMLElement::getDocNamespaces() has and extra parameter which + allows for toggling if the list of namespaces starts from the document root + or from the node you call the method on + +- Since 5.4.7, ctor is always called when new user stream wrapper object is created. + Before, it was called only when stream_open was called. + ============================== 5. Changes to existing classes ============================== @@ -373,6 +382,9 @@ - FilesystemIterator, GlobIterator and (Recursive)DirectoryIterator now use the default stream context. +- Since 5.4.5, the constructor of ResourceBundle accepts NULL for the first two + arguments. + =========================== 7. Deprecated Functionality =========================== @@ -431,7 +443,7 @@ a. Extensions no longer maintained - ext/sqlite is no longer part of the base distribution and has been moved - to PECL. Use sqlite3 or PDO_SQLITE instead. + to PECL. Use sqlite3 or PDO_SQLITE instead. b. Extensions with changed behavior @@ -485,7 +497,7 @@ =========================== - A REQUEST_TIME_FLOAT value returns a floating point number indicating the - time with microsecond precision. All SAPIs providing this value should be + time with microsecond precision. All SAPIs providing this value should be returning float and not time_t. - apache_child_terminate(), getallheaders(), apache_request_headers() @@ -508,6 +520,11 @@ - is_link now works properly for symbolic links on Windows Vista or later. Earlier systems do not support symbolic links. +- As of PHP 5.4.5 and above the COM extension isn't compiled statically in PHP + anymore but shared. It'll still be delivered with the standard PHP release but + must be activated manually with the "extension = php_com_dotnet.dll" directive + in php.ini. + ================== 12. New in PHP 5.4 ================== diff -Nru php5-5.4.4/Zend/ChangeLog php5-5.4.9/Zend/ChangeLog --- php5-5.4.4/Zend/ChangeLog 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/ChangeLog 1970-01-01 00:00:00.000000000 +0000 @@ -1,22097 +0,0 @@ -2005-08-05 Dmitry Stogov - - * zend_execute.c - tests/array_type_hint_001.phpt - tests/bug33996.phpt: - Fixed bug #33996 (No information given for fatal error on passing invalid - value to typed argument) - - * zend_operators.c - tests/bug33999.phpt: - Fixed bug #33999 (object remains object when cast to int) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed memory leak in foreach() on undefined variable - (Zend/tests/foreach_undefined.php) - -2005-08-04 Antony Dovgal - - * tests/foreach_undefined.phpt: - add test for the last Dmitry's fix - -2005-08-04 Dmitry Stogov - - * zend_compile.c: - Fixed possible memory corryption during compilation of - - * (PHP_5_0) - zend_objects.c: - Fixed clone bug in ze1_compatibility mode - - * zend_objects.c: - Fixed clone bug in ze1_compatibilty mode - -2005-08-03 Jani Taskinen - - * LICENSE: - - Bumber up year - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_exceptions.c - zend_exceptions.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_interfaces.c - zend_interfaces.h - zend_istdiostream.h - zend_iterators.c - zend_iterators.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multibyte.c - zend_multibyte.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_reflection_api.c - zend_reflection_api.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_strtod.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h - zend_vm.h: - Bump up the year - - * README.ZEND_VM: - Nuked DOS EOLs - -2005-08-02 Dmitry Stogov - - * zend_execute_API.c - zend_execute_API.c: - Fixed bug #33942 (the patch to #33156 crash cygwin except cli) - -2005-08-02 Jani Taskinen - - * zend_exceptions.c: - - Fixed bug #33967 (misuse of Exception constructor doesn\'t display - errorfile) - -2005-08-02 Dmitry Stogov - - * bench.php: - Removed warnings - -2005-07-29 Ilia Alshanetsky - - * zend_vm_def.h - zend_vm_execute.h: - Fixed warning message generated when isset() or empty() are given invalid - offset type. - -2005-07-29 Anantha Kesari H Y - - * acconfig.h - acconfig.h: - In NetWare few of the programs like apache2 and ldap use winsock inclusinf - sys/socket.h is not desirable. - --Kamesh - -2005-07-29 Jani Taskinen - - * zend_vm_execute.h: - update generated file - -2005-07-28 Andi Gutmans - - * zend_vm_def.h: - - Tiny fixlet - -2005-07-28 Marcus Boerger - - * zend_API.c - zend_API.h: - - Add convenience function zend_is_callable_ex() and base zend_is_callable - and zend_make_callable on it. This functions allows to check if a php - variable is a callable function and returns its function pointer as well - as object if possible. - -2005-07-26 Jani Taskinen - - * zend_execute_API.c: - bug #33865 - -2005-07-25 Marcus Boerger - - * zend_API.c: - - Fix #33853 - -2005-07-22 Dmitry Stogov - - * zend.c - zend.c - tests/bug33802.phpt - tests/bug33802.phpt - tests/bug33802.phpt: - Fixed bug #33802 (throw Exception in error handler causes crash) - -2005-07-21 Marcus Boerger - - * zend_execute_API.c: - - Fix error generation logic (found by johannes) - -2005-07-21 Dmitry Stogov - - * zend_vm_def.h: - Fixed bug with returning from internal function by reference - -2005-07-19 Marcus Boerger - - * zend_interfaces.c: - - Dont't warn in case an exception is pending - in this case it'd - superflous - -2005-07-19 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_execute.c - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug #33710 (ArrayAccess objects doen't initialize $this) - -2005-07-18 Rasmus Lerdorf - - * zend_language_scanner.l: - Valgrind is unhappy that this is not initialized - -2005-07-18 Dmitry Stogov - - * zend_API.c - zend_API.h: - Fixed bug in new module statrup mechanism - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33558.phpt: - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * tests/bug33558.phpt - tests/bug33558.phpt: - - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Removed some compilation warnings. - -2005-07-18 Jani Taskinen - - * tests/bug33710.phpt: - typo - -2005-07-17 Marcus Boerger - - * tests/bug33710.phpt: - - Add new test - -2005-07-17 Ilia Alshanetsky - - * zend_compile.c: - Added missing init. - -2005-07-14 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b3) - zend.h: - - Beta 3 - -2005-07-12 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b3) - zend.h: - - Beta 3 - -2005-07-12 Dmitry Stogov - - * (php_5_1_0b3) - zend_execute_API.c - zend_execute_API.c: - Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). - (Nuno) - -2005-07-11 Ilia Alshanetsky - - * zend_vm_def.h - zend_vm_execute.h: - Make references misuse emit E_NOTICE rather E_STRICT to be compatible with - PHP 4.4.0 - -2005-07-08 Jani Taskinen - - * tests/unset_cv05.phpt - tests/unset_cv06.phpt: - fix test when session.save_handler is "user" - -2005-07-07 Dmitry Stogov - - * zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_objects.c - zend_reflection_api.c: - Fixed bug #33512 (Add missing support for isset()/unset() overloading to - complement the property get/set methods) - -2005-07-07 Anantha Kesari H Y - - * zend_stream.c - zend_stream.c: - zend_stream_getc uses fread internally. NetWare LibC fread reads 4(Which I - believe EOT) for EOF(^D) character. This happens when fread is asked to - read one and only character as is the case with cl interactive mode. - -- Kamesh - -2005-07-07 Dmitry Stogov - - * zend_execute_API.c - zend_hash.c - zend_hash.h - tests/bug28072.phpt: - Fixed bug #28072 (static array with some constant keys will be incorrectly - ordered). - -2005-07-04 Dmitry Stogov - - * zend_compile.h - zend_execute.c - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed SIGSEGV on 'global ${"{$blah}_ID"};' - - * zend_API.h - zend_execute_API.c: - Fixed bug #31158 (array_splice on $GLOBALS crashes) - -2005-07-03 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed memory leak - -2005-06-30 Dmitry Stogov - - * zend_API.c - zend_API.h: - Restored old behavior of zend_statup_module() - -2005-06-29 Stanislav Malyshev - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h: - fix conditions for freeing - - * zend_API.c - zend_API.c: - add comment - - * (PHP_5_0) - zend_execute.c: - fix conditions - -2005-06-28 Antony Dovgal - - * zend_execute.c: - fix leak: when dup was ful zend_std_object_get_class_name() - returns SUCCESS aka 0 - -2005-06-28 Stanislav Malyshev - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h: - fix previous patch - - * zend_vm_execute.h: - update - - * zend_execute.c - zend_vm_def.h: - fixes for non-php objects - - * (PHP_5_0) - zend_execute.c: - fixes fo rnon-php objects (John Coggeshall) - -2005-06-27 Jani Taskinen - - * zend.c: - - Fixed bug #31358 (Older GCC versions do not provide portable va_copy()). - -2005-06-27 Stanislav Malyshev - - * zend_API.c - zend_API.c - zend_API.h - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.c - zend_exceptions.c - zend_exceptions.c: - fix various "Class entry requested for an object without PHP class" - messages - when working with non-PHP objects. - -2005-06-27 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed SIGSEGV on assigment string offset by reference - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed wrong include/requre occurrences in debug backtrace. - -2005-06-24 Dmitry Stogov - - * zend_execute.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Export zend_do_fcall() helper from executor - - * zend_compile.c - zend_compile.c: - Partial fix for bug #26584 (Class member - array key overflow) - It doesn't fix integer overflow problem, but allows null, boolean and - double keys in array constants in the same way as in runtime. - - * tests/bug30519.phpt - tests/bug30519.phpt: - - Fixed bug #30519 (Interface not existing says Class not found) - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_execute_API.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30519.phpt: - Fixed bug #30519 (Interface not existing says Class not found) - -2005-06-23 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug28377.phpt: - Fixed bug #28377 (debug_backtrace is intermittently passing args) - - * tests/bug28377.phpt - tests/bug28377.phpt: - - file bug28377.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32660.phpt: - Fixed bug #32660 (Assignment by reference causes crash when field access is - overloaded (__get)) - - * tests/bug32660.phpt - tests/bug32660.phpt: - - Fixed bug #32660 (Assignment by reference causes crash when field access - is overloaded (__get)) - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug30828.phpt: - Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden - methods) - - * tests/bug30828.phpt - tests/bug30828.phpt: - - file bug30828.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - tests/bug27268.phpt: - Test for bug #27268. It is fixed in HEAD but not in PHP_5_0. - - * zend_execute.c - tests/bug27268.phpt - tests/bug27268.phpt: - Fixed bug #27268 (Bad references accentuated by clone). - -2005-06-23 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - Beta 2 - -2005-06-22 Dmitry Stogov - - * (php_5_1_0b2) - zend_builtin_functions.c - zend_builtin_functions.c - zend_execute_API.c - zend_execute_API.c - tests/bug29896.phpt: - Fixed bug #29896 (Backtrace argument list out of sync) - - * tests/bug29896.phpt - tests/bug29896.phpt: - - file bug29896.phpt was initially added on branch PHP_5_0. - -2005-06-22 Stanislav Malyshev - - * (php_5_1_0b2) - zend_vm.h - zend_vm_execute.h - zend_vm_gen.php: - export zend_vm_set_opcode_handler - -2005-06-22 Antony Dovgal - - * (php_5_1_0b2) - zend_ini.c: - - allow to use "yes" and "true" with ini_set() and in commandline (through - -d flag) - - fix #15854 that was caused by wrong consideration that - zend_ini_boolean_displayer_cb() - always recieves converted to "0"/"1" values. - -2005-06-22 Dmitry Stogov - - * (php_5_1_0b2) - zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33257.phpt: - Fixed bug #33257 (array_splice() inconsistent when passed function instead - of variable) - - * tests/bug33257.phpt - tests/bug33257.phpt: - - file bug33257.phpt was initially added on branch PHP_5_0. - -2005-06-22 Jani Taskinen - - * (php_5_1_0b2) - tests/unset_cv05.phpt - tests/unset_cv06.phpt: - fix tests - -2005-06-21 Dmitry Stogov - - * tests/unset_cv07.phpt: - Fixed test file - -2005-06-21 Andi Gutmans - - * zend.h: - - Back to -dev. Guys (n' Girls), give at least 1 hour before you start - - complaining about not going back to -dev. I like checking the tarball - - before I change it back. - - * (php_5_1_0b2) - zend.h: - - Take #3 :) - -2005-06-21 Ilia Alshanetsky - - * (php_5_1_0b2) - zend_reflection_api.c: - Fixed memory leak. - - -2005-06-21 Dmitry Stogov - - * (PHP_5_0) - zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS - in case of early binding - - * (php_5_1_0b2) - zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS in case of early binding - -2005-06-20 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - Beta 2 - -2005-06-20 Dmitry Stogov - - * (php_5_1_0b2) - zend_object_handlers.c - zend_object_handlers.c: - Fixed possible crash on $x = $obj->$non_string - -2005-06-20 Marcus Boerger - - * (php_5_1_0b2) - zend_reflection_api.c: - - Fix bug #33389 by fixing copying - - * zend_reflection_api.c: - - Show true/flase - -2005-06-19 Derick Rethans - - * tests/bug32226.phpt: - - Fixed layout of test description. - -2005-06-17 Jani Taskinen - - * tests/bug29368.phpt - tests/bug30856.phpt - tests/bug30961.phpt - tests/bug31720.phpt - tests/bug32226.phpt - tests/bug33277.phpt: - No short-tags! - -2005-06-17 Dmitry Stogov - - * zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Removed EX(fbc_constructor) (it is no longer needed) - -2005-06-17 Antony Dovgal - - * (PHP_5_0) - zend_API.c - zend_list.c: - MFH: improve error messages in internal classes - - * zend_API.c - zend_list.c: - improve error messages when error raised from an internal class (do not - hide class name) - -2005-06-17 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c: - Fixed bug #33277 (private method accessed by child class) - -2005-06-17 Antony Dovgal - - * zend_hash.c: - fix bug #33382 (array_reverse() fails after *sort()) - no need to MFH - the bug existed only in HEAD - -2005-06-17 Dmitry Stogov - - * zend_API.c - zend_API.h - zend_extensions.h - zend_modules.h: - Improved PHP extension loading mechanism with support for module - dependencies and conflicts. - -2005-06-16 Marcus Boerger - - * zend_reflection_api.c: - - Internal functions/methods can now return by reference - - * zend_execute.c: - - Fix TSRM build - -2005-06-16 Dmitry Stogov - - * bench.php: - typo - - * zend.h - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_extensions.h - zend_modules.h - zend_object_handlers.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Allowed return by refrence from internal functions - -2005-06-16 Stanislav Malyshev - - * zend_execute.c - zend_execute.h: - rename to zend_ - -2005-06-16 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33318.phpt: - Fixed bug #33318 (throw 1; results in Invalid opcode 108/1/8) - -2005-06-16 Zeev Suraski - - * zend_language_scanner.l: - Fixlet - -2005-06-16 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Compilation warnings - - * zend_compile.c - zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - ZEND_UNSET_DIM_OBJ is splitted to ZEND_UNSET_DIM and ZEND_UNSET_OBJ. - -2005-06-16 Stanislav Malyshev - - * zend_execute.c - zend_execute.h: - export zval getters - -2005-06-16 Dmitry Stogov - - * zend_execute.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - USER_OPCODE API is improvet. - Implemented ability to dispatch from user handler to internal handler of - another opcode. - -2005-06-15 Dmitry Stogov - - * zend.c - zend.h: - Fixed OS X compatibility - -2005-06-15 Jani Taskinen - - * tests/bug32428.phpt: - typofix - -2005-06-14 Ilia Alshanetsky - - * bench.php: - more accurate timing function. - -2005-06-14 Dmitry Stogov - - * zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Removed old executor - -2005-06-14 Jani Taskinen - - * Zend.m4: - reordered + added msg to configure output for PHP_ZEND_VM - - * Zend.m4: - typofix - - * Zend.m4 - acinclude.m4: - fix standalone build - -2005-06-13 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Specializer optimization - - * zend.c - zend.h - zend_execute.c: - Fixed bug #33212 ([GCC 4]: 'zend_error_noreturn' aliased to external symbol - 'zend_error'). - The fix is not tested on Solaris and DARWIN! - - * zend_reflection_api.c - tests/bug33312.phpt: - Fixed bug #33312 (ReflectionParameter methods do not work correctly) - -2005-06-11 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - b2 (will post it to internals@) - -2005-06-10 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b1) - zend.h: - - Go with 5.1.0b1 - -2005-06-10 Dmitry Stogov - - * (php_5_1_0b1) - tests/bug30162.phpt: - Added test for bug #30162 (it is already fixed but test file was forgotten) - - * (php_5_1_0b1) - tests/bug31177.phpt: - Added test file for bug #31177 (not fixed yet) - - * tests/bug31177.phpt - tests/bug31177.phpt: - - file bug31177.phpt was initially added on branch PHP_5_0. - - * (php_5_1_0b1) - tests/bug29689.phpt: - typos - - * (php_5_1_0b1) - zend_reflection_api.c - zend_reflection_api.c: - Fixed support for ZEND_ACC_SHADOW in ReflectionProperty constructor - - * (php_5_1_0b1) - zend_execute.c - zend_execute.h - zend_extensions.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Fix so that extensions like xdebug, can overload opcodes in all execution - modes including goto/switch - - * (php_5_1_0b1) - zend_compile.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Merge three opcodes (ZEND_NEW, ZEND_JMP_NO_CTOR, ZEND_INIT_CTOR) into one - (ZEND_NEW). There was no real reason for this anymore and API should be - changed before 5.1 - -2005-06-09 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_reflection_api.c - tests/bug29689.phpt: - MF50: fix #29689 and more private property problems - - * tests/bug33277.phpt: - add test for this TBF bug - - * zend_compile.c: - disallow abstrace private methods - - * (PHP_5_0) - zend_compile.c: - Disallow abstract privae methods - - * (PHP_5_0) - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_reflection_api.c - tests/bug29689.phpt: - fix #29689 and more private property problems - -2005-06-09 Dmitry Stogov - - * zend.c - zend.c - zend_execute_API.c - zend_execute_API.c: - Fixed double call to php_stream_close() on compiler errors - -2005-06-09 Stanislav Malyshev - - * tests/bug33277.phpt - tests/bug33277.phpt: - - file bug33277.phpt was initially added on branch PHP_5_0. - -2005-06-09 Dmitry Stogov - - * zend.c - zend.c: - Fixed bug #25922 (In error handler, modifying 5th arg (errcontext) may - result in seg fault) - - * zend_language_scanner.l - zend_language_scanner.l: - Fixed bug (Crash on Windows and ZTS) that was introduced with fix for bug - #26456 - -2005-06-08 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed exception handling in getIterator() callback (bugs #26229 & #30725) - - * zend_compile.c - zend_compile.c: - Fixed valgrind errors - - * zend_reflection_api.c: - Fixed ReflectionClass::setStaticPropertyValue() - -2005-06-08 Jani Taskinen - - * zend_config.w32.h: - Hopefully fixes win32 builds - -2005-06-08 Dmitry Stogov - - * zend_compile.c: - Fixed lookups for previos opcodes - - * zend_execute_API.c - zend_execute_API.c - tests/bug30140.phpt: - Fixed bug #30140 (Problem with array in static properties) - - * tests/bug30140.phpt - tests/bug30140.phpt: - - file bug30140.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - tests/bug32322.phpt: - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * tests/bug32322.phpt - tests/bug32322.phpt: - - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug30820.phpt: - Fixed bug #30820 (static member conflict with $this->member silently - ignored) - - * tests/bug30820.phpt - tests/bug30820.phpt: - - file bug30820.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - zend_compile.c - zend_language_parser.y - zend_language_parser.y - tests/bug30961.phpt: - Fixed bug #30961 (Wrong linenumber in ReflectionClass getStartLine()) - - * tests/bug30961.phpt - tests/bug30961.phpt: - - file bug30961.phpt was initially added on branch PHP_5_0. - -2005-06-07 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_language_scanner.l - zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen - - * Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4: - - Show "none" when nothing is found - -2005-06-07 Ilia Alshanetsky - - * zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * zend_alloc.h: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - -2005-06-07 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - - * zend_execute.c - zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - -2005-06-07 Dmitry Stogov - - * zend_objects.c - zend_objects.c - tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - - * tests/bug33243.phpt - tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - -2005-06-07 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_language_scanner.l - zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen - - * Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4: - - Show "none" when nothing is found - -2005-06-07 Ilia Alshanetsky - - * zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * zend_alloc.h: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - -2005-06-07 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - - * zend_execute.c - zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - -2005-06-07 Dmitry Stogov - - * zend_objects.c - zend_objects.c - tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - - * tests/bug33243.phpt - tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - -2005-06-06 Derick Rethans - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Regenerate VM files and add warning about regeneration - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h: - - MH44: Problems with user defined error handler and wrong usage of - references - -2005-06-06 Dmitry Stogov - - * zend_compile.c - tests/bug32428.phpt: - Fixed bug #32428 (The @ warning error supression operator is broken) - - * zend_objects_API.c - zend_objects_API.c - tests/bug32799.phpt: - Fixed bug #32799 (crash: calling the corresponding global var during the - destruct) - - * tests/bug32799.phpt - tests/bug32799.phpt: - - file bug32799.phpt was initially added on branch PHP_5_0. - - * tests/bug32596.phpt: - Added test for bug #32596 (Segfault/Memory Leak by getClass (etc) in - __destruct) - - * tests/bug32596.phpt - tests/bug32596.phpt: - - file bug32596.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute_API.c: - Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct) - - * (PHP_5_0) - tests/bug32993.phpt: - Added test for bug #32993 (implemented Iterator function current() don't - throw - exception) - - * tests/bug32993.phpt - tests/bug32993.phpt: - - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug33171.phpt: - Fixed bug #33171 (foreach enumerates private fields declared in base - classes) - - * tests/bug33171.phpt - tests/bug33171.phpt: - - file bug33171.phpt was initially added on branch PHP_5_0. - -2005-06-06 Wez Furlong - - * zend_language_scanner.l: - Avoid double-freeing streams. - This can happen because all streams are registered as resources; - the engine also tracks them in the open_files global. - - Avoid the potential for double-freeing by simply making streams exposed to - the - engine have no closer for the engine to call; they will already be in the - resource list, and thus will be shut down properly at request end. - -2005-06-04 Zeev Suraski - - * zend_compile.h - zend_language_parser.y - zend_language_scanner.l - zend_stream.c - zend_stream.h - tests/halt01.phpt - tests/halt02.phpt - tests/halt03.phpt: - Thought I committed it ages ago... Anyway, without further delays, the - final - __halt_compiler() patch - -2005-06-03 Dmitry Stogov - - * tests/bug30394.phpt: - Added test for 5.0 specific bug #30394 (Assignment operators yield wrong - result with __get/__set) - - * (PHP_5_0) - zend.c - zend_execute_API.c - tests/bug30394.phpt - tests/bug30394.phpt: - Fixed bug #30394 (Assignment operators yield wrong result with __get/__set) - - * zend_compile.c - zend_compile.c - tests/bug30080.phpt: - Fixed bug #30080 (Passing array or non array of objects) - - * tests/bug30080.phpt - tests/bug30080.phpt: - - file bug30080.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - zend_compile.c - zend_execute.c - tests/bug27598.phpt: - Fixed bug #27598 (list() array key assignment causes HUGE memory leak) - - * tests/bug27598.phpt - tests/bug27598.phpt: - - file bug27598.phpt was initially added on branch PHP_5_0. - - * zend_execute.c - zend_object_handlers.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/object_handlers.phpt: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), - ...) - - * tests/object_handlers.phpt - tests/object_handlers.phpt: - - file object_handlers.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_object_handlers.c: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), ...) - -2005-06-01 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug30791.phpt: - Fixed bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call - if object is overloaded) - - * tests/bug30791.phpt - tests/bug30791.phpt: - - file bug30791.phpt was initially added on branch PHP_5_0. - -2005-05-31 Magnus Mtt - - * tests/bug27304.phpt: - Fix test - -2005-05-31 Dmitry Stogov - - * zend_operators.c: - Reverted wrong fix for bug #30572. - Seems the bug was already fixed in other way. - But reverted patch produced a lot of valgrind errors, because IS_TMP_VAR - operands don't initialize refcount. - -2005-05-31 Marcus Boerger - - * zend_compile.c: - - Only allow changing return ref agnostic when a script method overrides an - internal method (found by dmitry) - -2005-05-29 Jani Taskinen - - * Zend.m4: - - Unify the "configure --help" texts - -2005-05-29 Hartmut Holzgraefe - - * acinclude.m4: - forgot to re-add 1.875 as a valid bison version after testing - - * acinclude.m4: - bison may be installed under a different executable name, e.g. - - YACC="bison-1.75" configure ... - - removing the check for "bison -y" allows for this - the check was redundant anyway as the following one filters - for "GNU Bison" in the --version output - - * Zend.m4 - acinclude.m4: - avoid code duplication in bison version test - -2005-05-28 Marcus Boerger - - * zend_compile.c - zend_compile.h: - - Make zend_do_inheritance ZEND_API - -2005-05-27 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug22836.phpt - tests/bug22836.phpt: - Fixed bug #22836 (returning reference to uninitialized variable) - -2005-05-26 Dmitry Stogov - - * (PHP_5_0) - zend_execute_API.c - tests/bug33116.phpt: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload) - - * tests/bug33116.phpt - tests/bug33116.phpt: - - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * zend_execute_API.c: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_reflection_api.c - tests/array_type_hint_001.phpt: - Added array type hinting. (This patch requires full re-make) - -2005-05-26 Marcus Boerger - - * (PHP_5_0) - tests/bug27304.phpt - tests/bug32981.phpt: - - Add new tests - - * tests/bug27304.phpt - tests/bug27304.phpt - tests/bug32981.phpt - tests/bug32981.phpt: - - - Add new tests - -2005-05-22 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #29338 (unencoded spaces get ignored after certain tags). - - * zend_highlight.c: - Fixed bug #29338 (unencoded spaces get ignored after certain tags). - -2005-05-22 Stanislav Malyshev - - * zend.c - zend.c: - fix leak - -2005-05-19 Dmitry Stogov - - * (PHP_5_0) - zend_object_handlers.c: - Backported fix for bug #30451 - - * tests/bug31828.phpt - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32080.phpt: - Strict warnings - -2005-05-18 Stanislav Malyshev - - * zend.c - zend.c: - fix for #29890 - part 2 - - * (PHP_5_0) - tests/bug29890.phpt: - test - - * tests/bug29890.phpt - tests/bug29890.phpt: - - test - - * zend_execute_API.c - zend_execute_API.c: - fix #29890 - crash when function call fails - - * zend_object_handlers.c: - revert - seems to be fixed elsewhere - - * zend_object_handlers.c: - fix #30451 static properties don't work properly - - * tests/bug29689.phpt - tests/bug30451.phpt: - tests - - * tests/bug29689.phpt - tests/bug29689.phpt - tests/bug30451.phpt - tests/bug30451.phpt: - - file bug29689.phpt was initially added on branch PHP_5_0. - -2005-05-17 Magnus Mtt - - * tests/bug31828.phpt - tests/bug32080.phpt: - Fix tests. - -2005-05-13 Antony Dovgal - - * (PHP_5_0) - zend.c: - MFH: fix bug #29975 (memory leaks when set_error_handler() is used inside - error handler) - - * zend.c: - fix bug #29975 (memory leaks when set_error_handler() is used inside error - handler) - -2005-05-12 Marcus Boerger - - * zend_reflection_api.c: - - Make ReflectionObject::hasProperty() recognize dynamically added props - -2005-05-06 Jani Taskinen - - * zend_object_handlers.h: - typofix :) - -2005-05-05 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31525.phpt: - Fixed bug #31525 (object reference being dropped. $this getting lost) - - * tests/bug31525.phpt - tests/bug31525.phpt: - - file bug31525.phpt was initially added on branch PHP_5_0. - -2005-05-04 Stanislav Malyshev - - * zend.c: - fix bug #32924: prepend does not add file to included files - - * (PHP_5_0) - zend_execute.c: - clarify some magic - -2005-05-04 Dmitry Stogov - - * zend_execute.c: - Fixed bug #30641 (Compile error: error: symbol "zend_error" is used but not - defined) - - * tests/bug30707.phpt - tests/bug30707.phpt: - - file bug30707.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30707.phpt: - Fixed bug #30707 (Segmentation fault on exception in method) - - * (PHP_5_0) - zend_execute.c: - ws - - * tests/bug30162.phpt - tests/bug30162.phpt: - - file bug30162.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30161.phpt: - Fixed bug #30162 (Catching exception in constructor couses lose of $this) - -2005-05-03 Dmitry Stogov - - * tests/unset_cv07.phpt: - Fixed notice message - -2005-05-03 Marcus Boerger - - * (PHP_5_0) - tests/bug32252.phpt: - - Add test - -2005-05-03 Dmitry Stogov - - * zend_object_handlers.c: - Fixed destruction of zval after returning from __call() - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug32296.phpt: - Fixed bug #32296 (get_class_methods output has changed between 5.0.2 and - 5.0.3) - Now get_class_methods() shows accessible private and protected methods if - it is called from class scope. - - * tests/bug32296.phpt - tests/bug32296.phpt: - - file bug32296.phpt was initially added on branch PHP_5_0. - -2005-05-02 Marcus Boerger - - * zend_builtin_functions.c - zend_object_handlers.c - zend_object_handlers.h: - - Extend API to support real existance test without the need to add any new - functions or change any behavior - - * zend_execute_API.c: - - Part 2 of #30126: Enhancement for error message for abstract classes - - * zend_execute_API.c: - - Part 1 of #30126: Enhancement for error message for abstract classes - -2005-04-29 Jani Taskinen - - * zend_object_handlers.c: - compile fix - - * tests/bug30332.phpt - tests/bug32852.phpt: - Make sure E_STRICT is set always - -2005-04-29 Dmitry Stogov - - * zend_API.c - zend_API.c - tests/bug30332.phpt: - Fixed bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with - array_push()) - - * tests/bug30332.phpt - tests/bug30332.phpt: - - file bug30332.phpt was initially added on branch PHP_5_0. - - * zend_execute.c - zend_execute.c - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32852.phpt: - Fixed bug #32852 (Crash with singleton and __destruct when - zend.ze1_compatibility_mode = On) - Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On) - Fixed bug #32080 (segfault when assigning object to itself with - zend.ze1_compatibility_mode=On) - - * tests/bug31828.phpt - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32080.phpt - tests/bug32852.phpt - tests/bug32852.phpt: - - file bug31828.phpt was initially added on branch PHP_5_0. - -2005-04-29 Jani Taskinen - - * tests/bug22836.phpt - tests/bug27641.phpt: - - Unify error_reporting setting + make sure E_STRICT is set when wanted - -2005-04-28 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug29015.phpt: - Fixed bug #29015 (Incorrect behavior of member vars(non string - ones)-numeric mem vars und others) - - * tests/bug29015.phpt - tests/bug29015.phpt: - - file bug29015.phpt was initially added on branch PHP_5_0. - -2005-04-27 Dmitry Stogov - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h - tests/bug29210.phpt: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes) - - * (PHP_5_0) - zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h - tests/bug29210.phpt - tests/bug29210.phpt: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes). - - * zend_compile.c - zend_compile.c - tests/bug29104.phpt - tests/bug29104.phpt - tests/bug29104.phpt: - Fixed bug #29104 (Function declaration in method doesn't work) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32833.phpt: - Fixed bug #32833 (Invalid opcode) - - * tests/bug32674.phpt - tests/bug32674.phpt: - - file bug32674.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32674.phpt: - Fixed bug #32674 (exception in iterator causes crash) - -2005-04-26 Dmitry Stogov - - * tests/bug30889.phpt - tests/bug30889.phpt: - - file bug30889.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30889.phpt: - Fixed bug #30889 (Conflict between __get/__set and ++ operator) - - * tests/bug32429.phpt: - fix - - * zend_API.c - zend_API.c - tests/bug30702.phpt: - Fixed bug #30702 (cannot initialize class variable from class constant) - - * tests/bug30702.phpt - tests/bug30702.phpt: - - file bug30702.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - tests/bug32427.phpt: - Fixed bug #32427 (Interfaces are not allowed 'static' access modifier). - - * zend_builtin_functions.c - tests/bug32429.phpt: - Fixed bug #32429 (method_exists() always return TRUE if __call method - exists) - -2005-04-25 Andrei Zmievski - - * zend_object_handlers.c: - Reverting. Let's not introduce major BC breakage like this without a - good reason. - -2005-04-25 Dmitry Stogov - - * tests/bug29944.phpt - tests/bug29944.phpt: - - Fixed bug #29944 (Function defined in switch, crashes). - - * zend_compile.c - zend_compile.c - tests/bug29944.phpt: - Fixed bug #29944 (Function defined in switch, crashes). - -2005-04-25 Jani Taskinen - - * zend_hash.c: - ws - -2005-04-25 Dmitry Stogov - - * zend_hash.c: - Fixed call to estrndup() with invalid length - - * (PHP_5_0) - zend_hash.c: - Fixed call to estrndup() with invalid lengt - -2005-04-25 Sebastian Bergmann - - * zend_reflection_api.c: - Correct grammar. - -2005-04-24 Marcus Boerger - - * zend_compile.c: - - Need to copy doc comments correct for properties - -2005-04-23 Marcus Boerger - - * tests/bug29674.phpt - tests/bug30161.phpt - tests/bug30346.phpt: - - Add new tests - -2005-04-21 Jani Taskinen - - * tests/unset_cv05.phpt: - Fix test when register_long_arrays is off in your php.ini - -2005-04-19 Marcus Boerger - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_reflection_api.c: - - Add ReflectionProperty::getDocComment() - -2005-04-19 Jani Taskinen - - * zend_compile.c - zend_exceptions.c: - No c++ comments in C code - -2005-04-18 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c - zend_execute.c: - Fixed memory leak in debug_backtrace() - -2005-04-17 Marcus Boerger - - * zend_builtin_functions.c: - - Fix special cases of property_exists() - - * zend_object_handlers.c: - - Fix logic - -2005-04-16 Sara Golemon - - * tests/method_exists.phpt: - method_exists() regression test - - * zend_builtin_functions.c: - Fix method_exists(), pce is fetched, but ce is used - -2005-04-15 Marcus Boerger - - * zend_builtin_functions.c: - - Fix even though we already know that the function will be renamed - -2005-04-15 Andrei Zmievski - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fix certain operations to stop relying on presence of read_property and - write_property handlers. They may be NULL'ed out by certain objects - pretending to be pure arrays, for example. Do checks first. - -2005-04-12 Stanislav Malyshev - - * zend_ini.c: - fix memory corruption if one on the on_modify handlers errors out - - * (PHP_5_0) - zend_ini.c: - fi memory corruption if one on the on_modify handlers errors out - -2005-04-08 Marcus Boerger - - * zend_operators.c: - - Fix memory corruption found by rob - - * tests/bug22836.phpt: - - Ensure we see all errors. No need for () in return - - * zend_builtin_functions.c: - - Add property_exits() - - * zend_object_handlers.c: - - No E_ERROR when we just check (where did my 0->1 change go on first - commit?) - - * zend_object_handlers.c: - - No E_ERROR when we just check, here visibility simply means there is none - - * zend_object_handlers.c - zend_object_handlers.h: - - Simplify getting property info and make it an api function - -2005-04-07 Jani Taskinen - - * zend_alloc.c - zend_alloc.h: - - Nuke the code duplication - - * zend_alloc.h: - Fix build when USE_ZEND_ALLOC is 0 - -2005-04-07 Zeev Suraski - - * (PHP_5_0) - zend_alloc.c - zend_alloc.h: - MFH (Fix strdup() bug when USE_ZEND_ALLOC was disabled) - - * zend_alloc.c - zend_alloc.h: - Fix strdup() bug when USE_ZEND_ALLOC is disabled - -2005-04-05 Marcus Boerger - - * zend_interfaces.c: - - Just return FAILURE & allow NULL without emmidiate error - -2005-04-04 Stanislav Malyshev - - * zend_builtin_functions.c: - MF50: fix backtraces - non-Zend classes have names too - - * (PHP_5_0) - zend_builtin_functions.c: - fix backtraces - non-Zend classes have names too - -2005-04-03 Jani Taskinen - - * (PHP_5_0) - zend_execute_API.c: - MFH: - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)). - MFH: (kameshj at fastmail dot fm) - -2005-03-31 Derick Rethans - - * (PHP_5_0) - zend_API.c: - - MFH: internal_function->fn_flags is not initialized at this point - -2005-03-26 Jani Taskinen - - * zend_execute_API.c: - - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)) - (kameshj at fastmail dot fm) - -2005-03-24 Marcus Boerger - - * zend_vm_execute.h: - - Second part of removing temp solution - - * zend_vm_def.h: - - Remove potential bad solution for now - -2005-03-23 Andrei Zmievski - - * zend_execute.c: - Consolidate: call _get_zval_ptr_var() for IS_VAR case in - _get_zval_ptr(). - -2005-03-21 Andi Gutmans - - * (PHP_5_0) - zend_execute.c: - - Fix memset() bug (Joe Orton) - -2005-03-21 Andrei Zmievski - - * zend_API.c: - internal_function->fn_flags is not initialized at this point - -2005-03-20 Marcus Boerger - - * tests/bug31102.phpt: - - Added missing description (thanks jani) - - * tests/bug31102.phpt: - - Add new test - -2005-03-19 Marcus Boerger - - * zend_object_handlers.c: - - More fixes to gracefully act on exception thrown in overload methods - - * zend_object_handlers.c: - - Fix #31185 - - * zend_execute_API.c: - - Fix all incarnations of bug #30266 - -2005-03-19 Andi Gutmans - - * zend_interfaces.c - zend_interfaces.h: - - Fix typos - -2005-03-16 Wez Furlong - - * (PHP_5_0) - zend_API.c: - MFH: don't call rshutdown twice for dl()'d modules. - - * zend_API.c: - don't call rshutdown twice for dl()'d modules. - Spotted by Andrei. - -2005-03-15 Wez Furlong - - * zend.c - zend_API.c - zend_modules.h: - fix shutdown so that dl()'d modules are unloaded after all the dtors have - been called. - -2005-03-14 Zeev Suraski - - * zend_ini.c: - Clarify logic - -2005-03-14 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - ws - -2005-03-13 Stanislav Malyshev - - * zend_stream.c - zend_stream.c: - Do not convert ZEND_HANDLE_FP to ZEND_HANDLE_STREAM but allow using - reader/closer - on it - -2005-03-13 Marcus Boerger - - * zend_interfaces.c: - - More exact signatures (even though complete correct not possible atm) - -2005-03-13 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fix get_extension_funcs() - extension names are now lowercased, so should - be function arguments. - -2005-03-13 Marcus Boerger - - * zend_execute_API.c: - - Actually this is a much better error decription - - * zend_execute_API.c - tests/bug32290.phpt - tests/bug32290.phpt: - - Bugfix #32290 - -2005-03-12 Marcus Boerger - - * zend_vm_def.h - zend_vm_execute.h: - - If an exception is pending we don't bail out but show the unhandled - exception - -2005-03-11 Anantha Kesari H Y - - * (PHP_5_0) - acconfig.h: - NetWare LibC's sys/types.h does not include sys/select.h implicitly as it - is the case with Linux LibC - -2005-03-11 Marcus Boerger - - * tests/bug32252.phpt: - - Add new test - - * tests/bug27145.phpt - tests/bug27145.phpt: - - Irrelevant - - * zend_object_handlers.c: - - Don't touch refcount/is_ref - -2005-03-10 Marcus Boerger - - * tests/bug28442.phpt - tests/bug28442.phpt: - - - Bugfix #28442 - - * zend_compile.c: - - Bugfix #28442 - -2005-03-10 Anantha Kesari H Y - - * (PHP_5_0) - acconfig.h: - Autoconf based build can be used for NetWare - - * (PHP_5_0) - zend.h: - NetWare can make use of ./configure generated zend_config.h - - * (PHP_5_0) - Zend.m4: - This patch is needed for cross compilation to go through - -2005-03-10 Marcus Boerger - - * zend_vm_execute.h: - - #31562 2nd part - - * zend_vm_def.h: - - Fix #31562 - -2005-03-07 Marcus Boerger - - * zend.h - zend_compile.c - zend_interfaces.c - zend_interfaces.h: - - New Interface Serializeable - - Change signature of unserialize() callback to ease inheritance and - support code reuse of handlers - - * tests/bug32226.phpt - tests/bug32226.phpt: - - - Add updated description - - * zend_builtin_functions.c - tests/bug32226.phpt: - - Fix #32226 - -2005-03-07 Zeev Suraski - - * zend_language_scanner.l - zend_language_scanner.l: - Revert // patch - -2005-03-06 Marcus Boerger - - * zend_reflection_api.c: - - Fix by Tim - -2005-03-06 Jani Taskinen - - * zend_compile.c - zend_compile.c: - Fixed compile warning (bug #32046) - - * zend_mm.c: - Fix compile warning (bug #32047) - -2005-03-01 Marcus Boerger - - * zend_interfaces.c: - - Support statuc methods/functions - -2005-03-01 Jani Taskinen - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fixed bug #31672 ( not considered closing tag if - MFH: preceded by one-line comment) - - * zend_language_scanner.l: - Fix the fix for one line comments with tags - -2005-02-28 Marcus Boerger - - * zend_builtin_functions.c: - - Add support for methods dynamically added through object handlers - -2005-02-27 Marcus Boerger - - * zend_object_handlers.c: - - If silence if wanted we do not error out - - * zend_reflection_api.c: - - Add two new methods - - Fix signature, no need to cast it - - * zend_API.h: - - These must be initailized - - * zend_builtin_functions.c: - - Update method_exists to new handlers and allow first parameter as string - -2005-02-27 Jani Taskinen - - * Zend.m4: - - Cache the version check results - -2005-02-24 Andi Gutmans - - * zend_language_scanner.l: - - Make one line comments work the same with as with - - other tags. This will break scripts that have whitespace at the end - - of the closing tag but this is barely used as it is - - and I doubt ppl used whitespace. (patch by Jani) - - * zend_objects_API.h: - - This part of the patch was right - -2005-02-24 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug in ZEND_POST_INC/ZEND_POST_DEC handlers. - These opcodes assume IS_TMP_VAR as result. - -2005-02-24 Andi Gutmans - - * zend_modules.h: - - Need zend_Compile.h for struct _zend_arg_info definiton (thanks to Joe - Orton) - - * zend_objects.c - zend_objects.h - zend_objects_API.h: - - Revert following patch until we decide what is the right way to handle - - this: - - Fix signatures they are all meant to be able to deal with any type in - any - object storage (though we are still missing several parts) - -2005-02-23 Derick Rethans - - * (PHP_5_0) - zend_reflection_api.c: - - MFH: fixed bug #32076 (ReflectionMethod :: isDestructor() always return - true). - - * zend_reflection_api.c: - - Fixed bug #32076 (ReflectionMethod :: isDestructor() always return true) - (Patch by Antony Dogval) - -2005-02-23 Stanislav Malyshev - - * zend.h - zend_compile.c: - Custom object serializer infrastructure - -2005-02-23 Jani Taskinen - - * Zend.m4: - Hack the planet - -2005-02-23 Marcus Boerger - - * zend_interfaces.c: - - Allow to convert Traversable into Aggregate - -2005-02-22 Marcus Boerger - - * zend_objects_API.c: - - We cannot provide this fallback becuase it requires zend_object ptr's. - -2005-02-22 Jani Taskinen - - * Zend.m4: - Fix cross-compile - - * acconfig.h: - Fix build (it was #ifNdef NETWARE..) - -2005-02-22 Marcus Boerger - - * zend_objects.c - zend_objects.h - zend_objects_API.h: - - Fix signatures they are all meant to be able to deal with any type in any - object storage (though we are still missing several parts) - - * zend_objects_API.c: - - Force calling of dtors unless otherwise specified (fixes several - __destruct bugs) - -2005-02-22 Anantha Kesari H Y - - * zend.h: - NetWare can include autoconf generated config headers - - * acconfig.h: - NetWare can make use of the configure script generated header file. - -2005-02-21 Moriyoshi Koizumi - - * Makefile.am: - - Add missing entry. - -2005-02-20 Dmitry Stogov - - * zend_compile.c: - Fixed possible memory corruption - -2005-02-19 Rui Hirokawa - - * (PHP_5_0) - zend_language_scanner.l: - MFH: fixed #31987 zend-multibyte in ZTS. - - * zend_language_scanner.l: - fixed #31987 zend-multibyte in ZTS. - -2005-02-17 Marcus Boerger - - * zend_API.c: - - A little optimization to prevent problems when trying to reimplement an - interface inherited from an interfaces that was just implemented...... - - * zend_API.c: - - No C++ ruleZ here - - * zend_API.c: - - Actually we must do this in two steps: 1st resize the table and set all - interfaces, 2nd implement the interfaces - - * zend_API.c: - - Incrementation is done elsewhere - - * zend_API.c: - - Fix windows build (funny MS compiler) - -2005-02-17 Jani Taskinen - - * (PHP_5_0) - Zend.m4 - zend_strtod.c: - MFH: - Compile fix for systems without int32_t typedef - - * Zend.m4 - zend_strtod.c: - - Compile fix for systems without int32_t typedef - -2005-02-13 Marcus Boerger - - * zend_execute_API.c - zend_reflection_api.c: - - Be more gracious in reflection API - - * zend_language_scanner.l: - - Fix doc comment handling - -2005-02-12 Marcus Boerger - - * zend_execute_API.c: - - Bugfix #30682 (autoconversion from false/true to 0/1 missing in case of - static property default value) - -2005-02-11 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Cleanup foreach handling - -2005-02-10 Jani Taskinen - - * zend_strtod.c - zend_strtod.c: - - Fixed bug #31920 (zend_strtod.c error: conflicting types for 'int8_t') - -2005-02-10 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30407.phpt: - Fixed bug #30407 (Strange behaviour of default arguments) - -2005-02-07 Dmitry Stogov - - * zend_compile.c: - Fixed bug introduced with foreach() optimization patch - - * zend_compile.c: - Fixed FE_RESET/FE_FETCH bug. - Now FE_RESET instruction takes jump-address from itself, not from the - following FE_FETCH instruction. - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - foreash($a as $key => $val) optimization - Removed temorary array creation on each iteration. - -2005-02-07 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Remove part of the cleanup which causes a problem with unnormal code - like tests/lang/040.phpt - -2005-02-06 Zeev Suraski - - * (PHP_5_0) - zend_ini_scanner.l: - Correct fix for #28803 - - * zend_ini_scanner.l: - Correct fix for #28804 - -2005-02-05 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Cleanup foreach statement - -2005-02-04 Hartmut Holzgraefe - - * zend_API.c - zend_API.h: - added some missing zend_[declare|update]_property_...() convenience - functions for bool, double and binary safe string data - -2005-02-03 Jani Taskinen - - * (PHP_5_0) - zend_ini_scanner.l: - MFH: Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * zend_ini_scanner.l: - - Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * zend_ini_scanner.l - zend_ini_scanner.l: - ws fix - -2005-02-02 Stanislav Malyshev - - * zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - - * tests/bug31720.phpt: - test for Bug #31720 - - * tests/bug31720.phpt - tests/bug31720.phpt: - - file bug31720.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - -2005-02-02 Dmitry Stogov - - * zend.h - zend.h - zend_object_handlers.c - zend_object_handlers.c - tests/bug31683.phpt: - Fixed bugs #29767 and #31683 (__get and __set methods must not modify - property name). - - * tests/bug31683.phpt - tests/bug31683.phpt: - - file bug31683.phpt was initially added on branch PHP_5_0. - -2005-02-01 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fix debug_trace with eval (patch from Antony Dovgal) - - * tests/bug_debug_backtrace.phpt: - test for eval debug_backtrace bug - - * tests/bug_debug_backtrace.phpt - tests/bug_debug_backtrace.phpt: - - file bug_debug_backtrace.phpt was initially added on branch PHP_5_0. - -2005-01-31 Marcus Boerger - - * zend_reflection_api.c: - - Add ReclectionClass:hasProperty(), ReflectionClass::hasConstant() - to complete api (johannes@php.net) - -2005-01-28 Marcus Boerger - - * zend_execute_API.c: - - Fix severity (found by johannes) - -2005-01-25 Jani Taskinen - - * zend.h: - New versions of glibc support a RTLD_DEEPBIND flag to dlopen. The - effect of this flag when loading a "foo.so" with undefined symbols is - that the search that symbol starts at foo.so and its dependencies - *before* the loading process' global symbol table. - - This is an effective workaround for symbol namespace collisions between - various modules and the libraries on which they depend (where fixing the - respective modules or libraries is not possible e.g. due to API - constraints). - - (By: Joe Orton) - -2005-01-25 Marcus Boerger - - * (PHP_5_0) - zend_execute.c - zend_interfaces.c - tests/bug26229.phpt: - - MFH #26229 (getIterator() segfaults when it returns arrays or scalars) - - * zend_interfaces.c - zend_vm_def.h - zend_vm_execute.h - tests/bug26229.phpt: - - Bugfix #26229 (getIterator() segfaults when it returns arrays or scalars) - - * Makefile.frag: - - Fix dependency - - * zend_vm_def.h - zend_vm_execute.h: - - Use correct freeing (thx Dmitry) - -2005-01-24 Marcus Boerger - - * zend_vm_def.h - zend_vm_execute.h - tests/bug30725.phpt: - - Second and last part of #30725 fix - - * zend_interfaces.c: - - Allow getIterator() to fail - - * tests/bug30725.phpt: - - - Add new test - -2005-01-22 Jani Taskinen - - * (PHP_5_0) - Zend.m4 - configure.in - zend_strtod.c: - MFH: Compile fix for systems without uint32_t typedef - - * Zend.m4 - configure.in - zend_strtod.c: - - Compile fix for systems without uint32_t typedef - -2005-01-22 Marcus Boerger - - * zend_API.c - zend_API.h - zend_reflection_api.c: - - Fix #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.) - -2005-01-22 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: - - Two new API calls for Derick (retreive CV name and value) by Dmitry - -2005-01-20 Jani Taskinen - - * zend.h - zend_constants.c: - - Revert the weird change of ZEND_STRS() macro and use the correct - ZEND_STRL() macro. - -2005-01-19 Jani Taskinen - - * zend_object_handlers.c: - - Fixed bug #29183 (Undefined symbol zend_check_private with Solaris CC) - -2005-01-19 Marcus Boerger - - * zend_ini_parser.y: - - Fix memleak - -2005-01-18 Dmitry Stogov - - * zend_compile.c: - Fixed patch for bug #31478 (SegFault/Memory Leak with empty()) - - * zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). - - * (PHP_5_0) - zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). (Dmitry) - -2005-01-18 Ilia Alshanetsky - - * (PHP_5_0) - zend_operators.h: - MFH: Fixed bug #30726 (-.1 like numbers are not being handled correctly). - - * zend_operators.h: - Fixed bug #30726 (-.1 like numbers are not being handled correctly). - -2005-01-17 Jani Taskinen - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - - * zend_language_scanner.l: - - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - -2005-01-15 Andi Gutmans - - * (PHP_5_0) - zend_API.c: - - Fix WS - - * (PHP_5_0) - zend_API.c: - - Change to using DL_UNLOAD macro. - - * zend_API.c: - - Unload on MAC OS X (shouldn't be a reason not to) - -2005-01-14 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31098.phpt: - Restore behavior of $str["str"]. (Now $str["str"] is equivalent to $str[0] - again) - - * (PHP_5_0) - tests/bug31098.phpt: - Path -> pattern - - * (PHP_5_0) - zend_execute.c - tests/bug31098.phpt: - Revert to old behavior of $str["str"]. ($str["str"] is equivalent of - $str[0]) - -2005-01-13 Dmitry Stogov - - * zend_execute.c - zend_execute.c: - Additional fix for fix of bug #29883 - -2005-01-12 Dmitry Stogov - - * zend_execute.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31098.phpt - tests/bug31098.phpt: - Fixed bug #31098 (isset false positive) - -2005-01-11 Moriyoshi Koizumi - - * (PHP_5_0) - zend_execute.c - tests/bug31098.phpt: - - MFH: fix for bug #31098. - - * tests/bug31098.phpt - tests/bug31436.phpt: - - - Test renaming - - * zend_vm_execute.h - tests/bug31436.phpt: - - Fix bug #31436 (isset() incorrectly returns true in dereference of a - wrong type) - - * zend_compile.c: - - Fix bug #31478 (segfault with empty()) - -2005-01-10 Rasmus Lerdorf - - * zend.h - zend_API.c: - Fix OSX DL_UNLOAD macro and actually use it to make shared extensions - work on OSX. - -2005-01-10 Jani Taskinen - - * header - zend_arg_defs.c - zend_strtod.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - - Added missing header sections. - - * acinclude.m4 - configure.in: - - Added AC_ZEND_C_BIGENDIAN macro (as requested by Andi) - -2005-01-09 Jani Taskinen - - * (PHP_5_0) - zend.h: - MFH: - Fix outside-source-tree builds. Always include generated header - files - with #include to make sure the correct file is - used. - - * zend.h: - - Fix outside-source-tree builds. Always include generated header files - with #include to make sure the correct file is used. - - * zend.c: - MFB: - Rationalize code a bit - -2005-01-03 Stanislav Malyshev - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - - * zend_language_scanner.l: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - -2005-01-02 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #31371 (highlight_file() trims new line after heredoc). - - * zend_highlight.c: - Fixed bug #31371 (highlight_file() trims new line after heredoc). - -2004-12-30 Jani Taskinen - - * (PHP_5_0) - zend_compile.c - zend_highlight.c - zend_indent.c - zend_ini_scanner.l - zend_language_scanner.l: - MFH: - Fixed bug #28930 (PHP sources pick wrong header files generated by - bison). - - * zend_compile.c - zend_highlight.c - zend_indent.c - zend_ini_scanner.l - zend_language_scanner.l: - - Fixed bug #28930 (PHP sources pick wrong header files generated by bison) - - * Zend.m4 - acinclude.m4: - MFB_4_3: Quote macro names in AC_DEFUN() - -2004-12-27 Zeev Suraski - - * zend_builtin_functions.c: - MFB - - * (PHP_5_0) - zend_builtin_functions.c: - Fix desc - -2004-12-27 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - - MFH: Need to unmangle the class name here - - * zend_reflection_api.c: - - Need to unmangle the class name here - -2004-12-27 Zeev Suraski - - * (PHP_5_0) - zend_exceptions.c: - Add descriptions - -2004-12-27 Dmitry Stogov - - * zend_execute.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - tests/bug22836.phpt - tests/bug22836.phpt - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv06.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - "Undefined variable: %s" noticies were fixed to use one space - -2004-12-27 Marcus Boerger - - * zend_reflection_api.c: - - More proto/error message fixes - - * zend_reflection_api.c: - - Small fixlet (by Tony) - -2004-12-24 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h: - New sarbage collector's bug was fixed (the behavior should be the same as - in PHP_5_0) - - * zend_execute.c - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv06.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - "Undefined variable: %s" noticies were fixed to be compatible with PHP_5_0 - -2004-12-21 Jani Taskinen - - * (PHP_5_0) - zend_strtod.c: - MFH: - Use correct header files (in c99 compliant way). uint32_t is - preferred. - - * zend_strtod.c: - - Use correct header files (in c99 compliant way). uint32_t is preferred. - -2004-12-20 Jani Taskinen - - * zend_strtod.c: - Better fix for endian compile problems. - -2004-12-17 Andi Gutmans - - * zend_object_handlers.c: - - Fixed Bug #30562 Segmentation fault with __call() - -2004-12-17 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MF43: Fixed strtod for Irix and some other strange platform - -2004-12-16 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MF43: Make it compile on HPUX on Itanium 2 - - * zend_strtod.c - zend_strtod.c: - - MF43: Fixed bug #31107 (strtod on solaris9/intel) - -2004-12-16 Jani Taskinen - - * (PHP_5_0) - ChangeLog: - - MFH: Fix typo (avaliable -> available). (bug #28725) - - * ChangeLog: - - Fix typo (avaliable -> available). (bug #28725) - -2004-12-16 Derick Rethans - - * zend_strtod.c: - - MF43: Fixed bug #31110 and #31111 (Zend/zend_strtod.c problems) - - * (PHP_5_0) - zend_strtod.c: - - Fixed bug #31110 and #31111 (Zend/zend_strtod.c problems) - -2004-12-15 Andi Gutmans - - * (PHP_5_0) - zend.h: - - 5.0.4-dev - - * (PHP_5_0) - zend.h: - - Redo 5.0.3 - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - Roll PHP 5.0.3 - -2004-12-14 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MFH: Fixed compile error related to bug #28605. - -2004-12-13 Derick Rethans - - * zend_operators.c: - - Added "G" modifier to ini setting number format. - -2004-12-10 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.3RC2 - -2004-12-07 Dmitry Stogov - - * zend_exceptions.c - zend_exceptions.c: - Fixed bug #30904 (segfault when recording soapclient into session). - -2004-12-06 Stanislav Malyshev - - * tests/bug30998.phpt: - add test - - * zend.c - zend.c: - port fix for #30998: Crash when user error handler returns false on amd64 - -2004-12-06 Dmitry Stogov - - * zend_compile.c - zend_compile.c - tests/bug30922.phpt: - Fixed bug #30922 (reflective functions crash PHP when interfaces extend - themselves) - - * tests/bug30922.phpt - tests/bug30922.phpt: - - file bug30922.phpt was initially added on branch PHP_5_0. - -2004-12-06 Stanislav Malyshev - - * (PHP_5_0) - zend_builtin_functions.c: - if fetch called not from PHP function, ptr can be NULL - -2004-12-01 Ilia Alshanetsky - - * zend_strtod.c: - MFB: Removed extra space that causes problems for some compilers. - - * (PHP_5_0) - zend_strtod.c: - Removed extra space that causes problems for some compilers. - -2004-12-01 Derick Rethans - - * (PHP_5_0) - zend_strtod.c: - - revert unwanted change - - * zend_strtod.c - zend_strtod.c: - - Fixed MacOSX compilation (Patch by Christian) - - * (PHP_5_0) - zend.h: - - And in Zend/ too. - -2004-12-01 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - tests/bug29883.phpt - tests/bug29883.phpt - tests/bug29883.phpt: - Fixed bug #29883 (isset gives invalid values on strings). - -2004-11-30 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Go with 5.0.3RC1 - -2004-11-29 Derick Rethans - - * (PHP_5_0) - zend_operators.c: - - MF43: Revert Joe's work around a bug in GCC patch as it breaks too many - things. - - * zend_operators.c: - - MFH: Revert Joe's work around a bug in GCC patch as it breaks too many - things. - -2004-11-25 Zeev Suraski - - * (PHP_5_0) - zend_execute.c - zend_execute_API.c - zend_extensions.h - zend_object_handlers.c - zend_object_handlers.h: - Reverting get_method() signature change - -2004-11-24 Marcus Boerger - - * zend_reflection_api.c: - - Fix Bug #30856 (ReflectionClass::getStaticProperties segfaults) - - * tests/bug30856.phpt: - - - Add new test - -2004-11-17 Stanislav Malyshev - - * (PHP_5_0) - zend_execute_API.c: - fix #30543 - - * zend_execute_API.c: - fix crash - -2004-11-16 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - Make this compile for the Mac again - -2004-11-15 Derick Rethans - - * (PHP_5_0) - zend_strtod.c: - - MFH: Fixed bug #30779 (Compile of Zend/zend_strtod.c fails on Sparc) - - * zend_strtod.c: - - Fixed bug #30779 (Compile of Zend/zend_strtod.c fails on Sparc) - -2004-11-14 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH #30783 Apache crash when using ReflectionFunction::getStaticVariables() - MFH proto fixes - - * zend_reflection_api.c: - - Bugix #30783: Apache crash when using - ReflectionFunction::getStaticVariables() - -2004-11-09 Andrei Zmievski - - * zend_ini_parser.y: - Revert inadvertent commit. - - * zend_ini_parser.y: - .dylib extension are Mach-O shared libraries that meant for linking - against. Loadable modules (aka bundles) can have any extension, so we - should probably stick with .so - - http://fink.sourceforge.net/doc/porting/shared.php?phpLang=en#lib-and-mod - -2004-11-05 Derick Rethans - - * (PHP_5_0) - zend_execute_API.c: - - Fix for bug #30367, #30490 and possibly #30011. - -2004-11-04 Edin Kadribasic - - * Zend.dsp - ZendTS.dsp: - Added zend_strtod.* to the build - - * zend_strtod.c - zend_strtod.h: - Make zend_strtod compile on windows - -2004-11-04 Moriyoshi Koizumi - - * (PHP_5_0) - Makefile.am: - - MFH: Add entry for zend_strtod.c in belief that this is still active. - - * Makefile.am: - - Add entry for zend_strtod.c in belief that this is still active. - -2004-11-03 Moriyoshi Koizumi - - * Zend.m4: - - Don't show grep outputs - -2004-11-03 Derick Rethans - - * (PHP_5_0) - zend_execute_API.c - zend_globals.h - zend_ini.c - zend_language_scanner.l - zend_operators.c - zend_operators.h - zend_strtod.c - zend_strtod.h: - - MFH: Fixed bug #30630: Added a BSD based strtod function that is - locale-independent. - - * zend_execute_API.c - zend_globals.h - zend_ini.c - zend_language_scanner.l - zend_operators.c - zend_operators.h - zend_strtod.c - zend_strtod.h: - - Fixed bug #30630: Added a BSD based strtod function that is - locale-independent. - -2004-11-03 Moriyoshi Koizumi - - * Zend.m4 - zend.h - zend_execute.c: - - Checks for Darwin'ish systems that uses Mach-O, which apparently doesn't - support weak symbol aliasing at this time. - -2004-11-03 Marcus Boerger - - * zend_reflection_api.c: - - Trying to invoke function not methot here - - * zend_reflection_api.c: - - Fix invokeargs() with static methods - -2004-11-03 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h: - Fixed "isset() and the new VM" bug. - -2004-11-02 Sebastian Bergmann - - * (PHP_5_0) - zend_API.c: - MFH: Patch by Joe Orton . - - * zend_API.c: - Patch by Joe Orton . - -2004-10-31 Marcus Boerger - - * zend_reflection_api.c: - - Add ReflectionFunction::invokeArgs(array) - - Add ReflectionMethod::invokeArgs(obj, array) - -2004-10-31 Sebastian Bergmann - - * zend_reflection_api.c: - Invokation -> Invocation - -2004-10-30 Marcus Boerger - - * zend.h: - Bump version (as discussed with Andi) - - * (PHP_5_0) - zend_execute.c: - - Fix (readd function name which got lost during earlier comit) - - * zend_reflection_api.c: - - Be consistent and use names as keys (found by johannes) - - * zend_extensions.h - zend_modules.h: - - Bump API version - - * (PHP_5_0) - zend_extensions.h - zend_modules.h: - Bump api after latest changes - - * (PHP_5_0) - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - MFH change zend_object_handlers->get_method() - - * zend_execute_API.c - zend_object_handlers.c - zend_object_handlers.h - zend_vm_def.h - zend_vm_execute.h: - - Change zend_object_handlers->get_method() to allow aggregation for - internal classes - - * Makefile.frag: - - New architecture needs one more dependency - - * zend_exceptions.c - zend_reflection_api.c: - - Fix protos - -2004-10-29 Andi Gutmans - - * zend_operators.c: - - For Ilia: - - MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a - boolean). - - Hope this works well. I will MFH tomorrow if no one complains. - -2004-10-28 Dmitry Stogov - - * README.ZEND_VM - zend_vm_gen.php: - --without-lines changed to --with-lines - -2004-10-28 Andi Gutmans - - * zend_vm_execute.skl - zend_vm_gen.php: - - Fix typo - -2004-10-27 Andi Gutmans - - * zend_vm_opcodes.h: - - Oops missed this one - - * zend_operators.c: - - Revert Fixed bug #30228 (crash when comparing SimpleXML attribute to a - boolean). - - Need to discuss where the real problem is. - - * README.ZEND_VM: - - Tiny fixes - - * README.ZEND_VM - zend_compile.h - zend_vm_execute.h - zend_vm_gen.php: - - Improve comments, docs, code... - -2004-10-26 Andi Gutmans - - * zend_builtin_functions.c: - - Patch from Andrey Hristov: - I have cooked a small patch which allows is_subclass_of() the accept - not only an object as first parameter but a string as well. When string - is passed the function checks whether the class specified is subclass of - the second parameter - class a{} - class b{} extends a{} - is_subclass_of("a", "a") //false - is_subclass_of("b", "a") //true - currently only objects are allowed as first parameter - -2004-10-26 Ilia Alshanetsky - - * (PHP_5_0) - zend_operators.c: - MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a - boolean). - - * zend_operators.c: - Fixed bug #30228 (crash when comparing SimpleXML attribute to a boolean). - -2004-10-23 Andi Gutmans - - * zend_vm_execute.h: - - Add missing file - -2004-10-22 Andi Gutmans - - * zend_vm_handlers.h - zend_vm_spec.h: - - Nuke another two files - - * Makefile.frag - zend_execute.c - zend_vm.h - zend_vm_def.h - zend_vm_execute.skl - zend_vm_gen.php: - - Commit new VM - - Old one is tagged as PRE_NEW_VM_GEN_PATCH - - Still doing work so more commits to come. Don't complain (yet) :) - - * (PRE_NEW_VM_GEN_PATCH) - zend_execute.c: - - Fix crash (MFB PHP5_0) - -2004-10-21 Andi Gutmans - - * (PHP_5_0) - zend_execute.c: - - Fix bug #30395 (Apache Child Segmentation fault in specific PHP-Code) - -2004-10-20 Andi Gutmans - - * zend_operators.c: - - If object handles are equal then save the comparison of properties in - - the == operator. - -2004-10-18 Anantha Kesari H Y - - * zend_modules.h: - including zend_compile.h for NetWare as NetWare uses MetroWerks Code - warrior compiler which does not allow declarations of following kind - before defining the types. - extern struct _zend_arg_info first_arg_force_ref[2]; - -2004-10-16 Andi Gutmans - - * zend_compile.c: - - One more test (WS) - - * zend_compile.c: - - WS fix to test commit - -2004-10-16 Anantha Kesari H Y - - * zend_compile.c - zend_compile.c: - Fix for 30457 - -2004-10-14 Marcus Boerger - - * zend_builtin_functions.c: - - Allow to omit object/classname in get_parent_class() which makes it - compatible with the signature and behavior of get_class() - -2004-10-13 Andi Gutmans - - * zend_compile.c: - - Don't allow access modifiers in interfaces. Explicitly stating public - - should also be disallowed but we don't have a way to detect it today. - -2004-10-12 Marcus Boerger - - * zend_builtin_functions.c: - Bug #30381 Strange results with get_class_vars() - - * (PHP_5_0) - zend_builtin_functions.c: - MFH Fix visibility of get_class_vars() and get_class_methods() - - * zend_builtin_functions.c: - - Fix visibility in get_class_vars() and get_class_methods() - - * zend_builtin_functions.c: - - Fix set_exception_handler - -2004-10-10 Sebastian Bergmann - - * .cvsignore - tests/.cvsignore: - Add *.gcda and *.gcno (from gcc -fprofile-{use|generate}) to .cvsignore. - -2004-10-08 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_vm_handlers.h: - - Revert automatic pass arg_info - -2004-10-08 Andi Gutmans - - * zend_compile.c: - - Fix BC break with default in switch() having to be at the end. - -2004-10-08 Anantha Kesari H Y - - * acconfig.h - zend_config.nw.h: - explicitly including sys/select.h as NetWare LibC sys/types.h does not - include sys/select.h implicitly as other LibC - -2004-10-06 Marcus Boerger - - * zend_reflection_api.c: - - Fix Bug #30344 - -2004-10-05 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_vm_handlers.h: - - Add arginfo ZEND_ARG_SEND_AUTOMATIC which lets the compiler automatically - determine whether pass by ref is possible or pass by value is needed. - -2004-10-05 Dmitry Stogov - - * tests/unset_cv06.phpt - tests/unset_cv07.phpt - tests/unset_cv07.phpt: - Test files are fixed. - - * zend_execute.c - zend_vm_handlers.h - tests/unset_cv11.phpt: - Fixed unset() bug that was introduced with CV optimization patch - - * zend_execute_API.c - zend_vm_handlers.h - tests/unset.inc - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv05.phpt - tests/unset_cv06.phpt - tests/unset_cv07.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - Added test cases for CV optimization patch - -2004-10-04 Andi Gutmans - - * zend_API.h - zend_execute_API.c: - - Rename delete_global_variable() to zend_delete_global_variable() - - * Zend.m4 - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c - zend_vm.h - zend_vm_handlers.h - zend_vm_spec.h: - - Commit the variable fetch optimization. - - Extensions which delete global variables need to use new special - function - - delete_global_variable() (I'm about to rename it) to remove them. - - Will post to internals@ or via commit messages if there's anything else. - -2004-10-04 Marcus Boerger - - * zend_builtin_functions.c: - - Bugfix #27798 - - * tests/bug27798.phpt: - - - Add new test - -2004-10-02 Marcus Boerger - - * (PHP_5_0) - tests/bug28444.phpt - tests/bug29368.phpt: - - Add new tests - - * tests/bug28444.phpt - tests/bug29368.phpt: - - - Add new test - -2004-10-01 Marcus Boerger - - * Makefile.frag: - - Add makefile fragment which simplifies working on the executer - -2004-09-30 Andi Gutmans - - * zend_operators.c: - - Small improvement to DVAL_TO_ZVAL macro - -2004-09-29 Marcus Boerger - - * zend_API.c: - - MFB (synch correctly not only for one problem) - - * zend_API.c: - - Refix the fix - -2004-09-29 Andi Gutmans - - * bench.php - tests/bench.php: - - Move bench.php to Zend/ - -2004-09-28 Marcus Boerger - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_objects.c: - Simplify/Optmize magic method calls (__get/__set/__call/__clone/__destruct) - -2004-09-28 Andi Gutmans - - * zend_execute_API.c: - - Return the warning until we check if we can change the type of str.len - -2004-09-28 Marcus Boerger - - * zend_reflection_api.c - zend_reflection_api.h: - - publish reflection_class_factory() as zend_reflection_class_factory() - -2004-09-27 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH fix several property handling issues - - * zend_reflection_api.c: - - Make internally used properties read-only and fix default properties - - * zend_exceptions.c: - - Fix memeleak - - * zend_reflection_api.c: - - Declare properties - -2004-09-27 Andi Gutmans - - * README.ZEND_VM: - - Document zend_vm_use_old_executor() for Derick. - -2004-09-27 Marcus Boerger - - * zend_reflection_api.c: - Fix Reflection_Class to ReflectionClass in docu/messages - - * zend_execute_API.c: - - Fix warning - - * zend_compile.c - zend_stream.c: - - Fix warning - - * zend_builtin_functions.c - zend_reflection_api.c: - - Fix warnings - - * zend_interfaces.c: - Fix warnign - -2004-09-27 Andi Gutmans - - * zend_variables.c - zend_variables.h: - - Use zval_ctor_func() for wrapper and update the prototype to void - - * zend_variables.c - zend_variables.h: - - Make zval_copy_ctor() return void like dtor(). No one ever checks the - - return value which is SUCCESS always. - -2004-09-26 Marcus Boerger - - * zend.h - zend_variables.h: - - Fix build - -2004-09-26 Andi Gutmans - - * zend.h - zend_variables.c - zend_variables.h: - - Apply Thies and Sterling's patch which doesn't call ctor/dtor functions - - for types which don't require it (BOOL/NULL/LONG/DOUBLE) - - Breaks serialization!!! - -2004-09-24 Anantha Kesari H Y - - * zend_API.c: - selectively avoiding module cleanup code for apache 1 build and removing a - duplicate code - -2004-09-24 Dmitry Stogov - - * zend_vm_spec.h: - Fixed specializer bug. - -2004-09-23 Andi Gutmans - - * (PHP_5_0) - zend.h: - - PHP 5.0.3-dev - - * zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_opcode.c - zend_vm.h: - - Commit new VM architecture. This one allows people (aka Derick) to - - ask the engine to use function handler mode. Will update the README - - about that. - - * (PHP_5_0) - zend.h: - - Roll 5.0.2 - -2004-09-23 Ilia Alshanetsky - - * tests/bug20240.phpt: - Fixed test. - -2004-09-23 Marcus Boerger - - * zend_reflection_api.c: - Bugfix # 30209 - -2004-09-23 Andi Gutmans - - * tests/bench.php: - - Commit synthetic benchmark - -2004-09-23 Anantha Kesari H Y - - * zend_execute.c - zend_execute_API.c - zend_globals.h: - Reverted the NetWare Specific Stack limit related patches as asked by Andi - -2004-09-22 Anantha Kesari H Y - - * zend_execute_API.c - zend_globals.h: - NetWare specific stack limit checks - - * zend_API.c: - Aligned the ifdef NETWARE blocks to first column. - - * zend_execute.c: - Stack limit will be checked while executing the script - - * zend_config.nw.h: - To avoid redefinition (of free, alloca etc.) compilation errors in Zend. - - * zend_API.c: - When Apache is unloaded, it calls dlclose on all the PHP extensions - that are loaded in memory. In the case of Apache 1.3, this call is - blocking indefinitely. As a work around, this call is bypassed for Apache - 1.3 build on NetWare only. This means that none of the loaded PHP - extensions are unloaded. They will have to be manually unloaded before - re-loading the Apache 1.3 again. - - * zend.h: - defined ZEND_PATHS_SEPERATOR to semicolon for NetWare - - * acconfig.h: - enabled macros to call the proper LibC functions - -2004-09-22 Dmitry Stogov - - * zend_vm_handlers.h - zend_vm_spec.h: - Specializer was updated with executor's fixes. - - * zend_execute.c - zend_execute.c: - Fixed bug #29566 (foreach/string handling strangeness (crash)). - - * zend_execute.c: - Fixed bug in fix for bug #29707 - -2004-09-21 Andi Gutmans - - * zend_execute.c - zend_execute.h: - - Fix for bug #29707 - -2004-09-19 Marcus Boerger - - * zend_reflection_api.c: - Bugfix #30146 (ReflectionProperty->getValue() requires instance for static - property) - - * zend_reflection_api.c: - Bugfix #30148 (ReflectionMethod->isConstructor() fails for inherited - classes) - -2004-09-17 Stanislav Malyshev - - * zend_execute_API.c - zend_objects_API.c - zend_objects_API.h: - fix crash when dtor is fialing on shutdown - -2004-09-16 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Go with PHP 5.0.2RC1 - - * tests/bug27669.phpt: - - Add test for bug #27669 - -2004-09-16 Sebastian Bergmann - - * zend_language_parser.y: - ZTS fix. - -2004-09-16 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Fix bug #27669 (Dmitry). - Fixes: - - -2004-09-15 Ilia Alshanetsky - - * zend_operators.h: - MFH: Fixed a bug causing ".123" * "90" and alike to return a 0. - - * (PHP_5_0) - zend_operators.h: - Fixed a bug causing ".123" * "90" and alike to return a 0. - -2004-09-15 Derick Rethans - - * zend_config.w32.h: - - Windows support strcoll too. - -2004-09-13 Stanislav Malyshev - - * zend_execute.c: - Antony Dovgal's error message improvement - #27290 - -2004-09-11 Derick Rethans - - * zend_operators.c - zend_operators.h: - - MFB: Added the sorting flag SORT_LOCALE_STRING to the sort() functions - which - makes them sort based on the current locale. (Derick) - - * (PHP_5_0) - zend_operators.c - zend_operators.h: - - Added the sorting flag SORT_LOCALE_STRING to the sort() functions which - makes - them sort based on the current locale. (Derick) - -2004-09-11 Andi Gutmans - - * zend_operators.c: - - Resolve undefined behavior (joe at redhat) - -2004-09-10 Andi Gutmans - - * zend_compile.c: - - This one fixes rather strange problem - ZE allows multiple declarations - of the same class constant. - - It could be a minor BC break, but I'm sure it's a bug. (Antony Dovgal - aka tony2001) - -2004-09-09 Andi Gutmans - - * zend_extensions.h: - - Revert API bump - - * README.ZEND_VM: - - Commit VM explanation. - - * zend.c: - - Recommit - - * zend_API.c - zend_API.h - zend_compile.c: - - Recommit: - - Check signature of magic methods - - Register __get/__set/__call for internal classes - - * zend_extensions.h: - - Recommit: - - Bump the API number to work around this major breakage. - - * ChangeLog - zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_exceptions.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_opcode.c: - - Roll back VM commit - -2004-09-09 Marcus Boerger - - * zend.c: - - Drop namespace relict - - * (PHP_5_0) - zend_API.c - zend_API.h - zend_compile.c: - MFH signature check/method registration - - * zend_API.c - zend_API.h - zend_compile.c: - - Check signature of magic methods - - Register __get/__set/__call for internal classes - -2004-09-09 Derick Rethans - - * zend_extensions.h: - - Bump the API number to work around this major breakage. - -2004-09-09 Dmitry Stogov - - * zend_vm.h: - We will use CALL dispatch method for compilers other then GCC. It is more - safe. - -2004-09-09 Andi Gutmans - - * zend_API.c: - - Fix the fix. - -2004-09-06 Marcus Boerger - - * zend_objects.c: - - Fix handling of exceptions in dtors - -2004-09-05 Zeev Suraski - - * zend.c - zend.h - zend_ini_parser.y: - Fix reverse dependency - -2004-09-04 Andi Gutmans - - * zend_API.c: - - Don't destroy object when calling overloaded cast method in - - zend_parse_parameters() - -2004-09-02 Sebastian Bergmann - - * zend_compile.c: - Fugbix typo. - -2004-08-30 Marcus Boerger - - * (PHP_5_0) - ZEND_CHANGES: - MFH: Add some information about array overloading - - * ZEND_CHANGES: - Add some information about array overloading - -2004-08-30 Stanislav Malyshev - - * zend_execute.c: - fix crash #29893 - -2004-08-29 Marcus Boerger - - * zend_execute.c: - String offset starts with 0, fix isset($str[$len]) - - * (PHP_5_0) - zend_compile.c: - MFH: Bugfix #29882 isset crashes on arrays - - * zend_compile.c: - Bugfix #29882 isset crashes on arrays - -2004-08-27 Andi Gutmans - - * zend_alloc.c: - - Fix leak report for 0 byte allocations (Dmitry) - -2004-08-26 Marcus Boerger - - * (PHP_5_0) - zend_compile.c: - MFH: Enforce semantics: Classes cannot extend Interfaces - - * zend_compile.c: - Enforce semantics: Classes cannot extend Interfaces - - * tests/bug29828.phpt: - Fix test: Classes cannot extend Interfaces - - * zend_compile.c: - Drop doubled check - - * zend_compile.c: - - Bugfix #29828 Interfaces no longer work - - * tests/bug29828.phpt: - - Add new test - -2004-08-25 Andi Gutmans - - * zend_builtin_functions.c: - - Add interface_exists() and differentiate between classes and interfaces - (Andrey Hristov) - -2004-08-24 Marcus Boerger - - * zend_API.c: - - Add missing brackets - -2004-08-23 Marcus Boerger - - * zend_compile.c: - - Drop unused variable - - * zend_execute_API.c - zend_globals.h: - - Boost up __autoload() calls by caching the lookup - -2004-08-23 Andi Gutmans - - * zend_compile.c: - - Improve performance of switch() - -2004-08-23 Zeev Suraski - - * (PHP_5_0) - zend_reflection_api.c: - Fix names - -2004-08-21 Sara Golemon - - * zend_compile.c: - Bugfix#29777 Some compilers don't like // style comments - -2004-08-20 Sara Golemon - - * zend_ini_parser.y: - Fix compile - -2004-08-19 Andi Gutmans - - * zend_execute.c: - - Cleanup - - * zend.c - zend_execute_API.c - zend_globals.h: - - Second wave of garbage removal. - - * zend_compile.h - zend_execute.c: - - Stop using garbage. Please let me know if you find any bugs resulting - - of this patch (very likely). (Dmitry, Andi) - -2004-08-19 Marcus Boerger - - * zend_reflection_api.c: - - Implement #29728: Reflection API Feature: Default parameter value. - . ReflectionParameter::isDefaultValueAvailable() - . ReflectionParameter::getDefaultValue() - - * zend_reflection_api.c: - - Nedd to work on copy - -2004-08-18 Marcus Boerger - - * zend_reflection_api.c: - - Show default value of optional parameters of user defined functions. - -2004-08-18 Andrei Zmievski - - * zend_ini_parser.y: - Forgot to turn off debugging. - - * zend_ini_parser.y - zend_ini_scanner.l: - Re-add my patch for .ini variable access. - -2004-08-16 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH: Fix bug #29447: Reflection API issues - - * zend_reflection_api.c: - - Fix bug #29447: Reflection API issues - -2004-08-15 Marcus Boerger - - * zend_compile.c: - Remove unnecessary check - -2004-08-14 Marcus Boerger - - * zend_compile.c: - Add missing check - -2004-08-12 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to 5.0.2-dev - - * (PHP_5_0) - zend.h: - - Roll 5.0.1 - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.1RC2 - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Don't use magic numbers - - * zend_compile.c - zend_execute.c: - - Significantly improve performance of foreach($arr as $data). (Marcus) - -2004-08-11 Ilia Alshanetsky - - * zend_highlight.c: - MFH: Fixed bug #29607 (highlighting code with HEREDOC produces invalid - output). - - * (PHP_5_0) - zend_highlight.c: - Fixed bug #29607 (highlighting code with HEREDOC produces invalid output). - -2004-08-11 Marcus Boerger - - * zend_execute.c: - More meaningfull error message - -2004-08-11 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Patch to allow the Zend memory allocators to be disabled. - - * zend_alloc.h: - - Added missing defines. - -2004-08-10 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then - returning the value). - - * zend_highlight.c: - Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then - returning the value). - -2004-08-10 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.1RC1 - -2004-08-10 Marcus Boerger - - * zend_execute.c: - - Fix warnings - -2004-08-07 Andi Gutmans - - * zend_alloc.h: - - Commit Derick's patch for allowing Zend to use regular libc memory - - allocation functions. Mainly useful in conjunction with tools such as - - valgrind which enables us to find bugs we might not find with the - - current memory managers boundary protection. - -2004-08-05 Ilia Alshanetsky - - * zend_builtin_functions.c: - Eliminate unneeded variable. - -2004-08-04 Marcus Boerger - - * zend_reflection_api.c - tests/bug29523.phpt: - - Fix bug #29523 (ReflectionParameter::isOptional() is incorrect) - -2004-08-03 Marcus Boerger - - * ZEND_CHANGES: - Update - - * (PHP_5_0) - zend_builtin_functions.c - tests/bug29505.phpt: - - MFH Bug #29505 get_class_vars() severely broken when used with arrays - - * tests/bug29505.phpt: - - Add new test - - * zend_builtin_functions.c: - - Fixed Bug #29505 get_class_vars() severely broken when used with arrays - -2004-08-02 Marcus Boerger - - * zend_reflection_api.c: - - Add methods to check parameter count - - * (PHP_5_0) - zend_compile.c: - MFH Change to use memcmp instead of strcmp - - * zend_compile.c: - - Change to use memcmp instead of strcmp - -2004-08-02 Andi Gutmans - - * zend_compile.c: - - Fix typo - -2004-08-02 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - - Remove all for now - - * zend_compile.c - zend_compile.h - zend_execute_API.c: - MFB: Enforce protocol on magic methods/functions - -2004-08-02 Ilia Alshanetsky - - * (PHP_5_0) - zend_execute.c: - MFH: A gentler (performance wise) allocation of buffer for temp variables. - - * zend_execute.c: - A gentler (performance wise) allocation of buffer for temp variables. - -2004-08-01 Marcus Boerger - - * (PHP_5_0) - zend_compile.c - zend_compile.h - zend_execute_API.c: - - Enforce protocol on magic methods/functions - -2004-07-30 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_ptr_stack.c - zend_ptr_stack.h: - - More ptr_stack optimizations and cleanups - - * zend_alloc.c - zend_alloc.h - zend_execute.c - zend_fast_cache.h - zend_ptr_stack.h: - - Improve performance by inlining zend_ptr_stack_n_push(). var_args can - usually not be inlined by compilers. - -2004-07-29 Marcus Boerger - - * zend_hash.c: - - Increase performance of *sort() and some internal sort operations. - -2004-07-29 Sara Golemon - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Revert goto opcode - - * zend_execute.c: - &tmp and label are the same thing, don't free it till we're done with it. - - * zend_compile.c - zend_execute.c: - Plug some memory leaks and promote unknown label to E_ERROR. - If someone tries to jump to a non-existant label execution really - shouldn't try to carry on. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Add goto operator by popular request. - -2004-07-28 Wez Furlong - - * zend_ini.c: - Fix: ini entries for dl()'d modules now work under ZTS - Side-effect: avoid possible crashes when multiple threads load/unload - modules and mess with the global hash table. - -2004-07-28 Andi Gutmans - - * zend.h - zend.h: - - Fix MAC OSX to always use native DSO loading - -2004-07-27 Marcus Boerger - - * zend_exceptions.c: - - Be specific about visibility - -2004-07-27 Wez Furlong - - * zend_builtin_functions.c: - Fix two possible crashes. Latter is unlikely unless you are doing scary - things, but former looks nasty. - -2004-07-26 Stanislav Malyshev - - * zend_interfaces.c: - quick fix for #29382 - -2004-07-25 Marcus Boerger - - * zend_reflection_api.c: - - Show visibility errors (try to fix #29354) - - * (PHP_5_0) - zend_execute.c - zend_objects_API.c - zend_objects_API.h: - - MFH: Fix bug #29368 : The destructor is called when an exception is - thrown from the constructor - - * zend_execute.c - zend_objects_API.c - zend_objects_API.h: - - Fix bug #29368 : The destructor is called when an exception is thrown - from the constructor - - * zend.c - zend.h - zend_execute.h - zend_execute_API.c: - - Execute destructors earlier (Florian Schaper, fschaper at intux org) - - * zend_reflection_api.c: - - Add ReflectionParameter::isOptional() to test whether a parameter is - optional and also show this information in export. - - * zend_exceptions.c: - - Add optional parameters $filename and $lineno to ErrorException - constructor to allow overwriting automatically retrieved information. - -2004-07-23 Marcus Boerger - - * zend_execute.c: - Fix 0 Byte leak after alloca to emalloc change - -2004-07-22 Zeev Suraski - - * zend_object_handlers.c: - Fix bug in handling of protected properties - -2004-07-21 Edin Kadribasic - - * zend_builtin_functions.c: - Fixed build - -2004-07-21 Marcus Boerger - - * (PHP_5_0) - zend_builtin_functions.c: - MFH: Fixded #29291: get_class_vars() return names with NULLs - - * zend_builtin_functions.c: - - Fixded #29291: get_class_vars() return names with NULLs - -2004-07-20 Moriyoshi Koizumi - - * zend_alloc.c - zend_alloc.h: - - Add safe_pemalloc() - -2004-07-20 Marcus Boerger - - * zend_reflection_api.c: - - Fixed bug 28895 again (long live the dead) - -2004-07-20 Zeev Suraski - - * zend_exceptions.c: - Fix prototypes - - * zend_exceptions.c: - Add descriptions - -2004-07-20 Stanislav Malyshev - - * zend_compile.c: - add todo - - * (PHP_5_0) - zend_ini.h - zend_ini_parser.y: - export ini parser - -2004-07-19 Sebastian Bergmann - - * zend_reflection_api.c: - Fix prototypes: Reflection_* -> Reflection*. - - * zend_reflection_api.c: - Make ReflectionClass::getMethod() and ReflectionClass::getProperty() raise - an ReflectionException instead of returning NULL on failure. - - * zend_reflection_api.c: - Do not use contracted forms. - -2004-07-19 Stanislav Malyshev - - * zend_ini.h - zend_ini_parser.y: - export INI parser - - * zend_object_handlers.c: - __set and __get will be called not only when variable doesn't exist but - also when it's - invisible - -2004-07-19 Andi Gutmans - - * zend_extensions.h - zend_modules.h: - - Bump API number due to empty_string change - - * zend.c - zend.h - zend_API.h - zend_alloc.h - zend_execute.c - zend_object_handlers.c - zend_operators.c - zend_variables.c: - - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE() - used to return "" and not bool(false). It's not worth keeping it because - STR_FREE() and zval_dtor() always have to check for it and it slows down - the general case. In addition, it seems that empty_string has been - abused - quite a lot, and was used not only for setting zval's but generally in - PHP code instead of "", which wasn't the intention. Last but not least, - nuking empty_string should improve stability as I doubt every place - correctly checked if they are not mistakenly erealloc()'ing it or - calling efree() on it. - NOTE: Some code is probably broken. Each extension maintainer should - check and see that my changes are OK. Also, I haven't had time to touch - PECL yet. Will try and do it tomorrow. - -2004-07-18 Wez Furlong - - * zend_execute_API.c: - No point allocating 0 bytes - -2004-07-16 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - - Speed up by making null/false/true reserved word which allows to drop - an opcode (FETCH_CONSTANT) for every usage. - - * zend_execute.c: - Bugfix #28464 catch() does not catch exceptions by interfaces - -2004-07-16 Ilia Alshanetsky - - * zend_operators.h: - MFB: Fixed bug #28800 (strings beginning with "inf" improperly converted). - - * (PHP_5_0) - zend_operators.h: - Fixed bug #28800 (strings beginning with "inf" improperly converted). - -2004-07-15 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: - - Improve performance of zend_alloc by stopping the size from being a bit - - field. - -2004-07-15 Marcus Boerger - - * zend_exceptions.c - zend_exceptions.h: - - Add new class ErrorException to encapsulate errors in exceptions - - * zend_dynamic_array.h: - - Fix prototype - -2004-07-14 Stanislav Malyshev - - * zend_object_handlers.c: - be consistent with write_dimension - - * zend_object_handlers.c: - fix #28957 - -2004-07-13 Andi Gutmans - - * zend.h: - - 5.0.1-dev - -2004-07-13 Marcus Boerger - - * zend_constants.c: - Bugfix #29116 Zend constant warning uses memory after free (jdolecek at - NetBSD dot org) - -2004-07-13 Andi Gutmans - - * (php_5_0_0) - zend.h: - - Roll PHP 5.0.0 - -2004-07-12 Ilia Alshanetsky - - * (php_5_0_0RC4) - zend_execute.c: - Fixed bug #29086 & #28064 (PHP crashes on extremly long scripts). - -2004-07-12 Andi Gutmans - - * (php_5_0_0RC4) - zend.c: - - Convert zend_class_entry -> zend_class_entry * - -2004-07-10 Jon Parise - - * zend.c: - DragonFly BSD is derived from FreeBSD and requires the same floating point - precision fix. - -2004-07-10 Andi Gutmans - - * zend_alloc.c - zend_hash.c - zend_variables.c: - - Better stability during premature shutdown of request startup - -2004-07-05 Andi Gutmans - - * zend_mm.h: - - Disable zend_mm for 5.0.0 - -2004-07-03 Andi Gutmans - - * zend_alloc.c: - - Should fix mem leak with ZEND_MM. I made this change a while ago and - - rolled it back but I don't remember why. Please test! - -2004-07-01 Ilia Alshanetsky - - * zend_constants.c: - Do not use alloca() where it can be easily abused by the users. - - -2004-06-25 Wez Furlong - - * zend_stream.c - zend_stream.h: - export zend stream functions for zend extensions under windows - -2004-06-24 Sara Golemon - - * zend_execute.c: - Ease off on severity of new error (Using Resources as array offsets) - -2004-06-23 Sara Golemon - - * zend_execute.c: - BugFix #28879 Inconsistent behavior between explicit and implicit array - creation. - - Changes: - - Throw E_WARNING "Illegal offset type" when explicitly creating - array elements with objects, arrays, or resorces as indexes. - This matches implicit creation w/ obj/arr indices. - - Throw E_WARNING "Resource ID#%ld used as offset, casting to integer (%ld)" - when implicitly creating array with resource as index. (BC) - -2004-06-19 Sebastian Bergmann - - * zend_reflection_api.c: - Reflection_* -> Reflection*. Patch by Timm Friebe. - -2004-06-18 Sara Golemon - - * zend_execute.c: - Another typo in converting array index doubles to long. - -2004-06-18 George Schlossnagle - - * zend_builtin_functions.c: - fix for 28213. - - class_name and call_type should be reinitialized on every loop iter. - -2004-06-17 Sara Golemon - - * zend_builtin_functions.c: - String length in parse_parameters should be int - -2004-06-15 Marcus Boerger - - * zend_reflection_api.c: - - -2004-06-14 Marcus Boerger - - * zend_language_scanner.l: - Need {} here - -2004-06-10 Marcus Boerger - - * zend_language_scanner.l: - - Require a single white-space char after /** to start a doc comment that - way we prevent /*** from becoming a doc comment (as requested Derick). - - * zend_API.h: - Add missing declaration - - * zend_reflection_api.c: - Small code layout change - - * zend_language_scanner.l: - Do not require NEWLINE at start of doccomment - - * zend_reflection_api.c: - Bugfix #28699: Reflection api bugs - -2004-06-09 Marcus Boerger - - * zend_reflection_api.c: - Fix Bug #28694 ReflectionExtension::getFunctions() crashes PHP - -2004-06-07 Andi Gutmans - - * zend.h: - - Go back to -dev (Shouldn't need another RC) - - * (php_5_0_0RC3) - zend.h: - - Roll RC3 - -2004-06-06 Stefan Esser - - * zend_compile.h - zend_opcode.c: - Fixed Zend Function Destructor to use correct TSRM handle. - -2004-06-05 Marcus Boerger - - * zend_API.c: - Fix #28641: Instance of Interface - -2004-06-03 Andi Gutmans - - * (php_5_0_0RC3RC2) - zend.h: - - Prepare for RC3RC2 - -2004-06-02 Andi Gutmans - - * zend_mm.h: - - Don't use ZEND_MM in Windows - -2004-06-02 Stanislav Malyshev - - * zend_execute.c: - fix incdec - make value's refcount non-zero when passing to - write_property - otherwise __set caller cleanup could kill it. - -2004-06-01 Andi Gutmans - - * zend.c: - - If user error handler returns "false" then we relay to the built in error - handler - -2004-05-31 Marcus Boerger - - * zend_reflection_api.c: - Refcount must not be set separatley again. - - * zend_reflection_api.c - zend_reflection_api.c: - Add missing initialization - - * zend_compile.c: - - -2004-05-28 Andrei Zmievski - - * zend.c: - Allow user-defined error handlers to indicate whether default error - handler should be re-invoked, by returning true or false. - -2004-05-28 Marcus Boerger - - * zend_execute.c: - Prevent possible problems with illegal properties - -2004-05-28 Derick Rethans - - * zend_builtin_functions.c: - - Make the default mask for user defined error handlers include ALL errors, - including E_STRICT. - -2004-05-27 Andi Gutmans - - * zend.h: - - Back to RC3-dev until we roll final - - * (php_5_0_0RC3RC1) - zend_execute.c: - - Fix problem with exceptions returning from include(). (Dmitry) - - * (php_5_0_0RC3RC1) - zend.h: - - RC3RC1 - -2004-05-26 Wez Furlong - - * zend_object_handlers.c: - Fix leak on systems where alloca isn't really alloca. - -2004-05-26 Andrei Zmievski - - * zend_constants.c: - Avoid unnecessary and silly copying of constant name when registering. - -2004-05-26 Andi Gutmans - - * zend_alloc.c: - - Fix memory manager problem - -2004-05-26 Sebastian Bergmann - - * ZEND_CHANGES: - Update Reflection API class names. Whitespace fixes. - -2004-05-25 Andi Gutmans - - * zend_objects_API.h: - - Nuke unused decleration - - * zend_alloc.c - zend_alloc.h: - - More fixes - - * zend_alloc.c - zend_alloc.h: - - Make fix compile. - - * zend_alloc.c - zend_alloc.h: - - Fix memory leak in mem cache in conjunction with Zend MM. How come no one - - noticed this? :) - -2004-05-23 Andi Gutmans - - * zend_objects_API.c: - - Fix problem with object being destroyed more than once - - * zend_builtin_functions.c: - - Fix the following script (it crashed): - - -2004-05-20 Wez Furlong - - * zend_exceptions.c - zend_exceptions.h: - Revert; obviously I missed the function at the bottom of the file... - - * zend_exceptions.c - zend_exceptions.h: - Export this, so extensions may throw their own exception objects that - they have already instantiated. - -2004-05-18 Marcus Boerger - - * zend_API.c: - - Need to operate on module pointer in hash table - -2004-05-18 Wez Furlong - - * zend_execute_API.c: - Fix bug #28438: win32 build fails in non-zts mode - -2004-05-18 Stanislav Malyshev - - * zend_API.c: - Z_TYPE_P is for zvals - -2004-05-18 Wez Furlong - - * zend_API.c: - Register according to the type specified by the module. - (Helps to fix dl() bug) - -2004-05-18 Sara Golemon - - * zend_execute.c: - Bugfix#28404 When type is double we need to access dval, not lval - -2004-05-17 Andrei Zmievski - - * zend_ini_parser.y - zend_ini_scanner.l: - Revert the .ini vars patch. Will have to try again next Christmas - apparently. - - * zend_ini_parser.y: - Fix the apparent bug (; at the end of parse rule block). - -2004-05-17 Wez Furlong - - * zend_objects_API.c - zend_objects_API.h: - As discussed with Andi, add this helper API for setting the object pointer - from - within the constructor. - - Please read the comment for notes about how to use it; in general, you - don't - need it, so don't use it. - -2004-05-14 Andrei Zmievski - - * zend_ini_parser.y - zend_ini_scanner.l: - Adding ability to refer to existing .ini variables from within .ini - files. Example: - - open_basedir = ${open_basedir} ":/new/dir" - -2004-05-12 Marcus Boerger - - * zend_API.c: - - Centralize register and hash operations for startup/register_module - in new zend_register_module_ex(). - - * zend_API.c: - - Revert to 1.249 - -2004-05-11 Andi Gutmans - - * zend_compile.c: - - Don't allow passing NULL to type hinted parameter. - -2004-05-10 Zeev Suraski - - * zend_operators.c: - - Fix comparison of objects - - Clarify convert_object_to_type() - -2004-05-10 Stefan Esser - - * zend_alloc.c: - Checking MEMORY_LIMIT before doing emalloc/erealloc solves several ugly - problems. - -2004-05-04 Wez Furlong - - * zend_iterators.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Add count_elements handler for overloaded objects. - -2004-05-02 Andi Gutmans - - * zend_operators.c: - - Fix comparison of two objects in non-compatibility mode. - -2004-05-01 Marcus Boerger - - * zend_API.c: - Don't load modules twice - -2004-04-29 Stanislav Malyshev - - * zend_execute.c: - Fix bug #27876 - -2004-04-28 Marcus Boerger - - * zend_exceptions.h: - Fix c++ builds - -2004-04-27 Marcus Boerger - - * zend_builtin_functions.c: - - Optional parameter to class_exists() that can be used to bypass - __autoload() which can be helpfull in __autoload() itself. - - * zend_interfaces.c: - - Fix warnings - - * zend_interfaces.c - zend_interfaces.h - zend_iterators.h: - - no unneccessary retval initialization - - new c-level iterator handler invalidate_current that is optionally - used to clear internal caching like in implementation of Iterator - -2004-04-27 Andi Gutmans - - * zend_reflection_api.c: - - Fix prototypes - -2004-04-26 Marcus Boerger - - * zend_reflection_api.c: - Fix prototype - -2004-04-25 Marcus Boerger - - * zend_builtin_functions.c: - Skip correct amount of stack entries - - * zend_interfaces.c: - Capture potential problem by error message - - * zend_reflection_api.c: - Show number of classes - -2004-04-25 Andi Gutmans - - * zend.h: - - RC3-dev - - * (php_5_0_0RC2) - zend.h: - - RC2 - -2004-04-23 Andi Gutmans - - * zend_compile.c: - - Fixed bug #27923. foreach() without a key should not check if the key - - is a reference (Adam) - -2004-04-21 Andi Gutmans - - * zend.h: - - RC2-dev - - * (php_5_0_0RC2RC2) - zend.h: - - Prepare for RC2RC2 (if everything is OK especially Zeev's interface - - patch I'll roll RC2 tomorrow). - -2004-04-21 Zeev Suraski - - * (php_5_0_0RC2RC2) - zend_compile.c: - Restore fatal error in case a method that's supposed to implement an - interface/abstract method, breaks its prototype - -2004-04-20 Andi Gutmans - - * zend_language_parser.y: - - Fix bug #27283 - Exceptions where the last catch() statement was - sometimes - - skipped. - -2004-04-19 Marcus Boerger - - * zend_reflection_api.c: - show ini entries and classes for extensions. - -2004-04-17 Marcus Boerger - - * zend.c: - Retval may not be set when zend_execute() is overloaded - -2004-04-15 Marcus Boerger - - * zend_execute.c: - Handle failure in get_current_data - -2004-04-14 Andi Gutmans - - * zend_extensions.h: - - Add comment - - * zend.h: - - RC2-dev - - * (php_5_0_0RC2RC1) - zend.h: - - RC2RC1 - -2004-04-13 Marcus Boerger - - * zend_exceptions.c: - Classnames shall start with an uppercase character - -2004-04-13 Zeev Suraski - - * zend_builtin_functions.c: - Fix debug_backtrace to show arguments again - We need to merge code from debug_backtrace & debug_print_backtrace at - some point! - -2004-04-13 Andi Gutmans - - * zend_extensions.h: - - Fix API no of Engine 2. The first number is the engine version and the - - rest is the API_NO. This way engine2_api_no is always greater than - - engine1_api_no. - - * zend.c - zend_exceptions.c - zend_exceptions.h: - - Add hook for exception handler (Derick) - -2004-04-12 Marcus Boerger - - * zend_API.h: - Fix order of macro parameter (synch with other macros) - -2004-04-12 Andi Gutmans - - * OBJECTS2_HOWTO - zend_extensions.h - zend_ini.c - zend_ini.h - zend_modules.h: - - modifyable -> modifiable - -2004-04-09 Andi Gutmans - - * zend_object_handlers.c: - - Fix bug #26441 (When __set() returned a value it corrupted it) - -2004-04-08 Marcus Boerger - - * zend_reflection_api.c: - Bugfix #27519 Reflection_Function constructor crashes with non-existant - function's name - -2004-04-07 Andi Gutmans - - * zend_builtin_functions.c: - - Hopefully fix the debug_backtrace() code. - - * zend_builtin_functions.c: - - Fix crash bug in zend_debug_backtrace(). No idea how come this survived - - for so long.... - -2004-04-04 Ilia Alshanetsky - - * zend_objects_API.c: - Removed unused variable. - -2004-04-03 Andi Gutmans - - * zend_builtin_functions.c: - Patch by Timm Friebe: - It changes - set_exception_handler() to accept the pseudo-type "callable" (instead of - a string referring to a global function). - - - Examples: - set_exception_handler('function_name'); - set_exception_handler(array('class_name', 'static_method')); - set_exception_handler(array($instance, 'instance_method')); - - - This also makes set_exception_handler() more consistent with all the - other callback functionality, e.g. set_error_handler(). - - * zend_operators.c: - - Nuke more old junk - - * zend.h - zend_operators.c - zend_operators.h: - - Nuke code which hasn't been in use for ages. - -2004-04-01 Ilia Alshanetsky - - * zend_builtin_functions.c: - MFB: Revert patch for bug #27782. - - * zend_execute.c - tests/bug27731.phpt: - Fixed reversed condition for error reporting. - -2004-03-31 Dmitry Stogov - - * zend_execute.c: - Fixed BUG in zend_post_incdec_property - -2004-03-31 Andi Gutmans - - * zend_reflection_api.c: - - Fix typo - -2004-03-30 Marcus Boerger - - * tests/bug26695.phpt: - Fix test - -2004-03-30 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #27782 (Wrong behaviour of next(), prev() and each()). - -2004-03-30 Marcus Boerger - - * zend_reflection_api.c: - TSRM fix - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_globals.h - zend_reflection_api.c: - - Fix Reflection class names - - Add ability to get the extension an internal class was defined in - -2004-03-29 Marcus Boerger - - * acconfig.h: - NAN==NAN doest work (Ard) - - * zend_builtin_functions.c: - Allow mixed case search for extensions - -2004-03-29 Sebastian Bergmann - - * zend_execute.c: - -clonning+cloning - -2004-03-29 Dmitry Stogov - - * zend_execute.c: - Implicit clonning strict warning was added for ze1_compatibility_mode - -2004-03-29 Ilia Alshanetsky - - * zend_execute.c - tests/bug27731.phpt: - Fixed bug #27731 (error_reporting() inside @ block fails to set - error_reporting level). - -2004-03-28 Marcus Boerger - - * zend_API.c: - Use lowercasing here - - * zend.c: - Initialize the complete struct - -2004-03-28 Stanislav Malyshev - - * zend_language_parser.y: - check writability on =& too - - * zend_execute.c: - - call set handler if assigning to object having this handler - - cleanup: use macros to access object internal vars - - * zend_interfaces.c: - preserve ZEND_API in definition - - * zend_interfaces.h: - declare as extern - -2004-03-28 Marcus Boerger - - * zend_reflection_api.c: - Fix memleak found by Timm - -2004-03-28 Stanislav Malyshev - - * zend_operators.c: - centralize object-to-scalar conversion, make it work with get handler - - * zend.c: - try get handler on printable conversion - - * zend_object_handlers.h: - some more clear comments - - * zend_operators.c: - Use macros for object parts access - -2004-03-28 Dmitry Stogov - - * zend_execute_API.c: - fix of fix related to __autoload. (ext/standard/tests/network/bug20134.phpt - passes again) - -2004-03-27 Marcus Boerger - - * zend.c: - Even though it is uncommented it should be right - -2004-03-26 Marcus Boerger - - * zend_API.c - zend_compile.c: - Force destructors to have empty signatures - -2004-03-26 Andi Gutmans - - * zend_execute.c: - - Fix build (thanks to Timm) - -2004-03-25 Derick Rethans - - * zend_language_scanner.l: - - Remove old and deprecated scanner token. - -2004-03-25 Andi Gutmans - - * zend_compile.c: - - If __construct() is defined then it will always take precedence over - - old style constructors. - -2004-03-25 Stanislav Malyshev - - * zend_execute.c: - no need to use result for RECV's - as in PHP4 - - * zend_execute.c: - Use get/set handlers for increment.decrement ops on objects - -2004-03-25 Andi Gutmans - - * zend_execute_API.c: - /* The compiler is not-reentrant. Make sure we __autoload() only during - run-time - * (doesn't impact fuctionality of __autoload() - */ - -2004-03-25 Dmitry Stogov - - * zend_execute_API.c: - Using ALLOC_HASHTABLE/FREE_HASHTABLE instead of emalloc/free. - -2004-03-24 Dmitry Stogov - - * zend.c - zend_execute_API.c - zend_globals.h: - New autoload protection schema was implemented (Using HashTable instead of - boolean flag) - -2004-03-24 Derick Rethans - - * zend_operators.c: - - Revert bogus commit - - * zend_operators.c: - - Fixed NEWS - -2004-03-24 Dmitry Stogov - - * tests/bug27641.phpt: - Fixed bug #27641 (Object cloning in ze1_compatibility_mode was - reimplemented) - - * zend_execute.c - zend_variables.c: - Object cloning in ze1 compatibility mode (zend.ze1_compatibility_mode) was - reimplemented (Dmitry, Andi) - -2004-03-22 Andi Gutmans - - * zend_compile.c: - - Fix bug - - * zend_execute.c: - - Remove whitespace - -2004-03-21 Andi Gutmans - - * zend_execute.c: - - Improve consistency - -2004-03-21 Stanislav Malyshev - - * zend_objects_API.c - zend_objects_API.h: - return zval *, to make it useful for read_property - - * zend_objects_API.c: - update to new API - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - API change for read_property: - instead of bool silent it now gets fetch type - This can be used for creating proxy objects for write contexts - -2004-03-21 Andi Gutmans - - * zend_execute.c: - - Nuke unused code - -2004-03-18 Andi Gutmans - - * zend.h: - - Back to RC2-dev - -2004-03-18 Zeev Suraski - - * (php_5_0_0RC1) - zend.h: - Prepare to roll RC1 - - * (php_5_0_0RC1) - zend_execute.c: - Fix possible data corruption with __set() - -2004-03-18 Stanislav Malyshev - - * zend_execute.c: - Improve error message - on E_STRICT, method is actually called, - so the error shouldn't say it cannot be called. - -2004-03-18 Andi Gutmans - - * (php_5_0_0RC1) - zend_compile.c: - - Change redefinition of constructor from E_COMPILE_ERROR to E_STRICT. - - * (php_5_0_0RC1) - ZEND_CHANGES: - - Update Changes - -2004-03-17 Sascha Schumann - - * zend_multiply.h: - Readd x86 implementation - -2004-03-17 Andi Gutmans - - * (php_5_0_0RC1RC2) - zend_multiply.h: - - Improved patch for support multiplication on 64bit machines - - * (php_5_0_0RC1RC2) - zend_execute.c: - - Fix tiny bug (one of the reasons we can't support __toString() for - - regular objects). - - * (php_5_0_0RC1RC2) - zend.c: - - Stop make_printable_zval() from calling __toString() - - * zend_execute.c: - - Fixed problem with __toString(). Due to the engine's architecture it is - - currently not possible to call __toString() anywhere besides print & - eval. - - Follow up will be on internals@ - -2004-03-17 Stanislav Malyshev - - * (php_5_0_0RC1RC2) - zend_compile.c: - fix typo - -2004-03-17 Andi Gutmans - - * zend_multiply.h - zend_operators.c: - - Apply Ard's patch to support multiplication & overflow on both 32bit - and 64bit machines - -2004-03-16 Derick Rethans - - * zend.c - zend.h - zend_API.h - zend_modules.h: - - Replaced the exec_finished hook by the zend_post_deactive hook for - extensions. The new hook will be run after the symbol table and - destructors - are run. (Derick) - - * zend_modules.h: - - Bump API number so that it actually differs from PHP 4. This is needed - because we don't want PHP 4 and PHP 5 extensions to be in the same - directory - when doing "make install" for shared, or phpize'd extensions. - -2004-03-16 Marcus Boerger - - * zend_execute_API.c: - Fix SEGV in certain conditions while calling static methods - -2004-03-16 Zeev Suraski - - * zend_compile.c - zend_compile.h: - Add ability to disable JIT for a particular auto global - -2004-03-16 Marcus Boerger - - * zend_execute_API.c: - TSRM fix - -2004-03-16 Sascha Schumann - - * zend.h: - Enable ptr format check for GCC 3.1 and higher - -2004-03-16 Ilia Alshanetsky - - * zend.h: - Do not allow 3.0.4 for __attribute__. - - * zend.h: - Fixed bug #27600 (GCC 3.0.4 does not like __attribute__ directive) - -2004-03-16 Andi Gutmans - - * zend_compile.c: - - Fix problem when using old-style constructors it wasn't being inherited - correctly. - -2004-03-16 Derick Rethans - - * zend_execute_API.c: - - Spaces to tabs - -2004-03-16 Andi Gutmans - - * zend_execute_API.c: - - If the called method is static then don't define $this - - * zend_execute.c - zend_execute_API.c: - - Error out if get_method() isn't defined. - - Use calling scope of internal function callee when calling a method - using static syntax (array("A", "func")); - -2004-03-16 Marcus Boerger - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Improve error message - -2004-03-15 Andi Gutmans - - * zend_operators.c: - - Restore E_NOTICE for longs and doubles. - -2004-03-15 Jani Taskinen - - * zend.h: - - Fixed bug #24582 (extensions can not be loaded dynamically in - Solaris/iPlanet) - -2004-03-15 Andi Gutmans - - * zend_operators.c: - - Nuke E_NOTICE. This caused a notice when doing if ($obj == NULL) - -2004-03-14 Marcus Boerger - - * zend_builtin_functions.c: - Make object parameter optional - -2004-03-14 Ilia Alshanetsky - - * zend.c: - Fixed bug #27590 (crash during shutdown when freeing persistent resources - in ZTS mode). - -2004-03-14 Andi Gutmans - - * zend_execute_API.c: - - Fix windows build - - * zend_execute_API.c: - - Fix for bug #27504 - - * zend_builtin_functions.c: - - Fixing bug #27123 - - * zend_operators.c: - - Improve compatibility mode and compare objects according to property - - comparison (sucky but this is how PHP 4 behaved). - - * zend.c: - - Fix flow of logic - - * zend_operators.c: - - Support old style of converting objects to long/double/bool. - - This is only enabled in compatibility mode, else it calls cast_object() - - and if that is not available we return 1 (true) so that the following - - code would work: - if ($obj) { - } - -2004-03-14 Marcus Boerger - - * zend_operators.c: - Fix: Add return type void - -2004-03-14 Andi Gutmans - - * zend.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - - Support Cast operator in convert_to_* so that we support internal - - extensions such as SimpleXML. This is for Sterling. - - * zend_operators.c: - - Fix memory leak in the following code (Dmitry): - - - * zend_operators.c: - - Initial commit which allows comparing overloaded objects with native - - types (only for internal classes and not for user-land classes). - -2004-03-11 Andi Gutmans - - * zend_objects_API.c: - - Real fix for bug #27535 (Dmitry) - - * zend_objects_API.c: - - Attempt to fix bug #27535 - -2004-03-09 Marcus Boerger - - * ZEND_CHANGES: - Rename hasMore() to valid() as discussed. (Part VI) - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_interfaces.c - zend_language_parser.y - zend_reflection_api.c: - Clearify the different method/class flags (as discussed with Andi). - - * zend.h: - No longer needed - -2004-03-09 Andi Gutmans - - * zend_constants.c: - - Fix crash: - - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Nuke unused code. - -2004-03-08 Marcus Boerger - - * zend_execute.c - zend_interfaces.c - zend_iterators.h: - Rename hasMore() to valid() as discussed. (Part II) - - * zend_interfaces.c: - Rename hasMore() to valid() as discussed. (Part I) - - * zend_execute_API.c: - Check count. - - * zend_reflection_api.c: - Add another missing conversion - -2004-03-05 Andi Gutmans - - * zend_compile.c: - - Fix some small problems I introduce in last patch. - - * zend_compile.c: - - Finally fix the following: - $xml_mem = - simplexml_load_string('1'); - /* The following works fine */ - foreach ($xml_mem->part as $part) { - foreach($part->chapter->page as $page) { - print $page; - } - } - /* The following segfaults */ - foreach ($xml_mem->part as $part) { - foreach($part->chapter as $chapter) { // Difference here from previous - example - print $chapter; - } - } - -2004-03-04 Moriyoshi Koizumi - - * zend_language_scanner.l: - - Fix memleak when scanner is called from within tokenizer extension. - -2004-03-04 Stanislav Malyshev - - * zend_execute.h: - fix the fix - - * zend_execute.h: - oops, fix cut&paste gone bad - - * zend_execute.h: - Fix object true value: if we are in compat mode and it's Zend object - - use PHP4 rules. Otherwise, object is always true. - -2004-03-04 Derick Rethans - - * zend_constants.h - zend_operators.h: - - Fixed a 64bit issue (for zend_builtin_functions.c, module_number is an - int). - - Change the MAX_LENGTH_OF_LONG constant to 20, as LONG_MAX is 20 - characters. - (Patches by Ard Biesheuven) - - * tests/zend_operators.phpt: - - Added instance_of test (patch by Ard Biesheuvel) - -2004-03-04 Stanislav Malyshev - - * zend_compile.c: - Disallow redefining ctors and cleanup - - * zend_mm.c: - Handle out of memory/bad size situation gracefully, without getting into - loop - -2004-03-03 Andi Gutmans - - * zend_objects_API.c: - - Fix crash: - x as $x); - } - } - new foo(); - echo 'OK'; - ?> - -2004-03-02 Marcus Boerger - - * zend_API.c - zend_API.h: - Fix zend_parse_method_parameters_ex() and make it consistant with - zend_parse_method_parameters(). - -2004-03-02 Andi Gutmans - - * zend_compile.c: - - Fix leaks (although there might be still a problem here). - - * zend_execute.c: - - Fix leak (Dmitry) - - * zend_compile.c: - - Fix crash in: - attributes as $name => $attr) { - } - } - } - - $f= new Foo(); - $f->export(); - ?> - - * zend_objects.c: - - Improve fix for protecting destructor's from exceptions. - - I was killing the current exception completely which was wrong. - -2004-03-01 Andi Gutmans - - * zend_objects.c: - - Fix crash in destructors(). You can't throw an exception in destructors - as there is no guaranteed time when the destructor will be called. - - * zend_reflection_api.c: - - Fix leak - - * zend_reflection_api.c: - - Fix crash in reflection API (pierre) - - * zend.c - zend_exceptions.c - zend_execute_API.c: - - Fix crash in exception handling (zend_exception_error(...) and - zend_eval_string_ex() were buggy (Dmitry, Andi) - -2004-03-01 Derick Rethans - - * zend_compile.h: - - Typo fix (by Jan) - - * zend_builtin_functions.c: - - Fixed bug #27443 (defined() returns wrong type). - -2004-02-29 Andi Gutmans - - * zend_reflection_api.c: - - Apply fixes by Timm. - - * zend_compile.c: - - Change prototype isA check not to check the constructor. - - Only give an E_STRICT for non-isA compliant code as opposed to - E_COMPILE_ERROR. - -2004-02-29 Stanislav Malyshev - - * zend_compile.h: - add ZEND_API there too for opcode handlers - -2004-02-29 Derick Rethans - - * zend_execute.c: - - Initialize memory to \0 so that we can reliable detect whether a specific - opcode element is in use. - -2004-02-29 Stanislav Malyshev - - * zend_execute.c: - export opcode table - -2004-02-27 Marcus Boerger - - * zend_API.c - zend_compile.h: - Add some comments - - * zend_API.c - zend_compile.c - zend_execute.c: - Fixes for abstract classes/methods - -2004-02-26 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - Fix __METHOD__ (noticed by Davey Sahfik) - - * zend_reflection_api.c: - Fix problem with Reflection_Property (patch from Timm slightly modified). - -2004-02-25 Marcus Boerger - - * zend_objects_API.c: - As Andi found out the dtor may increase the refcount. - -2004-02-25 Jani Taskinen - - * zend_builtin_functions.c: - ws + cs - -2004-02-25 Zeev Suraski - - * zend_compile.c - zend_execute.c: - Fix leak in foreach ($o->mthd()->arr) - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - - Improve ARG_INFO() macros to support supplying required_num_args - - Initial fix for foreach($o->mthd()->arr) crash (now leaks) - -2004-02-25 Derick Rethans - - * zend_highlight.c: - - Use instead of in highlight_string(). (Patch by - mg@iceni.pl) - -2004-02-25 Jani Taskinen - - * zend_exceptions.c: - Improve error messages - -2004-02-25 Zeev Suraski - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_variables.c: - - Rename compatiblity mode to zend.ze2_compatibility_mode (it doesn't - only affect auto-clone). - - Perform implementation checks even with simple inheritance (off when - compatibility mode is enabled). - - Restore default arguments in interfaces and handle it correctly. - - Move registration of internal classes later in the startup sequence - in order to have INI options available. - -2004-02-25 Derick Rethans - - * zend_exceptions.c: - - Fixed bug #27391 (typo in Fatal Error message). - -2004-02-25 Zeev Suraski - - * zend_API.c - zend_compile.c - zend_compile.h - zend_opcode.c: - - Abstract methods cannot have defaults for arguments - - Make function foo($a, $b=null) satisfy both foo($a) and foo($a, $b) - prototypes - -2004-02-25 Sebastian Bergmann - - * zend_reflection_api.c: - Proto fixes. - -2004-02-25 Marcus Boerger - - * zend_objects_API.c: - Fix object destruction/free in shutdown - - set destructor_called even when no dtor is given - - use free_storage even when no dtor hat to be called - - * zend_objects_API.c: - Checking once for dtor is enough - -2004-02-24 Marcus Boerger - - * zend_API.c: - Fix class flags when handling abstract methods - -2004-02-23 Andi Gutmans - - * zend_language_parser.y: - - Improve precendence: - - foo = "Blah"; - - if (!$obj instanceof StdClass) { - print "No"; - } else { - print "Yes"; - } - - * zend_language_parser.y: - - Decrease precedence of instanceof so that the following is true: - php -r 'var_export((object)1 instanceof stdClass);'; - Patch by Jan Lehnardt - -2004-02-22 Derick Rethans - - * zend_operators.c: - - Fixed bug #27354 (Modulus operator crashes PHP). - -2004-02-22 Marcus Boerger - - * ZEND_CHANGES: - Add some more obviously needed information - -2004-02-20 Hartmut Holzgraefe - - * zend.h - zend_API.h - zend_iterators.h - zend_operators.h - zend_variables.h: - more EXTERN_C wrapping of ZEND_API prototypes - -2004-02-20 Jani Taskinen - - * zend_opcode.c: - ws fix - -2004-02-18 Hartmut Holzgraefe - - * zend.h - zend_builtin_functions.h - zend_extensions.h - zend_indent.h - zend_interfaces.h - zend_object_handlers.h - zend_objects.h - zend_objects_API.h - zend_ptr_stack.h - zend_stack.h - zend_stream.h: - wrap ZEND_API prototypes into BEGIN_EXTERN_C/END_EXTERN_C - for C++ extension support - -2004-02-18 Zeev Suraski - - * zend.c: - Forward-port fixlet from PHP 4 (thanks to Michael Sisolak) - -2004-02-17 Jani Taskinen - - * zend_list.c: - MFB: - Fix bug #26753 (zend_fetch_list_dtor_id() does not check NULL - strings) - -2004-02-16 Derick Rethans - - * ZEND_CHANGES: - - Clearify clone behavior, fixed clone example (Patch by Jan Lehnardt) - -2004-02-16 Marcus Boerger - - * zend_compile.c: - Bugfix #27227 Mixed case class names causes Fatal Error in Constructor call - -2004-02-14 Marcus Boerger - - * zend_iterators.c: - dtor's may not be called from free_storage handlers - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_execute.c: - - Remove old code - -2004-02-12 Hartmut Holzgraefe - - * (php_5_0_0b4) - ZEND_CHANGES: - making sure that the provided examples actualy work (or at least do not - generate no parse errors) unless they are really expected to fail - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_object_handlers.c: - - This was too strict. - -2004-02-12 Zeev Suraski - - * (php_5_0_0b4) - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_interfaces.c - zend_object_handlers.c: - - Check return-by-reference bit when implementing interface prototypes - - Add infrastructure for built-in functions to hint whether they - return by reference or not. It is NOT currently used for anything, - except for interface prototypes (you can use it to request that the - function that implements your prototype returns by reference or - doesn't return by reference). - For downwards compatibility - by default, interface prototypes are - agnostic as to whether the function that implements them returns - by reference or not. Use ZEND_BEGIN_ARG_INFO_EX() with - ZEND_RETURN_VALUE/ZEND_RETURN_REFERENCE to change that. - - Fix ArrayAccess::getOffset() to conduct additional checks. - If your getOffset() should work with multidimensional arrays - it - must return by reference. - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_object_handlers.h: - - Add comments to read/write property/dimension for extension authors - -2004-02-12 Zeev Suraski - - * zend_default_classes.h: - zend_default_classes.h -> zend_exceptions.h - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - Makefile.am: - - Add zend_exceptions.c - -2004-02-12 Zeev Suraski - - * (php_5_0_0b4) - ZendTS.dsp - zend.c - zend_default_classes.c - zend_exceptions.c - zend_exceptions.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_reflection_api.c: - Centralize exceptions code in zend_exceptions.[ch]. - Remove zend_default_classes.h (use zend_exceptions.h instead) - - NOTE: This currently breaks the build, fixes to php-src and pecl coming - soon - -2004-02-12 Andi Gutmans - - * zend_execute.c: - - Use zend_throw_exception_object() in throw_handler to make sure it - - does all the checks - -2004-02-12 Zeev Suraski - - * zend_default_classes.c - zend_default_classes.h - zend_exceptions.c - zend_exceptions.h - zend_execute.h - zend_execute_API.c: - Exceptions updates: - - - Enforce exceptions to be derived from class Exception. This allows - users to perform catch-all. It's not yet complete, so don't get - comfortable with it just yet :) Updates are coming soon. - - Implement zend_throw_exception() using zend_throw_exception_ex() - -2004-02-12 Andi Gutmans - - * zend_execute.h - zend_execute_API.c: - - Add API function to throw exception by using an object - -2004-02-11 Marcus Boerger - - * zend.c: - Must be initialized in ZTS mode - - * ZEND_CHANGES - ZEND_CHANGES: - Update - - * zend_compile.c - zend_language_parser.y: - Fix: [extends [, ]* ] - -2004-02-11 Zeev Suraski - - * zend_execute.c: - Fix leaks in assignments to overloaded objects - - * zend_execute.c: - Fix leak with overloaded objects, when they're used just "for the hell - of it" :) - - * zend_execute.c: - Fixed a bug the caused overloaded array indices to be converted to strings - - * zend_execute.c: - Turn off bogus warnings with overloaded dimensions and += (and friends) - - * zend_execute.c: - Improve the implementation of unset() on array dimensions to be more - consistent with that of regular variables and string offsets - - * zend_execute_API.c: - Fix bug #25038 - - * zend_reflection_api.c: - Fix crash (patch by Rob Richards) - - * zend.c - zend_execute_API.c: - Fix exceptions thrown without a stack frame - Always enable set_exception_handler() - - * zend_list.h: - Change FETCH_RESOURCE to return false on error instead of null, for - consistency with other error situations - - * zend_compile.c: - Fix bug #26802 (the right aspects of it found by Marcus, anyway :) - - * tests/bug26802.phpt: - Fix and clarify the test case - - * zend_execute_API.c: - Complete the fix for handling of exceptions happening during the - argument passing phase of function calls (fixes bug #26866) - - * zend_execute_API.c: - whitespace - -2004-02-10 Zeev Suraski - - * tests/bug26698.phpt: - Ignore the memleak in this test - - * zend_execute.c: - Fix bug #26698 (exceptions handled properly during argument passing to - functions) - - * zend_default_classes.c: - Fix bug #27186 - - * zend_execute_API.c: - Fix bug #26869 - - * zend_execute.c: - Fix refcounting of ++/+= overloading (fix leak in __get()/__set() - based classes) - -2004-02-10 Andi Gutmans - - * zend_compile.c: - - Nuke more unused code - -2004-02-10 Zeev Suraski - - * zend_execute.c: - Fix handling in assignment using multidimensional array syntax to string - offset ($s = "FUBAR"; $s[0][0] = 1;) - -2004-02-10 Andi Gutmans - - * ZEND_CHANGES: - - We will go with PHP 4 behavior. With the new object model assigning by - reference has lost a lot of its importance. - - * zend_compile.c: - - Remove junk - -2004-02-10 Zeev Suraski - - * zend_execute.c: - Fix exception handling in opcodes spanned across multiple oplines (fixes - the crash in __set()) - - * zend_execute.c: - - Fix pre/post increment for overloaded objects - - Fix binary-assign-op for overloaded objects - - NOTE: This requires the implementation of the 'get' callback! - -2004-02-10 Moriyoshi Koizumi - - * tests/bug22836.phpt: - - Correcting test. - -2004-02-08 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Fix write-mode of overloaded objects when using array dimensions - -2004-02-08 Andi Gutmans - - * zend_objects_API.c: - - Check if free_storage exists - -2004-02-05 Sebastian Bergmann - - * ZEND_CHANGES: - Committing for Jan. - -2004-02-05 Ilia Alshanetsky - - * zend_compile.c - tests/bug27145.phpt: - Fixed bug #27145 (Unmangle private/protected property names before printing - then inside error messages). - -2004-02-04 Zeev Suraski - - * zend_execute_API.c: - Fix exceptions happening inside internal functions called through - zend_user_function() - - * zend_execute_API.c: - Remove double initialization - -2004-02-04 Marcus Boerger - - * zend_objects.h: - Add new prototype - - * zend_reflection_api.c: - Fix reflection - - * zend_iterators.c: - Fix warnings - -2004-02-04 Zeev Suraski - - * zend_compile.c: - Fixlet - - * zend_compile.c: - Fix handling of $this in some cases - - * zend_compile.c: - Handle additional cases - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_language_parser.y: - Reinstate early-binding for classes. - - Note that this is available for downwards compatibility only - and it - doesn't - work if you use new features (namely, interfaces). Generally, people - should - declare their classes before using them, but we just didn't want hell to - break - loose (c) - - * zend_opcode.c: - Optimize - - * zend_compile.c: - - Improve $this assignment detection and generalize some code in - zend_compile.c - - * zend_compile.c: - -Error out when trying to re-assign $this - - * zend_objects_API.c - zend_objects_API.h: - The valid bit was necessary after all - restored - - * zend_objects_API.c: - Fixlets - - * zend_compile.c - zend_objects.c: - - Small fixes - - * zend_execute.c: - - Improve wording - - * zend_execute_API.c - zend_iterators.c - zend_objects.c - zend_objects_API.c - zend_objects_API.h - zend_reflection_api.c: - Change destructor implementation (details will follow on internals@) - -2004-02-03 Marcus Boerger - - * tests/bug24884.phpt: - Update tests - - * zend_objects.c: - Nuke unused variable - - * zend_compile.c: - Fix Warning - -2004-02-03 Sebastian Bergmann - - * ZEND_CHANGES: - clone/__clone() related changes. - -2004-02-03 Zeev Suraski - - * zend_compile.c: - Remove unused variable - - * zend_objects_API.c - zend_objects_API.h: - Remove more garbage - valid bit was not really necessary - - * zend_execute_API.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c - zend_objects_API.h: - - Clean garbage (delete was nuked a long time ago) - -2004-02-03 Ilia Alshanetsky - - * zend_execute.c: - More unneeded code removed. - -2004-02-03 Zeev Suraski - - * zend_execute.c - zend_language_scanner.l: - Abort on parse error in an include file (patch by Ilia) - - * zend_compile.c: - Remove redundant code - - * zend_execute.c: - Fix try/catch block logic - - * zend_compile.c - zend_objects.c: - Perform a bitwise copy of the object even when __clone() is defined. - __clone() is back to not requiring any arguments, as $that is no longer - needed ($this already contains a copy of the original object, by the time - we __clone() is executed). - Calling the parent clone is done using parent::__clone() - - * zend_compile.c - zend_compile.h - zend_default_classes.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Rewrote exception support. Fixes a few limitations and bugs in the old - implementation, and allows exceptions to 'fire' much earlier than before. - - Instructions on how to use the new mechanism will follow on internals@ - shortly... - - Note - this (most probably) breaks the current implementation of - set_exception_handler() - -2004-02-02 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_language_scanner.l - zend_objects.c: - Redesign the clone() feature to fix some fundamental flaws in the previous - implementation. - - Using clone directly is now done using - $replica = clone $src; - - Clone methods must now be declared as follows: - function __clone($that) - { - } - - Clone methods in derived classes can call the __clone method of their - parent - classes using parent::__clone($that) - -2004-01-31 Marcus Boerger - - * zend_reflection_api.c: - Throw an exception in case a reflection object cannot be found and do not - override the exception from constructors in static method calls. - -2004-01-30 Ilia Alshanetsky - - * zend_execute.c: - Apply the same parse error handling to (include|require)_once as the one - for - their non-once counterparts. - -2004-01-28 Zeev Suraski - - * zend_compile.c: - Tweak checks to detect some additional cases. - Reorder checks to make more sense. - - * zend_compile.c: - - Error message fix - - Prevent inheritance of the same constant from two interfaces - - * zend_compile.c: - Fixlets - - * zend_compile.c - zend_compile.h: - Prevent classes from implementing interfaces that have the same function - - * zend_execute.c: - Whitespace - - * zend_compile.c: - Code relayout - - * zend_execute_API.c: - Forward-port fix for timeouts under Windows - -2004-01-26 Marcus Boerger - - * zend_interfaces.c - zend_interfaces.h: - - Export struct zend_user_iterator - - Ad 'it' to function prefix to prevent naming clashes - - Export zend_user_it_free_current - -2004-01-25 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #26814 (On parse error include included file, terminate - execution script). - -2004-01-25 Marcus Boerger - - * zend_execute.c - zend_iterators.c - zend_iterators.h: - Respect proeprty visibility in foreach - - * tests/bug26696.phpt: - Update test - -2004-01-24 Marcus Boerger - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Switch from ZEND_ACC_DYNAMIC to ZEND_ACC_ALLOW_STATIC and disallow calling - internal non-static methods statically. - -2004-01-24 Sebastian Bergmann - - * zend_execute.c - zend_execute_API.c: - Change message as proposed by Jon. - -2004-01-23 Marcus Boerger - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Simplify detection of methods that must be called dynamic (with object) - - * zend_execute.c - zend_execute_API.c: - Disallow calling __clone/__construct/__destruct static - Send an E_STRICT when calling a non static method static - - * zend_API.c - zend_compile.c - zend_compile.h: - Disallow static declaration of clone - -2004-01-23 Jani Taskinen - - * zend_constants.h - zend_ini.h: - Silence some compile warnings - -2004-01-22 Marcus Boerger - - * zend_default_classes.c: - Fix internal access to exception properties - -2004-01-19 Andi Gutmans - - * zend_execute.c - zend_execute.h: - - Hopefully fix bug #26696. - - Please let me know if hell-breaks loose - -2004-01-19 Marcus Boerger - - * zend_API.c - zend_API.h: - Add zend_get_module_started() to quickly check whether a module is present - and its MINIT function has been called. - -2004-01-18 Marcus Boerger - - * zend_execute.h - zend_execute_API.c: - Improove debug capabilities - - * zend_reflection_api.c: - Fix some casing issues - -2004-01-17 Marcus Boerger - - * zend_interfaces.c: - - - * zend_interfaces.c: - Fix inheritance rule for interface Traversable - -2004-01-17 Jani Taskinen - - * tests/bug26802.phpt: - - Renamed all *php4* files to *php5*, changed all php4/PHP4 to php5/PHP5 - -2004-01-17 Ilia Alshanetsky - - * zend_object_handlers.c - zend_object_handlers.h: - Expose zend_std_call_user_call(), needed for implementation of things like - __call handlers. - -2004-01-17 Jani Taskinen - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - Nuke compile warning by using the LANG_SCNG macro instead - -2004-01-16 Jani Taskinen - - * zend_reflection_api.c: - - Fixed bug #26640 (__autoload() not invoked by Reflection classes) - - -2004-01-15 Zeev Suraski - - * zend.c: - Nice patch Christian, but it wasn't at all enabled? :) - - Fix bug #26883 - -2004-01-14 Zeev Suraski - - * zend_compile.c: - Don't allow interfaces to implement anything - -2004-01-14 Andi Gutmans - - * zend_operators.h: - - Remove bogus macros - -2004-01-13 Wez Furlong - - * zend_ini_parser.y: - Don't treat strings containing : as potential constant names in - the .ini parser. - This fixes Bug #26893 - -2004-01-12 Andi Gutmans - - * zend_compile.c: - - Return the PHP 4 behavior of not allowing class declerations within - - class declerations. This happened when declaring a class within a - - method. - class A { - function foo() { - class B { - } - } - } - -2004-01-12 Marcus Boerger - - * zend_API.h: - Add missing macro - -2004-01-11 Wez Furlong - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - TSRMLS fix - -2004-01-11 Andi Gutmans - - * zend_language_parser.y: - - Re-allow conditional class declerations. Needless to say that I also - - think it's not great coding.. Use polymorphism instead :) - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - - This should fix the problem of conditional function decleration on the - - same line of code not to work. You should re-evaluate your coding style - - if you really code this way :) - -2004-01-10 Zeev Suraski - - * zend_operators.c: - Remove conflict - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h - zend_operators.c: - Added error mask to set_error_handler() - Patch by Christian Schneider - -2004-01-09 Wez Furlong - - * acconfig.h: - support for building asm in the unix buildsys. - Also, when ZEND_ACCONFIG_H_NO_C_PROTOS is defined, - omit the C prototypes from the configuration header - so that it can be included into asm files. - -2004-01-09 Marcus Boerger - - * RFCs/002.txt: - this one is declined - -2004-01-09 Wez Furlong - - * zend_object_handlers.h: - must be extern to avoid problems with some compilers - -2004-01-09 Stanislav Malyshev - - * tests/bug26077.phpt: - fix expect - - * zend_compile.c: - Bug #25816 - disallow arrays in class constants - - * tests/bug26077.phpt: - add test - - * zend_compile.c - zend_execute.c: - Fix Bug #26077 - memory leak when new() result is not assigned - and no constructor defined - -2004-01-08 Jani Taskinen - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_default_classes.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_scanner.h - zend_interfaces.c - zend_interfaces.h - zend_istdiostream.h - zend_iterators.c - zend_iterators.h - zend_language_scanner.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multibyte.c - zend_multibyte.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_reflection_api.c - zend_reflection_api.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - - Happy new year and PHP 5 for rest of the files too.. - -2004-01-08 Andi Gutmans - - * zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l: - - - A belated happy holidays (by two years) - -2004-01-07 Marcus Boerger - - * zend_execute.c: - Reimplement part of Bug #24608 that was reverted too - - * zend_execute.c: - Revert patch that allowed to call sttaic methods via $method() - -2004-01-06 Ilia Alshanetsky - - * zend_mm.c: - Check if realloc() succeeds or not. (Noticed by Andrey) - -2004-01-06 Marcus Boerger - - * tests/bug26802.phpt: - Update - -2004-01-05 Marcus Boerger - - * zend_execute.c - tests/bug26802.phpt: - Fixed bug #26802 - - * tests/bug26802.phpt: - Fix test - - * tests/bug26801.phpt - tests/bug26802.phpt: - Add new test - - * tests/bug26696.phpt: - Update test - -2004-01-05 Stanislav Malyshev - - * zend_API.c: - Fix bug #26543 - check parent:: and self:: in class names - - * zend_execute.c - zend_object_handlers.c: - Bug #24608 - fix interaction between __accessors and get_property_ptr - -2004-01-03 Derick Rethans - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_reflection_api.c: - - Fixed var_export() to show public, protected and private modifiers - properly. - - Exported (un)mangle_property_name. - -2004-01-02 Andrei Zmievski - - * zend_default_classes.c: - Do not show exception message if it's empty. - - -2003-12-31 Andrei Zmievski - - * zend_default_classes.c: - Make default message look better. - -2003-12-30 Andi Gutmans - - * ZEND_CHANGES: - - Fix typos - -2003-12-30 Marcus Boerger - - * ZEND_CHANGES: - Update - -2003-12-30 Ilia Alshanetsky - - * tests/bug26696.phpt: - Added test case for bug #26696. - -2003-12-29 Marcus Boerger - - * zend_execute.c: - Fix (string) conversion - - * zend.c: - Add missing notice - - * zend_execute_API.c: - Fix __autoload() with derived classes - -2003-12-28 Marcus Boerger - - * zend_API.c: - WS - - * zend_API.h - zend_compile.c: - Fix order of class_entry member initialization (needed for example for DOM) - -2003-12-27 Marcus Boerger - - * zend_language_parser.y: - Fixed bug #26065 (Crash when nesting classes) - - * tests/bug26698.phpt: - Add new test - - * zend_objects.c: - Simplify - - * zend_object_handlers.c: - Fix __tostring() and concatenation - -2003-12-25 Marcus Boerger - - * zend_execute.c - zend_execute.c: - Fix warning - -2003-12-25 Ilia Alshanetsky - - * zend_highlight.c: - Fixed Bug #26703 (Certain characters inside strings incorrectly treated as - keywords). Original patch by vrana@php.net. - -2003-12-23 Marcus Boerger - - * zend.c - zend_execute_API.c - zend_globals.h - tests/bug26697.phpt: - Fixed bug #26697 (calling class_exists on a nonexistent class in __autoload - results in segfault). - -2003-12-22 Marcus Boerger - - * tests/bug26229.phpt - tests/bug26695.phpt: - Add more tests - - * tests/bug24884.phpt - tests/bug26166.phpt: - Fix tests now that class names are shown in correct casing - - * zend_compile.c: - Preserve class name casing. - - * zend_reflection_api.c: - Fixed bug #26695 (Reflection API does not recognize mixed-case class hints) - - * zend_object_handlers.c: - Fixed bug #26675 (Segfault on ArrayAccess use) - Update NEWS - -2003-12-22 Wez Furlong - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h: - export these symbols for use by SPL as a shared extension - -2003-12-19 Andi Gutmans - - * (php_5_0_0b3RC2) - zend_language_parser.y: - - Nuke another rule (thanks to Jan for noticing this) - -2003-12-19 Dmitry Stogov - - * (php_5_0_0b3RC2) - zend.c: - Bug #25547 (error_handler and array index with function call) was fixed - tests/lang/bug25547.phpt - -2003-12-19 Andi Gutmans - - * zend_language_parser.y: - - Nuke unused code - -2003-12-19 Dmitry Stogov - - * (php_5_0_0b3RC2) - zend_execute.c: - Error reporting on unset string offset was added (Bug #24773 - Zend/tests/bug24773.phpt) - - * zend_execute.c: - Assign_op operators (+=) were fixed for elements of overloaded objects - -2003-12-18 Andi Gutmans - - * zend_execute.c: - - Nuke C++ comment - - * zend_execute.c: - - Revert patch 1.566 - -2003-12-18 Marcus Boerger - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Fixed bug #24837 Incorrect behaviour of PPP using foreach. - -2003-12-17 Zeev Suraski - - * (php_5_0_0b3RC1) - zend_execute.c: - This part of the if was necessary after all. - Refix bug #22510 - -2003-12-17 Dmitry Stogov - - * (php_5_0_0b3RC1) - zend_execute_API.c: - -** empty log message *** - - * (php_5_0_0b3RC1) - zend_compile.c: - Dynamic function call from object's property was fixed - (See "tests/lang/bug24926.phpt" and "tests/lang/bug25652.phpt") - - * zend_execute_API.c: - Access to globals/autoglobals from class __destructor was fixed. - (see "tests/lang/bug24908.phpt" and - "tests/classes/destructor_and_globals.phpt") - -2003-12-16 Sebastian Bergmann - - * zend_compile.h - zend_object_handlers.h - zend_stream.h: - Sync: Export externally used functions. - -2003-12-16 Stanislav Malyshev - - * zend_compile.c: - export class initialization function - - * zend_object_handlers.c: - export externally used functions - - * zend_stream.c: - export function - -2003-12-15 Marcus Boerger - - * zend.c - zend_object_handlers.c - zend_object_handlers.h: - Reenable __tostring() magic for print,echo,concatenation,function naming... - but not for other internal things. - -2003-12-15 Jani Taskinen - - * zend_execute.c: - ws + cs (no c++ comments in c code) - -2003-12-15 Dmitry Stogov - - * zend_execute.c: - Bug #24773 was fixed (Zend/tests/bug24773.phpt) - Assign_op operators (+=) were fixed for elements of overloaded objects - Memory leaks during accessing ptoperies/elements of overloaded objects - were fixed - - * zend_execute_API.c - zend_reflection_api.c: - Memory corruptions were fixed in zend_str_tolower_copy() - -2003-12-14 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: - Fix behavior of return-by-reference functions. Remove erroneous warnings, - add E_STRICT warnings in case you return something by reference that - you're - not supposed to (anything that's not a variable, or a return-value of a - function that returned by reference). - - * zend.h - zend_execute.c - zend_execute.h: - Some cleanup - -2003-12-13 Moriyoshi Koizumi - - * zend_operators.c: - Fixes for POSIX compliancy. - -2003-12-12 Marcus Boerger - - * zend.c: - Free is needed in non ZTS too - - * zend.c: - Fix memleaks in ZTS mode - - * zend.c: - Fix memleaks - -2003-12-12 Ilia Alshanetsky - - * zend_constants.c: - Do not copy extra byte. - -2003-12-11 Ilia Alshanetsky - - * zend.h: - Fixed extra byte allocation for TRUE/FALSE/ZEND_THREAD_SAFE/NULL constants. - -2003-12-11 Marcus Boerger - - * zend_execute_API.c: - Bugfix: #26591 [NEW]: "__autoload threw an exception" during an uncaught - Exception - -2003-12-11 Andi Gutmans - - * zend_execute.c: - - Refix bug #24773 - -2003-12-11 Marcus Boerger - - * zend_object_handlers.c: - Handle getter failure and allow to bypass thrown exceptions. - - * zend_execute.c: - read_dimension() handler might return 0, handle this. - -2003-12-10 Marcus Boerger - - * zend_execute_API.c: - Do not double copy the string - -2003-12-09 Jani Taskinen - - * zend_operators.c - zend_operators.h: - - Brought ext/bcmath to the new millennium - -2003-12-09 Andi Gutmans - - * zend_constants.c: - - Fix overallocation (thanks to Ilia) - -2003-12-08 Derick Rethans - - * zend_builtin_functions.c: - - Make it compile again - -2003-12-07 Stanislav Malyshev - - * zend_builtin_functions.c: - Apply Andrey Hristov's patch adding get_declared_interfaces() - -2003-12-06 Marcus Boerger - - * zend_compile.c: - This test is against interfaces not abstract classes. - - * zend_default_classes.c: - Show the exception message again after __toString() magic has been dropped. - -2003-12-05 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Remove two unneeded convert_to_string() (found by Marcus) - - Change illegal use of string offset to E_ERROR - -2003-12-05 Ilia Alshanetsky - - * zend_default_classes.c: - Fixed crash demonstrated with ext/dom/tests/dom003.phpt test case. - -2003-12-04 Moriyoshi Koizumi - - * zend_execute.c: - Revert crap. - - * zend_execute.c: - Raise error in case dereference is performed on a scalar value. - -2003-12-03 Ilia Alshanetsky - - * tests/bug24773.phpt: - Test case for bug #24773. - -2003-12-03 Moriyoshi Koizumi - - * zend_execute.c: - This kind of error should be caught. (suggested by Andi, thanks) - - * zend_execute.c: - Fix bug #24773 (unset()ing string offsets crashes PHP) - -2003-12-03 Derick Rethans - - * zend_execute.c: - - Remove newline from error message - -2003-12-02 Marcus Boerger - - * zend_object_handlers.c: - Remove automatic call to __toString() since it is supposed to cause too - much trouble. See discussion on the mailing list. - -2003-12-02 Andi Gutmans - - * zend_API.c - zend_operators.c: - - Revert the revert of these patches. This overloading can only be used - - by C extensions such as SimpleXML and *NOT* PHP code. Reasons given - - on the mailing list and problem with reentrancy inside the opcodes. - - * zend_compile.c: - - Fix for bug #26182 - - * zend_errors.h: - - Don't include E_STRICT in E_ALL. - -2003-12-02 Marcus Boerger - - * zend_API.h: - Free the zval container only if it should be freed and was not copied. - -2003-12-01 Andi Gutmans - - * zend_execute.c: - - Change to E_STRICT so as not to break existing scripts. - - Thanks Edin - - * zend_builtin_functions.c: - - Nuke property_exists(). We need to fix isset() and this is already - - supported in reflection API. In any case, it's best not to add new - - functions in the general namespace except for keeping engine consistency - (which would have been true in this case) - - * zend_API.c: - - Revert auto-conversion in parameter API - - * zend_operators.c: - - Don't automatically call __toString() in convert_to_string_ex(). - - use __toString() in your code. - - Keep the auto-case in make_printable_zval. - -2003-11-30 Marcus Boerger - - * zend_default_classes.c: - Check return value of exception::__tostring() - - * tests/bug20240.phpt: - Fix test - -2003-11-29 Marcus Boerger - - * zend_compile.c - zend_iterators.c: - Fix memleak - -2003-11-29 Ilia Alshanetsky - - * zend_highlight.c - zend_language_scanner.l: - Fixed bug #26463 (Incorrect handling of semicolons after heredoc) - -2003-11-29 Marcus Boerger - - * zend_API.h: - This takes the address of a zval ptr - - * zend_API.h: - Add macros to return values of other zvals. - This is needed because one cannot use REPLACE_ZVAL_VALUE with - return_value. - -2003-11-29 Ilia Alshanetsky - - * zend_execute.c: - Restore original patch for bug #26281. - - -2003-11-29 Marcus Boerger - - * zend_compile.c: - Revert accidential commit until decision - - * zend_compile.c - zend_default_classes.c: - Make exception code more robust: - - Fix error in calculation of trace-string length - - Allow to overload __strostring() and make it work for uncaught - exceptions - - Show exception thrown while displaying exceptions - -2003-11-28 Ilia Alshanetsky - - * zend_API.c: - Add removed lcname, it is still needed. - -2003-11-27 Marcus Boerger - - * zend_API.c: - Convert objects to string if string is required by newer parameter parsing - since we do this for older parameter parsing does so too. - - * zend_object_handlers.c: - The macro REPLACE_ZVAL_VALUE cannot be used since we only have zval * - writeobj. to allow it the api needs to be changed to zval **writeobj. - - * zend_builtin_functions.c: - Add a support function to check for property existance which is different - from checking a property from being empty/set. - Update test #26182. - -2003-11-24 Marcus Boerger - - * zend_execute.c - zend_interfaces.c - zend_interfaces.h - zend_object_handlers.c - zend_operators.c - zend_operators.h: - Add new interface ArrayAccess to use objects as Arrays - -2003-11-24 Andi Gutmans - - * zend_constants.c: - - Fix newly introduced bug which stopped class constants from working. - - Thanks to Jan Lehnardt for reporting it. - -2003-11-24 Sebastian Bergmann - - * RFCs/004.txt: - No longer needed. - -2003-11-24 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_reflection_api.c: - - Fix __autoload() to preserve class case. - - Heads up, this patch might break stuff so please let me know if you - - bump into any problems. - -2003-11-23 Andi Gutmans - - * zend_reflection_api.c: - - Allocation optimizations by Timm Friebe - -2003-11-21 Ilia Alshanetsky - - * zend_execute.c: - Cleaner patch for bug #26281. - -2003-11-19 Ilia Alshanetsky - - * zend_execute.c - tests/bug26281.phpt: - Possible fix for bug #26281 & test case. - -2003-11-18 Marcus Boerger - - * zend_API.h: - Add method alias macro - -2003-11-18 Andi Gutmans - - * zend.c - zend_builtin_functions.c - zend_constants.c - zend_errors.h - zend_language_parser.y: - - Add E_STRICT, to be used to warn purists (like Jani :) - -2003-11-18 Marcus Boerger - - * zend_compile.c: - Backpatch the correct opcode for list(), property overloading needs more - opcodes (Bugfix #26257). - - * zend_interfaces.c: - Use correct order - - * zend_interfaces.c: - Use correct macro/function - -2003-11-17 Marcus Boerger - - * zend_interfaces.c: - Correct destruction - -2003-11-13 Moriyoshi Koizumi - - * zend_operators.c: - Bugfix #26156 (REPLACE_ZVAL_VALUE works on uninit stack-based zvals) - -2003-11-13 Marcus Boerger - - * ZEND_CHANGES - zend_interfaces.c: - IteratorAggregate::getIterator() cannot return anythingy else than objects - -2003-11-13 Andi Gutmans - - * zend_compile.c: - - Make sure internal clasess are malloced - -2003-11-10 Marcus Boerger - - * zend_iterators.c: - Don't use zend_class_entry indirection - - * zend_builtin_functions.c: - Bugfix #26010 (Bug on get_object_vars() function) - - * zend_object_handlers.c: - Correct default handlers - - * zend_iterators.c: - Need to update iterators handler table too. - - * zend_execute.c - zend_object_handlers.c: - Fix those warnings - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Split isset/isempty for object property and object dimension hooking. - - * zend_interfaces.c: - Little iterator improvement: ability to store index in iterator - -2003-11-08 Marcus Boerger - - * zend_reflection_api.c: - Add method reflection_class::implementsInterface() - Allow string & reflection_class in isSubclassOf() - - * zend_reflection_api.c: - Fix reflection_class::isSubclassOf() - - * zend.c - zend_object_handlers.c - zend_operators.c - tests/bug26166.phpt: - Handle exceptions in casting more gracefully. - This fixes bug #26166 - -2003-11-07 Marcus Boerger - - * zend_execute_API.c: - Make __autoload() faster - - * zend_execute.c - zend_iterators.h: - Update Iterators: Call next at the correct point in time. - - * zend_compile.c: - Add missing initialization. - - * zend_interfaces.h: - Make these class entries available for inheriting classes - -2003-11-06 Ilia Alshanetsky - - * zend_operators.c: - Fixed bug #26148 (Print the notice before modifying variable on type - mismatch). - - - Patch by: morten-bugs dot php dot net at afdelingp dot dk - -2003-11-04 Marcus Boerger - - * zend_execute.c - zend_interfaces.c: - Prevent some SEGV's when Exceptions are thorown inside iterators. - - * zend_builtin_functions.c: - Removedouble efree call - -2003-11-04 Moriyoshi Koizumi - - * zend_object_handlers.c: - __tostring() handler should be binary-safe - - * tests/bug26010.phpt: - Fix one more test - -2003-11-04 Stanislav Malyshev - - * Makefile.am: - add zend_iterators.c zend_interfaces.c to make - -2003-10-31 Moriyoshi Koizumi - - * tests/bug26010.phpt: - Add test case for bug #26010 - -2003-10-30 Stanislav Malyshev - - * zend_compile.c: - make CATCH opcode use "class" T like other opcodes do - via IS_CONST - -2003-10-30 Andi Gutmans - - * (php_5_0_0b2) - ZEND_CHANGES: - - Beta 2 - -2003-10-29 Moriyoshi Koizumi - - * zend_operators.h: - Use pretty macro instead. - -2003-10-28 Andi Gutmans - - * zend_language_parser.y: - - Head up! I'm reverting the patch which allows for expressions in constant - - declerations. Allowing the access of other constants in this code is - - flawed. We are reverting back to PHP 4's static scalars. - - Don't worry if you get the following msg when compiling: - - "zend_language_parser.y contains 3 useless nonterminals and 22 useless - rules" - - I didn't nuke the code in case we have some brilliant ideas after beta 2 - -2003-10-28 Marcus Boerger - - * zend_interfaces.c: - Give some freedon to c iterators but not in userspace. - -2003-10-28 Shane Caraveo - - * zend_compile.c: - fix crash in do_implement_interface when compiling - pear/PHPUnit/Framework/TestCase.php line 63 - while only interface_gets_implemented is the issue in this instance, both - these vars were unitialized, causing potential other issues - -2003-10-25 Marcus Boerger - - * zend_API.c - zend_API.h: - Add zend_make_callable() which allows to make zval's callable zval's. - At the moment this function only converts strings of the form - class::method - to an array(class,method). - - * zend_default_classes.c - zend_reflection_api.c: - This forces a better error message for non working clone calls. - - * zend_default_classes.c: - And use things to throw an exception here - - * zend_default_classes.c: - You shall not clone Exception instances - - * zend_reflection_api.c: - You shall not clone reflection_xx instances - - * ZEND_CHANGES - ZEND_CHANGES: - Update - -2003-10-25 Sebastian Bergmann - - * ZEND_CHANGES: - Fugbix typo. - - * ZEND_CHANGES: - s/Throwable/Printable: Exception has become an internal class since I - initially documented interfaces. - -2003-10-24 Andi Gutmans - - * ZEND_CHANGES: - - Fix typo - -2003-10-24 Marcus Boerger - - * zend_API.c - zend_execute_API.c: - Revert accidental commit - - * ZEND_CHANGES - zend_API.c - zend_execute_API.c: - Zend/ZEND_CHANGES - -2003-10-23 Sebastian Bergmann - - * Zend.dsp - ZendTS.dsp: - Add zend_interfaces.{c|h}. - -2003-10-22 Ilia Alshanetsky - - * zend.c: - Fixed bug #25922 (Crash in error handler when 5th argument is modified). - -2003-10-22 Marcus Boerger - - * zend_default_classes.c - zend_interfaces.c - zend_interfaces.h: - Impement userspace iterator interfaces and tests. See tests for details - on the names. - - * zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - Expand Interface C API. - In short: zend_class_entry->interface_gets_implemented() allows to modify - the class entry of a class when an interface gets implemented. - - * zend_default_classes.c: - The string conversion method should be named __toString() - -2003-10-21 Marcus Boerger - - * ZEND_CHANGES: - Make this clear - -2003-10-20 Andi Gutmans - - * ZEND_CHANGES: - - Add comment from Timm - -2003-10-20 Marcus Boerger - - * ZEND_CHANGES - ZEND_CHANGES: - Update - -2003-10-19 Andi Gutmans - - * zend_language_parser.y: - - Nuke const in function parameters. I just can't remember why this exists - - and it seems no one else remembers either. It has no semantic meaning. - -2003-10-18 Marcus Boerger - - * zend.h - zend_API.h - zend_compile.c - zend_iterators.h: - Fix class/iterator relationship & handling - - * zend_iterators.c: - Fallback to old behavior until we have a default iterator that respects - visibility we do the array trick. - - * zend_iterators.h: - Change order: Optional rewind() to end of structure - -2003-10-17 Marcus Boerger - - * ZendTS.dsp: - WS - - * zend_reflection_api.c: - Show if a class/object is iterateable - - * ZendTS.dsp - zend.h - zend_API.h - zend_default_classes.c - zend_execute.c - zend_iterators.c - zend_iterators.h: - Added c-api for iterators - - * zend_reflection_api.c: - Fix showing final/abstract for classes - -2003-10-17 Ilia Alshanetsky - - * zend_ini_parser.y: - Fixed formatting issue. - - * zend_alloc.c: - Fixed if() condition. - -2003-10-15 Marcus Boerger - - * zend_API.c - zend_API.h: - Add oo support function zend_class_implements() - - * zend_default_classes.c: - Fix cast function - -2003-10-14 Andi Gutmans - - * zend_mm.c: - - Argh, the suffering copy&paste can cause - - * zend_alloc.c: - - Fix compile problem. - - * zend_mm.c: - - Fix the fix by making sure the new block is in the right free list. - -2003-10-14 Stanislav Malyshev - - * zend_execute_API.c: - The freed one is a hashtable - may matter if Hashtables are allocated - differently - -2003-10-14 Andi Gutmans - - * zend_mm.c: - - Support merging free block which was created by reallocing to smaller - - size. This should fix some performance issues. This code is still not - - thoroughly tested. - -2003-10-09 Zeev Suraski - - * zend_compile.c - zend_execute.c - zend_language_parser.y: - Allow foo::$bar() - -2003-10-07 Rasmus Lerdorf - - * Zend.m4: - MFB bison configure test fix - -2003-10-07 Zeev Suraski - - * zend_execute.c: - Fix bug #17997 (Warning when switch & reference are combined) - - * zend_ini_parser.y: - Fix the fix :) - Not thoroughly tested, but appears to work fine - -2003-10-07 Marcus Boerger - - * zend_ini_parser.y: - Bugfix #25770 Segfault with PHP and bison 1.875 - -2003-10-05 Zeev Suraski - - * zend_object_handlers.c: - Remove unused callback - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Remove redundant callback, simplify API - -2003-10-05 Shane Caraveo - - * (BEFORE_HANDLERS_RESHUFFLE) - zend_API.h: - this little piggy broke lots of things...eg. _function_check_flag in - reflection api. - -2003-10-03 Moriyoshi Koizumi - - * zend_API.c: - Fixed bug #24766 (strange result array from unpack()) - - * zend.h: - Bug #25738 (alloca() related problems on the Darwin platform) - - * zend_API.h: - Ensure lval to have a *boolean* value. - -2003-10-03 Jani Taskinen - - * Zend.m4: - Aligned configure help texts. - -2003-09-30 Moriyoshi Koizumi - - * zend_compile.c: - Remove redundant '\n' - -2003-09-26 Hartmut Holzgraefe - - * zend_alloc.c: - signed/unsigned compiler warning fixes - -2003-09-25 Georg Richter - - * zend_alloc.c: - fixed compiler warning - removed dead code - - * zend_hash.h: - changed ulong to long to avoid compiler warnings (comparison between signed - and unsigned) - -2003-09-22 Ilia Alshanetsky - - * zend.c - zend_language_scanner.l: - Added missing format. - -2003-09-20 Marcus Boerger - - * zend_reflection_api.c: - Add public array Reflection_Class::getDefaultProperties() - -2003-09-18 Marcus Boerger - - * zend_builtin_functions.c: - Nuke vars no longer needed - - * zend_builtin_functions.c - zend_reflection_api.c: - Go with studlyCaps - - * zend_reflection_api.c: - Change tostring() into __toString() to match method name used in casting. - - * zend.c - zend_operators.c: - Fallback to default behaviour for unsupported object type conversions - - * zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - - Allow partial type conversion support for objects. - - Add support for object to string conversion from userspace by method - __toString() and add a test. - - * zend_API.c: - Add missing check - -2003-09-17 Marcus Boerger - - * zend_compile.c - zend_execute.c: - Show name of missing function as typed - - * zend_default_classes.c: - Use studlyCaps in exception class - - * zend_compile.c: - Go with studlyCaps in error messages/backtrace/reflection output - -2003-09-16 Marcus Boerger - - * zend_reflection_api.c: - - Make it clear whether it is an interface or a class - - Fix static properties - -2003-09-15 Marcus Boerger - - * zend_execute.c: - Revert - need to look for a better solution - - * zend_execute.c: - Bugfix #25547 - -2003-09-15 Zeev Suraski - - * zend_operators.c: - Simplify / fix - -2003-09-14 Marcus Boerger - - * zend.c: - Bugfix #25335 - -2003-09-14 Zeev Suraski - - * zend_operators.c: - Commit 64-bit fixes to the standard operators - by Ard Biesheuvel (abies@php.net) - -2003-09-14 Marcus Boerger - - * zend.h: - Bugfix #25528 (by Ard Biesheuvel) - -2003-09-13 Marcus Boerger - - * zend_alloc.c: - Fix warnings - -2003-09-11 Stanislav Malyshev - - * tests/dtor_scope.phpt: - add test - - * zend_execute_API.c: - ws - - * zend_execute_API.c: - Use scope from method, not from object - -2003-09-11 Marcus Boerger - - * zend_default_classes.c: - Use type instead of constant - -2003-09-08 Marcus Boerger - - * zend_compile.c: - Fix property inheritance where a derived class inherits a public property - and owns it as an implicit public property already (noticed by Brad). - - * zend.c: - Fix registering/derigistering of stdClass in ZTS and NON ZTS mode - -2003-09-07 Marcus Boerger - - * zend_execute.c: - Fix foreach() called with non array - -2003-09-07 Stanislav Malyshev - - * Zend.m4: - check for mach-o/dyld.h - needed for non-PHP ZE build - -2003-09-06 Marcus Boerger - - * zend_default_classes.c: - Disallow to changing the backtrace - - * zend_reflection_api.c: - Add missing newline if no static methods are available - - * zend_reflection_api.c: - - Internal functions shall be static - - Fix more nesting - - * zend_reflection_api.c: - Fix logic - - * zend_reflection_api.c: - - Fix CS: {{{ / }}} - - Fix static reflection_*::export() - - Add class reflection_object which allows to show dynamic properties - - * zend_reflection_api.c: - Use %s where it makes more sense - -2003-09-05 Marcus Boerger - - * zend_reflection_api.c: - Simplify reflection_property::__constructor() and fix property factory - - * zend_reflection_api.c: - - Don't use resorved words as variable names. - - Improve several exception messages. - - Fix Reflection_Property::_construct() / getDeclaringClass() - - * zend_reflection_api.c: - Fix reflection_api::__construct() (noticed by Andrey) - - * zend_default_classes.c: - Provide string casting for exceptions by calling toString() - -2003-09-04 Marcus Boerger - - * zend_API.c - zend_execute.c - zend_object_handlers.c: - Tests show updating consts must happen once at runtime (revert - optimization). - Add tests for static properties. - - * zend_reflection_api.c: - Add reflection_class::getstaticproerties() - -2003-09-03 Marcus Boerger - - * zend_compile.c: - Partly revert and reintroduce hash table entries for the ctor. - - * zend_compile.c: - Nuke unused variable, too - - * zend_compile.c: - - Inheritance applies to __clone() too. - - No need to add additional functions for the constructor. - The handler uses the pointer as intended and doesn't look the the name. - - * zend_compile.c: - Cannot turn a static property into a non static one and vice versa - - * zend_API.c - zend_API.h - zend_compile.c - zend_default_classes.c: - Fix handling of static properties initialized to arrays - - * zend_compile.c: - Add missing error messages when violating static property inheritance - rules. - - * zend_API.c - zend_compile.c - zend_execute.c - zend_object_handlers.c: - Fix static properties. - - * zend_compile.c: - Allow redeclareing a protected property as public. - -2003-09-03 Zeev Suraski - - * zend_compile.c: - Revert bogus patch - One must *never* use E_CORE_* error levels! - -2003-09-03 Marcus Boerger - - * zend_reflection_api.c: - Clearly distinguish between Const, Static and Other members. - -2003-09-02 Marcus Boerger - - * zend_compile.c: - Fix error messages - - * zend_API.c: - Allow redeclaring of protected properties as public (for internal classes). - - * zend_reflection_api.c: - Use appropriate function for property name unmangling. - - * zend_reflection_api.c: - Make these static as noticed by Andrey - - * zend_execute.c - zend_object_handlers.c - zend_objects.c: - Synch/Unify error messages related to function/method calls - - * zend_compile.c: - Fix error level - - * zend_API.c - zend_compile.c: - Currently we cannot support static ctor/dtor - - * zend_reflection_api.c: - These are implicit properties as denoted by the flag. Dynamic properties - only - exist in one single object and currently reflection api is not capable of - showing those. - -2003-08-31 Marcus Boerger - - * zend_reflection_api.c: - Don't repeat first const count(consts) time - - * zend_reflection_api.c: - Beautify output - - * zend_reflection_api.c: - Add reflection_parameters, patch by Timm Friebe - - * zend_default_classes.c: - Excluded chars < 32 when displaying string parameters that would obliterate - output. - -2003-08-31 Zeev Suraski - - * zend_arg_defs.c - zend_builtin_functions.c - zend_modules.h: - Attempt at fixing the linkage problem in Win32 - -2003-08-31 Marcus Boerger - - * zend_execute.c: - Synch error message with other one to fix tests - - * zend_reflection_api.c: - Check whether we may access tat union - - * zend.c: - Revisited: Replace the non portable code by spprintf - - * zend_reflection_api.c: - Using zend_spprintf should be faster here - - * zend.c - zend.h - zend_default_classes.c: - Make vspprintf available as zend utility function. Use it in exception - output. - -2003-08-30 Marcus Boerger - - * zend_default_classes.c: - Actually fetch the parameter - - * zend_default_classes.c - zend_default_classes.h - zend_execute.c - zend_reflection_api.c: - - Calling abstract methods should be a error for consistency reason. - - So in reflection_api we use the reflection_exception again. - -2003-08-30 Andi Gutmans - - * zend_default_classes.c: - - PLEASE stop commiting ^M's - -2003-08-30 Marcus Boerger - - * zend_default_classes.c: - Even though it is ignored this should be correct - - * zend_default_classes.c: - Add frame numer and finally display stack trace in the message. - - * zend_default_classes.c: - Add exception::traceAsString() and exception::toString() - - * zend_reflection_api.c: - fci.function_table & fci.function_name are not needed since we use - zend_fcall_info_cache - - * zend_reflection_api.c: - Be precise - - * zend_reflection_api.c: - Actually using fcc would be a good idea - - * zend_default_classes.c - zend_default_classes.h - zend_execute.c: - - The compiler can't detect all abstract function calls so we need to - check. - - * zend_default_classes.c: - Make those final (see comment) - -2003-08-29 Marcus Boerger - - * zend_API.c - zend_API.h: - - Add zend_merge_properties() which is designed to serve *_fetch_object(). - - Explain drawbacks of object_and_properties_init and - zend_merge_properties. - - * zend_reflection_api.c: - - Use zend_fcall_info_cache in invoke() to improve speed. - -2003-08-29 Zeev Suraski - - * zend_compile.c: - Fix a problem in implicit public properties and inheritance - -2003-08-29 Sascha Schumann - - * zend_hash.c: - improve a number of zend_debug format strings - -2003-08-29 Marcus Boerger - - * zend_builtin_functions.c - zend_builtin_functions.h - zend_default_classes.c: - Need to tell zend_fetch_debug_backtrace() whether to skip top function or - not. - -2003-08-28 Marcus Boerger - - * zend_default_classes.c: - Add public read access to protected - - * zend_default_classes.c - zend_default_classes.h: - Add zend_throw_exception_ex() which allows to format exception messages. - - * zend.c: - Classe tables work this way - - * zend_builtin_functions.c - zend_builtin_functions.h - zend_default_classes.c: - - Split debug_backtrace() into lowlevel c function and php function wrapper - - Add trace property to default method based on new - zend_fetch_debug_backtrace - -2003-08-28 Sascha Schumann - - * zend.h: - older gccs don't understand attribute((format)) on function pointers - - * zend.h: - ZEND_GCC_VERSION should always be defined to a number so we can use - simple comparisons all the time. - - * zend.h - zend_alloc.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c: - Add format attribute to a number of functions - - Kill a few warnings - - * zend.h - zend_alloc.h: - cleanup & centralize ZEND_GCC_VERSION and ZEND_ATTRIBUTE_MALLOC so that - they can be used by downstream applications - - * zend_alloc.h: - Enable attribute((malloc)) for GCC 2.96 - - * zend_alloc.h: - GCC 2 does not know about malloc yet. - - * zend_alloc.h: - provide attribute((malloc)) where appropiate - -2003-08-27 Marcus Boerger - - * zend_reflection_api.c: - Nuke unused variable - - * zend_reflection_api.c: - Fix reflection_class::newInstance() - -2003-08-25 Jani Taskinen - - * zend.h: - - Fixed bug #25240 (spaces before pre-processor directives) - -2003-08-24 Marcus Boerger - - * zend_API.c: - Add missing check - - * zend_API.c: - Fix memory source of string duplication for non internal properties - - * zend_API.c - zend_API.h - zend_compile.c - zend_default_classes.c - zend_execute_API.c - zend_variables.c - zend_variables.h: - - Provide appropriate way to destroy internal zval's. - - Allow internal zval's of type string and disallow complex types. - - Define the default string for extensions at class level instead of ctor. - - * zend_API.h - zend_compile.h - zend_reflection_api.c: - Don't identify alias'ed functions - -2003-08-24 Zeev Suraski - - * zend_API.c: - Use ""'s if you want empty strings. We want to crash on errors. - - * zend_compile.c: - Use pemalloc() - -2003-08-24 Marcus Boerger - - * zend_API.c: - Allow NULL, too - -2003-08-24 Zeev Suraski - - * zend_API.c: - Get rid of more ^M's - Marcus, please check your CVS client! - - * zend_default_classes.c: - Get rid of more ^M's - - * zend_compile.c: - line endings fix - - * zend_execute.c: - Never, ever, overwrite the refcount element of a connected zval! - -2003-08-24 Marcus Boerger - - * zend_reflection_api.c: - Add dedicated reflection_exception - - * zend_default_classes.c - zend_default_classes.h: - Allow to throw instances of classes derived from exception - - * zend.c - zend_default_classes.c - zend_default_classes.h - zend_execute.h - zend_execute_API.c: - - Provide a unified way to display uncaught exceptions, which shows - file/line/message info if possible. - - Add zend_eval_string_ex() to be able to handle exceptions in eval'd - code. - - Use above function to fix memleaks in CLI. - - * zend_reflection_api.c: - Make invoke() work - - * zend_reflection_api.c: - zend_parse_parameters 'O' works the way we need here - - * zend_reflection_api.c: - Not needed - - * zend_default_classes.c: - Make use method macros - - * zend_API.h: - One of PPP is needed, too - - * zend_reflection_api.c: - - Add Reflection_Function::isAlias - - Use ZEND_ME/ZEND_METHOD - - Fix static entries - - * zend_API.h - zend_compile.h: - - Add fn_flag ZEND_ACC_ALIAS - - Unify way of function_entry generation by new macro ZEND_FENTRY - - * zend_API.c: - Fix fn_flags handling - - * zend_API.c - zend_API.h - zend_default_classes.c: - Add property read code and use that in default exception class - -2003-08-23 Marcus Boerger - - * zend_default_classes.c - zend_default_classes.h - zend_reflection_api.c: - Allow zend_throw_exception() to also set the exception code - - * zend_default_classes.c: - Exception has 4 protected default properties (message,code,file,line). - They are all initialized at c-level constructor correctly. - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Internal classes can now have default properties. - - * zend_reflection_api.c: - Show ctor/dtor information and those don't return anything - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c: - - Flag ctor/dtor methods - - Use this to prevent memleaks when an exception gets thrown in ctors. - - * zend_default_classes.c: - Make exception code more robust - -2003-08-22 Ilia Alshanetsky - - * zend_builtin_functions.c - zend_constants.h: - Replace *magic number* with a much nicer define. - - * zend_builtin_functions.c: - Set 2147483647 as the module number of user defined constants - Fixed a few bugs and cleaned up get_defined_constants(). - -2003-08-21 Marcus Boerger - - * zend_default_classes.c - zend_default_classes.h - zend_reflection_api.c: - Add function 'zend_throw_exception(char *message, int duplicate - TSRMLS_DC);' - to provide an easy way to throw exceptions for extension developers. - - * zend_API.c: - If ce not given than any object would do - - * zend_API.c: - Paramspec 'O' / zend_parse_method_params(): only if given check the class - type - -2003-08-20 Zeev Suraski - - * zend_alloc.c: - adhere to silence - -2003-08-20 Marcus Boerger - - * zend_alloc.c: - Fix counting number of leaks - -2003-08-19 Wez Furlong - - * zend_execute.c: - fix build - -2003-08-18 Wez Furlong - - * zend_ini.h: - linkage for C++ - -2003-08-18 Zeev Suraski - - * ZendTS.dsp - zend_execute.c - zend_execute_locks.h: - Prevent access to internal engine functionality - - * zend.h - zend_alloc.c - zend_compile.h - zend_execute.c: - - Improve tracking - - Fix several overloading issues - - * zend_API.c - zend_alloc.h - zend_hash.c - zend_hash.h - zend_ts_hash.c - zend_ts_hash.c - zend_ts_hash.h - zend_ts_hash.h: - Improve tracking - - * zend_compile.c: - ws - -2003-08-17 Marcus Boerger - - * zend_API.h - zend_builtin_functions.c - zend_execute.c - zend_object_handlers.c - zend_operators.c - zend_reflection_api.c: - Fix warnings - -2003-08-17 Sascha Schumann - - * zend.h: - One bit fields need to be unsigned, otherwise there is no storage for - the sign bit - - "A signed bit field has a length of 1 bit." - - * zend_API.h: - explicitly cast size_t to zend_uint to avoid warnings on 64 bit platforms. - -2003-08-17 Marcus Boerger - - * zend_execute.c: - Remove unnecessary if - - * zend_execute.c: - Put the code where it belongs - fixes a warning and confusion - - * zend_compile.c - zend_execute.c: - Implement a TBD: JMP to the end of foreach - - * zend_compile.c: - WS - - * zend_API.c: - - Show class names in error messages when dealing with methods - - Mark class as abstract if it gets an abstract method - -2003-08-16 Marcus Boerger - - * zend_API.c - zend_API.h - zend_reflection_api.c: - Simplify abstract method declaration - - * zend_object_handlers.h: - WS - -2003-08-15 Sascha Schumann - - * zend_execute.c - zend_object_handlers.c: - Restrict scope of inline functions to compile unit - - Submitted by: Jason Greene - -2003-08-13 Marcus Boerger - - * zend_objects_API.c: - Add missing entry - - * zend_API.c: - - Show classes in case of methods - - Using sprintf here was a bad idea - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-11 Marcus Boerger - - * zend_hash.c - zend_hash.h: - Bugfix 21918 - -2003-08-11 Masaki Fujimoto - - * Zend.m4 - flex.skl - zend_compile.c - zend_globals.h - zend_highlight.c - zend_language_scanner.h - zend_language_scanner.l - zend_multibyte.c - zend_multibyte.h: - - added script encoding support to Zend Engine 2. - this enables ZE2 to gracefully parse scripts written in UTF-8 (with - BOM), - UTF-16, UTF-32, Shift_JIS, ISO-2022-JP etc... (when configured with - '--enable-zend-multibyte' and '--enable-mbstring') - -2003-08-10 Marcus Boerger - - * zend_compile.c: - Bugfix #24637 __destruct not called - -2003-08-09 Moriyoshi Koizumi - - * zend_compile.c: - Fix segfault when a referenced parameter is specified with typehint. - Result of the node will never be used because verify_instanceof handler - has - been eliminated. - -2003-08-09 Marcus Boerger - - * zend_objects.c: - Precise destructor errors - -2003-08-07 Moriyoshi Koizumi - - * tests/bug21478.phpt: - Add missing right parensis - -2003-08-07 Zeev Suraski - - * zend_execute_API.c: - Clarify use of original_function_state_ptr - -2003-08-07 Marcus Boerger - - * zend_execute_API.c: - - Fix warnings - - Fix code - -2003-08-06 Zeev Suraski - - * zend_execute_API.c: - clarify :) - -2003-08-05 Jani Taskinen - - * zend_execute_API.c: - Fix the build - -2003-08-05 Zeev Suraski - - * zend_API.h - zend_execute_API.c - zend_reflection_api.c: - Try to put an end to the endless number of call_user_function variants. - zend_call_function() now takes a structure that should contain all of the - necessary information. If further information is necessary in the future, - then we'll be able to add it without having to introduce a new function. - - As for caching - the 2nd, optional argument is a struct that can hold all - of the information that's necessary to invoke the function, including its - handler, scope and object it operates on (if any). Note that you may only - use a cache if the arguments you provide to zend_call_function() are - identical to the ones of the last call, except for the argument and return - value information. - - - The recently introduced fast_call_user_function() was removed - - I fixed most of the places that used fast_call_user_function() to use - caching - but there are still some that need to be fixed (XML and reflection) - -2003-08-05 Stanislav Malyshev - - * tests/bug24699.phpt: - fix syntax - - * zend_execute_API.c: - remove stack clean - it makes trouble - -2003-08-04 Marcus Boerger - - * zend_execute.c: - Fix ZTS - - * zend_execute_API.c: - Nuke unused variables - - * zend_reflection_api.c: - Add function/method parameter reflection - -2003-08-04 Ilia Alshanetsky - - * zend_execute_API.c - tests/bug23104.phpt: - Fixed bug #23104 (hash position of static arrays not being reset) - -2003-08-04 Stanislav Malyshev - - * zend_execute_API.c: - oops. forgot function - - * zend_execute_API.c: - fix crash #24842 - - * zend_compile.c: - fix leaks: bug #24831 - - * zend_execute.c: - use get_obj_zval_ptr - - * tests/bug24884.phpt: - add test - - * zend_execute.c: - Fix #24884 - clone $this - -2003-08-04 Zeev Suraski - - * zend_compile.c: - Simplify code using XOR - - * zend.h: - Add logical XOR, proves to be quite useful lately - - * zend_opcode.c: - This check shouldn't be necessary - -2003-08-03 Marcus Boerger - - * zend_opcode.c: - Fix crash - - * zend_compile.c: - Fix test and add missing initialization - -2003-08-03 Zeev Suraski - - * zend_API.c: - Ensure functions have a valid access level - - * zend_API.c: - Default to public - -2003-08-03 Marcus Boerger - - * zend_API.c: - Not needed, will be copied from ptr->flags later - - * zend_builtin_functions.c: - Add missing arg info - -2003-08-03 Moriyoshi Koizumi - - * tests/bug24635.phpt - tests/bug24699.phpt: - Style & WS fixes - -2003-08-03 Zeev Suraski - - * (BEFORE_ARG_INFO) - zend_API.c: - No need for this initialization - this function initializes all of the - elements of zend_internal_function - - * (BEFORE_ARG_INFO) - zend_execute.c: - Clean up. extended_value can only contain either ZEND_UNSET_DIM or - ZEND_UNSET_OBJ. - - * (BEFORE_ARG_INFO) - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c: - Generalize fetch_class - -2003-08-02 Marcus Boerger - - * zend_API.c: - Initialize all struct members: Necessary for reflection - - * zend_reflection_api.c: - Show interfaces - -2003-08-02 Wez Furlong - - * zend_API.c: - fix usage of instanceof here too - -2003-08-02 Marcus Boerger - - * zend_execute.c: - Fix warning - -2003-08-01 Wez Furlong - - * zend_API.c: - better fix... - - * zend_API.c: - Fix "O" format for zend_parse_parameters - -2003-07-31 Zeev Suraski - - * zend_API.c: - Use instanceof_function() - - * zend_compile.c - zend_execute.c: - Finish the array overloading patch - - * zend_execute.c: - Cleanup - -2003-07-31 Andi Gutmans - - * zend_hash.c: - - Fix logic. It was the wrong way around. - -2003-07-30 Andi Gutmans - - * zend_execute.c - zend_hash.c: - - Fix problem with hash when updating same bucket with data of different - sizes one after another. - - Fix number of arguments to read_dimension. - -2003-07-30 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Get rid of an opcode - - * zend_compile.c - zend_execute.c: - Support overloading of $foo["bar"] += "baz" - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Improve array overloading - support unset($foo["bar"]) - - * zend_compile.h: - Remove garbage - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_modules.h: - Add exec_finished() callback for modules - this is the last place where the - modules may touch the symbol table reliably - -2003-07-29 Ilia Alshanetsky - - * tests/bug22836.phpt: - Test case for bug #22836. - -2003-07-29 Jani Taskinen - - * zend.c: - Remove the obfuscation caused by the double "#ifdef ZTS" - -2003-07-27 Stanislav Malyshev - - * zend_compile.c: - fix compare - - * zend_compile.c: - use zend_binary_strncasecmp - - * zend_execute_API.c: - change shutdown order so that dtors would coexist with object error - handlers - - * zend_execute.c: - clean the right one - - * zend_execute_API.c: - make shutdown more granular so in case some dtor goes ape we still - can shut down cleanly - - * zend_compile.c - zend_execute.c - zend_objects.c: - make clone and throw coexist peacefully - - * tests/bug24635.phpt - tests/bug24699.phpt: - add test - - * zend_execute.c: - fix #24635: clean hash before putting into cache - - * zend_language_scanner.l: - fix crash #24550 - - * zend_compile.c - zend_constants.c: - fix leaks with class constants (bug #24699) - - * zend_compile.c: - make __clone call case insensitive, just as other calls are - -2003-07-24 Jani Taskinen - - * tests/bug19859.phpt - tests/bug20240.phpt - tests/bug20242.phpt - tests/bug21478.phpt - tests/bug21888.phpt - tests/bug22725.phpt - tests/bug24436.phpt: - cleanup (CS+ws) - -2003-07-24 Zeev Suraski - - * tests/bug24436.phpt: - Fix expectations :) - - * zend_execute.c: - Fix logic and comments in ASSIGN_DIM - - * zend_compile.c: - Fix another HANDLE_NUMERIC bug. Looks like you opened Pandora's box, - Sterling ;) - - * zend_builtin_functions.c: - Fix each() binary safety for keys - - * zend_execute.c: - Fix assignments to numeric array indices - - * zend_compile.c: - Remove useless code - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Support references in foreach() - Syntax: - foreach ($arr as &$val) - foreach ($arr as $key => &$val) - - * zend_execute.c: - Fix binary safety in foreach() keys (fixes bug #24783) - - * zend.c: - Make print_r() binary safe with keys - -2003-07-23 Stanislav Malyshev - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_opcode.c: - Remove namespace leftovers - -2003-07-23 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Go back to ZE1-like code - -2003-07-23 Sebastian Bergmann - - * zend_reflection_api.c: - Fix segfault. Patch by Timm Friebe . - -2003-07-22 Marcus Boerger - - * zend_hash.h: - Fix for the moment - -2003-07-22 Zeev Suraski - - * zend_execute.c - zend_hash.c - zend_hash.h - zend_operators.c - zend_operators.h: - Improve infrastructure of numeric handling of elements in symbol tables. - - When you want to work with a symbol table, and you don't know whether you - have a numeric ("string that looks like a number") or a string element in - your hands, use zend_symtable_*() functions, in place of zend_hash_*() - functions. - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Fix isset()/empty() for non-trivial object elements - (API change - read_property now accepts an extra element) - Fixes bug #24436 - -2003-07-21 Zeev Suraski - - * zend_object_handlers.c: - Fix bug #24499 - - * zend_execute.c: - Revert fix for #24729, and refix - -2003-07-21 Marcus Boerger - - * zend_execute.c: - Go with a better fix for #24729 - -2003-07-21 George Schlossnagle - - * zend_API.h: - reverted at Andi's request. replaced with more generic wrapper. - -2003-07-20 Marcus Boerger - - * zend_execute.c: - Bugfix #24729 = new ; causes crash when is not set - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - should nt here - -2003-07-20 Marcus Boerger - - * zend_reflection_api.c: - Fix warnings and whitespace in output - - * zend_reflection_api.c: - Add support for instances in Reflection_Class. - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - removed references to smart_str, replaced with private string management - function. When snprintf is integrated into the engine, string_printf - should be altered to use that. - -2003-07-20 Marcus Boerger - - * zend_objects_API.c: - More informative errors here and these are real core errors - - * zend_execute.c: - Fix uncloneable objetcs - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - more of Timm's implementation. - -2003-07-20 Marcus Boerger - - * zend_hash.c - zend_hash.h: - Make it a macro - -2003-07-19 Marcus Boerger - - * zend_hash.c: - This is meant to be used in for(;has_more;next) - - * zend_hash.c - zend_hash.h: - Add missing function to ease implementations - -2003-07-19 Jani Taskinen - - * zend.h: - Fix the HPUX alloca fix as suggested by Sascha - -2003-07-19 Marcus Boerger - - * zend_objects.c - zend_objects.h: - Shuffle code to ease writing clone handlers - -2003-07-19 Andi Gutmans - - * zend.h: - - Don't use alloca on HP-UX (Moriyoshi Koizumi ) - -2003-07-16 Zeev Suraski - - * zend_compile.c: - Fix bug in the verification of interface-function implementation - - * zend_compile.c - zend_compile.h - zend_execute.c: - More cleanup for assign-op handling of objects - - * zend_alloc.c: - Fix warning - -2003-07-12 Andi Gutmans - - * zend_API.c: - - WS - -2003-07-11 Andi Gutmans - - * zend_API.c: - - Add support for Z in zend_parse_parameters(). It will allow the extension - - to retreive the zval **, thus allowing it to use the convert_to_*_ex() - - family of functions to do type conversions without effecting the value - in - - the engine itself. (Josh Fuhs ) - -2003-07-08 Zeev Suraski - - * zend_execute.c: - initial refactoring for assign-op handling of objects - -2003-07-07 Zeev Suraski - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Rework zend_do_declare_property and related code into one code base - - * zend_API.c: - Fix bug - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Add get_dim callback - - * zend_execute.c: - Fix naming convention - -2003-07-07 Derick Rethans - - * zend_execute.c: - - Help Zeev fixing ghosts :) - -2003-07-07 Zeev Suraski - - * zend_object_handlers.c - zend_object_handlers.h: - whitespace - - * zend_objects_API.c: - Fix & whitespace - - * zend_object_handlers.c: - fixlet - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Initial support for overloading of array syntax for objects (very initial) - -2003-07-06 George Schlossnagle - - * zend_API.c - zend_API.h: - add convenience functions or adding class properties. Ok'd for commit by - Andi. - -2003-07-04 Andi Gutmans - - * zend_alloc.c - zend_mm.c - zend_mm.h: - - Add heap to memory manager. This should improve performance. - - Enabling it by default so that it gets tested. We should decide before - beta 2 if we want to revert back to malloc or not. - - Thanks to Sebastian for benchmarking it - -2003-07-04 Sebastian Bergmann - - * zend_reflection_api.c: - 2 * TSRMLS_FETCH() -> 1 * TSRMLS_DC - -2003-07-04 George Schlossnagle - - * zend_reflection_api.c: - ws fix - -2003-07-03 Marcus Boerger - - * zend_compile.c: - Allow final private methods - -2003-07-03 George Schlossnagle - - * zend_reflection_api.c: - win build fixes (Rob Richards) - - * zend_reflection_api.c: - can't forget Andrei - -2003-07-03 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: - enable Classname() constructor to be called via parent::__constructor() - - * tests/bug19859.phpt: - add test for Bug #19859 - - * zend_API.c - zend_execute_API.c: - Fix bug #19859 - allow fast_call_user_function to support __call - - * zend_builtin_functions.c: - fix the get_parent_class fix - -2003-07-03 George Schlossnagle - - * zend_reflection_api.c: - more of Timm's patches, and mod authors line to give credit where credit is - due. - -2003-07-02 Marcus Boerger - - * zend_objects.c: - Temporairy solution to overcome shutdown propbelms with objects that have - hidden destructors. - - * zend_objects.c: - Reorganize this a bit to ensure the object memory is destructed before - showing the error. - - * zend_builtin_functions.c: - Bug #24399: is_subclass_of(): fix memleak, too - -2003-07-02 Zeev Suraski - - * zend_execute.c: - Throughly fix scoping change. Fixes, among other things, bug #24403 - -2003-07-02 Andi Gutmans - - * zend_compile.c - zend_globals.h: - - Nuke CG(in_clone_method) - -2003-07-02 Zeev Suraski - - * zend_execute.c: - Fix for bug #22367. - Heads up - this will break syntactical compatiblity, return($foo) will - not work with functions that return references - return $foo should be - used - instead. It never worked well before, and caused all sorts of odd bugs. - It *might* be possible to support this specifically, albeit unlikely - -2003-07-02 Sterling Hughes - - * zend_execute_API.c: - optimize the case where the object is really a class name, as we don't need - to set EX(object) here. - - * zend_execute_API.c: - Timm Friebe points out that object detection should be done regardless of - the function pointer - -2003-07-02 Marcus Boerger - - * zend_objects.c: - Finally fix property cloning and fix the tests accordingly. - - -2003-07-02 Sterling Hughes - - * zend_builtin_functions.c: - Fix bug #24445 - -2003-07-01 Marcus Boerger - - * zend_objects.c: - Fix __clone(). - - - * tests/bug20240.phpt: - Use both destructor and shutdown - - * zend_execute_API.c: - small bugfix - - * tests/bug24436.php - tests/bug24436.phpt: - Rename test to correct extension - - * zend_execute.c: - __clone might not be defined - - * zend_execute.c: - Fix __clone visibility - - * zend_object_handlers.c - zend_object_handlers.h - zend_objects.c: - Fix destructor visibility - -2003-07-01 Derick Rethans - - * tests/bug24436.php: - - Added test for bug #24436 - -2003-07-01 George Schlossnagle - - * zend_reflection_api.c: - Timm Friebe's patches for code celanup and additional functions. - -2003-07-01 Jani Taskinen - - * tests/.cvsignore - tests/bug21478.phpt - tests/zend2.php - tests/zend2.php.txt: - Missing .cvsignore, broken test, renamed zend2.php -> zend2.php.txt - -2003-07-01 Sebastian Bergmann - - * zend_reflection_api.c: - ZTS fixes. - -2003-07-01 George Schlossnagle - - * zend_reflection_api.c: - more incremental changes. add anything that needs a class factory. - - * zend_reflection_api.c: - all the easy parts of Reflection_Class - -2003-06-30 Shane Caraveo - - * zend_operators.h: - this fixes including this header in a c++ file (vs6) - -2003-06-30 Sterling Hughes - - * zend_compile.c: - nuke "main" as a reserved keyword - -2003-06-30 Andi Gutmans - - * zend.c - zend_API.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_mm.c - zend_opcode.c - zend_reflection_api.c: - - ZE coding style requires if ( instead of if( - -2003-06-30 Sebastian Bergmann - - * zend_reflection_api.c: - ZTS fixes. Remove unused local variables. - -2003-06-30 George Schlossnagle - - * Makefile.am - Zend.dsp - ZendTS.dsp - zend_default_classes.c - zend_reflection_api.c - zend_reflection_api.h: - added support for Reflection_Function, the first part of - the reflection api - -2003-06-30 Sterling Hughes - - * zend_builtin_functions.c: - move the check down a little so it catches all cases - - * zend_builtin_functions.c: - Fix bug #24399 from an excellent test case by edin - -2003-06-30 Zeev Suraski - - * zend_execute.c: - Semantically it's a refcount increase, not a lock... - - * zend_execute.c: - Fix 'global' implementation (fixes, at least, bug #24396 - -2003-06-30 Sterling Hughes - - * zend_operators.c: - revert back the optimization for now. - -2003-06-29 Ilia Alshanetsky - - * zend_object_handlers.c: - Fixed bug #24279 (__get() crash when no value is returned) - -2003-06-29 Sebastian Bergmann - - * ZEND_CHANGES: - Remove namespace references. - -2003-06-29 Sterling Hughes - - * zend_operators.c: - Very simple, but very effective optimization. Provides a signifigant speed - improvement to matches done via '=='. This checks that the lengths of two - strings are equal before performing a memcmp() on them. - -2003-06-23 Zeev Suraski - - * zend_execute.c: - Fix crash :) - -2003-06-23 Stanislav Malyshev - - * zend_execute.c: - FIx leak - -2003-06-22 Zeev Suraski - - * zend_execute.c - zend_language_parser.y: - Fix complex expressions for class names in NEW - - * zend_language_parser.y: - Simplify - -2003-06-21 Marcus Boerger - - * zend_language_parser.y: - WS - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Add final classes - -2003-06-16 Stanislav Malyshev - - * zend_execute.c: - no need to init zval - assignment will init - - * zend_execute.c: - Fix bug #22592 - cascading assignments to string offsets - - * zend_constants.c: - support for self:: and parent:: constants - - * zend_builtin_functions.c: - fix lambda function static vars (related to #17115) - -2003-06-15 Sebastian Bergmann - - * zend_constants.c: - Fix ZTS build. - -2003-06-15 Stanislav Malyshev - - * zend.c: - Fix bug #23279 - exception handler exits after first function call - - * zend_execute_API.c: - No need to duplicate code - zend_get_constant() knows to - handle class constants now - - * zend_execute_API.c: - Fix bug #18872 - Improper handling of class constants used as default - function argument values - - * zend_constants.c: - set ending \0 for string - - * zend_compile.c - zend_constants.c - zend_language_parser.y: - Fix bug #23384 - static class::constant constants should now - work in static & array expressions. - - * zend_execute_API.c: - Fix bug #21800 - initialize opcode handlers in interactive mode - -2003-06-14 Marcus Boerger - - * zend_hash.c: - ecalloc doesn't return NULL - - * zend.c: - Bugfix #24182: va_arg macro error in Zend/zend.c - -2003-06-10 Jani Taskinen - - * zend_multiply.h: - - Missing $Id$ tag - -2003-06-10 James Cox - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_default_classes.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_istdiostream.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - updating license information in the headers. - -2003-06-09 Wez Furlong - - * zend_execute_API.c: - Fix for Bug #23951 - -2003-06-09 Stanislav Malyshev - - * zend_execute.c: - remove NS leftover - -2003-06-09 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix bogus implicit declarations of properties (squash bug #23671) - -2003-06-09 Stanislav Malyshev - - * zend_API.c - zend_execute_API.c: - Support 'self' and 'parent' in call_user_func() - -2003-06-09 Zeev Suraski - - * zend_execute.c: - Fix indirect reference calls to bogus function names - -2003-06-09 Jani Taskinen - - * zend_builtin_functions.c: - ws - -2003-06-08 Zeev Suraski - - * zend_object_handlers.c: - Fix casing issues in access level checks - - * zend.c - zend_compile.c - zend_compile.h: - Nicer handling of protected/private members in print_r() - - * zend_execute.c: - Fix handling of object property assignments in switch expressions - (bug #23925) - - * zend_builtin_functions.c: - Fix set_error_handler() - -2003-06-06 Sascha Schumann - - * zend_multiply.h: - mfb #24025 fix - -2003-06-04 Stanislav Malyshev - - * zend.c: - fix non-ZTS build - -2003-06-04 Sebastian Bergmann - - * zend.c: - Fix segfault. Again. - -2003-06-04 Stanislav Malyshev - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_object_handlers.c: - rm namespace leftovers - -2003-06-04 Sebastian Bergmann - - * zend.c: - Fix segfault. #Hopefully not a Voodoo Fix[TM]. - -2003-06-02 Sebastian Bergmann - - * zend.c - zend_execute.h: - Leftover. - -2003-06-02 Stanislav Malyshev - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_object_handlers.c - zend_opcode.c: - MEGA-patch: namespaces are R.I.P. - -2003-06-01 Marcus Boerger - - * tests/zend2.php: - No nested classes - - * tests/bug20240.phpt - tests/bug20242.phpt - tests/bug21478.phpt - tests/bug21888.phpt - tests/bug22725.phpt: - Add some ZE2 bug tests - - * zend_opcode.c: - Bugfix #23670: implements and extends cause Apache 2 crash - - * zend_constants.c: - Do it correct always - - * zend_compile.h: - Defining it once is enough - -2003-05-31 Marcus Boerger - - * zend.c: - Fix init shutdown - -2003-05-31 Sterling Hughes - - * zend_compile.c - zend_execute.c: - revert the function call caching patch until a new solution is decided - upon. - -2003-05-31 Marcus Boerger - - * zend_constants.c: - Fix constants (noticed by David Brown ) - - * zend_constants.c: - c->name_len already contains the '\0' - -2003-05-30 Stanislav Malyshev - - * zend_execute.c: - fix crash on exceptions when return value of the inside function is used - -2003-05-29 Marcus Boerger - - * zend_compile.c - zend_language_parser.y: - Fix ~ operator in class constants. - - * zend_compile.c - zend_compile.h - zend_operators.c: - Faster interface inheritance & faster inheritance checks - - * zend_language_scanner.l: - CS - -2003-05-29 Wez Furlong - - * zend_compile.c: - Fix Bug #23285 (Potential Stack Overflow in zendlex). - -2003-05-28 Sterling Hughes - - * zend_alloc.c: - no reason to do this at runtime - - * zend_compile.c - zend_execute.c: - Cache function call lookups with loops (store in a temporary variable on - the - result opline). - Assuming lazy concensus on message that GeorgeS sent to the list last week - -2003-05-27 Sterling Hughes - - * zend.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - Assume lazy consensus regarding the cast_object() patch. *Only* - implemented - from a internals perspective. This callback has been very useful for both - ext/mono and ext/simplexml - -2003-05-26 Marcus Boerger - - * zend_language_scanner.l: - Add pseudo constant __METHOD__ to easily report namespace::class::method. - - -2003-05-23 Marcus Boerger - - * zend_API.h: - Revert to sizeof() - -2003-05-23 Sterling Hughes - - * zend_execute.c - zend_hash.c - zend_operators.c - zend_operators.h: - move HANDLE_NUMERIC() from the hash table implementation upstream to the - places that actually need to use it. - -2003-05-22 Marcus Boerger - - * zend_execute.c: - No need to copy here unless implicit_clone is active (noticed by rob) - -2003-05-21 Marcus Boerger - - * zend_API.c - zend_builtin_functions.c - zend_constants.c - zend_object_handlers.c: - Make use optimized string lowering - - * zend_operators.c - zend_operators.h: - Use same parameter order as strcpy() - - * zend_API.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_operators.h: - Make zend_str_tolower_copy() a copy function (like stccpy). - Supply a dup version (like estrdup). - Fix tolower() handling. - -2003-05-21 Jani Taskinen - - * zend_builtin_functions.c: - Fixed bug #23619 (set_error_handler() registered handler not called for - object instances). (Jani, waboring@qualys.com) - -2003-05-21 Sterling Hughes - - * zend_operators.c: - optimize loops. The check only exists for integers because that's the more - common optimization, and you actually lose performance if you check for - a double too (wierd but true). - - * zend_mm.h: - add some logic to detect zend_mm, which is really only useful when thread - safety support is enabled. - - * zend_mm.h: - leave this off until its more ready/stable - php5 actually beats php4.3.* in my benchmarks now - - - * zend_API.c: - use zend_str_tolower_copy() - - * zend_execute.c: - Bottom drawer optimization to avoid this comparison, but this OP is - executed - quite often (all of the fetch_* ops) - -2003-05-20 Sterling Hughes - - * zend_operators.c: - bah humbug, use the pointer based version, which turns out to be an - instruction - faster - - * zend_operators.c: - use pointer arithmetic for the normal zend_str_tolower() - -2003-05-20 Marcus Boerger - - * zend_execute.c: - No need to copy the zval unless __clone() is called - -2003-05-20 Sterling Hughes - - * zend_operators.c: - make this faster and sexier - - * zend_execute.c: - use the new zend_str_tolower_copy() function - - * zend_operators.c: - doesn't need to be register - - * zend_execute_API.c - zend_operators.c - zend_operators.h: - optimize the lookups by avoiding a copy and then another pass - - Naked Dancing Girls should be given to: Myself, Zeev, Marcus, - and George Schlossnagle (in no particular order) - - * zend_API.h - zend_execute_API.c: - add fast_call_user_function() - -2003-05-20 Hartmut Holzgraefe - - * zend_API.h - zend_constants.h - zend_operators.h: - C++ compile fixes - -2003-05-19 Marcus Boerger - - * zend_execute.c: - Fix exception memleak - -2003-05-19 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: - fix __clone - -2003-05-12 Marcus Boerger - - * zend_execute_API.c: - One function call is enough - -2003-05-08 Marcus Boerger - - * zend_compile.c: - Inheritance fix - -2003-05-07 Edin Kadribasic - - * zend_compile.c: - Reverting Marcus' incomplete patch which broke the build. - -2003-05-07 Marcus Boerger - - * zend_compile.c: - Inheritance fixes - -2003-05-04 Marcus Boerger - - * zend_API.c: - Fix namespace issue: Only CG is needed here - - * zend_API.c - zend_API.h: - Allow functions in internal namespaces (for example factories) - - * zend_execute.c: - Modify the abstract error message so that it shows up to three methods not - implemented. - - * zend_execute.c: - Fix warnings - - * zend_compile.c: - Don't inherit twice what is needed only once - - * zend.c: - Fix bug #23162 user_error() crashs if > 1024 bytes (Marcus, Moriyoshi) - -2003-05-04 Sterling Hughes - - * zend_default_classes.h: - semicolon - -2003-05-03 Sterling Hughes - - * zend_default_classes.h: - proto - - * zend_default_classes.c: - add an accessor for the default exception - -2003-04-29 Sascha Schumann - - * zend_multiply.h: - Fix the *= operator - - Slightly modified patch by Wez Furlong - -2003-04-25 Jani Taskinen - - * zend_language_scanner.l: - Fixed bug #21820 ("$arr[foo]" generates bogus E_NOTICE, should be E_PARSE) - -2003-04-24 Sascha Schumann - - * zend_alloc.c - zend_alloc.h - zend_multiply.h: - add safe_emalloc - -2003-04-21 Stanislav Malyshev - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_object_handlers.c: - Change get_class() so that it returns qualified names for namespaced - classes. - - *HEADS UP*: get_class_name() handler interface is changed, now it should - allocate the space it returns with emalloc, and the users free it. If - anyone has problems with it or has suggestions how to do it without this - - please tell. - - Also: make function_exists() understand namespaces. - - * zend_execute.c: - make import * fail if such classes or functions already there - -2003-04-20 Sterling Hughes - - * zend_compile.c: - Add check for final properties - -2003-04-20 Stanislav Malyshev - - * zend_execute_API.c: - Check name before '::' so that it would be a namespace in - zend_lookup_ns_class - - * zend_builtin_functions.c: - refine the set_error_handler fix - - * zend_builtin_functions.c: - Fix for bug #21094 (set_error_handler can not accept methods), - by Timm Friebe - -2003-04-19 Sebastian Bergmann - - * zend.c: - Corrected patch by Marcus Brger . - -2003-04-18 Sterling Hughes - - * zend.c - zend_opcode.c: - Patch by Marcus Brger to fix some memleaks - -2003-04-18 Derick Rethans - - * zend.h - zend_extensions.c: - - Revert my symbol fix patch, and merge in Stas' fixes to Zend Engine 1. - - * zend.h: - - MacOSX also prepends the _ before symbols in bundles - -2003-04-17 Sebastian Bergmann - - * zend.c: - Patch by Marcus Brger . - -2003-04-11 Sebastian Bergmann - - * zend_compile.c - zend_compile.h: - Fix warnings. - -2003-04-10 Sterling Hughes - - * zend_compile.c: - satisfy andi's switch fetish ;-) - -2003-04-10 Sebastian Bergmann - - * zend_compile.c: - Fix ZTS build. Fix warning. - - * ZEND_CHANGES: - Document 'const' keyword. - -2003-04-10 Sterling Hughes - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - allow expressions within constants, so the following is possible - - class foo { - const a = 1<<0; - const b = 1<<1; - const c = a | b; - } - - this makes const a compile-time expression. all other operators are - unaffected. - -2003-04-10 Zeev Suraski - - * zend_language_parser.y - zend_language_scanner.l: - Revert Harald's commit - -2003-04-10 George Schlossnagle - - * zend_language_parser.y: - One line fix so that it will compile - -2003-04-09 Harald Radi - - * zend_language_parser.y - zend_language_scanner.l: - removing the *syntactical sugar* again - - -2003-04-08 Andrei Zmievski - - * zend_builtin_functions.c: - Switch some functions to use new zend_lookup_ns_class() methods. This - means that they will accept both simple and fully qualified class names. - - * zend_API.c - zend_API.h: - Rename zend_register_internal_class_in_ns() to a better, less filling, - but with the same great taste zend_register_internal_ns_class(). - - * zend_execute.h - zend_execute_API.c: - Add zend_lookup_ns_class() function. - - * zend_operators.h: - Move memnstr into Zend and make an alias for BC in PHP. - -2003-04-07 Jani Taskinen - - * zend_language_scanner.l: - Fixed bug #23093 (highlight_string() crashed with __FUNCTION__) - -2003-04-07 Sterling Hughes - - * zend_compile.h: - add markers that make this file easy to parse for external sources - -2003-04-04 Andrei Zmievski - - * zend_API.h: - Introduce ZEND_ME() and ZEND_METHOD() macros. Use these for declaring - class methods to avoid name collisions. - -2003-04-04 Stanislav Malyshev - - * zend_API.c - zend_API.h: - Fix namespace issues - -2003-04-03 Andrei Zmievski - - * zend_API.c: - Patch from Timm Friede for when EG(active_namespace) is NULL initially. - - * zend.c - zend_API.c - zend_compile.c: - Initialize all relevant zend_class_entry fields to avoid accidental - crashes. - -2003-04-03 Sebastian Bergmann - - * zend_list.c: - Leftover. - -2003-04-03 Sterling Hughes - - * zend_list.c - zend_list.h: - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - -2003-04-02 Andrei Zmievski - - * zend_API.c - zend_API.h: - - Add zend_register_internal_namespace() API function. - - Add zend_register_internal_class_in_ns() API function. - - * zend_compile.h: - Simplify. - -2003-04-02 Derick Rethans - - * zend_list.c: - - Fix whitespace - -2003-04-02 Sterling Hughes - - * zend_list.c - zend_list.h: - add the ability for curl_multi_info to introspect the handles. - - -2003-04-02 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Implement a different way to catch documentation comments. - - * zend_compile.c - zend_compile.h - zend_highlight.c - zend_language_parser.y - zend_language_scanner.l: - Revert portions of the doc comment patch. There should be no parser - errors now. - -2003-04-02 Stanislav Malyshev - - * zend_builtin_functions.c - zend_compile.h - zend_execute.c: - allow class_exists() to work with namespaces too. - add CLASS_IS_NAMESPACE macro - - * zend_builtin_functions.c: - fix typo - - * zend_builtin_functions.c: - fix parameterless get_declared_classes call - -2003-04-01 Andrei Zmievski - - * zend_execute.c: - Stas's patch on zend_execute.c (1.448 -> 1.449) resulted in a bug where - the namespaced member accesses didn't work. This should hopefully - correct it. - - * zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_opcode.c: - Split ZEND_NAMESPACE into user and internal namespaces. Hope this is - okay with engine folks. - -2003-04-01 Stanislav Malyshev - - * zend_builtin_functions.c: - improve namespace name hanfling - - * zend_builtin_functions.c: - fix get_declared_classes() - - * zend_language_parser.y - zend_language_scanner.l: - Add __NAMESPACE__ auto-constant. - - * zend_builtin_functions.c: - make get_declared_classes() work with namespaces (based on Tal Peer's - patch) - -2003-03-31 Andrei Zmievski - - * zend.h - zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Multi-purpose patch: - - The fields of zend_namespace were not completely initialized which - led to a variety of problems. - - The occurrence of class/interface/namespace definition is now - captured. - - Functions/classes/interfaces/namespaces can be preceded by doc - comments which are stored for use by extensions. - -2003-03-31 Stanislav Malyshev - - * zend.c: - Use strncpy instead of sprintf - -2003-03-30 Andrei Zmievski - - * zend_language_parser.y: - Since zend_do_begin_class_member_function_call assumes the previous - opcode is FETCH_CONSTANT, swap the calls around. - -2003-03-30 Sebastian Bergmann - - * zend_execute.c: - ZTS fix. - -2003-03-30 Stanislav Malyshev - - * zend.c: - Try to report class name of the exception - - * zend_execute.c: - Fix namespace switch - -2003-03-29 Zeev Suraski - - * zend_compile.c: - Add missing initialization - - * zend_compile.c: - Fix crash - - * zend_API.c - zend_compile.c - zend_compile.h: - Initial support for enforcing prototype of abstract/interface method - implementations - -2003-03-29 Sterling Hughes - - * zend.c: - remove unused variable - -2003-03-27 Stanislav Malyshev - - * zend_execute.c: - fix fetch_class buglet - -2003-03-26 Stanislav Malyshev - - * zend_execute.c - zend_language_parser.y: - Un-nest namespaces - now namespace X { namespace Y {} } is a parse error - Also refine namespaced includes - -2003-03-26 Ilia Alshanetsky - - * zend_compile.c: - Fixed bug #22900 (declaration of namespaces with same name results in - leaks). - -2003-03-26 Sebastian Bergmann - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.h: - Eliminate TSRMLS_FETCH() calls in destroy_op_array() and - zend_get_class_entry(). - - * zend_API.c - zend_object_handlers.c - zend_objects.c - zend_objects.h: - Eliminate TSRMLS_FETCH() calls in zend_objects_new() and - zend_objects_get_address(). - -2003-03-25 Andi Gutmans - - * zend_compile.c: - - Temporarily fix problem with inheriting from an internal class. This - might - - need some rework in the future (thanks to Marcus) - -2003-03-24 Stanislav Malyshev - - * zend_execute.c: - Fix {include|require}_once error message - if open - fails, don't use tream, use original name. - -2003-03-23 Andi Gutmans - - * zend.c: - - Fix win32 build - -2003-03-23 Stanislav Malyshev - - * zend.c: - resore namespace on shutdown - since some functions use - EG() and CG() pointers - -2003-03-23 Sebastian Bergmann - - * zend_default_classes.c: - ZTS fix. - -2003-03-23 Zeev Suraski - - * zend_compile.c: - Another fix for implicit public, perhaps it was not such a good idea :I - -2003-03-23 Sebastian Bergmann - - * Zend.dsp - ZendTS.dsp - zend_default_classes.c: - Add new files to ZendTS.dsp. Sync list of files in Zend.dsp with - ZendTS.dsp. ZTS fixes. - -2003-03-23 Sterling Hughes - - * zend_default_classes.h: - DEFAULT_CLASSES_H not DEFAULT_INTERFACES_H - - * Makefile.am - zend.c - zend_default_classes.c - zend_default_classes.h: - add a standard Exception class. - -2003-03-22 Shane Caraveo - - * zend_compile.h: - export functions needed by cli - - * zend_language_scanner.l: - fix crash in win32 debug build - -2003-03-20 Stanislav Malyshev - - * Zend.m4: - Add stdlib.h too - it is needed fot strto{ld} - -2003-03-19 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_highlight.c - zend_language_parser.y - zend_language_scanner.l: - - Keep track of starting/ending line numbers for user functions. - - Store last parsed doc comment in a compiler global for future use. - - * zend_API.c: - Lowercase the function name when used as key in the function name. The - original case is still preserved in zend_function structure. - -2003-03-18 Zeev Suraski - - * zend_compile.c - zend_object_handlers.c: - - Fix situation where a derived class declares a public (or implicit - public) - with the same name as a private in the parent - - Optimize 'static binding' of private properties a bit - -2003-03-18 Stig Bakken - - * RFCs/002.txt: - - email address change - -2003-03-17 Stanislav Malyshev - - * zend_extensions.c: - MFZE1 - -2003-03-17 Jani Taskinen - - * Makefile.am: - Added missing zend_mm.c file and renamed zend_object_API.c -> - zend_objects_API.c - -2003-03-13 Andrei Zmievski - - * zend_API.c: - Fix warning in va_start(). - -2003-03-12 Andrei Zmievski - - * zend_API.c: - Initialize the namespace when registering functions. - -2003-03-12 Zeev Suraski - - * zend_compile.c: - Fix a crash bug in the implicit public declaration - -2003-03-11 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Fix handling of ::func() - -2003-03-10 Zeev Suraski - - * zend_compile.c: - Clean redundant code - -2003-03-10 Jani Taskinen - - * zend_compile.c: - Fixed some leaks. Patch by Moriyoshi - -2003-03-10 Shane Caraveo - - * zend_config.w32.h: - fix isinf for win32 - -2003-03-09 Zeev Suraski - - * zend_language_parser.y: - Optimize - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix handling of ::foo - - * zend_compile.c: - Cleanup - -2003-03-09 Andi Gutmans - - * zend_language_scanner.l: - - Nuke junk - -2003-03-09 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix parsing rules of namespaces/classes - - * zend_language_parser.y: - Add ability to use ::interface_name in implements - - * zend_compile.c: - Fix :: handling - -2003-03-07 Sebastian Bergmann - - * ZEND_CHANGES: - Dedicated to Greg Beaver . - - * ZEND_CHANGES: - Document 'final'. - - * ZEND_CHANGES: - Fix class type hints example. - - * ZEND_CHANGES: - Update 'abstract' section. - -2003-03-07 Jani Taskinen - - * zend_ini.c - zend_ini.h: - Renamed OnUpdateInt -> OnUpdateLong to prevent further misunderstandings. - - * zend_execute.c: - Better fix for the memleaks (bug 19943) by Moriyoshi - -2003-03-06 Zeev Suraski - - * zend_compile.c - zend_execute.c: - Fix warnings - - * zend_execute.c: - Fix error message - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Require abstract classes to be explicitly declared 'abstract', in order to - avoid making developers traverse the entire class/interface hierarchy - before they can figure out whether a class is instantiable - (ok, so it makes sense :) - -2003-03-06 Sebastian Bergmann - - * ZEND_CHANGES: - -german+english+. - - * ZEND_CHANGES: - D some TBDs - -2003-03-06 Jani Taskinen - - * zend_execute.c: - Fixed bug #19943 (the memleaks) - -2003-03-06 Ilia Alshanetsky - - * zend_highlight.c: - More cleanup of the zend_strip() function. - No longer strip __LINE__, since while it may become useless it could break - code where __LINE__ is passed as a function parameter. - - * zend_highlight.c: - Fixed in zend_strip() that corrupted heredoc. - Optimized the writing routine by moving from putchar() to fwrite(). - Changed hardcoded opcode # to it's defined name. - -2003-03-06 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Change opcode name - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Add class type hints - -2003-03-05 Zeev Suraski - - * zend_compile.c: - Fix auto globals - - * zend_compile.c - zend_execute.c - zend_language_parser.y: - Implement $obj::static_func() - - * zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c - zend_operators.c - zend_operators.h: - Add support for interfaces - -2003-03-04 Zeev Suraski - - * zend_compile.c - zend_language_parser.y: - Remove legacy code - - * zend_compile.c: - Remove redundant code - -2003-03-03 Harald Radi - - * zend_API.c: - add missing strtolower - - * zend_API.c - zend_API.h: - commiting zend_disable_class patch for George: - disabled classes will be replaced by dummy classes - that print a warning upon instanciation - -2003-03-02 Zeev Suraski - - * zend_execute_API.c: - Fix destructors some more - - * zend_compile.c - zend_compile.h: - Improve infrastructure - - * zend.c - zend_compile.c - zend_compile.h: - Add infrastructure for JIT initialization of auto globals - -2003-03-01 Zeev Suraski - - * zend_compile.c: - Fix mem leak - -2003-03-01 Andi Gutmans - - * zend_compile.c: - - Make __construct() have higher priority than class name functions - - for constructors. - - Fix problem with the engine allowing final/abstract for the same method. - - Both patches are by Marcus Brger. - -2003-02-27 Rasmus Lerdorf - - * zend_ini_scanner.l: - MFB: We know ini file scanning will never be interactive, so speed it up a - bit. Need a dynamic check for the language scanner. - -2003-02-26 Sebastian Bergmann - - * ZEND_CHANGES: - Syntactic sugar is sweet. - -2003-02-25 Zeev Suraski - - * zend_compile.c: - Get the bits right - final/private fix - -2003-02-25 Jani Taskinen - - * acconfig.h: - Do not redefine zend_isnan if it is already defined. - - * Zend.m4: - - Fixed bug #14245 ('make install' fails on AIX when using --with-apxs). - -2003-02-24 Stanislav Malyshev - - * zend_compile.c: - fix exception handling - -2003-02-24 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_language_scanner.l: - Add 'final' - -2003-02-24 Sebastian Bergmann - - * ZEND_CHANGES: - Remove obsolete not on redeclaring protected members. - - * ZEND_CHANGES: - Leftover. - - * ZEND_CHANGES: - Initial documentation of namespace {}. - -2003-02-23 Zeev Suraski - - * zend_compile.c: - Move abstract inheritance logic to the right spot - - * zend_compile.c: - Fixed abstract handling in inheritence - -2003-02-20 Wez Furlong - - * zend_stream.c: - -cough* - Fix another stupid mistake. - -2003-02-20 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_opcode.c: - Allow namespaces to have a number of parts. I.e., now you can do: - namespace foo { - function abc() {} - } - ... - namespace foo { - functio def() {} - } - -2003-02-19 Wez Furlong - - * zend_stream.c: - Fix stupid mistake that only affected interactive mode. - -2003-02-18 Rasmus Lerdorf - - * zend_stream.c: - fileno() needs a FILE * here, and at least on FreeBSD with gcc-2.95.3 - it is unable to figure out that this is indeed a FILE * and hence it - won't compile without this cast. - -2003-02-18 Zeev Suraski - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_scanner.l - zend_opcode.c: - Avoid using a C++ reserved word - -2003-02-18 Wez Furlong - - * ZendTS.dsp - flex.skl: - Fixup build for win32 - - * Makefile.am - flex.skl - zend.c - zend.h - zend_compile.h - zend_execute.c - zend_globals.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l - zend_stream.c - zend_stream.h: - Implement simple stream support in the ZE scanners. - -2003-02-17 Zeev Suraski - - * zend_language_parser.y: - Whitespace & minor renames - - * zend_language_parser.y: - whitespace - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Improve handling of static member variables - - * zend_config.w32.h - zend_ini_parser.y: - Improve Win32 build performance - -2003-02-16 Zeev Suraski - - * zend_execute.c: - Fix complex cases of self-assignments (bugs #21600, #22231) - - * zend_execute.c: - Make EG(This) and EG(scope) available to internal methods - - * zend_execute.c: - Revert patches - they weren't ready yet! - - * zend.c: - Fix initialization - -2003-02-16 Georg Richter - - * zend_execute.c: - fixed compiler warning - - * zend_execute.c: - tested patch from Zeev (fixes oo-bug in ext/mysqli) - -2003-02-16 Stanislav Malyshev - - * zend_compile.c - zend_language_parser.y: - add support for ::foo syntax meaning "global one" - - * zend_compile.c: - remove debug prints - -2003-02-16 Sebastian Bergmann - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - ZTS fixes - -2003-02-16 Stanislav Malyshev - - * zend_object_handlers.c: - namespace patch - static variable access - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Namespace patch. Big changes: - 1. Nested classes are gone. - 2. New syntax for namespaces: - namespace foo { - class X { ... } - function bar { ... } - var x = 1; - const ZZ = 2; - } - 3. Namespaced symbol access: $x = new foo::X; - etc. - For now, namespaces are case insensitive, just like classes. - Also, there can be no global class and namespace with the same name - (to avoid ambiguities in :: resolution). - -2003-02-15 Ilia Alshanetsky - - * zend_ini_scanner.l: - Added feature #19645 (ini parser can now handle quoted multi-line values). - -2003-02-14 Thies C. Arntzen - - * zend_execute_API.c: - init current_execute_data befor we start executing - - * Makefile.am: - ups - - * Makefile.am: - add really nice dump_bt function for debugging in gdb - -2003-02-13 Zeev Suraski - - * zend_object_handlers.c: - Fix error handling in illegal property access - -2003-02-13 Harald Radi - - * zend_language_scanner.l: - MFB PHP_4_3 - -2003-02-12 Ilia Alshanetsky - - * zend_API.c - zend_API.h: - Removed zend_get_module(), this function is not used by anything and more - importantly. it does not work. It tries to find data based on numeric keys - in hash table using string keys. - -2003-02-12 Zeev Suraski - - * zend_compile.c: - Fix declaration of class members that don't have an explicit access - modifier - -2003-02-11 Zeev Suraski - - * zend_compile.c: - Fix require() handling - that's an old bug! - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Improve parser handling of 'abstract' - -2003-02-10 Zeev Suraski - - * zend_compile.c: - Fix zend_initialize_class_data() - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h: - Centralize class initialization - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Treat $this->foo inside class X as an implicit 'public $foo' if X::$foo - is not explicitly declared - - Forbid multiple declaration of the same variable - - * zend_execute.c: - whitespace - - * zend_API.c - zend_compile.c: - Add missing destructors - -2003-02-10 Stanislav Malyshev - - * zend_object_handlers.c: - update static constants too - -2003-02-10 Zeev Suraski - - * zend_builtin_functions.c: - Fix get_parent_class() - - * zend_object_handlers.c: - Restore missing check - - * zend_execute.c - zend_execute_API.c: - Add ability to reference self:: and parent:: in constant initializers - (bug #21849) - - * zend_execute.c: - Remove redundant code - -2003-02-09 Zeev Suraski - - * zend_execute.c: - Fix the array() problem (and probably some other problems too) - -2003-02-08 Georg Richter - - * zend_API.c - zend_API.h: - fixed zend_parse_method_param - -2003-02-08 Sebastian Bergmann - - * zend_builtin_functions.c: - zend_config.h (and its Win32 version) is already included by zend.h - -2003-02-08 Ilia Alshanetsky - - * zend_builtin_functions.c: - The string.h is already available through zend.h, so the manual inclusion - is not necessary. - -2003-02-07 Ilia Alshanetsky - - * zend_builtin_functions.c: - Added a check to ensure that string.h is available before trying to use it. - - Thanks Andi. - - * zend_builtin_functions.c: - Added missing header. - -2003-02-07 Zeev Suraski - - * zend_globals.h - zend_object_handlers.c: - Improve PPP handling of properties - - * zend_config.w32.h: - Better fix - - * zend_config.w32.h: - Fix Windows build - -2003-02-07 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #15734 (Added an optional parameter to get_defined_constants(), - which if passed, will include information regarding who created the - constant). - -2003-02-06 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #19506 (get_extension_funcs() can now retrieve a list of built-in - Zend Engine functions, if "zend" is specified as the module name). - Made get_extension_funcs() on failure. - -2003-02-06 Zeev Suraski - - * zend_compile.c: - Fix the 2nd buglet in the error message :) - - * zend_object_handlers.c: - Fix check - - * zend_hash.c - zend_hash.h: - Fix prototype (may have caused stack corruption) - -2003-02-05 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - - read_property cleanup - - Implement unset/isset/empty for PPP - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_opcode.c: - Rework static class properties - now supports access restrictions - - * zend_hash.c - zend_hash.h: - Add quick_exists() - - * zend_object_handlers.c: - Add PPP support for arrays - - * zend_compile.c: - Fix buglet in error message - -2003-02-04 Zeev Suraski - - * zend_object_handlers.c: - Missing update - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_object_handlers.c - zend_opcode.c - zend_ts_hash.c - zend_ts_hash.h: - Reimplement PPP properties - -2003-02-03 Sebastian Bergmann - - * zend_API.h: - Build fix. - -2003-02-02 Harald Radi - - * zend_API.c - zend_API.h: - extend the parameter parsing API by two functions - for parsing method parameters with automatic - detection if the function was called as such or as - a class method (with a valid this ptr). - if called as a function the first parameter has to be - the object it is operating on, if called as a method - this is used. - - -2003-02-02 Zeev Suraski - - * zend.h - zend_operators.h: - whitespace - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Core rearrangements - move Zend Objects specific code to their - specific implementation file - -2003-02-02 Andi Gutmans - - * zend_compile.c: - - Fix warning - -2003-02-01 Sebastian Bergmann - - * zend_ini_scanner.l - zend_language_scanner.l: - Fix build. - -2003-02-01 Jani Taskinen - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_istdiostream.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - - Added some missing CVS $Id$ tags, headers and footers. - -2003-01-30 Ilia Alshanetsky - - * zend_operators.c: - Fixed compiler warning regarding signed/unsigned int comparisons. - -2003-01-30 Harald Radi - - * zend_ts_hash.c - zend_ts_hash.h: - fix non-zts build for wez - -2003-01-30 Ilia Alshanetsky - - * zend_execute_API.c: - Fix ZTS build. - -2003-01-29 Stanislav Malyshev - - * zend_compile.h - zend_execute_API.c - zend_opcode.c: - Add additional stage to post-session cleanup. - We need separate cleanup stage because of the following problem: - Suppose we destroy class X, which destroys function table, - and in function table we have function foo() that has static $bar. Now if - object of class X was assigned to $bar, its destructor will be called and - will - fail since X's function table is in mid-destruction. - So we want first of all to clean up all data and then move to tables - destruction. - Note that only run-time accessed data need to be cleaned up, pre-defined - data can not contain objects and thus are not probelmatic. - -2003-01-29 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Code rearrangements - -2003-01-29 Stanislav Malyshev - - * zend_execute_API.c: - Fix object destructors: - zend_objects_store_call_destructors is not used anymore, we rely on - symbol tables cleaners to destroy all objects. - - * zend_objects_API.c: - extra safety - - * zend_compile.c: - fix memory leak - -2003-01-29 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Fix assignments to $this. - Fixes the 'make install' problem reported on php-dev - -2003-01-28 Zeev Suraski - - * zend_compile.c: - Fix a ticks related crash - - * (PHP_5_0_dev_before_13561_fix) - zend_execute.c: - Allow methods in parent classes to call protected methods in derived - classes - -2003-01-27 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c: - Replace MAKE_VAR opcode with special 'data' opcode - This opcode is not executeable but only holds data for opcodes - that need more than two arguments (presently only ASSIGN_OBJ and the ilk - but - in the future also ASSIGN_DIM) - -2003-01-26 Sascha Schumann - - * zend_API.c: - Replace snprintf() call using zend_error's capabilities - -2003-01-23 Zeev Suraski - - * zend_execute.c: - Let the scope propagate to internal functions - -2003-01-23 Jani Taskinen - - * zend_execute_API.c: - Fixed bug: #14542, register_shutdown_function() timeout problem - -2003-01-22 Stanislav Malyshev - - * OBJECTS2_HOWTO: - some small refinements for get_class_* - -2003-01-22 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #21814 (Allow booleans to be used as array keys). - -2003-01-21 Sterling Hughes - - * zend_objects_API.c: - fix by phanto to the cloning - -2003-01-19 Zeev Suraski - - * Zend.m4: - relabel - -2003-01-19 Stanislav Malyshev - - * zend_compile.c: - Restore for now old statics behaviour (so that indirect $$var references - would work again). Comprehensive fix will follow later. - -2003-01-19 Harald Radi - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l: - ini patch to allow 'entry[] = value' entries - -2003-01-17 Harald Radi - - * zend_objects.c - zend_objects.h: - export zend_objects_destroy_object() - static inline was meaningless anyways as the function - was only used as a callback handler and was never - called directly - - * zend_objects_API.c - zend_objects_API.h: - make std_object_handlers struct available for shared modules - -2003-01-16 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #20933 (isset/empty didn't work when used on string offsets). - -2003-01-15 Andi Gutmans - - * zend_compile.c: - - Revert int -> unsigned int change for str.len - -2003-01-15 Sascha Schumann - - * zend.h: - Revert commit which turned the lengths of strings into zend_uint. - -2003-01-14 Andi Gutmans - - * ZEND_CHANGES - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Change "is" to "instanceof" as it explains better what the operator - means. - - "is_a" was also appropriate but ugly. - -2003-01-14 Stanislav Malyshev - - * zend_API.c: - fix memory leaks and key size - -2003-01-14 Ilia Alshanetsky - - * zend_ini_parser.y: - MFZE2 - -2003-01-14 Stanislav Malyshev - - * zend_compile.c: - fix warning - - * zend_API.c - zend_API.h: - Make add_property_ functions work via write_property handler - - * zend.c - zend_object_handlers.c: - ws - -2003-01-14 Ilia Alshanetsky - - * zend_ini_parser.y: - Reverting previous patch. - -2003-01-13 Ilia Alshanetsky - - * zend_ini_parser.y: - MFZE2 - -2003-01-13 Andi Gutmans - - * zend_objects_API.c: - - Don't check if the handle is bogus. We should crash. - -2003-01-12 Harald Radi - - * zend_modules.h: - fix wrong dereferenciation - -2003-01-12 Stanislav Malyshev - - * zend_compile.c: - fix inheritance - - * zend_API.h: - Remove handle_property from here too - - * zend.c - zend.h - zend_compile.c: - RIP handle_* functions. ZE2 will use __ handlers instead. - - * zend_object_handlers.c: - Move Z_OBJ_P here. - - * zend_operators.h: - Remove Z_OBJ - it's internal to Zend objects, no generic function except - those in zend_object_handlers.c should use it. - Add Z_OBJ_HANDLER macro for easy access to handlers - -2003-01-12 Sebastian Bergmann - - * zend.c - zend.h - zend_builtin_functions.c: - ZTS fixes. - -2003-01-12 Stanislav Malyshev - - * zend_object_handlers.c: - add get_class_name handler - - * zend.c: - Use generic handlers instead of Z_OBJ - -2003-01-12 Harald Radi - - * zend_modules.h: - - - * zend_ini.h - zend_ini_entry.h - zend_modules.h: - partially revert previous commit and - change zend_modules.h to include - a forward declaration to zend_ini_entry - - * zend_ini.h - zend_ini_entry.h - zend_modules.h: - added zend_ini_entry to zend_modules_entry as - discussed with zeev - - * zend_builtin_functions.c: - fix 'use of uninitialized variable' warning - -2003-01-12 Stanislav Malyshev - - * zend_objects_API.c: - validate handle - -2003-01-12 Zeev Suraski - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_ini.c - zend_ini.h - zend_variables.c: - Implemented compatibility mode - To enable - zend2.implicit_clone = on in php.ini or using ini_set() - -2003-01-11 Andi Gutmans - - * zend_execute.c: - - Fix typo and whitespace - -2003-01-11 Derick Rethans - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c: - - Ported the zend_execute_internal hook to ZendEngine2. - -2003-01-11 Harald Radi - - * zend_ts_hash.c: - freed reader twice instead of writer and reader - -2003-01-10 Ilia Alshanetsky - - * zend_alloc.c: - MFZE2 - -2003-01-10 Andrei Zmievski - - * zend_API.c: - Automatically register constructor, destructor, and clone function when - class methods are registered. - -2003-01-09 Zeev Suraski - - * zend_compile.c: - Found some more occurences of that elusive bug... - - * zend_compile.c: - Fix one lousy, annoying lurking bug (memory corruption) - Sebastian - try coWiki again please... - - * zend_API.h: - Unify and make it easy to add code into the broken-string error handler - - * zend_language_parser.y: - Fix writability checks - - * zend.c: - Fix leak - -2003-01-08 James Cox - - * zend.h: - cvs is dev not alpha. - -2003-01-08 Ilia Alshanetsky - - * zend_builtin_functions.c: - MFZE2 - -2003-01-05 Zeev Suraski - - * zend_compile.c - zend_globals.h - zend_language_scanner.l: - MFZE1 - lineno fix - -2003-01-02 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix incorrect linkage of access-levels, when using private methods - -2003-01-01 Zeev Suraski - - * zend_API.c - zend_operators.h: - Win32 build fix - -2003-01-01 Stanislav Malyshev - - * zend_operators.h: - use handler for Z_OBJPROP - -2003-01-01 Zeev Suraski - - * zend_API.c: - Fix Wez's problem - -2002-12-31 Sebastian Bergmann - - * LICENSE - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_language_scanner.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - Bump year. - -2002-12-31 Stanislav Malyshev - - * zend_object_handlers.h: - fix level of indirection - -2002-12-30 Andrei Zmievski - - * zend_execute_API.c: - Adjust the error message. - -2002-12-30 Stanislav Malyshev - - * zend_object_handlers.h: - Oops, fix it indeed - - * zend_object_handlers.h: - Better check - -2002-12-26 Andrei Zmievski - - * zend_compile.c: - do_inherit_method_check() is supposed to return 0 or 1, not SUCCESS or - FAILURE. - -2002-12-14 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE2 - -2002-12-10 Zeev Suraski - - * zend_compile.c: - Fix check to allow for static+access level modifiers - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Allow variables to have both 'static' modifier and an access level. - NOTE: This only works at the syntax level right now (parser). It - doesn't actually work as of yet - all statics are considered - public for now - - Prevent users from putting more restrictions on methods in derived - classes - (i.e., you cannot make a public method private in a derived class, etc.) - -2002-12-09 Andi Gutmans - - * zend_mm.c: - - Fix a bug which I just introduced. - - * zend_mm.c: - - Fix typo - - * zend_mm.c: - - Improvements - - * zend_mm.c - zend_mm.h: - - First attempt to improve memory manager during realloc()'s - -2002-12-08 Zeev Suraski - - * zend_compile.c: - Remove comment - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Treat the absence of an access type just as if 'public' was supplied - - * zend_compile.c: - Simplify/fix inheritance checks - - * zend_execute.c: - Support private/protected constructors - -2002-12-07 Sebastian Bergmann - - * ZEND_CHANGES: - Update. - -2002-12-07 Zeev Suraski - - * zend_execute.c: - Fix error messages - - * zend_language_parser.y - zend_language_scanner.l: - Remove unintentional code - -2002-12-07 Andi Gutmans - - * zend_compile.c: - - Dissallow using parent, self and main as class names - -2002-12-06 Zeev Suraski - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_hash.h - zend_language_parser.y - zend_language_scanner.l: - - Implement public/protected/private methods. - - Prevent instantiation of classes with abstract methods. - Based in part on Marcus's patch. - -2002-12-01 Andi Gutmans - - * zend_alloc.c: - - Allow enabling of memory cache with zend_mm - - * zend.c - zend.c - zend.h - zend.h - zend_builtin_functions.c - zend_builtin_functions.c: - - MFZE1 - - * zend.c - zend.h - zend_builtin_functions.c: - - Revert as the patch doesn't compile - - * zend.c - zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_indent.c - zend_object_handlers.c - zend_opcode.c - zend_operators.c - zend_operators.h - zend_variables.c: - h WHitespace - - * zend.c: - - Initialize constants_updated (by Marcus) - - * zend_builtin_functions.c: - - Nuke use of deprecated macro - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - FN_IS_STATIC -> FN_STATIC - - * zend.c: - - Fix crash - - * zend_compile.c - zend_compile.h: - - My personal cleanups - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_language_parser.y - zend_object_handlers.c: - - Commit Marcus' cleanup of abstract and static inheritance and improve - - error messages - -2002-11-22 Derick Rethans - - * zend_API.c: - - Initialize all functions to non-static (patch by Marcus Brger - . - -2002-11-22 Sebastian Bergmann - - * zend_execute.c: - Show class name as well. Patch by Marcus Brger. - - * zend_execute.c: - Show the name of the abstract method in the error. - - * zend_compile.h: - Fix prototype. - -2002-11-20 Derick Rethans - - * zend_builtin_functions.c: - - MFZE1: Disable leak() and crash() when not using debug mode - -2002-11-20 Andi Gutmans - - * ZEND_CHANGES: - - Add abstract methods - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l: - - Fix build (thanks Marcus) - - Implement abstract methods, syntax: - - abstract function foo($vars); - - I don't see any reason why modifiers such as static/public need to be - - used with abstract. PHP is weakly typed and there would be no meaning to - - this anyway. People who want a strictly typed compiled language are - - looking in the wrong place. - -2002-11-19 Zeev Suraski - - * zend.c - zend.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c: - MFZE1 - error_reporting fix - -2002-11-18 Andi Gutmans - - * zend_language_scanner.l: - - MFZE1 - -2002-11-17 Stanislav Malyshev - - * zend_execute.c: - fix the leak - -2002-11-16 Andi Gutmans - - * zend_language_scanner.l - zend_language_scanner.l: - - MFZE1 - - * Zend.m4 - configure.in: - - MFZE1 - - * zend_hash.c: - - Commit fix for bug #19566 (I think it's by Marcus :) - -2002-11-14 Andrei Zmievski - - * zend_llist.h: - MFZE1 - -2002-11-13 Stanislav Malyshev - - * zend_execute.c: - semi-fix string offsets crash - now it doesn't crash, but still leaks - - * zend_object_handlers.c: - fix static - -2002-11-11 Andi Gutmans - - * ZEND_CHANGES: - - Update with statics - -2002-11-11 Sebastian Bergmann - - * zend_execute.c: - Fugbix typo. - -2002-11-11 Ilia Alshanetsky - - * zend.h: - MFZE1 - -2002-11-10 Andi Gutmans - - * zend_compile.c: - - MFZE1 - -2002-11-10 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - fix statics - make it behave like $this (fetch type "static") - Side effect: indirect references to statics won't work. - -2002-11-06 Sebastian Bergmann - - * zend_execute.c: - Fix ZTS build. - -2002-11-06 Stanislav Malyshev - - * zend_execute.c: - fix zend_assign_to_object_op - -2002-11-05 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE1 - -2002-11-05 Andi Gutmans - - * zend_compile.h: - - Shift around zend_op members - - * ZEND_CHANGES: - - A couple of updates - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - Add support for static methods. Basically methods which are defined as - - static don't have $this. That's the whole difference. - - * tests/zend2.php: - - $clone -> $that - - * zend_execute_API.c: - - Fix bug introduced with type change of free_op1/2 - - * zend_language_parser.y - zend_language_scanner.l: - - ATTENTION: Finally nuke old_function and cfunction. I think it is time - - to get rid of these BC notations. This is from the days of the move from - - PHP/FI 2 -> PHP 3 - -2002-11-05 Ilia Alshanetsky - - * zend_hash.c: - Revert of previous patch. - -2002-11-05 Andi Gutmans - - * zend_compile.c - zend_objects.c: - - Change the automatically created variable $clone in __clone() to - - $that as discussed at the PHP Conference. If there are any objections - - alternative names please let me know. The reason for changing it from - - $clone is because $clone sounds as if it's the newly cloned object and - - not the old one. - -2002-11-05 Stanislav Malyshev - - * zend_compile.c - zend_compile.h: - avoid using 'class' in exported functions - it annoys c++ - -2002-11-05 Stig Bakken - - * zend.c: - Fixed some special cases that were crashing for the exception default - handler. - -2002-11-04 Ilia Alshanetsky - - * zend_compile.c: - Silence compiler warnings. - - * zend_hash.c: - If ordered is not set a random compiler assigned value of *p2 would be - used, - this patch fixes the problem by initializing *p2 to NULL. - - * zend_operators.c: - Silence compile warning, ctype.h is needed for tolower() function. - - * zend_language_scanner.l: - MFZE1 - -2002-11-02 Derick Rethans - - * zend_language_scanner.l: - - Fix segfault when __CLASS__ was used outside a class definition - - * zend.c: - - MFZE1 - -2002-11-02 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE1 (20214). - -2002-11-01 Andi Gutmans - - * zend_execute.c: - Fix unset($this->foo) - -2002-10-24 Andi Gutmans - - * zend_execute.c - zend_opcode.c: - Also tune jmpz_ex - - * zend_execute.c - zend_opcode.c - zend_compile.h: - - Improve performance of part of the jmps. More to follow. - -2002-10-23 Andi Gutmans - - * zend_execute.c - zend_compile.c: - - This might improve performance. Commiting it so that I can check it on - - Linux - - * zend_execute.c: - - Make Ts access a macro. I need this for my next patch which should - - improve performance but not sure yet if it will. - -2002-10-22 Andi Gutmans - - * zend_execute.c: - Nuke unused get_incdec_op() - - Nuke old comment - - * zend_compile.h - zend_execute.c - zend_globals.h: - Improve overall engine performance - - * zend_execute.c: - Fix bug reported by Daniel T. Gorski - -2002-10-21 Thies C. Arntzen - - * zend_builtin_functions.c: MFZE1 - -2002-10-20 Stanislav Malyshev - - * zend_object_handlers.c: looks like this message should go - - * zend_compile.c: Fix private handling - -2002-10-20 Sebastian Bergmann - - * zend_highlight.c - zend_highlight.h: Sync zend_html_puts parameter list with Zend Engine 1. - -2002-10-19 Andi Gutmans - - * zend_compile.h: - Fix compile warning. - - * zend_opcode.c - zend_compile.h - zend_execute.c: - Improve opcode dispatching - -2002-10-18 Andi Gutmans - - * zend.c - zend_compile.c - zend_execute.c: - - Change opcode dispatch mechanism to use a function per opcode and use - - a lookup table using the opcode # to call the correct function. - - Still have lots of tuning to do. - - * zend_execute.c: - Cleanup - -2002-10-16 Sebastian Bergmann - - * zend_execute.c: Fix ZTS build. - -2002-10-16 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: Fix class static members: now the following code works: - - and returns "Hello" (class statics are not copied anymore, but looked up in - runtime) - - * zend_compile.c - zend_compile.h - zend_execute.c: Fix and generalize $this handling. - ZEND_FETCH_FROM_THIS is removed, IS_UNUSED type on class variables will be - used instead as the sign that it's a fetch from $this - -2002-10-14 Ilia Alshanetsky - - * zend_ini_parser.y - zend_ini_scanner.l - zend_globals.h: MFZE1 - -2002-10-14 Andi Gutmans - - * zend_execute.c - zend_language_parser.y: - Support new classname::$class_name, e.g.: - hello; - ?> - -2002-10-13 Ilia Alshanetsky - - * zend_extensions.h: Increased the API number. (re: floats patch) - -2002-10-12 Ilia Alshanetsky - - * zend_operators.c - zend_operators.h - zend.c - zend_execute_API.c - zend_globals.h: MFZE1 (floats & locale issue) - -2002-10-10 Sebastian Bergmann - - * ZEND_CHANGES: Fugbix typo. - -2002-10-10 Stanislav Malyshev - - * zend_object_handlers.c: add comment - - * zend_object_handlers.c: fix memory leaks - -2002-10-09 Stanislav Malyshev - - * zend_object_handlers.c: Fix object write handler behaviour: - * If this value is already set to given value, don't try to set it again. - * If we have reference, we should not move it. - * If we are assigning referenced variable, we should separate it. - -2002-10-09 Ilia Alshanetsky - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_object_handlers.c - zend_operators.c - zend_operators.h: MFZE1 zend_str_tolower issue. - -2002-10-07 Andi Gutmans - - * tests/zend2.php: - Fix test - - * zend_execute.c: - - Require $this-> when calling a methods. This whole automatic lookup - - first in the class and then in the global scope is confusing, slow and - - not quite BC compatible. - - * zend.c - zend_compile.c - zend_globals.h: - - Allow access to private/protected variables of $clone inside the __clone() - - method - -2002-10-06 Andi Gutmans - - * zend_execute.c: - Fix problem with unsetting object members. - -2002-10-01 Andi Gutmans - - * zend_language_parser.y: - - Fix problem when crashing on illegal tokens in class name during class - - definition. - -2002-09-30 Derick Rethans - - * ZEND_CHANGES: - No tabs :) - -2002-09-28 Derick Rethans - - * zend_builtin_functions.c: - Fix for defines... - - * zend_builtin_functions.c: - Fix build in non-ZTS mode - -2002-09-26 Ilia Alshanetsky - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_object_handlers.c - zend_operators.c - zend_operators.h: MFZE1 - -2002-09-25 Stanislav Malyshev - - * zend_extensions.h: - Propmote API NO year, so that it will never be the same as ZE1 API NO - -2002-09-24 Andi Gutmans - - * zend_compile.c: - Fix leak - - * zend_language_parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Megapatch to try and support inheritance from sub-classes. Things might - - be *very* buggy now so don't get too upset if that happens. - - I still need to improve some stuff but it's a good step (hopefully). - -2002-09-23 Andi Gutmans - - * zend_globals.h - zend_ini.c - zend_language_parser.y: - MFZE1. - -2002-09-21 Andi Gutmans - - * zend_extensions.h: - Someone screwed this up. - -2002-09-19 Derick Rethans - - * zend_ini.c: - Make Colin happy - -2002-09-19 Zeev Suraski - - * zend.c - zend.h - zend_execute_API.c: MFZE1 - connection_status() fix - - * zend.c: Fix non ZTS build - - * zend.c: Fix that obscure crash in Debug_TS mode - -2002-09-18 Zeev Suraski - - * zend.c: - Fix the thread-safe initialization of the ZE2. This should solve some - sporadic crashes, as well as the problem with the built-in constants. - - * zend_constants.c: Remove dead code - - * zend_builtin_functions.c: Add useful debugging function - -2002-09-17 Zeev Suraski - - * zend_hash.c - zend_hash.h: Add tracking for hashtable allocation - - * zend.c: ZE2 fix - - * zend_compile.c: whitespace - - * zend.c - zend.h: MFZE1 - threading fix - -2002-09-16 Andrei Zmievski - - * zend_API.h - zend_builtin_functions.c - zend_API.c - zend_execute_API.c: MFZE1 - -2002-09-15 Ilia Alshanetsky - - * zend_highlight.c: Make zend actually strip comments. Bug #18151 - - * zend.c: - Make zend return a proper exit error code when it encounters a parse error. - -2002-09-15 Andi Gutmans - - * zend_compile.c: - - Hopefully fix problem with __autoload not working well with inherited classes. - - There might still be some weird situations I haven't thought of. - - * zend_list.c - zend_execute.c: - WS fix - "while (" instead of "while(" - - * zend_execute_API.c - zend_ini.c - zend_list.c - zend_object_handlers.c - zend_objects_API.c - zend_operators.c - zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c: - WS - Always use "if (" and not "if(" - - * zend_execute_API.c: - WS - -2002-09-10 Stanislav Malyshev - - * zend_execute_API.c - zend_variables.c: MFZE1 - -2002-09-09 Stanislav Malyshev - - * zend_object_handlers.c: remove comment - -2002-09-08 Andi Gutmans - - * zend.h: - Prepare for alpha 3 - -2002-09-05 Stanislav Malyshev - - * zend_compile.c: quick-n-dirty inheritance support for __handlers - -2002-09-04 Sebastian Bergmann - - * ZEND_CHANGES: Whitespace fixes. - -2002-09-04 Stanislav Malyshev - - * zend_object_handlers.c: remove dead code - - * ZEND_CHANGES - zend_object_handlers.c: Fix __call and add some docs - -2002-09-04 Sebastian Bergmann - - * zend_object_handlers.c: Fix ZTS build. - - * ZEND_CHANGES: TBD: __call(), __get(), __set(). - -2002-09-04 Stanislav Malyshev - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_extensions.h - zend_object_handlers.c - zend_objects.c: Support for __get, __set and __call in classes. - This should work as follows: if class hasn't member with given name, - __get/__set is called. If class has no method with given name, __call is called. - __get/__set are not recursive, __call can be. - -2002-09-04 Sebastian Bergmann - - * ZEND_CHANGES: Workaround for superfluous comma in var_export() result. - - * ZEND_CHANGES: - Let debug_backtrace() example print out the class name, if applicable, and the function/method arguments. - -2002-09-03 Thies C. Arntzen - - * zend_builtin_functions.c: nuke warning - - * zend_builtin_functions.c: nuke unneeded stuff - -2002-09-03 Zeev Suraski - - * zend.c - zend.h - zend_ini.c: MFZE1 - -2002-09-03 Derick Rethans - - * zend_ini.c: - Revert - - * zend_ini.c: - - MFH for: Apply rest of html errors fix (Patch by Jan Lehnardt ) - -2002-09-03 Sebastian Bergmann - - * zend.h: - Add html_errors to zend_utility_values. Patch by Jan Lehnardt . - -2002-09-03 Andi Gutmans - - * zend_builtin_functions.c: - Fix typo - -2002-09-02 Thies C. Arntzen - - * zend_builtin_functions.c: - refine last patch. if the argument-stack is not consistent don't try to show - arguments. no call to zend_error is made as we might end up in an infinite - recursion if called from an error_handler. - so: if the arguments to functions aren't shown in debug_backtrace this is 'cause - the arument stack was not consistent when debug_backtrace was called. - - * zend_builtin_functions.c: - debug_backtrace() now checks the complete argument-stack for consistency. - -2002-09-02 Stanislav Malyshev - - * zend_execute.c: MFZE1 - -2002-09-01 Andi Gutmans - - * zend_llist.c: - Fix leak reported by "l0t3k" - -2002-09-01 Stanislav Malyshev - - * zend_operators.c: MFZE1 - -2002-08-28 Thies Arntzen - - * zend_builtin_functions.c - zend_execute_API.c: debug_backtrace() - - make args passed to functions called vy call_user_function available again. - - * zend_builtin_functions.c: debug_backtrace(): - - make args work if called from the error_handler - - fix refcount for args - - * zend.c: - clear current_execute_data on bailout as it would point into some freed area - on the stack. - -2002-08-28 derick - - * zend.c: - MFZE1 - -2002-08-26 Thies Arntzen - - * zend_builtin_functions.c: - debug_backtrace(): show name of included file for include and require calls - plus some small fixes suggested by andi. - -2002-08-24 Andi Gutmans - - * zend_builtin_functions.c: - Whitespace - - * zend_builtin_functions.c: - Whitespace and better variable name - -2002-08-24 Thies Arntzen - - * zend_builtin_functions.c: fix warning - -2002-08-23 Andi Gutmans - - * Zend.m4: - Add \n to configure fprintf - - * zend_extensions.c: - dlerror -> DL_ERROR - -2002-08-23 Thies Arntzen - - * zend_builtin_functions.c: - debug_backtrace: show include/require/eval as normal functions on the stack - -2002-08-23 derick - - * zend_builtin_functions.c: - No spaces :) - -2002-08-23 Thies Arntzen - - * zend_builtin_functions.c: - - debug_backtrace now also returns an array containing the arguments of the - called function. - - zeev, andi - is knowing the structure of the stack considered a bad thing in - zend_builtin_function? if yes i would have to create a new function in - zend_ptr_stack.c (but i think we are save this way) - - * zend_builtin_functions.c - zend_execute_API.c: - debug_backtrace: - added "type" ('->' or '::') for object calls. - made calls done thru call_user_func show-up correct in backtraces. - - andi, - does this look correct to you? - - * zend_execute.c: those are set by RETURN_FROM_EXECUTE - -2002-08-21 Thies Arntzen - - * zend_execute.c: - zend_execute: make sure that current_execute_data points to the right thing - after coming back from recursion. - -2002-08-19 Zeev Suraski - - * zend_operators.c: MFZE1 - -2002-08-17 Andi Gutmans - - * zend_execute.c: MFZE1 - -2002-08-17 Zeev Suraski - - * zend_execute.c - zend_hash.c: MFZE1 - -2002-08-16 Stig Bakken - - * zend.c: * append emacs footer - - * zend.c: * remove builtin exception class - -2002-08-16 Andi Gutmans - - * zend.c: - Fix whitespace - -2002-08-16 Stig Bakken - - * zend_execute_API.c - zend_globals.h - zend.c - zend_builtin_functions.c: - - Added set_exception_handler() function for registering a global, - catch-all exception handling function - - Added set_exception_handler() function for registering a global, - catch-all exception handling function (Stig) - -2002-08-15 Zeev Suraski - - * flex.skl - zend.c - zend_globals.h - zend_language_scanner.l: MFZE1 - -2002-08-14 jason - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y: - MFZE1 (use token instead of global for opcode counting) - -2002-08-13 Andi Gutmans - - * zend_execute_API.c: - - Fix crash when exception is raised in __autoload function - -2002-08-13 Zeev Suraski - - * zend.h: MFZE1 - -2002-08-08 sebastian - - * zend_objects.c: Fix warning. - -2002-08-08 stas - - * zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h: Add ZEND_API to functions - -2002-08-08 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Make new 'is' operator work with classes only and return false when - - the object isn't of the said class or the value isn't an object. - - * zend_static_allocator.c: - Bad Harald! :) - -2002-08-08 Zeev Suraski - - * zend_alloc.c: MFZE1 - -2002-08-07 phanto - - * zend_static_allocator.c - zend_alloc.c - zend_config.w32.h - zend_hash.c - zend_ini.c - zend_llist.h - zend_mm.c - zend_operators.c: make win32 debug output more verbose - -2002-08-03 Andi Gutmans - - * tests/zend2.php: - Small fix - -2002-08-03 Zeev Suraski - - * zend_execute.c: MFZE1 - -2002-08-01 stas - - * zend_execute.c - zend_hash.c: MFZE1 - -2002-07-30 jason - - * zend_compile.c - zend_execute.c - zend_globals.h: MFZE1 global declare - - * zend_compile.c: Fix segfault - -2002-07-30 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Adding 'is' operator that can be used to check the type of a variable, - or its class. - -2002-07-28 phanto - - * OBJECTS2_HOWTO: update the handlers struct - -2002-07-27 Andi Gutmans - - * zend_compile.c - zend_execute_API.c: - - Make sure classes are first looked for in the current scope. - - Make sure that during inheritance the global scope is searched if the - - current one doesn't work. - -2002-07-26 Andi Gutmans - - * zend_execute.c - zend.c - zend_builtin_functions.c - zend_compile.h: - - Fix problem with debug_backtrace() reported by Stig. We weren't reporting - - global function information because it wasn't available. We have to do - - an additional assignment per-function call so that it'll be available. - - Also don't define the global scope as function name _main_ but leave it - - empty so that frameworks like Pear can decide what they want to do. - -2002-07-25 sniper - - * Zend.m4: Fixed 3 major failures in this test: - - 1. Tests work better when they are actually run.. - 2. When file is opened, it should be closed sometime too. - 3. AC_TRY_RUN cleans after itself (rm -f conftest.*), so it's - good idea to read the values while the file still exists. - - -2002-07-24 Andi Gutmans - - * zend_mm.c: - Fix some compile problems with the new configure checks. - -2002-07-24 James Cox - - * Zend.m4 - zend_mm.c: move testing for the alignment values into configure. - - * Zend.m4: ws fixes. - -2002-07-23 Andi Gutmans - - * zend_hash.c: - Fix WS. - -2002-07-21 Andi Gutmans - - * zend_compile.c: - - Fix bug reported by Sebastian where old constructors didn't work in - - nested classes. - -2002-07-18 derick - - * zend.h - zend_extensions.c: - MFZE1 - MacOSX fixes by Marko Karppinen - -2002-07-17 Andi Gutmans - - * zend_compile.c: - - Remove code which wasn't supposed to go into the patch. - - * zend_compile.c - zend_language_parser.y: - Rejuggle some code. - -2002-07-17 sniper - - * ZEND_CHANGES: This was mentioned already above (with an example too :) - -2002-07-16 Andi Gutmans - - * ZEND_CHANGES: - Before I forget to list it, this was also added. - - * zend_language_scanner.l: - - Syntactic sugar - Add "public" as a synonym for "var". - - Now we have the three P's. - You can do: - - - -2002-07-15 derick - - * zend_operators.c: - MFH of the crap removal - -2002-07-15 Andi Gutmans - - * ZEND_CHANGES - zend.c - zend.h - zend_API.c - zend_compile.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - - Commit patch to support protected member variables (by Timm Friebe w/ - - some fixes by me). - - You can't access protected variables from outside the object. If you want - - to see a protected member from your ancestors you need to declare the - - member as protected in the class you want to use it in. You can't - - redeclare a protected variable as private nor the other way around. - - * zend_operators.c: - - Really implement bool increment/decrement as flip-flop. - -2002-07-14 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - ZEND_CHANGES: - - Nuke delete(). It was a big mistake to introduce it and I finally - - understand why Java didn't do so. - - If you still want to control destruction of your object then either make - - sure you kill all references or create a destruction method which you - - call yourself. - - * zend_execute.c: - Nuke some unused code - -2002-07-14 derick - - * zend_operators.c: MFZE1 - - * zend_operators.c: - MFZE1 - -2002-07-07 Andi Gutmans - - * zend_objects_API.c: - Path which should improve previous fix. - - * zend_objects_API.c: - - First try at solving problem with different objects being allocated the - - same id. - -2002-07-07 Stanislav Malyshev - - * zend_object_handlers.c: name length should be strlen+1 - -2002-07-07 Sebastian Bergmann - - * zend_language_parser.y: - Allow for 'class Namespace::Bar extends Foo' syntax. Patch by Timm Friebe . - -2002-07-06 Andi Gutmans - - * zend_execute.c: - - Fix problem where scope was lost in nested function calls. - - Thanks to Timm Friebe for diving into this one. - -2002-07-06 Zeev Suraski - - * zend_language_parser.y: spelling fix - -2002-07-05 Stig Bakken - - * zend_builtin_functions.c: * folding fixes - -2002-07-01 Andi Gutmans - - * zend_compile.c: - Fix bug when acccessing $this not in class scope. - - * zend_objects.h - zend_objects.c: - Export zend_object_get_address() - -2002-06-30 Andi Gutmans - - * ZEND_CHANGES: - Remember to document autoload when I have time. - -2002-06-30 Derick Rethans - - * zend_modules.h: - MFZE1 - -2002-06-29 Andi Gutmans - - * zend.h: - Get ready for alpha2 - - * zend_execute_API.c: - Invalid -> Undefined - - * zend_language_parser.y: - Add missing semi-colon. - - * zend_execute_API.c - zend_execute.c: - Improve some error messages. - - * zend_compile.c: - Revert previous fix. - - * zend_compile.c: - Change E_ERROR -> E_COMPILE_ERROR where needed. - - * zend_compile.c: - - Fix for bug #17882. We complain if the same method is declared twice. - - * zend.h - zend_operators.c: - Fix bug 15037 - - Bump version to alpha2-dev - -2002-06-28 Andi Gutmans - - * zend_operators.c: - WS fix - -2002-06-26 Andi Gutmans - - * zend_execute_API.c: - - Autoloading support based on patch from Ivan Ristic. - - Again I hope this feature ends up working well because if it doesn't we - - might need to nuke it. This only works for global scoped classes and it - - will never work for sub-classes so don't even ask!!!!! - - Just define an __autoload() function in the global scope and it will be - - called with the class name as the parameter if it doesn't manage to find - - the class. - - * zend_API.c - zend_builtin_functions.c - zend_mm.h: - Centralize global class fetch - - * zend_alloc.c - zend_execute.c: - - Fix problem with scope's not changing correctly during method calls. - - Reapply a tiny optimization to the allocator so that in non-debug mode - - we clean memory without detecting leaks. - -2002-06-24 Andi Gutmans - - * zend_fast_cache.h: - - MFZE1 (Turn off fast cache until we make sure it performs well.) - - * zend_alloc.c: - More fixes (warnings, bug fixes etc.) - - * zend_execute.c: - - Revert patch which checks at run-time if you're allowed to assign - - certain values by reference. - - We still need to find a solution for cases when this shouldn't be allowed - - as it might cause leaks. - - * zend_alloc.c: - Fix crash bug and clean up a bit. - -2002-06-24 Sebastian Bergmann - - * Zend.m4: IMHO, ZTS should no longer be labeled experimental. - -2002-06-24 Andi Gutmans - - * zend_alloc.c: - MFZE1 - - * zend_alloc.c: - Don't use cache if we're using ZEND_MM - - * zend_mm.c: - - Hardcode alignment to 8. We might need a configure check for this. - - * zend_mm.c - zend_mm.h: - Improve memory manager to allocate small blocks quickly. - - * zend_alloc.h - zend_mm.h - zend_alloc.c: - - Don't keep allocated blocks in a linked list if we're in non-debug mode - - as now the memory manager takes care to nuke all leaking blocks. - - * zend.h - zend_types.h: - MFZE1 - -2002-06-23 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Fix problem with constructor not being inherited and called correctly. - - * zend_mm.c: - Fix small bug - - * zend_mm.c: - - Almost completely implement realloc(). It now resizes in place when - - possible. - -2002-06-22 Andi Gutmans - - * zend_alloc.c - zend_mm.c: - Fix crash when zend_mm_shutdown is called more than once. - - * zend_alloc.c - zend_alloc.h - zend_globals.h - zend_language_parser.y: - MFZE1 - - * zend_constants.h - zend_objects.c - zend_variables.c - zend_variables.h - zend_constants.c - zend_alloc.c - zend_alloc.h: - Nuke persist_alloc(). - -2002-06-19 Andi Gutmans - - * zend_globals.h: - - This was also supposed to be part of the previous ZEND_MM commit :) - - * zend_alloc.c: - - Oops, this was supposed to be part of the previous #ifdef ZEND_MM change - - * zend_mm.h: - Use #ifdef for ZEND_MM - - * zend_mm.c: - Make sure MAX is defined - - * zend_constants.c: - - Fix problem where you couldn't define constants with different cases but - - the same name. - -2002-06-18 Derick Rethans - - * zend.c: - MFZE1 - -2002-06-17 Andi Gutmans - - * zend_mm.c: - Improve speed of alignment calculation - - * zend_mm.c - zend_mm.h - zend_alloc.c: - - Fix a bug and add code which frees actual allocated segments at the end - - of execution (this still doesn't work because some blocks remain - - referenced after the memory manager is killed. - - * zend_mm.c - zend_mm.h: - Save space per-allocated block. - -2002-06-16 Andi Gutmans - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Fix bug in class constants - - Start centralizing main class lookups. This will help implement - - __autload() - - * zend_mm.c - zend_mm.h: - - Remove debug code which doesn't work anymore and add headers. - - * zend_globals.h - zend_mm.c - zend_mm.h - zend_alloc.c - ZendTS.dsp: - Commit an initial version of a home made memory manager. - - It's just for seeing if this would be an advantage to PHP in MT - - environments. If this is to become production material there is still - - a long way to go. - -2002-06-15 Andi Gutmans - - * zend_objects.h - zend_objects_API.c: - - Fix copy&paste problem where we allocated according to an old structure - - decleration and not the new one. - -2002-06-11 Andi Gutmans - - * zend_builtin_functions.c: - - Don't show debug_backtrace() in the trace itself. - - This patch is a bit ugly because the whole code itself is pretty complex - - and hard to re-order. - - * zend_execute.c - zend_language_parser.y: - - Fix problem with assigning functions by reference. - -2002-06-11 Sebastian Bergmann - - * RFCs/004.txt: Add __delegate(). - -2002-06-10 Harald Radi - - * zend_ts_hash.h - zend_ts_hash.c: added TS_HASH macro - -2002-06-10 Stanislav Malyshev - - * zend_execute.c: Fix leak - -2002-06-09 Harald Radi - - * zend_API.h - zend_builtin_functions.c - zend_object_handlers.h: - only check for an available class entry instead of - the std_object_handlers on some places - - -2002-06-08 Andi Gutmans - - * zend_hash.h - zend.h: - This should improve performance on Windows - - * zend_hash.h: - - Add a loop unrolled version of the hash function and a bit of an - - explanation about our hash function (Ralf S. Engelschall) - -2002-06-06 Sebastian Bergmann - - * RFCs/004.txt: Add RFC on delegation. - -2002-06-05 Sebastian Bergmann - - * zend_execute.c: Remove unused local variable. - -2002-06-05 Andi Gutmans - - * zend_compile.c - zend_execute.c - zend_object_handlers.c: - - Allow overloaded objects to receive the method name in its original - - case. - -2002-06-05 Derick Rethans - - * zend_llist.c: - Fix memleak (patch by Stefan Sesser) - -2002-06-04 Derick Rethans - - * zend_ini_scanner.l: - Fix for bug #17462 (Patch by Edin Kadribasic) - -2002-05-31 Andi Gutmans - - * ZendTS.dsp: - Add zend_objects_API.* to dsp - - * zend_objects_API.c: - Fix build (one more coming up) - - * zend_objects.c: - Fix build - -2002-05-31 Sebastian Bergmann - - * Zend.dsp: Add zend_objects_API.c to project. - -2002-05-31 Stanislav Malyshev - - * Makefile.am - zend_execute_API.c - zend_globals.h - zend_object_handlers.c - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h: Generalize object storage and reference bookkeeping - -2002-05-30 Venkat Raghavan S - - * zend.h - zend_config.nw.h - acconfig.h: NetWare changes - -2002-05-26 Andi Gutmans - - * zend_multibyte.c: - - Add empty zend_multibyte.c to allow build with 4.3.0-dev. - -2002-05-24 Sebastian Bergmann - - * ZEND_CHANGES: Fugbix typo. - -2002-05-24 Andi Gutmans - - * ZEND_CHANGES: - Add a bit of information. - -2002-05-20 Zeev Suraski - - * zend_API.h - zend_execute.h - zend_list.h: MFZE1 (Expose more C++ APIs) - -2002-05-14 Andi Gutmans - - * zend_objects.c - zend_objects.h: - constructor_called is supposed to be destructor_called - -2002-05-13 Sterling Hughes - - * zend_qsort.c: MFZE1 - -2002-05-13 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-05-12 Zeev Suraski - - * zend_highlight.c: MFZE1 - -2002-05-12 Sebastian Bergmann - - * ZEND_CHANGES: Rephrase. - - * ZEND_CHANGES: Beautify. - - * ZEND_CHANGES: Start documenting the debug backtracing. - - * ZEND_CHANGES: Whitespace fixes. - -2002-05-11 Zeev Suraski - - * zend_highlight.c - zend_highlight.h: MFZE1 - -2002-05-10 Andi Gutmans - - * zend_builtin_functions.c: - Nuke C++ comment - - * zend_builtin_functions.c: - - Make debug_backtrace() return an array. Still not finished because I - might want to differentiate between method calls and static methods. - - Example: - $bt = debug_backtrace(); - foreach ($bt as $frame) { - if (isset($frame['class'])) { - print $frame['class']; - print "::"; - } - print $frame['function']; - print " ["; - print $frame['file']; - print ":"; - print $frame['line']; - print "]\n"; - } - -2002-05-08 Andi Gutmans - - * zend_execute.c - zend_builtin_functions.c: - - Hopefully fix problems with debug_backtrace() - -2002-05-08 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-05-07 Andi Gutmans - - * zend.c - zend_builtin_functions.c - zend_compile.h - zend_execute.c: - - More debug backtrace work. It still doesn't work very well... - -2002-05-02 Andi Gutmans - - * zend.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: Initial support for built-in backtracing. - There are still a few problems such as includes and calling other functions - from internal functions which aren't seen (will have to think if and how to - fix this). - Also the main scripts filename isn't available. Need to think about that. - -2002-04-30 Stanislav Malyshev - - * zend_API.h - zend_builtin_functions.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.h - zend_API.c: Make OBJCE return zend_class_entry*, also some cleanups - -2002-04-28 Sebastian Bergmann - - * zend_alloc.c - zend_alloc.h: Revert. - -2002-04-27 Sebastian Bergmann - - * zend_alloc.c - zend_alloc.h: - MFZE1: If the size-operands of memset are constants, the compiler can turn them into fast inline code. So, instead of using ecalloc, we use emalloc + memset in macro form now. emalloc will not return NULL, so the chosen macro form is safe. This is not true for malloc(3). An inline function accomodates our needs here. Suggested by: http://www.mail-archive.com/dev%40httpd.apache.org/msg02492.html (Sascha) - -2002-04-25 Harald Radi - - * zend_config.w32.h: unbreak the win32 build - -2002-04-24 Harald Radi - - * zend_API.c: MFZE1 saschas 'Avoid exceeding buffer limits' patch - -2002-04-23 Harald Radi - - * zend_hash.c - zend_hash.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ts_hash.c - zend_ts_hash.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_API.c - zend_API.h - zend.h: some type cleanup work - -2002-04-22 Harald Radi - - * zend_object_handlers.c - zend_object_handlers.h - zend_objects.h - zend_operators.h - zend_API.c - zend_API.h - zend_builtin_functions.c: added get_class_entry callback handler to the - object handlers structure - -2002-04-22 Sebastian Bergmann - - * Zend.m4: MFZE1: Change default value of inline-opt to yes (Sascha). - -2002-04-22 Harald Radi - - * zend_config.w32.h - acconfig.h - flex.skl: fixed linkage warning under win32 - -2002-04-20 Zeev Suraski - - * zend_execute_API.c: MFZE1 - -2002-04-19 Sebastian Bergmann - - * zend_list.c - zend_hash.c - zend_hash.h: - MFZE1: make sure the resource-list is always consistent during shutdown (Thies). - - * zend_hash.c: MFZE1: Fix imbalance bug (Zeev). - -2002-04-10 Jani Taskinen - - * zend_language_scanner.l - zend_language_parser.y: MFZE1 - -2002-04-07 Stanislav Malyshev - - * zend.h: make compatible with current PHP - - * zend_compile.c: sync - -2002-03-29 Derick Rethans - - * zend_compile.c: - revert patch - -2002-03-25 Derick Rethans - - * zend_compile.c: - MFZE1 - -2002-03-23 Andi Gutmans - - * zend_ts_hash.c - zend_ts_hash.h: - - Fix build without ZTS. If someone has a nicer fix let me know. - -2002-03-21 Andi Gutmans - - * zend_language_parser.y: - - No idea how this slipped in. Fix delete $obj statement. - -2002-03-20 Harald Radi - - * ZendTS.dsp - zend.h - zend_ts_hash.c - zend_ts_hash.h: added thread safe hashtable which allows concurrent - reads but only exclusive writes - -2002-03-19 Andi Gutmans - - * zend_language_parser.y - zend.h: - - Finish covering all parsed methods to check for validity in parser. - - Change zval's refcount to zend_uint (If it doesn't slow down the Engine - - too much it should probably stay this way). If anyone has time to test - - the difference in speed between zend_ushort & zend_uint in zend.h of - - the struct _zval_struct (one line change) I'd be glad to get some - - figures. - -2002-03-18 Andi Gutmans - - * zend_compile.c - zend_language_parser.y: - - More fixes to check for member/function call legality. - -2002-03-17 Andi Gutmans - - * zend_language_parser.y - zend_compile.c: - - Start putting error handling where method calls are being used in a - - context where only writable variables should be used. - -2002-03-15 Andi Gutmans - - * zend_execute.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_variables.c: - Pass TSRMLS to callbacks. - - * zend_execute.c: - - Scope fix. When calling an imported function the scope will change - - correctly to the scope of the functions class. - - - * zend_opcode.c - zend_execute.c - zend_compile.h - zend_compile.c: - - Fix issues with $this when using it by itself without indirection such as - - $this->foo. - -2002-03-14 Stanislav Malyshev - - * OBJECTS2_HOWTO: more cleanup - - * OBJECTS2_HOWTO: Update howto - - * zend_execute.c: fix for delete $this and unset $this - - * zend_execute_API.c: Fix call_user_function - -2002-03-12 Andi Gutmans - - * zend.h: - Forgot to close comment. - - * zend.h: - Macro for duality between Engine 1 and 2 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_opcode.c - zend_operators.c: - Another couple of indirection fixes. - - Make class_entry->refcount be part of the structure and not allocated. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - Fix bug introduced with latest class hash table change. - -2002-03-12 Stanislav Malyshev - - * zend_API.c: Fix standard object creation - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend.c - zend.h: - make class tables contain class_entry *, not class_entry - - fix isset($this) - -2002-03-10 Andi Gutmans - - * zend_execute.c: - Fix build in ZTS mode. - -2002-03-10 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: New stuff for objects API: - - Better assignment handling - - More flexible operations with zval-containing objects - -2002-03-09 Andi Gutmans - - * tests/zend2.php: - - Add the original example script to the CVS so that it's always available. - -2002-03-08 Sebastian Bergmann - - * ZEND_CHANGES: Add 'import const' example. - -2002-03-08 Andi Gutmans - - * zend_execute.c: - Support importing constants. e.g.: - - - * ZEND_CHANGES: - Add another 'import' example and merge 'import' section into 'Namespaces' section. - -2002-03-06 Andi Gutmans - - * zend_execute.c: - - Add function * and class * functionality. Only constants are left. - - - * ZEND_CHANGES: Consistency. - - * ZEND_CHANGES: Add 'import statement' section. - -2002-03-02 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Initial patch to support importing from class scopes (for Stig). - - It isn't complete yet but I want to work on it from another machine. It - - shouldn't break anything else so just don't try and use it. - - The following is a teaser of something that already works: - - -2002-03-02 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-03-01 Andrei Zmievski - - * zend_API.c: MFZE1 - -2002-03-01 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Remove use of C++ reserved words namespace/this - - * zend_opcode.c - zend_language_parser.y - zend_compile.h - zend_compile.c - zend_API.c: - Fix bug in nested try/catch's - - Infrastructure for implementing imports of methods. - - * zend_objects.c: - - Fix crash reported by Sebastian when destructor function causes a fatal - - error. I hope this does it and we don't find any other problems. - -2002-02-26 Andi Gutmans - - * zend_alloc.h - zend_alloc.c - zend.c: - MFZE1 - -2002-02-21 Sebastian Bergmann - - * ZEND_CHANGES: - Maintain ZEND_CHANGES to account for the addition of private member variables. - -2002-02-21 Andi Gutmans - - * zend_object_handlers.c - zend_opcode.c - zend_language_parser.y - zend_language_scanner.l - zend_compile.c - zend.c - zend.h - zend_API.c: - Experimental support for private members. - Hello; - } - } - - class MyClass2 extends MyClass { - function printHello() - { - MyClass::printHello(); /* Should print */ - print $this->Hello; /* Shouldn't print out anything */ - } - } - - $obj = new MyClass(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); /* Should print */ - - $obj = new MyClass2(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); - ?> - -2002-02-14 Stanislav Malyshev - - * zend.h - zend_API.c: Pass TSRM to create_object - -2002-02-14 Andrei Zmievski - - * zend_compile.c: - Fix the bug where the declared properties without init values were not - entered into the table. - -2002-02-13 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - * zend_compile.h: - Export lex_scan(). Both the PHPDoc and tokenizer extension need this. I hope this is okay with Z&A. - -2002-02-08 Andi Gutmans - - * zend_objects.c: - Remove object debug messages. - -2002-02-07 Stanislav Malyshev - - * Makefile.am - OBJECTS2_HOWTO - ZendTS.dsp - configure.in - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: Mega-commit: Enter the new object model - Note: only standard Zend objects are working now. This is definitely going to - break custom objects like COM, Java, etc. - this will be fixed later. - Also, this may break other things that access objects' internals directly. - -2002-02-04 Andi Gutmans - - * zend_execute.c: - - This small patch should also take care of allowing unseting of $this->foo - - and static members. The unset() opcode was luckily already suitable for - - object overloading. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_objects.c: - - Fix problem with the objects_destructor called during shutdown. It was - - freeing objects from id 0 instead of id 1. id 0 is not used. - - Change isset/empty opcodes to support static members and the new way of - - doing $this->foobar. Also the opcodes operate now on the hash table - - combined with the variable names so that they can be overloaded by the - - soon to be added overloading patch. - -2002-02-03 Adam Dickmeiss - - * Makefile.am - configure.in: - Zend config sets ZEND_EXTRA_LIBS. Bugs 14452, 14602, 14616, 14824 - -2002-02-02 Sebastian Bergmann - - * zend_builtin_functions.c: Revert per Andi's request. Sorry :-( - - * zend_builtin_functions.c: Fix warning. Again :-) - -2002-02-02 Andi Gutmans - - * zend_builtin_functions.c: - - Please don't use strcmp() and friends in Zend but only the mem* - - functions. I didn't check this patch so please check that it works. - -2002-02-02 Sebastian Bergmann - - * zend_builtin_functions.c: Fix a warning. - -2002-02-02 Andi Gutmans - - * zend_modules.h: - Nice catch by Derick. GINIT is dead. - -2002-02-01 Sebastian Bergmann - - * zend_builtin_functions.c: MFZE1: is_a() - -2002-01-27 Sebastian Bergmann - - * zend_config.w32.h: - MFZE1: define a couple of macros under win32. (Patch By: Jon Parise ) - -2002-01-25 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_objects.c - zend_objects.h - zend_opcode.c: - - First destructor hell fix. There was a situation where an object's - - destructor could be run after its class was already dead. Right now - - object destructors is the first thing whic happens during shutdown in - - order to prevent this problem. It's very likely that destructors will - - cause more grief and we'll have to outline exactly when you should use - - them and what kind of logic you're allowed to do inside of them. - - This bug was reported by sebastian. - -2002-01-22 Andi Gutmans - - * zend_execute.c: - - Fix a bug reported by Sebastian with indirect class names not working. - -2002-01-20 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - Improve performance of functions that use $GLOBALS[] - - Please check this and make sure it doesn't break anything. - -2002-01-19 Thies C. Arntzen - - * zend_language_parser.y: MFZE1 - -2002-01-14 Andi Gutmans - - * zend_execute_API.c: - - Fix crash bug in call_user_function_ex(). Thanks to Sebastian for the - - very nice and short reproducing script. - - -2002-01-14 Sebastian Bergmann - - * ZEND_CHANGES: Update Exceptions example. - -2002-01-13 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Change exception handling to use the Java-like catch(MyException $exception) - - semantics. Example: - exception = $exception; - } - - function Display() - { - print "MyException: $this->exception\n"; - } - - } - class MyExceptionFoo extends MyException { - function __construct($exception) - { - $this->exception = $exception; - } - function Display() - { - print "MyException: $this->exception\n"; - } - } - - try { - throw new MyExceptionFoo("Hello"); - } catch (MyException $exception) { - $exception->Display(); - } - ?> - - * zend_ini_scanner.l: - MFZE1 - -2002-01-06 Andi Gutmans - - * zend.c: - - Output error when there's an uncaught exception (by Timm Friebe) - - * zend_execute.c: - Make sure $this is passed on to methods - -2002-01-06 Sebastian Bergmann - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c: Happy New Year. - -2002-01-05 Andi Gutmans - - * zend_compile.c: - Small fix - - * zend_compile.c - zend_compile.h - zend_execute.c: - Allow passing of $this as function arguments. - - Fix a bug which I introduced a couple of months ago - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Significantly improve the performance of method calls and $this->member - - lookups. - -2002-01-04 Andi Gutmans - - * zend_execute.c: - - Improve performance of indirect-referenced function calls - - * zend_compile.c: - Nuke C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c: - Separate other kinds of function calls too. - - Significantly improve performance of function calls by moving lowercasing - - the function name to compile-time when possible. - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Start splitting up different kinds of function calls into different - - opcodes. - -2002-01-03 Derick Rethans - - * zend_API.c - zend_API.h - zend_execute.c - zend_list.c: - - MFZE1 for exit fix, exposing current function name in error messages and - exposing zend_zval_type_name(). - -2001-12-31 Sebastian Bergmann - - * ZEND_CHANGES: Consistency. - -2001-12-31 Andi Gutmans - - * ZEND_CHANGES: - - Add example of default argument for argument passed by-ref - -2001-12-30 Sebastian Bergmann - - * ZEND_CHANGES: Typo. - -2001-12-29 Andi Gutmans - - * zend.h: - - #define to help #ifdef stuff in PHP sources to make them work w/ ZE1 and - - 2 - - * ZEND_CHANGES: - A few clarifications - -2001-12-29 Sebastian Bergmann - - * ZEND_CHANGES: Integrate Andi's examples and some notes by Stig. - - * ZEND_CHANGES: Update Exceptions example. - -2001-12-28 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Fix some case insensitivity stuff in respect to classes - - * zend_execute.c - zend_language_parser.y: - - Support default arguments for reference parameters - - Fix two compile warnings - - * zend_compile.c: - - Wasn't adding the lower case version of the class name to the hash - -2001-12-27 Andi Gutmans - - * zend_compile.c - zend_objects.c: - - Use two underscores for __construct(), __clone and friends... - - * zend_objects.c: - - Only check refcount of object if the destructor was called. - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c - zend_objects.h: - - Experimental support for destructors. We need to see if destructors - - will actually work well in the context of PHP so we should consider this - - as experimental. Possible problems might be that when the constructor is - - run PHP might not be in a stable state. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Support parent:: again - - * zend_compile.c: - Support unified constructor name _construct() - -2001-12-26 Andi Gutmans - - * zend_execute.c - zend_execute_API.c: - Fix scoping issue. The following works now: - id = self::$id++; - } - - function _clone() - { - $this->name = $clone->name; - $this->address = "New York"; - $this->id = self::$id++; - } - } - - - - $obj = new MyClass(); - - $obj->name = "Hello"; - $obj->address = "Tel-Aviv"; - - print $obj->id; - print "\n"; - - $obj = $obj->_clone(); - - print $obj->id; - print "\n"; - print $obj->name; - print "\n"; - print $obj->address; - print "\n"; - - * zend.c: - Print out object id for easier debugging - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c: - Pretty much finish _clone() support - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Initial support for _clone() - - * zend_compile.c - zend_language_parser.y: - - Start fixing the parsing rules so that function and method calls - - can't be used in a write context. - - * zend.c: - Fix crash correctly. - -2001-12-25 Andi Gutmans - - * zend_language_parser.y: - Revert delete syntax patch - - * zend.c - zend_execute.c: - Fix a crash (not a thorough fix). - - Commented old code - -2001-12-24 Andi Gutmans - - * zend_execute.c: - - Fixed bug where global functions weren't called if they didn't exist - - in the class scope - -2001-12-23 Andi Gutmans - - * zend.c: - - Fix a bug where function's didn't work anymore in multi-threaded - - servers after the latest startup changes. - -2001-12-22 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_language_parser.y: - - Add initial capability of defining nested classes as class foo::bar - -2001-12-18 Zeev Suraski - - * zend_language_scanner.h - zend_language_scanner.l: MFZE1 - -2001-12-16 Sebastian Bergmann - - * ZEND_CHANGES: I'm too trigger-happy. - - * ZEND_CHANGES: delete is now function - -2001-12-16 Andi Gutmans - - * zend_language_parser.y: - - Seems like most people prefer delete($obj) over delete $obj. - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Start adding parsed variable checks. - - * zend_compile.h - zend_language_parser.y: - - Framework for knowing what kind of variable we just parsed. - - This will be used in compile-time error checking which couldn't be done - - at the level of the grammar. - -2001-12-13 Andi Gutmans - - * zend_language_parser.y: - - Rearrange grammar to allow dereferencing of objects returned from - - functions. It still crashes though. - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Fix crash bug in startup code. - - Start work on being able to reference global and local scope - -2001-12-12 Andi Gutmans - - * Zend.dsp - zend.c - zend_constants.c - zend_globals.h: - - Infrastructure changes for allowing to access the global scope from - - within a class scope. - - Fix the Zend.dsp project a bit. It seems someone pretty much killed it - - when commiting their own personal configuration. Please be careful in - - future. - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Make classes have scope and function/constant lookups default to the class - -2001-12-11 Andi Gutmans - - * zend.c: - Merge from ZE1 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: - - Rename zend_class_entry.constants -> zend_class_entry.constants_table - - * zend_execute.c: - - Start making scope change correctly when calling namespace functions. - - When inside a namespace fallback to global namespace when function - - or constant is not found. - -2001-12-11 Sebastian Bergmann - - * LICENSE: Forgot to update the LICENSE. - - * LICENSE - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h: Update headers. - - * Zend.m4 - zend.h: MFZE1 (AIX fixes) - - * zend_highlight.h - zend_highlight.c: MFZE1 (added zend_strip mode in the highliter) - -2001-12-10 Andi Gutmans - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - More namespaces work. - - Nuke memory leak. - -2001-12-08 Andi Gutmans - - * zend.c: - Fix crash with unhandled exceptions - -2001-12-06 Andi Gutmans - - * zend_execute.c: - Support constants. The following works now: - - - * zend_language_parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Initial work on changing namespace scope. Only methods & variables - - right now. - - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y: - - Nuke the namespace work I did. It'll be redone differently. - -2001-12-05 Sebastian Bergmann - - * ZEND_CHANGES: Document recent changes. - -2001-12-04 Andi Gutmans - - * zend_builtin_functions.c: - Damn Zeev :) - -2001-12-01 Andi Gutmans - - * zend_API.c: - - Revert one of the changes because it might be before the memory - - manager has started. - - * zend_API.c - zend_constants.c: - Use alloca() when possible. - -2001-11-30 Andi Gutmans - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - - Initial support for class constants. There are still a few semantic - - issues which need to be looked into but basically it seems to work. - - Example: - - - * Zend.m4: - Fix typo - -2001-11-27 Andi Gutmans - - * zend_language_parser.y: - - Support syntax for class constants (doesn't do anything yet but - - required some reworking of the grammar). - -2001-11-26 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Support static $var = 0; style initialization of static class - - members. For example: - - class foo { - - static $my_static = 5; - - - - } - - - - print foo::$my_static; - -2001-11-25 Andi Gutmans - - * zend.c - zend_compile.c: - Fix crash and leak - - * zend_compile.c: - Whitespace - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_opcode.c: - Support static members. The following script works: - - -2001-11-24 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: - MFZE1 - -2001-11-15 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-11-05 stig - - * zend_objects.h: add newline at end of file to avoid warnings - - * zend_language_parser.y: non-zts compile fix - -2001-11-04 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - Support instantiation of nested class. The following script now should - - work: - -bar(); - - - - $obj = new foo::barbara(); - - $obj->bar(); - - - -2001-11-03 Andi Gutmans - - * zend.h: - RISC OS patch by Alex Waugh - - * zend.c - zend_API.h - zend_compile.c: - Add some initializations - - * zend_compile.c - zend_execute.c - zend.h: - - Add constructor to the zend_class_entry instead of looking it up each - - time by name. - - This will allow the next patch of being able to instantiate nested - - classes such as new foo::bar::barbara(); - -2001-10-29 Andi Gutmans - - * zend_API.c - zend_opcode.c: - Fix internal classes - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_globals.h - zend_language_parser.y - zend_opcode.c: - Initial support for nested class definitions - -2001-10-27 Zeev Suraski - - * zend_execute.c: MFTGZE1 - -2001-10-26 Andi Gutmans - - * zend_execute_API.c: - Fix Zeev's MFZE1 - -2001-10-23 Zeev Suraski - - * zend_constants.c - zend_execute_API.c - zend_globals.h: MFZE1 - -2001-10-20 Andrei Zmievski - - * zend_API.c: MFHZ1 - -2001-10-12 Sebastian Bergmann - - * zend_API.c - zend_API.h - zend_modules.h: MFZE1: Introduced extension version numbers (Stig) - -2001-10-04 Sebastian Bergmann - - * zend_hash.c: MFZE1 - -2001-09-30 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Merge the NAMESPACES_BRANCH. It wasn't a good idea to have a branch when - - the whole CVS tree is work in progress - - * zend_compile.h - zend_execute.c: - - At last I've had some time to move all execute() locals into one struct. - - No immediate gain but it makes it more clear what variables are temps - - and which ones are execute() locals. - -2001-09-27 Andi Gutmans - - * zend_modules.h: - Bump it up in the right place - - * zend_modules.h: - Increase API number - -2001-09-26 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_execute.c: - Good catch by Sterling - -2001-09-24 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_globals.h: - More namespaces work - -2001-09-22 Sebastian Bergmann - - * ZEND_CHANGES: Keep ZEND_CHANGES up-to-date. - -2001-09-22 Zeev Suraski - - * zend_globals.h - flex.skl - zend.c - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-20 Andi Gutmans - - * zend.c - zend_compile.c: - Fix build on Win32 - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend.c: - - Create a branch for namespaces. This isn't even remotely close to - - working. - - * zend_list.h: - Nuke unused enum - -2001-09-19 Zeev Suraski - - * flex.skl - zend.c - zend_globals.h - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-19 Andi Gutmans - - * Makefile.am: - MFZE1 - -2001-09-19 Sebastian Bergmann - - * Makefile.am - zend_hash.c - zend_hash.h - zend_ini.c - zend_llist.c - zend_llist.h - zend_qsort.c - zend_qsort.h - Zend.dsp - ZendTS.dsp: MFZE1 - -2001-09-17 Brian L. Moon - - * RFCs/003.txt: adding RFC for loose type requirements for functions - -2001-09-16 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-09-10 Zeev Suraski - - * zend_compile.h - zend_globals.h - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: MFZE1 (nuke cplusplus code) - - * zend.c - zend_execute_API.c - zend_globals.h: MFZE1 (support return value in execute_scripts) - -2001-09-08 stig - - * RFCs/002.txt: remove bogus comment :) - - * RFCs/002.txt: RFC document for namespaces - - * RFCs/001.txt: wrapped to 80 columns :) - -2001-09-07 Andi Gutmans - - * zend_compile.c - zend_language_parser.y: - - Shift around the variable parsing code to make it simpler. - - * zend_llist.c: - - Fix warning (was fixed in ZE1 and not merged at some point). Please make - sure you merge patches! - -2001-09-05 Stanislav Malyshev - - * zend_operators.c: MFZE1 - -2001-09-03 Andi Gutmans - - * zend_language_parser.y: - CLS_CC -> TSRMLS_CC - -2001-08-31 Sterling Hughes - - * zend_llist.h: spaces->tabs - - * zend_llist.c - zend_llist.h - zend_execute_locks.h: MFZE1 - -2001-08-31 Zeev Suraski - - * zend.c - zend_compile.h: MFZE1 - -2001-08-30 Andi Gutmans - - * zend_compile.h - zend_compile.c: - Make it compile in thread-safe mode. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Get rid of warning and C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Initial support for exceptions. - -2001-08-30 Zeev Suraski - - * zend_execute.c: MFZE1 - -2001-08-28 Zeev Suraski - - * zend_language_scanner.l: MFZE1 - -2001-08-27 Andi Gutmans - - * RFCs/001.txt: - Add sample RFC - -2001-08-26 Stanislav Malyshev - - * Zend.m4 - zend.h: Add dlsym underscore detection, by Jani Taskinen - -2001-08-26 Andi Gutmans - - * zend_operators.c: - MFZE1 - - * zend_API.c: - - Merge Andrei's fix from Engine 1. Please commit patches to both trees! - -2001-08-21 Zeev Suraski - - * zend.c - zend_execute_API.c: MFZE1 - -2001-08-20 Zeev Suraski - - * zend_hash.c - zend_hash.h: MFZE1 - -2001-08-19 Andi Gutmans - - * zend.h: - Fix compile problem - -2001-08-19 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-08-18 Andi Gutmans - - * zend_execute.c - zend_llist.c - zend_llist.h: - Merge Sterling's patches from ZE1 - -2001-08-17 Andrei Zmievski - - * zend_execute.c: MFZE1 - -2001-08-17 Zeev Suraski - - * zend_alloc.c: MFZE1 - -2001-08-16 Zeev Suraski - - * flex.skl - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-08-16 Andi Gutmans - - * zend_execute.c: - Try and nuke get_object_zval_ptr() - - * zend_objects.c: - Remove bogus notice - - * zend_variables.c: - Sync with ZE1 - - * zend.h - zend_execute.c - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: - Fix a bug in method calls. - - Try to get the old copying behavior of objects to work (doesn't work yet). - -2001-08-15 Zeev Suraski - - * zend_extensions.c: MFZE1 - -2001-08-14 Zeev Suraski - - * zend_constants.c - zend_constants.h - zend_variables.c - zend_variables.h: MFZE1 - -2001-08-13 Andi Gutmans - - * zend_execute.c: - MFZE1 - - * zend_execute.c: - Merge from Engine 1 - -2001-08-13 Zeev Suraski - - * zend_API.c - zend_operators.c - zend_operators.h: MFZE1 - -2001-08-12 Stanislav Malyshev - - * zend_API.h: _FUNCTION is used in definition, so use _D - -2001-08-11 Andi Gutmans - - * zend_API.c - zend_API.h - zend_objects.c - zend_operators.c: - More work on making objects work - - * zend_API.c - zend_objects.c - zend_objects.h - zend_operators.c: - - Fix some places which create objects. The fixes are ugly and will be - revised when things start working well - -2001-08-11 Zeev Suraski - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_ini.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_operators.c: Whitespace - -2001-08-11 Andi Gutmans - - * Makefile.am - zend_objects.c: - Fix UNIX build. - - * zend_compile.c: - - Need to do some rewriting in the parser instead of this. - - * zend.h: - - For Sebastian. Will allow to see you're using the Engine 2 CVS via - phpinfo() - -2001-08-10 Andi Gutmans - - * zend_API.h: - Merge from Engine 1 - - * zend_compile.c: - A couple of fixes - - * zend_API.h: - Merge from Engine 1 CVS - -2001-08-09 Andi Gutmans - - * zend.c: - Merge from Engine 1 tree - -2001-08-08 Andi Gutmans - - * zend.c - zend_compile.c - zend_compile.h - zend_globals.h: - Merge new $_GET, $_POST etc. patch from Engine 1 tree - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Preliminary patch for method() dereferencing - - * zend.c - zend.h: - Merge zend_try fix from Engine 1 - -2001-08-07 Zeev Suraski - - * ZendTS.dsp: Migrate .dsp patches - -2001-08-07 Andi Gutmans - - * ZendTS.dsp: - Forgot to commit the updated dsp - - * ZendTS.dsp: - More sync with latest CVS - - * zend_objects.c - zend_objects.h - zend_operators.h - zend_variables.c - ZendTS.dsp - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Sync Engine2 CVS with latest Engine CVS - -2001-08-06 Zeev Suraski - - * zend_indent.c: Commit uncommitted build fix - - * zend_compile.c - zend_globals.h - zend_language_scanner.l: - Fix an off by one lineno issue, in case of an implicit ; - - * flex.skl - zend_highlight.c: Better shared code - - * Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Merge from branch - move to standard C scanners in thread safe mode - - * Makefile.am - Zend.m4 - flex.skl - zend_ini_scanner.l - zend_language_scanner.l: Make the C++less scanner compile under UNIX - -2001-08-06 Andi Gutmans - - * zend_execute.c: - Move to using Z_ macros - - * zend_API.h: - Use Z_ macros - -2001-08-05 Zeev Suraski - - * zend_globals_macros.h: More nulled-out macros - - * zend.c - zend_API.c - zend_API.h: TSRMLS_FETCH work - -2001-08-04 stig - - * .cvsignore: added some more stuff to .cvsignore - -2001-08-03 Zeev Suraski - - * zend_alloc.c: Fix buglet - - * zend_alloc.c: Fix macro - - * zend.c - zend_alloc.c - zend_globals.h: - Implement fast memory allocation and reduced fragmentation under Windows. - - * zend_globals_macros.h: Some compat macros - -2001-08-02 Zeev Suraski - - * zend_execute.c: - require_once()/include_once will return true in case a file was not included - because it was already included earlier. - Changed the default return value type of the include() family from long to - boolean - - * zend_constants.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Avoid going over huge lists of functions, classes and constants. - Special thanks to the guys from the MS lab for the profiling tools :) - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: Some cleanup - - * zend_builtin_functions.c - zend_hash.c - zend_hash.h: TSRMLS fixes - - * zend_ini_parser.y: non ZTS build fix - - * Zend.dsp - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Implement a standard C thread safe scanner within flex - -2001-08-01 Zeev Suraski - - * flex.skl - zend_language_scanner.l: - Implement fast scanning in the multithreaded environment - -2001-07-31 Zeev Suraski - - * zend_language_scanner.l: the make Sebastian happy part of the day :) - - * zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: More TSRMLS_FETCH work - - * zend_list.c - zend_list.h: More TSRMLS_FETCH annihilation - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_hash.c - zend_hash.h - zend_ini.c - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c: More TSRMLS_FETCH work - -2001-07-30 Zeev Suraski - - * zend_language_scanner.l: Compile fix - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.c - zend_highlight.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_language_scanner.l - zend_modules.h: More TSRMLS_FETCH work - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_modules.h: - More TSRMLS_FETCH work, and get rid of redundant ParametersPassedByRef - -2001-07-30 Andrei Zmievski - - * zend_API.c - zend_API.h: - Let's be consisten and keep TSRMLS_DC declaration after num_args. - -2001-07-30 Zeev Suraski - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_operators.c - zend_operators.h - zend_variables.c: More TSRMLS_FETCH annihilation - - * zend_API.c - zend_API.h: Get rid of more TSRMLS_FETCH's - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: Avoid TSRMLS_FETCH()'s (still lots of work left) - -2001-07-29 Andi Gutmans - - * zend_execute.h: - More object junk - - * zend.c: - Object macros... - -2001-07-28 Andi Gutmans - - * zend_operators.c: - Fix build - - * zend_operators.c: - More object macros. - - * zend_builtin_functions.c: - Use the Z_OBJ* macros for accessing objects - - * zend.h - zend_operators.h: - - Small patch to allow fixing the PHP tree to be compatible w/ the initial - - Zend 2 objects patch. Hopefully I can commit that this week. - -2001-07-28 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend.c - zend.h - zend_API.c - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_fast_cache.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_opcode.c: Redesigned thread safety mechanism - nua nua - -2001-07-28 sascha - - * zend.h: Fix build - -2001-07-27 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_globals_macros.h - zend_ini.c - zend_ini.h - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_modules.h - zend_operators.c - zend_variables.c - zend.c: Get rid of ELS_*(), and use TSRMLS_*() instead. - This patch is *bound* to break some files, as I must have had typos somewhere. - If you use any uncommon extension, please try to build it... - -2001-07-23 sascha - - * zend_alloc.c: tsrm_error is only available, if TSRM_DEBUG is defined. - -2001-07-21 Zeev Suraski - - * zend.c - zend.h: Always track bailout file/lineno - - * zend.c: Fix Release builds - - * zend.c - zend.h - zend_execute_API.c - zend_globals.h - zend_list.c: - Improve bailout mechanism, supports nesting of bailouts a-la try..catch - - * zend_hash.c: Fix compile warning - -2001-07-21 Andrei Zmievski - - * zend_compile.c: - Fix certain cases where inheritance of base class's overloaded handlers wasn't - being done. - -2001-07-20 Zeev Suraski - - * zend.c - zend_execute_API.c - zend_list.c: - Implement a more granular shutdown mechanism for the executor - - prevent corruption of constants and missing destructions of resources - -2001-07-19 Zeev Suraski - - * zend_compile.c: Unfix, it has too strong effects - - * zend_compile.c: Catch all cases - - * zend_compile.c: Fix bug #11970, strike 2 - - * zend_execute.c: Revert bogus patch - -2001-07-18 Stanislav Malyshev - - * zend_operators.c: fix double->long conversion - -2001-07-17 Andi Gutmans - - * zend_hash.c: - Remove unused code - -2001-07-16 Zeev Suraski - - * zend_API.h - zend_compile.c - zend_globals.h - zend_variables.c: - Fix bug #10287 - avoid crashing under a bogus usage of list() - - * zend.h - zend_compile.c - zend_execute_API.c: Fix bug #10467 - -2001-07-15 Zeev Suraski - - * zend_hash.h: Minor cleaning - - * zend_language_parser.y: Optimize the parser a bit - - * zend_language_scanner.h - zend_language_scanner.l: Fix an inline - - * zend_variables.c - zend_variables.h: - Time to bid this old timer goodbye - get rid of var_uninit() - - * zend_hash.c: Fix bug #6239 - - * zend_language_parser.y: - Allow indirect reference to method names in class::method() construct - - * zend_execute_API.c: Fix bug #10257 - - * zend_execute.c: Fix bug #11970 - - * zend_compile.c: Fix bug #9884 - - * zend.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_scanner.l - zend_opcode.c: - Improved interactive mode - it is now available in all builds, without any significant slowdown - - * zend.c: Early initialization - -2001-07-13 Zeev Suraski - - * zend_hash.c: layout - -2001-07-13 Thies C. Arntzen - - * zend_hash.c - zend_hash.h - zend_list.c: - the resource-lists are now destroyed backwards. this will make sure that - resources get destroyed in the opposite order they were created and thereby - db-cursors will always be released before their corresponding connection etc. - this sould not break anything! - -2001-07-11 Zeev Suraski - - * zend_API.c - zend_ptr_stack.c - zend_ptr_stack.h: Remove the last couple of bogus inlines - -2001-07-11 Andi Gutmans - - * zend_hash.c - zend_hash.h: - Move inline_zend_hash_func() to header file - -2001-07-11 Thies C. Arntzen - - * zend_API.h: fixed ZVAL_FALSE and ZVAL_TRUE - -2001-07-11 Stanislav Malyshev - - * zend_hash.h: No hashpjw anymore, but we have zend_hash_func - -2001-07-11 Zeev Suraski - - * zend_operators.c - zend_variables.h: Get rid of ZVAL_RESET... - - * zend_API.c - zend_operators.c - zend_variables.c - zend_variables.h: Get rid of some inlines - -2001-07-10 Andi Gutmans - - * zend_extensions.h - zend_hash.c - zend_hash.h: - Merge faster hash implementation. - - The hash function parameter in hash_init(...) is not used anymore. - - It should be removed but it is "to be decided" if we want to do that now - - or in a major version as it means changing MANY places and third party - - modules might stop working. - -2001-07-10 Thies C. Arntzen - - * zend_API.h - zend_variables.c: cleaned up the RETVAL_ RETURN_ and ZVAL_ macros - - added check for \0 at end-of-string at some places. all strings in PHP - have to be terminated with \0 because 3th party libraries might not be - binary-safe. - -2001-07-10 Andi Gutmans - - * zend_compile.c: - Commit Thies' patch. str.len was too long. - -2001-07-09 Andrei Zmievski - - * zend_API.c - zend_API.h: Adding new parameter parsing API. - -2001-07-09 Andi Gutmans - - * zend_hash.c - zend_hash.h: - - Significantly improve hash table performance by using djb's hash function - instead of hashpjw() and by using power of two sizes of hash tables (this - saves the % and isn't necessary with a good hash function). - Please try this patch. - -2001-07-03 Rasmus Lerdorf - - * zend_API.c: Trivial fix - but the period looks odd in error messages - -2001-06-30 Andi Gutmans - - * zend_alloc.c: - Fix the memory limit fix. - -2001-06-29 Andi Gutmans - - * zend_operators.c: - Remove bogus comment. - -2001-06-29 Zeev Suraski - - * zend_alloc.c: Fix memory_limit, kill warning - -2001-06-28 Zeev Suraski - - * zend_execute_locks.h: Fix warnings - -2001-06-27 Zeev Suraski - - * zend_execute.c: - Fix leak in the patch, and revert a couple of lines I didn't mean to commit - - * zend_execute.c: - Warn about illegal offsets - - Allow assignments to uninitialized string offsets (automatically pads the - string with spaces) - -2001-06-26 Zeev Suraski - - * zend_operators.c: - Fixed autoconversion of negative values to double (Fix bug #11685) - -2001-06-26 Andi Gutmans - - * zend_builtin_functions.c: - Fix crash bug (fix by Jani). - -2001-06-24 Andi Gutmans - - * zend.h: - Bump Zend version - -2001-06-21 Andi Gutmans - - * zend_execute.c - zend_execute_locks.h - zend_globals.h: - - Hopefully fix bug #11476 and improve garbage to be freed very quickly. - Tree tagged as PRE_GRANULAR_GARBAGE_FIX before commiting. - - * zend_execute_locks.h: - - Use inline instead of macro for PZVAL_LOCK()/PZVAL_UNLOCK() so that it - can be debugged. - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - Nuke dependency of all of PHP on zend_execute_locks.h. - -2001-06-21 Zeev Suraski - - * zend_execute.c: - Eliminate the leak that the original bogus code tried to solve - - * zend_compile.c - zend_execute.c - zend_globals.h: - parent::methodname() now works better with runtime classes (fix bug #11589) - - * zend_execute.c: - Fix bug #11590 (I want Andi to also review this patch before it goes into 4.0.6) - -2001-06-20 Andi Gutmans - - * zend_execute.c: - MFH - - * zend_execute.c: - Fix string offsets crash. - -2001-06-19 Andi Gutmans - - * zend_alloc.c: - Real MFH of memory fragmentation patch - - * zend_alloc.c: - Bad merge. Revert the previous patch (damn CVS). - - * zend_alloc.c: - MFH - - * zend_alloc.c: - - Fix memory fragmention problem which could lead to web server processes - growing much more than they should. (bug #11344?) - - * zend_execute.c - zend_execute.h: - MFH - -2001-06-19 Zeev Suraski - - * zend_execute.c - zend_execute.h: Add missing exports - - * zend_execute.c: Fix warning - -2001-06-13 Zeev Suraski - - * zend.c: MFH - - * zend.c: - Avoid crashing if the error reporting function is called after a bailout during shutdown - -2001-06-12 Zeev Suraski - - * zend_highlight.c: - Improve XHTML compliance (suggested by Anil Madhavapeddy) - -2001-06-10 Zeev Suraski - - * zend.c: Fix ZTS build problem - -2001-06-07 Andi Gutmans - - * zend_compile.h: - Avoid breaking op_array compatibility for 4.0.6 - -2001-05-30 Zeev Suraski - - * Zend.m4 - zend_execute_API.c: Add missing check - -2001-05-25 Andi Gutmans - - * zend_compile.c: - - Change if() to while() to make sure we skip enough opcodes - - * zend_compile.c: - MFH - - * zend_compile.c: - Fix memory leak - -2001-05-23 Andrei Zmievski - - * zend_builtin_functions.c: - Fix segfault -- need to copy-construct constant value. - -2001-05-21 Andrei Zmievski - - * zend_builtin_functions.c: Moving some functions into Zend. - -2001-05-20 sascha - - * .cvsignore: ignore ylwrap - -2001-05-20 Andi Gutmans - - * zend_list.h: - The previous name could be confused with resource # - - * zend_list.c - zend_list.h: - - Whitespace and change the name of the macro to something more verbose - ZEND_GET_RESOURCE_ID(...) - -2001-05-20 James Moore - - * zend_list.c - zend_list.h: - Add new ZEND_GET_LE macro for retrieving destructor - id's from remote extensions. (Jmoore, Zend Engine) - -2001-05-20 Andi Gutmans - - * zend_list.c: - Don't allow resource types of 0 - -2001-05-19 sascha - - * zend_hash.c: Fix segfault when using zend_hash_add_empty_element - -2001-05-18 Thies C. Arntzen - - * zend_alloc.c: reset allocated_memory_peak after each request. - -2001-05-17 Zeev Suraski - - * zend_language_scanner.l: That's slightly clearer that way :) - - * zend_alloc.c: Fix build - - * zend.c: MFH - - * zend.c: Fix corruption issue - -2001-05-16 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Implement zend_hash_add_empty_element() using the existing infrastructure - - * zend_globals.h: Commit missing fix - - * Zend.m4 - zend_alloc.c - zend_globals.h: Merge memory usage into memory limit - -2001-05-14 sascha - - * zend_hash.c: - Initialize empty pDataPtr to a pseudo value to prevent a pefree on - pData. - -2001-05-12 Andi Gutmans - - * zend_variables.c: - Remove check for ht == NULL in copy_ctor. - If ht is NULL at this point then we are better off crashing and fixing - the bug that caused it. - -2001-05-11 sascha - - * zend.h: add missing closing paranthesis - - * zend_hash.c: Some extensions don't associate any data with hash entries, - except the key. Prior to this change, a separate chunk of memory - was allocated in that case to store exactly zero bytes (plus - memory manager overhead). We treat that case similar to the - pointer case, but don't copy any data at all (because the pointer - is usually the NULL pointer). - - * zend_constants.c: - Fix a memory leak which occured upon registering an already existing - constant. - -2001-05-11 Thies C. Arntzen - - * Zend.m4 - zend_alloc.c - zend_globals.h: added --enable-memory-usage-info - -2001-05-11 Andi Gutmans - - * zend_opcode.c: - MFH - - * zend_opcode.c: - - Fix crash bug when opcodes array is erealloc()'ed to a different memory - area before it reaches the loop. - - Some whitespace stuff - -2001-05-10 Zeev Suraski - - * zend_operators.c: - Treat numeric strings as numbers in the increment operator - -2001-05-09 Andrei Zmievski - - * zend_API.c: Nuke unused variable. - - * zend_API.c: Fix a few bugs in zend_is_callable() and make it stricter. - -2001-05-08 Andi Gutmans - - * zend_language_scanner.l: - Fix line numbers when some lines end with \r - - * zend_opcode.c: - Fix crash bug reported by DBG author Dmitri Dmitrienko. - -2001-05-07 Zeev Suraski - - * zend.c: Make zend_execute_scripts() reentrant - -2001-05-06 Zeev Suraski - - * zend.c - zend_compile.c - zend_compile.h: - Recover from a parse error in include files (before, it could result in a crash under certain circumstances). Fix bug #8663 - -2001-05-06 Andi Gutmans - - * .cvsignore: - .cc files were renamed. Update .cvsignore. - -2001-05-06 Zeev Suraski - - * zend_operators.h: Yikes, that would have been a very bad bug :) - - * zend_execute.c: - Floating point keys didn't work in array() (fix bug #6662) - - * zend_compile.c - zend_execute_API.c: - Hear hear, interactive mode is finally showing some progress: - - Support function calls - - Fix crash bug - - * zend_compile.h - zend_language_parser.y - zend_language_scanner.l: Support interactive mode in thread-safe builds - - * zend_operators.h: Fix autoconversion of hexadecimal strings - It's time to close bug #5404 :) - - * zend_highlight.c: Retain single spaces as spaces to condense HTML - -2001-05-02 Andi Gutmans - - * zend_ini_scanner.l: - Support \r as newline in the ini scanner - - * zend_language_scanner.l: - Handle MAC OS X \r line endings - - * zend_execute.c: - - Patch by Andrei to prevent crash in error situation when not all - object overloading handles are defined. - -2001-05-01 Andi Gutmans - - * zend.h: - Bump up Zend version - -2001-04-30 Andi Gutmans - - * zend_builtin_functions.c: - Add mistakenly removen closing bracket - - * zend_builtin_functions.c: - Get rid of warning - - * zend_alloc.c: - - Try to solve crash on OS400. There is actually no reason I can see for - why his fix should solve a crash but it doesn't harm. - - * zend_execute_API.c: - Fix crash bug in interactive mode - -2001-04-29 Andi Gutmans - - * zend_alloc.h: - Whitespace - - * zend_alloc.c - zend_alloc.h: - Improve overwrite detection in debug mode. - - * zend_operators.c: - - Previous patch for too early freeing of resources seemed to have worked. - - Clean it up a bit. - - * zend_operators.c: - - Try and solve the too early resource destruction problem. - -2001-04-28 Zeev Suraski - - * zend.h - zend_hash.c - zend_language_scanner.l - zend_operators.c: include limits.h if available - - * zend.h: Fix bug 5661 - -2001-04-28 Andi Gutmans - - * zend_operators.c: - Move all cases into switch(). - - * zend_alloc.c: - Just some little whitespace stuff. - - * zend_alloc.c: - - Don't add/remove cached memory blocks from blocks list as this will slow - - down performance a bit. - -2001-04-28 Zeev Suraski - - * zend_operators.c: - Resources weren't being properly destroyed by the convert_to_*() functions - -2001-04-27 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_hash.c - zend_language_scanner.l - zend_operators.c - zend_operators.h: - More whitespace fixes while I'm at it. - - * zend.h - zend_alloc.c - zend_builtin_functions.c - zend_execute_API.c - zend_extensions.c - zend_language_scanner.l: - - Whitespace changes to be standard like the rest of Zend - -2001-04-24 Andi Gutmans - - * zend_execute.c: - Due to popular demand merge the foreach() crash fix. - -2001-04-24 Andrei Zmievski - - * zend_builtin_functions.c: MFH. - -2001-04-21 Andi Gutmans - - * zend_llist.c - zend_llist.h: - Add typedef for function pointer of llist dtor - -2001-04-20 Andi Gutmans - - * zend_execute.c: - - Fix for crash bug when using invalid arguments in the foreach() loop. - - Reported by Yasuo Ohgaki - -2001-04-19 Andi Gutmans - - * zend_API.h: - Patch from Jason Greene. - - Make it easier to write PHP function definitions in more than just one .c - file while accessing the same module globals. - -2001-04-17 Zeev Suraski - - * zend_alloc.c: small beautification - -2001-03-28 Zeev Suraski - - * zend_list.c: Fix warning - - * zend_list.c: Make Windows happy - - * zend_list.c: Get rid of more redundant code - - * zend_list.c: - Cleaner way of making sure resources start at 1 and not 0... - - * zend_list.c - zend_list.h: Remove redundant code - -2001-03-27 Zeev Suraski - - * zend_list.c - zend_list.h: God knows what this code was doing... - -2001-03-26 Andrei Zmievski - - * zend_builtin_functions.c: - Updated get_class_methods() to take class instance as well as class name. - - * zend_builtin_functions.c: - Making it possible to pass a class name to get_parent_class() as well - as a class instance. - -2001-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Fixing function name length. - -2001-03-19 Andi Gutmans - - * zend_language_parser.y: - - Add support for isset($var1, $var2, $var3); - Will be true only if all - - variables are set. - -2001-03-15 Andi Gutmans - - * zend_language_parser.y: - Nuke commented code - -2001-03-12 Andrei Zmievski - - * zend_API.c: Name length is already known. - -2001-03-12 Andi Gutmans - - * zend_API.c: - Missed second place. - - * zend_API.c: - Nuke snprintf() - - * zend_language_scanner.l: - White space - - * zend_language_scanner.l: - - Fix by Jani Taskinen for whole path also to work - with include_once()/require_once(). - -2001-03-12 Andrei Zmievski - - * zend_API.c - zend_API.h: - Improve zend_is_callable() to the point where it's actually useful. - Now it just needs to be invoked everywhere in PHP where a callback is - expected. - -2001-03-11 Andi Gutmans - - * Zend.m4 - acconfig.h: - Fix for Solaris. - -2001-03-10 Andi Gutmans - - * zend_execute.c: - Whitespace - -2001-03-07 Zeev Suraski - - * zend_ini.h: Add missing #define's - - * zend_compile.c - zend_execute.c: Make parent:: work in runtime bindings as well - -2001-03-06 sascha - - * Zend.m4: We actually only need AC_PROG_LEX here. - -2001-03-04 Zeev Suraski - - * zend_execute.c: Fix bug #8899 (thanks Jani) - -2001-03-03 sascha - - * Zend.m4: -Os is a valid GCC optimization level. - -2001-03-02 Zeev Suraski - - * zend_compile.c: Whitespace fix - -2001-02-28 Andrei Zmievski - - * zend_execute_API.c: Do case-insensitive class name matching when parsing - array('Class', 'method') structure. - You guys can clean it up, if there is a better way. - -2001-02-27 Andi Gutmans - - * zend_variables.c - zend_variables.h: - Nuke zval_del_ref() - -2001-02-27 Andrei Zmievski - - * zend_compile.c: Don't overwrite existing handlers with parent ones. - -2001-02-26 Andi Gutmans - - * Zend.dsp - ZendCore.dep - ZendTS.dsp - zend.c - zend_API.c - zend_API.h: - Rename modules.h to zend_modules.h - - * LICENSE: - One more copyright year update - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_modules.h: - Update copyright year - -2001-02-25 Andi Gutmans - - * zend_modules.h: - Fix dll linkage warnings - -2001-02-24 Andi Gutmans - - * zend_builtin_functions.c - zend_modules.h: - Add exports from Daniel Beulshausen - -2001-02-14 Stanislav Malyshev - - * zend.h: allow more extensions with resources - -2001-02-13 Zeev Suraski - - * zend_extensions.c: Move version registration to a more correct place - -2001-02-12 Andi Gutmans - - * zend_operators.c - zend_operators.h: - Remove two unused functions - - * zend_execute_API.c: - Fix whitespace. - -2001-02-12 Zeev Suraski - - * zend_execute_API.c: - Fix a bug that could cause corruption in case of an error during - get_zval_ptr() - -2001-02-09 Andi Gutmans - - * zend_execute.c: - - Remove duplicate code and do a tiny optimization in DO_FCALL - -2001-02-05 Zeev Suraski - - * zend_execute.c: Fix string offset data corruption - -2001-02-04 Andrei Zmievski - - * zend_execute_API.c: - Allow passing class name as well as an object instance to call methods. - -2001-02-03 Andrei Zmievski - - * zend_execute_API.c: - Set the correct function state during execution. This is mainly to have - get_active_function_name() to return proper value. - - * zend_compile.c: Inherit overloaded handlers. - -2001-02-01 Andrei Zmievski - - * zend_API.c - zend_API.h: - Added zend_is_callable() function that checks whether passed zval - represents a valid and exiting callable construct. - -2001-01-31 Andi Gutmans - - * zend_API.h - zend_API.c: - Change unset() functions to null(). unset() is legacy - - * zend_API.h: - - Quick fix. I'm for changing these to add_property_null() as we've nuked - - unset. - -2001-01-27 Andi Gutmans - - * zend_execute.c: - That doesn't seem like a smart thing to do :) - - I wonder if gcc optimized it out. - -2001-01-23 Thies C. Arntzen - - * zend_extensions.h - zend_ini_scanner.h - zend_list.c - zend_list.h: fix a couple of warnings - - * zend_API.c: fixed crash in add_index_bool. - -2001-01-22 Andrei Zmievski - - * zend_API.h: Make add_index_zval() available to the outside world. - -2001-01-21 Andi Gutmans - - * zend.h: - - Make people happy who like the Zend version number bumped up in parallel - with PHP. - -2001-01-20 Andi Gutmans - - * zend_API.c - zend_API.h: - - Patch from Sterling. Add API calls to add zval's as array indeces/ - object properties. Add _ex functions which take the string length as an - argument for better performance. - -2001-01-19 Andi Gutmans - - * zend_API.h - zend_API.c: - - For Sterling. I wonder if not all of the API functions should take the - - key_length as a parameter in order to save that strlen(). - -2001-01-17 Andi Gutmans - - * zend_execute.c: - - Fix leak in fetch_dim_address() which was already fixed in - - fetch_dim_object(). Take the oppertunity to make both use the same - - function and not duplicate the code. - -2001-01-16 Zeev Suraski - - * zend_list.c: Fix persistent resources, once and for all... - -2001-01-15 Zeev Suraski - - * zend.c - zend.h - zend_compile.c: Add free_estring() - -2001-01-12 Zeev Suraski - - * zend_istdiostream.h: Add newline - -2001-01-12 Rasmus Lerdorf - - * zend_highlight.c: Fix for bug number 8666 - -2001-01-07 Zeev Suraski - - * zend_ini.c: Fix mismatch in return values - - * zend.c - zend.h - zend_alloc.c - zend_ini.c - zend_ini.h: - Remove backward dependency from PHP -> Zend - - Rename get_ini_entry() as get_configuration_directive() for clarity - (it doesn't use the INI subsystem, but the module-supplied function for - retrieving configuration directives) - - * Zend.dsp - ZendTS.dsp: Remove -S option on all bison calls - - * zend.c: - Fix possibility of a crash during startup (very unlikely, but possible) - -2001-01-06 Zeev Suraski - - * ZendTS.dsp: Remove -S - -2001-01-06 Andi Gutmans - - * zend_ini.c: - This slipped in by mistake. - -2001-01-05 Zeev Suraski - - * zend_ini.c - zend_ini.h: - Merge in some ZEND_API additions from Daniel Beulshausen (needed for the - Win32 Apache module) - -2001-01-04 Andi Gutmans - - * zend_list.c: - - Make plist_destructor work like list_destructor to allow it to call - extended destructors. - -2001-01-03 Zeev Suraski - - * zend.h: Fix Zend version while we're at it - - * zend_execute_API.c: Merge call_user_function_ex() fixes - - * zend_language_scanner.l: Merge line number corruption bug fix - - * zend_language_scanner.l: - Fix another case of possible line number corruption - - * zend.h: Commit missing declaration - -2001-01-01 Andi Gutmans - - * zend_execute.c: - Remove unreachable code - -2000-12-30 Zeev Suraski - - * zend_language_scanner.l - zend_opcode.c: Fix possible corruption in line number information - -2000-12-27 Zeev Suraski - - * zend.c - zend_globals.h - zend_ini.c - zend_ini.h - ZendTS.dsp: - Make the INI mechanism thread safe (or at least thread safer :) - -2000-12-26 Zeev Suraski - - * zend_compile.h: - Use iostream.h instead of istream.h (IBM's compiler doesn't come with istream.h, - and iostream.h should include it) - - * ZendTS.dsp - zend_ini_scanner.l - zend_istdiostream.h - zend_language_scanner.l: - - Use supplied istdiostream definition for the INI scanner too - - Add Release_TSDbg configuration - -2000-12-24 Zeev Suraski - - * zend_extensions.h: This needs updating as well - - * zend_execute_API.c: - More aggressive protection in call_user_function_ex() - -2000-12-23 Zeev Suraski - - * zend_execute_API.c: - Fix a possible crash bug in call_user_function_ex(), if the function is - in fact not a user function - -2000-12-22 sascha - - * zend.c - zend_modules.h: - Set the floating-point exception mask on FreeBSD to 0 (as do other - FreeBSD system applications). Also bump up the module API number - as the zend_hash_get_current_key change affects source and binary - compatibility. - -2000-12-22 Zeev Suraski - - * zend.c - zend_builtin_functions.c - zend_execute.c - zend_hash.c - zend_hash.h: - Allow get_current_key() not to return the key itself, instead of a duplicate - - * zend_hash.c: * Fixed a possible crash in get_class_methods() - -2000-12-19 Stanislav Malyshev - - * zend_language_scanner.l: Add support for ASP tags in one-line comment - -2000-12-18 Andi Gutmans - - * flex.skl: - Success! Yay! - - * flex.skl: - Yet another one. - - * flex.skl: - Testing - - * flex.skl: - No luck - - * flex.skl: - Make this damn commit stuff work. - - * flex.skl: - Testing - -2000-12-18 Stanislav Malyshev - - * zend.c: - Use HashPosition iterator instead of saving/restoring internal pointer - - * zend.c: Preserve internal pointer over print_r (fix #8289) - -2000-12-18 Andi Gutmans - - * zend_compile.c: - Fix leak with useless statements such as "foo"; - - * flex.skl: - - Testing Sascha's CVS commit script which should work with branches. - - * flex.skl: - Testing - - * flex.skl: - Testin - -2000-12-18 Zeev Suraski - - * flex.skl: Test, ignore - -2000-12-18 Stanislav Malyshev - - * zend_operators.c: Add notice when auto-converting array to string - -2000-12-17 Andi Gutmans - - * zend_language_scanner.l: - - Clean up the scanner a tiny bit while messing with it. - - * zend_language_scanner.l: - - %> without asp_tags should not be treated as inline_html but as regular - tokens. Of course the parser will die with a parse error which is the - correct behavior. - - * zend_language_scanner.l: - - Fix problem in one line comments with line endings such as ??> - -2000-12-17 Stanislav Malyshev - - * zend_operators.c: Fix #8279 (-2147483647 > 2147483647). - -2000-12-14 Zeev Suraski - - * zend_modules.h: Update module_api_no - -2000-12-13 Zeev Suraski - - * zend_API.h - zend_execute_API.c: - Fix call_user_function() with objects - it could leak under certain circumstances - -2000-12-12 Stanislav Malyshev - - * zend_operators.c: Fix #8195: strncasecmp returns incorrect value - -2000-12-07 sascha - - * zend_builtin_functions.c: - Hardcode strlen due to problems on SCO OpenServer 5.0.4 which defines - strlen to __std_hdr_strlen. - -2000-12-07 Stanislav Malyshev - - * zend_compile.c: Whitespace fix - - * zend_compile.c: Allow var $foo = array(ABC => 1) constructs - - * zend_builtin_functions.c: - Fix memory leak - get_current_key mallocs it's result, no need to - copy it. - -2000-12-06 sascha - - * zend_hash.c: - INIT_DATA/UPDATE_DATA assumed that pData elements of the size of a void - pointer would actually be aligned like a void pointer. This lead - to bus errors on architectures which don't allow unaligned 32-bit accesses. - -2000-12-05 Andi Gutmans - - * zend_language_parser.y: - - Support for $var =& new foo() syntax. This allows you to use objects - which create extra references to themselves in the constructor. - -2000-12-05 Zeev Suraski - - * zend_execute.h: Expose all timeout functions - -2000-12-02 sascha - - * acconfig.h - configure.in: - Use the hardly-documented third parameter of AM_INIT_AUTOMAKE to suppress - defining PACKAGE/VERSION. - -2000-11-27 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Allow passing references which are returned from functions and new - - statements to be passed by reference. - -2000-11-27 Andrei Zmievski - - * zend_builtin_functions.c: - Update class constants before trying to get default properties. - -2000-11-22 Andi Gutmans - - * zend_compile.c: - Remove code which has been commented out for ages. - -2000-11-22 sascha - - * zend_execute.c - zend_globals.h: Pass on the exit status - -2000-11-21 Zeev Suraski - - * zend_operators.c - zend_operators.h: Fix build - -2000-11-21 Andi Gutmans - - * zend_execute.c: - The baby patch wasn't that innocent :) - -2000-11-21 Andrei Zmievski - - * zend_builtin_functions.c: - Sterling's patch to make get_defined_vars() simpler and better. - -2000-11-20 Andi Gutmans - - * zend_execute.c: - NEVER copy and paste :) - - * zend_compile.c - zend_execute.c: - Baby patch towards making the damn pass-by-ref work. - -2000-11-20 Zeev Suraski - - * zend_extensions.h: Update API number - -2000-11-20 Stanislav Malyshev - - * zend.h: - Add macro to replace value of zval with another value while preserving - referencing structure - -2000-11-20 Andi Gutmans - - * zend_execute.c: - This patch is broken and needs more thorough fixing. - -2000-11-19 Andi Gutmans - - * zend_execute.c: - - Try and fix the problem when sending references returned from a function by reference. - -2000-11-19 Zeev Suraski - - * zend_alloc.h: Fix Zend build for non ZTS - -2000-11-18 Zeev Suraski - - * zend_alloc.c: Forgot to commit the non-debug build fix yesterday... - - * zend_alloc.c - zend_alloc.h: - Add thread-safety debugging information (idea - Dmitri Dmitrienko) - -2000-11-14 Stanislav Malyshev - - * zend_language_scanner.l: Restore compatibility with old broken way - - * zend_language_scanner.l: - Better 0x handling - not change non-0x number behaviour - - * zend_language_scanner.l: - Attempt at better handling long 0x-numbers, like 0xffffffff - -2000-11-13 Andi Gutmans - - * zend_extensions.c - zend_extensions.h: - Remove unused function - - * zend_extensions.h: - - Use typedef's for function pointers so that we can easily define arrays - - of these function pointers. - -2000-11-13 Stanislav Malyshev - - * zend_llist.c: - Fix zend_llist_apply_with_del - it should remove from list, - not only call dtor - -2000-11-12 Zeev Suraski - - * ZEND_CHANGES: Test, ignore - -2000-11-11 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Move SET_UNUSED() to header - - * zend_opcode.c: - Beautify by using the standard #define. - -2000-11-10 Andi Gutmans - - * zend_compile.h - zend_compile.c: - Remove this damn thing once again. - - * .cvsignore: - Add files to .cvsignore thanks to Jon Parise - -2000-11-09 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Maybe it's OK now? :) - - * zend_compile.c - zend_compile.h: - Undo the previous commit for fixing $obj = new foo(). - - * zend_compile.c - zend_compile.h: - - Commit experimental patch to fix the problem when doing $a = new foo() - and the constructor assigns $this by reference to other symbol table - elements. Thanks to Daniel J. Rodriguez on this one. - -2000-11-08 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: Add ability to find extensions by name - -2000-11-06 sascha - - * zend_ini.c: Kill a misleading warning which is intended for old code - which assumes sizeof(int) == sizeof(void *). - -2000-11-03 Andi Gutmans - - * zend_ini_scanner.h: - Add trailing \n? - -2000-11-03 Zeev Suraski - - * zend_ini_scanner.l: Fix for bug #5571 (by mookid@sigent.ru) - -2000-11-03 Andi Gutmans - - * Makefile.am: - Fix dependency. - -2000-11-03 Zeev Suraski - - * zend_operators.h: Fix build - - * zend_operators.h: Add RESVAL macros - -2000-11-02 Zeev Suraski - - * zend.c: Fix bug #7599 - - * zend_language_parser.y - zend_language_scanner.l: Missed those - - * zend_API.c - zend_compile.c - zend_compile.h: Maintain consistency - -2000-11-02 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Replace do_exit() with zend_do_exit(). - - Problem reported by David Hedbor - -2000-11-02 Zeev Suraski - - * zend_ini_parser.y: Remove unnecessary variables - - * zend_ini.c: - explicit declaration here too - sigh, way too early in the morning - - * zend_ini.h: oops - - * zend_ini.h: explicit declaration - -2000-10-31 Zeev Suraski - - * zend_highlight.h: Fix Apache build - - * zend_ini.c - zend_ini.h: Remove unnecessary code, fix phpinfo() - - * Zend.m4: Require bison 1.28 - -2000-10-30 Zeev Suraski - - * Zend.dsp: Fix non-thread-safe Windows build - - * zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Final touches on the INI parser - -2000-10-30 Stanislav Malyshev - - * Makefile.am: Another attempt to make it build - - * Makefile.am - zend_ini_scanner.l: Fix build - -2000-10-29 Zeev Suraski - - * zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Fix leaks - - * zend_alloc.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: The new INI parser is showing some signs of life - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a corruption bug, when erroneously allowing to send non-variables by reference (several - bug-db reports seem to originate in this bug) - - * zend_extensions.c - zend_ini_parser.y: Fix build - - * zend_ini_scanner.h: Forgot this one - - * Makefile.am - ZendTS.dsp - zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l: Generalization work - -2000-10-29 Stanislav Malyshev - - * zend_extensions.c - zend_extensions.h: - Allow module to proclaim compatibility with any Zend version - -2000-10-29 Zeev Suraski - - * Makefile.am - ZendTS.dsp - zend_ini_parser.y - zend_ini_scanner.l - zend_language_scanner.l: Some more work on the INI parser/scanner - - * Makefile.am - zend_ini_parser.y - zend_ini_scanner.l: Initial step in rewriting the INI parsing mechanism - - * .cvsignore - Makefile.am - Zend.dsp - ZendCore.dep - ZendTS.dsp - zend-parser.y - zend-scanner.h - zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l: Unify the names of these last 3 files... - - * Zend.dsp - ZendTS.dsp: Fix Windows build - - * Makefile.am - zend_ini.c - zend_ini.h - zend_operators.c - zend_operators.h: - Initial steps to move the INI mechanism to the Zend engine - -2000-10-27 Andrei Zmievski - - * zend_operators.h: Added macros for object properties and class entry. - -2000-10-26 Andi Gutmans - - * zend_API.c - zend_modules.h: - Fix new -m on Windows - -2000-10-25 Andrei Zmievski - - * zend_list.h: Remove the patch to register_list_destructors(). - -2000-10-20 Andrei Zmievski - - * zend_list.c - zend_list.h: - Fixed a bug in zend_rsrc_list_get_rsrc_type() - - Switched register_list_destructors() to use - zend_register_list_destructors_ex() instead - -2000-10-19 Andi Gutmans - - * zend_compile.c: - - Constant expressions which are used multiple times need to be copy_ctored - -2000-10-18 Andi Gutmans - - * zend_llist.c: - Fix whitespace - - * zend_extensions.c - zend_llist.c - zend_llist.h: - - Try #2. Wasn't allowed to delete in the previous manner because we were - in the middle of an llist_apply() - -2000-10-18 sascha - - * zend_fast_cache.h: - Add explicit conversion from 'void *', otherwise ANSI C++ compilers - will break out. - -2000-10-18 Andi Gutmans - - * zend_extensions.c: - Fix crash - -2000-10-17 Andi Gutmans - - * zend_builtin_functions.c: - Fix copy&paste bug - -2000-10-15 Andi Gutmans - - * zend_opcode.c: - - Increase op_array size faster and make eralloc() it in the end to save - memory. - -2000-10-14 Andi Gutmans - - * zend_builtin_functions.c: - Add another patch from Sterling. - - * zend_builtin_functions.c: - - Preliminary commit of Sterlings get_defined_functions()/get_defined_vars - functions - - * zend_extensions.c: - - Only run startup() if ZEND_EXTENSIONS is defined to 1. - This fixes a link error on platforms which don't support libdl - -2000-10-13 Andi Gutmans - - * zend_operators.c: - Make increment of "" become "1" - -2000-10-11 Andi Gutmans - - * zend_hash.c - zend_hash.h: Don't use 'new' symbol - -2000-10-11 Zeev Suraski - - * zend_execute.c - zend_execute_API.c: - Fix -a interactive mode (no idea how the previous commit got committed) - - * zend_execute.c: *** empty log message *** - - * zend.h: Update version - - * zend_hash.c - zend_hash.h: Add zend_hash_merge_ex(), for selective merging - -2000-10-06 Andi Gutmans - - * zend_execute.h: - Fix Bug #7061 - -2000-10-05 Andi Gutmans - - * zend-scanner.l: - - Updated included_files() also for plain include()/require(). - -2000-10-04 Andi Gutmans - - * zend_alloc.c: - Fix fprintf - -2000-10-02 Andi Gutmans - - * zend_extensions.h: - Change zend_extension_api_no - -2000-09-30 Andi Gutmans - - * zend_builtin_functions.c: - Cleanup error output - -2000-09-28 Andi Gutmans - - * zend_hash.c: - - Another has optimization/fix like the hash_copy one from earlier on - -2000-09-28 Stanislav Malyshev - - * zend_hash.c: - Make hash_copy call copy constructor on a real copy, not on a temp - -2000-09-28 Andi Gutmans - - * ZendTS.dsp: - Remove zend_gcc_inline.c - -2000-09-26 sascha - - * Makefile.am - Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Remove --enable-c9x-inline option. We now use a syntax which is compatible - with all compilers by providing the function with static linkage in every - compilation unit. - -2000-09-25 Zeev Suraski - - * zend.c - zend_extensions.c - zend_extensions.h: - Fix previous update - move extension startup further down the startup sequence - - * zend.c: Move extension startup further down the startup sequence - -2000-09-19 Andi Gutmans - - * zend_operators.h: - Add Z_BVAL* macros - -2000-09-19 Stanislav Malyshev - - * zend_execute_locks.h: - Fix crash on Solaris with function parameter destruction - -2000-09-18 Stanislav Malyshev - - * zend_builtin_functions.c: - Made get_included_files() work again, in somewhat different way - -2000-09-17 Stanislav Malyshev - - * zend_compile.c: Set filename even on recursive include - -2000-09-14 Andi Gutmans - - * zend_execute.c: - - Fix NULL handling in ARRAY opcode and resolve memory leak - -2000-09-12 Zeev Suraski - - * zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.h: Make compile_string() accept a description of the code - -2000-09-11 Andi Gutmans - - * zend_compile.c: - - Forgot to create extended info in include()/require() call - -2000-09-10 Stanislav Malyshev - - * zend-parser.y: Allow require_once to take expressions, just like require - - * ZEND_CHANGES: Try once more to remove dups - - * ZEND_CHANGES: Test commit - weed out duplicate messages - -2000-09-09 Zeev Suraski - - * zend.c: Don't use unsafe sprintf() - -2000-09-08 Stanislav Malyshev - - * zend.c: Don't trust snprintf return - -2000-09-06 Andi Gutmans - - * zend_config.w32.h: - Save two lines - - * zend_config.w32.h: - Fix header - -2000-09-06 sascha - - * Zend.m4: Unless overwritten, default to no optimization in debug mode. - -2000-09-05 Andi Gutmans - - * zend_operators.h - zend_operators.c: - Commiting Sterling's new multi_convert* functions - -2000-09-05 Andrei Zmievski - - * zend_builtin_functions.c: Fix memory overrun. - -2000-09-05 Stanislav Malyshev - - * zend_builtin_functions.c: - Fix crash with trigger_error having no args (#6549) - -2000-09-04 Andi Gutmans - - * Makefile.am: - Remove two tabs - -2000-09-02 Andi Gutmans - - * ZendTS.dsp: - - Defining TSRM_WIN32 in each and every dsp sucked. Revert this change - - * ZendTS.dsp: - Fix windows build - -2000-08-31 Andi Gutmans - - * ZendTS.dsp: - - This should fix the performance problem with Release builds - - * zend-scanner.l - zend.c - zend_execute.c: - - Use emalloc() for opened_path now. This was a potential leak before. - - This patch has potential to break stuff but I tested it as much as I - - could. Fixes should be easy. - - * zend.c: - Remove support for __string_value() in print $obj - -2000-08-31 Zeev Suraski - - * zend.c: Safer shutdown process - -2000-08-29 Andi Gutmans - - * zend.h: - Update Zend version. - -2000-08-26 Andi Gutmans - - * zend_builtin_functions.c: - Don't define this function in non-debug mode - -2000-08-24 Andi Gutmans - - * zend_execute.c: - - Revert patch from 9/7/2000 which seems to have broken unset(). - - I hope what made me do this patch doesn't appear again. - -2000-08-22 Andi Gutmans - - * zend_execute_API.c: - - Fix bug report by Andrei when using a method as a sort user function - - parameter in usort() like functions - -2000-08-20 Zeev Suraski - - * zend_config.w32.h: Fix Win32 build - -2000-08-20 sascha - - * zend_config.w32.h: - _isnan seems to be supported on Win32, add an appropiate macro. - - * acconfig.h: If available, use fpclassify for substituting zend_finite. - - * acconfig.h: - Including math.h before using macros defined there will work better :) - - * acconfig.h: Add zend_isinf and zend_isnan. - -2000-08-19 Andrei Zmievski - - * zend-scanner.l: One more fix to C compile. - -2000-08-19 Zeev Suraski - - * zend-scanner.l: Fix C build - - * zend-scanner.l: Fix eval() leakage in ZTS mode - - * zend_compile.c - zend_globals.h: Eliminate run-time leak with eval()'s - - * zend_alloc.c: Fix build with no memory_limit - - * zend_alloc.c: Fix memory_limit - -2000-08-19 Andi Gutmans - - * zend_execute.c: - Beautify - -2000-08-17 Stanislav Malyshev - - * zend_API.h: Fix EMPTY_STRING macros - -2000-08-15 Zeev Suraski - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: - Fix warning issue (compile errors inside require()'d files were incorrectly supressed) - -2000-08-14 Zeev Suraski - - * zend_execute.c: - Fix leak and some logic - -2000-08-14 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - This patch should hopefully fix situations where a constructor uses - - the $this pointer as a reference. - -2000-08-14 Stanislav Malyshev - - * zend_execute.c: Fix crash - -2000-08-14 Andi Gutmans - - * zend_compile.c - zend_execute.h: - - Unused results should be marked with EXT_TYPE_UNUSED and not IS_UNUSED - -2000-08-13 Stanislav Malyshev - - * zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: Fix zend_fiel_handle handling. Should fix URL include - and various opened_path inconsistencies. - -2000-08-13 Andi Gutmans - - * zend-parser.y: - - Revert foreach() change which only allowed variables and array(...) - -2000-08-11 Andi Gutmans - - * zend-parser.y: - Only support variables and array(...) in foreach loops - -2000-08-10 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Fix problem with nested foreach()'s (Andi, Zend Engine) - - * zend_compile.c: - Fix switch which only has a default rule (Andi, Zend Engine) - Change require_once() to use the same file list as include_once(). - Patch includes making require() & include() to behave the same when it - comes to scoping. require() is now an include() which isn't allowed to fail. - require() caused too many memory reallocations which ended up being quite - slow for sites that required lots of files. (Andi & Zeev, Zend Engine) - - Fix switch() which only has default rule (bug #5879, - -2000-08-09 Zeev Suraski - - * zend_modules.h: that too - - * zend_extensions.h: Update API number - - * zend-parser.y - zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - The patch we promised - redesigned the compilation/execution API: - Advantages: - - Smaller memory footprint for the op arrays - - Slightly faster compilation times (due to saved erealloc() calls and faster zend_op - initialization) - - include_once() & require_once() share the same file list - - Consistency between include() and require() - this mostly means that return() - works inside require()'d files just as it does in include() files (it used to - be meaningless in require()'d files, most of the time (see below)) - - Made require() consistent with itself. Before, if the argument was not a constant - string, require() took the include() behavior (with return()). - - Removed lots of duplicate code. - Bottom line - require() and include() are very similar now; require() is simply an include() - which isn't allowed to fail. Due to the erealloc() calls for large op arrays, require() - didn't end up being any faster than include() in the Zend engine. - -2000-08-05 Andi Gutmans - - * zend_execute.c: - - Use some more SEPARATE_ZVAL macros instead of replicated code. - -2000-08-05 Stanislav Malyshev - - * zend_execute.c: Fix memory leak - -2000-08-04 Andi Gutmans - - * zend.h - zend_execute.c: - - Beautify code. Try and use more macros for splitting instead of - - replicating the code everywhere. - -2000-08-02 Andi Gutmans - - * zend_execute.c: - Remove commented code - -2000-07-29 Zeev Suraski - - * zend-scanner.l - zend_execute.c: Fix filename issues - -2000-07-28 Stanislav Malyshev - - * zend_builtin_functions.c - zend_constants.c - zend_constants.h: - Make define return false and issue E_NOTICE when trying to redefine constant - -2000-07-27 Andi Gutmans - - * zend-scanner.l - zend_execute.c: Always store full filename as compiled file name - -2000-07-26 Zeev Suraski - - * zend_compile.c: - Fix a possible issue with runtime inheritence under fairly rare circumstance - and optimize a tiny bit - -2000-07-26 Stanislav Malyshev - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Add strncasecmp function - -2000-07-18 Zeev Suraski - - * zend_builtin_functions.c: Forgot to link this function... - - * zend_hash.c: This is probably the oldest bug in PHP :) - Luckily it's unlikely we're ever actually bitten by this bug. - -2000-07-16 Andi Gutmans - - * zend_compile.c: - Beautify Zeev's patch a bit. - -2000-07-16 Zeev Suraski - - * zend_compile.c: Implement parent::foo() - -2000-07-15 Zeev Suraski - - * zend-parser.y - zend_compile.c: Add more extended_info calls - -2000-07-14 Zeev Suraski - - * zend_builtin_functions.c - zend_list.c - zend_list.h: Improve register_resource_ex() infrastructure - -2000-07-12 Thies C. Arntzen - - * zend.c: fix ZTS startup without filename (thanx purify!) - - * zend.c: unset active_symbol_table on zend-shutdown. - -2000-07-11 Zeev Suraski - - * zend_list.c: Another persistent hash - disable apply protection - - * zend.c - zend_hash.c - zend_hash.h: - Disable the hash_apply() protection on hashes that persist across requests - it's unsafe - because we may be aborted at any point - -2000-07-11 Stanislav Malyshev - - * zend_execute.c: - Fix a bug in passing second parameter of RECV_INIT with is_ref set - -2000-07-11 Andi Gutmans - - * zend_compile.h: - Oops. Too early in the morning - - * zend_compile.h: - Include iostream.h in C++. - -2000-07-09 Andi Gutmans - - * zend_execute.c: - Fix memory leak. - - * zend_execute.c: - Need to seperate if the hash isn't a reference - -2000-07-08 Andi Gutmans - - * zend.h: - Add zend_ulong - -2000-07-07 Stanislav Malyshev - - * zend_execute.c: Remove C++ commennts. - -2000-07-06 Andi Gutmans - - * zend-scanner.l: - - Remove code which has never been used (neither in PHP 3) - - * zend_compile.c: - - Make is_method_call() static and remove a couple of old lines - - * zend_execute.c - zend_extensions.h: - Yet another fix... - - * zend_execute.c: - One more... - - * zend_compile.c: - One more fix for the latest patch - - * zend_compile.c: - One dumb bug in my latest patch - - * zend-parser.y - zend_compile.c - zend_execute.c: - - Complex fix for solving a problem with objects & method calls. - - Previous version is tagged PRE_METHOD_CALL_SEPERATE_FIX_PATCH. - - I need to check this fix on a server so if it doesn't work I will revert - - it. - - * zend-scanner.l: - - Fix problem with newlines not being recognized under certain conditions - -2000-07-03 Andi Gutmans - - * zend_compile.c: - Fix bug #4120 - -2000-07-03 Stanislav Malyshev - - * zend_execute_API.c: Unblock SIGPROF signal when starting timer. - On Linux, this signal is blocked by default after first signal is run - -2000-07-03 sascha - - * FlexLexer.h - zend-scanner.h - zend_alloc.h - zend_compile.h - zend_constants.h - zend_dynamic_array.h - zend_execute.h - zend_globals.h - zend_hash.h - zend_highlight.h - zend_list.h - zend_operators.h - zend_static_allocator.h - zend_variables.h: - Replace macros which begin with an underscore through an appropiately - named macro. - -2000-07-02 sascha - - * zend.h - zend_API.h - zend_builtin_functions.h - zend_config.w32.h - zend_dynamic_array.h - zend_errors.h - zend_execute_locks.h - zend_extensions.h - zend_fast_cache.h - zend_globals_macros.h - zend_indent.h - zend_llist.h - zend_modules.h - zend_ptr_stack.h - zend_stack.h: Change header protection macros to conform to standard. - - Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment" - - All identifiers that begin with an underscore and either an uppercase - letter or another underscore are always reserved for any use by the - implementation. - -2000-07-02 Andi Gutmans - - * zend-parser.y: - Take #2 with tab size 4 - - * zend-parser.y: - - Beautify parser a bit. It still could do with some more at some point - - * zend_execute.h - zend_execute_API.c: - Forgot ZEND_API - -2000-06-30 Zeev Suraski - - * zend_config.w32.h: - Add a messagebox style that's safe to use from an ISAPI filter - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: error_reporting fix - -2000-06-29 Zeev Suraski - - * zend.c - zend.h: Add $context argument to error handler - -2000-06-28 Zeev Suraski - - * zend.c: Improve error handling code - - * zend-scanner.l: Be HTML friendly - -2000-06-28 Andi Gutmans - - * zend.h: version update - -2000-06-26 Zeev Suraski - - * zend.h - zend_constants.c - zend_extensions.h: - Make it possible to detect whether we're thread safe or not from PHP scripts and the php.ini - file - -2000-06-26 Andi Gutmans - - * zend_extensions.c: - Add another "\n" at the end of error messages. - -2000-06-26 Zeev Suraski - - * zend_execute_API.c: - Make max_execution_time work properly when set to 0 under Win32 (disable) - -2000-06-25 Andi Gutmans - - * zend.c: - I wrote a long msg but the commit didn't go through. - - So here is the short version: - - a) Start moving to binary opens in Windows - - b) Give checkuid_mode() a small face lift including the fopen-wrappers.c - - The mode to this function should at least be a #define but that is for - - another day. Anyway this whole stuff should be given more face lifts in - - the future. - -2000-06-24 Zeev Suraski - - * zend_alloc.c: Nuke a warning - -2000-06-23 Andi Gutmans - - * zend_static_allocator.c - zend_static_allocator.h: - Not returning a value anymore - - * zend_static_allocator.h: - Don't need SUCCESS/FAILURE anymore - - * zend_static_allocator.c - zend_static_allocator.h: - Add license - - * zend_static_allocator.c - zend_static_allocator.h: - - Commit static allocator structure which we might use in an upcoming Zend - - change - -2000-06-22 Andi Gutmans - - * zend-scanner.l: - Fix asp_tags. - - * zend_extensions.c: - Oops I miss-wrote that field - - * zend_extensions.c - zend_extensions.h: - - Change API version and make the error messages more meaningful. - - * zend_alloc.c - zend_alloc.h: - Change cache size and only initialize part of it. - -2000-06-22 Stanislav Malyshev - - * zend_alloc.c: - Cached-freed memory blocks should not be in "occupied" list - - * zend_alloc.c - zend_globals.h: Make cache counters to be unsigned int - Start collecting statistics after cache pre-fill - -2000-06-18 sascha - - * Zend.m4 - acinclude.m4 - zend.c: fp_except check for FreeBSD 1.0-2.2.5 - - * Zend.m4 - acconfig.h - zend_config.w32.h - zend_operators.h: Welcome zend_finite(n). - - This chooses the best combination of what is available: - - finite, isfinite, isinf, isnan - -2000-06-18 Stanislav Malyshev - - * zend.h - zend.c: Make error callback be publicly accessible - -2000-06-18 Andi Gutmans - - * zend.c: - Better FreeBSD fix. Does fp_except_t exist on 3.4? - - * zend.c: - - I don't know how this happened. I tested the bloody thing and I remember - - copy&pasting from code which used ~. - -2000-06-17 Zeev Suraski - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c - zend_ptr_stack.h: - Add restore_error_handler() - error_handler's are now stored in a stack - - * zend-scanner.l - zend.c - zend_API.h - zend_execute_API.c: - Allow the symbol_table to be passed to call_user_function_ex() - - * zend-scanner.h - zend-scanner.l: Fix filenames and line numbers in ZTS mode - - * zend_hash.c - zend_hash.h: - Avoid crashing with recursive applies - limit apply nest level to 3 (I'm not aware of a place - in which applying recursively on the same hash makes sense with more than one nest level, but - 3 should be enough) - -2000-06-16 Zeev Suraski - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Ok, this time here's some real Win32 system programming :) - Redesigned the timeout system using a single timeout thread and a single window, - and used a much quicker check. - -2000-06-16 Andi Gutmans - - * zend_execute_API.c: Fix UNIX build - -2000-06-16 Zeev Suraski - - * zend_execute.c: Macro it up the right way - - * zend_execute.c: Macro this up, so it can be moved to other places - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Move timeout code to Zend - - Implement timeouts in Win32 - -2000-06-15 Zeev Suraski - - * Zend.dsp - zend.c: - Fix non thread-safe mode - asp_tags/short_tags etc weren't getting initialized properly - -2000-06-15 Andi Gutmans - - * zend_list.c: *** empty log message *** - - * zend-parser.y: - Support multiple arguments to unset() - -2000-06-15 Thies C. Arntzen - - * zend_list.h: ups. - - * zend_list.h: - changed return type of ZEND_VERIFY_RESOURCE from FALSE to NULL - -2000-06-14 sascha - - * zend_operators.h - zend_operators.c: - Move some stuff to zend_operators.h which is required by the - moved inline functions. - -2000-06-14 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: - More correct way of doing bit mask - -2000-06-14 sascha - - * Zend.m4: Only replaced C0X and C0x, but not c0x.. - - * Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Rename C0x-inline to C9x-inline, and frame preprocessor directives in - zend_gcc_inline.c with #ifndef C9X_INLINE_SEMANTICS..#endif. - -2000-06-14 Andi Gutmans - - * ZendTS.dsp: - Make Win32 build - -2000-06-13 Andi Gutmans - - * zend_compile.c - zend_compile.h: Add to the API - -2000-06-13 sascha - - * Makefile.am - Zend.m4 - zend_API.h - zend_compile.h - zend_execute.h - zend_execute_API.c - zend_gcc_inline.c - zend_globals.h - zend_operators.c - zend_operators.h: Add optional support for C0x inline semantics. - - These are enabled by specifying `--enable-c0x-inline' on the command - line. We might add an autoconf check for this particular feature - later. - - * zend_llist.h: - Add llist_apply_func_t and make prototypes use the typedefs. - -2000-06-12 Zeev Suraski - - * zend_builtin_functions.c: Make Egon happy :) - - * zend_builtin_functions.c: - Return the previous error handler from set_error_handler() - - * zend_API.c - zend_API.h - zend_builtin_functions.c: - Avoid using E_CORE_* errorlevels in any place which is not in the global startup sequence - - * zend-parser.y - zend-scanner.l - zend.h - zend_compile.c: Get rid of - -2000-06-11 Andi Gutmans - - * zend.c: - Solve floating point precision crash on FreeBSD. - - * zend.c: - - Fixes crash problem on FreeBSD when losing precision. Need to still see - - how to detect we're on FreeBSD - -2000-06-11 Zeev Suraski - - * zend_API.c: Fix zend_get_parameters() - -2000-06-10 Andi Gutmans - - * zend_operators.c: - - Fixed problem when using uninitialized values in comparisons with strings. - - They behave as empty strings again just like in PHP 3. - -2000-06-10 Zeev Suraski - - * zend_execute.c: - I can't think of a reason of why it should just be a notice... Make it a warning, like it was in PHP 3. - - * zend_API.c - zend_builtin_functions.c: Fix bug #4768 - -2000-06-09 Andrei Zmievski - - * zend_builtin_functions.c - zend_hash.h: Made an alias for hash apply with arguments. - -2000-06-09 Andi Gutmans - - * zend_alloc.c: - Forgot to remove the FIXME - - * zend_alloc.c: - Make the memory limit accurate - - * zend_alloc.c: - Fix cache initialization - - * zend_alloc.c - zend_alloc.h: - - Allocate and cache in 8 byte blocks. Most allocators anyway use 8 byte - - blocks. This should help fragmentation and cache hits. - - The old tree is tagged as PRE_EIGHT_BYTE_ALLOC_PATCH - -2000-06-09 Zeev Suraski - - * zend_execute.c: Fix bug #4933 - - * zend_builtin_functions.c: Fixed bug #4819 - -2000-06-09 Andi Gutmans - - * zend_modules.h: - - Time to change it. We changed register_internal_class() -> - - zend_register_internal_class() - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Andrei, this is for you! - - Add zend_register_internal_class_ex() which allows you to specify a - - parent to inherit from. You can either specify the parent directly or via - - its name. - - * zend-parser.y - zend-scanner.l: - Typo - - * zend_execute.c: - Remove old obsolete code. - - * zend_execute.c: - Make unset consistent with the way array offsets work - -2000-06-09 Stanislav Malyshev - - * zend_execute.c: Handle unset with empty key - -2000-06-09 Andi Gutmans - - * zend_API.c - zend_API.h: - - Change register_internal_class to zend_register_internal_class for - - consistency. - - Andrei: I'm still thinking about the _ex you want me to implement - -2000-06-08 sascha - - * Zend.m4 - acconfig.h: Clean up acconfig.h - - * zend_execute_API.c - zend_operators.c: Add a couple of casts - -2000-06-06 Zeev Suraski - - * zend.c - zend.h - zend_compile.c: - Enable asp_tags/short_tags/allow_call_time_pass_by_reference to work on a per-directory - basis as well - -2000-06-06 sascha - - * zend_API.c: - Add newline at the end of the file (breaks at least SCO and Tru64 C compiler). - -2000-06-05 Andi Gutmans - - * zend-scanner.l: - Revert internazionalization fix. - - * zend_builtin_functions.c: - Complete change to create_function() - -2000-06-04 Zeev Suraski - - * zend_compile.c - zend_execute_API.c: - Change shutdown order to sort out a crash when assigning a resource id to a static. - - * zend_hash.c - zend_hash.h - zend_operators.c: - Support unordered hash comparisons - - Make == perform an unordered comparison with arrays/objects, and === perform an ordered comparison - - * zend_builtin_functions.c: Rename lambda() - -2000-06-03 Zeev Suraski - - * zend_hash.c - zend_hash.h - zend_operators.c - zend_operators.h: - Support comparisons of arrays (with arrays) and objects (with objects) - -2000-06-03 Andi Gutmans - - * zend.c: - Change #if to #ifdef. - -2000-06-03 Zeev Suraski - - * ZendTS.dsp - zend.c: Don't take chances with new include files - - * zend_execute_API.c: - Improve call_user_function() to support array($obj, $method) - - * zend-parser.y - zend.h - zend_operators.c: - Export normalize_bool - - This global/static syntax fix brought us back to the 4 documented conflicts - - * zend_builtin_functions.c: Fix a lambda() bug - - * zend_builtin_functions.c: Add missing { - - * zend_globals.h - zend_hash.c - ZendTS.dsp - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h: - Fix Win32 compilation (Use winsock2.h from now on) - - Add lambda() support - -2000-06-02 Andi Gutmans - - * zend-parser.y: - global/static require a trailing ';' - -2000-06-02 Zeev Suraski - - * zend_builtin_functions.c: Update error code - - * zend.c - zend.h - zend_config.w32.h: Nuke the old error code, use the new one - -2000-05-31 Zeev Suraski - - * zend.h: IS_BC isn't really being used, but still... - - * zend-parser.y - zend.h - zend_API.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_variables.c: - Fix a bug in static initializers/default values/class member variables that contained - array values - -2000-05-29 Zeev Suraski - - * zend_API.c - zend_API.h: Allow disabling of functions for security reasons - -2000-05-28 Andi Gutmans - - * zend_operators.c: - - Use pointer arithmetic to speed up the function a bit - - * Zend.m4: - This should have been done for 4.0.0. - - Default build is without debug now. Use --enable-debug if you want a - - debug build which includes leak/memory overwrite etc. detection - -2000-05-26 Andi Gutmans - - * zend-scanner.l - zend_operators.c - zend_operators.h: - - Fixed scanning decimal numbers in internationalized environments. They should - - always be in standard US format e.g. 23.3 - -2000-05-25 Zeev Suraski - - * zend_compile.c: - Fix a crash bug in certain situations of class redeclarations - -2000-05-24 Thies C. Arntzen - - * zend_hash.h: rename hastable -> _hashtable to avoid clashes - - * zend-scanner.l: - add rdbuf() to our own istdiostream implementation, allowing C++ compile - using SUN and SGI native compilers. (by Jayakumar Muthukumarasamy ) - -2000-05-22 Zeev Suraski - - * zend.c: - Remove ugly Ltd. - -2000-05-21 Sam Ruby - - * zend.c: Windows build failure - -2000-05-21 Andi Gutmans - - * zend.c - zend_compile.h: - - Fix Apache php source highlighting mode. It was crashing due to the - - module shutdown functions being called when the startup functions weren't - - being called. - - * zend.h - zend_extensions.h: - Get ready for release - -2000-05-19 Zeev Suraski - - * zend_highlight.c - zend_highlight.h: Open these up for the API - -2000-05-18 Zeev Suraski - - * zend_alloc.c: Do it in thread unsafe mode for now. - -2000-05-18 sascha - - * zend_alloc.c: Kill warnings - -2000-05-18 Andi Gutmans - - * zend_alloc.c: - Do this someplace else. - - * zend_execute.c - zend_operators.c: - - Fix include() when used on resources (shouldn't work but shouldn't crash - either). - -2000-05-18 Andrei Zmievski - - * zend_operators.c: - Update for sort functions - user can now specify sort type. - -2000-05-17 Andi Gutmans - - * zend_operators.h - zend_operators.c: - - Add support for string_compare_function() and number_compare_function(). - UNTESTED! - -2000-05-17 Zeev Suraski - - * zend_operators.c: Normalize results of compare_function() - - * zend-scanner.l: - Fix crash if %> is encountered in HTML while ASP-tags are disabled - -2000-05-17 Andi Gutmans - - * zend_opcode.c: Fix order - -2000-05-17 sascha - - * zend_operators.h: Add missing prototype - -2000-05-16 Zeev Suraski - - * zend_alloc.c: - - Small optimization. Filling up the Cache helps performance. - -2000-05-12 sascha - - * Makefile.am: Fix parallel makes on BSD - -2000-05-11 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.h - zend_operators.c: - Get rid of chval - it's really not necessary and seems to be confusing people - - * zend_compile.c: Refined fix - - * zend_compile.c: - Fix a memory corruption bug with by-ref function arguments - -2000-05-10 Andi Gutmans - - * zend_extensions.h: - Bump up Zend extension version number - -2000-05-10 Thies C. Arntzen - - * zend_compile.c: make waning readable - -2000-05-08 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_opcode.c: Thoroughly initialize IS_UNUSED for proper cleanup - - * zend.h: - Change Zend Engine version number - - * zend_alloc.c: - Return real size allocated - -2000-05-08 Zeev Suraski - - * zend_operators.c: Make zend_binary_strcasecmp compile again - -2000-05-08 sascha - - * zend_operators.c: Make strcasecmp() act correctly WRT SUS II. - - Patch by: hholzgra@php.net - PR: #3556 - -2000-05-06 Andi Gutmans - - * zend_execute.h - zend_execute_API.c: - Make zend_eval_string() return SUCCESS/FAILURE - - * zend_execute.c: - - Make $obj->test = 5; work again (assigning to uninitialized objects) - -2000-05-05 sascha - - * Zend.m4: - Linking directly against libc might result in unexpected behaviour. - We check for dlopen in libdl first, and check then whether dlopen exists. - -2000-05-03 Andi Gutmans - - * zend_compile.h: - Change fetch_type to be zend_uint - - * zend_compile.c - zend_execute.c: - Change the place CAST uses for the op_type - -2000-05-02 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Change zend_hash_get_current_key_ex() to also return the string length - -2000-05-02 sascha - - * zend_API.c: - Fix segfault occuring when a temporary module was unloaded and if this - module did not have a request shutdown function. - - * zend_API.h: - Add ZEND_GET_MODULE(name). This is a short-cut for the common - get_module function. - -2000-05-01 sascha - - * zend.c: - Source file does not end with a newline. Some old compilers don't like that. - -2000-05-01 Andrei Zmievski - - * zend_builtin_functions.c: Added a way to get all declared classes. - -2000-05-01 sascha - - * Makefile.am: Fix dependency - -2000-04-29 Zeev Suraski - - * zend_extensions.h - zend_opcode.c: - Pass the op_array to the ctor/dtor, instead of just the resource - - * zend_extensions.c: crash fix - - * zend_extensions.c - zend_extensions.h - zend_llist.c - zend_llist.h: - Add zend_llist_apply_with_arguments() - - Add a message handler to the extensions - - * zend_compile.h - zend_opcode.c: - Fix possible bug with extension dtors being called without the ctors being called first - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_opcode.c: Beautify - -2000-04-28 Zeev Suraski - - * zend.c - zend_extensions.c - zend_extensions.h: Fix a bug in the resource dispencer - - * zend_operators.c - zend_operators.h: Make convert_to_string() allocations traceable - -2000-04-27 Zeev Suraski - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: *** empty log message *** - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: Change to using the #define's - - * zend.c - zend.h: More error handling work (still completely disabled) - -2000-04-26 Zeev Suraski - - * zend_execute_API.c - zend_variables.c: Fix - forgot to split away if refcount>1 - -2000-04-25 Zeev Suraski - - * zend_extensions.c: Fix bug - - * zend.h: We'll need two... - - * zend_hash.h: Add useful macros - -2000-04-25 Andi Gutmans - - * zend_llist.c: - Fix persistence of llist - -2000-04-24 Zeev Suraski - - * zend_compile.c: - Forgot to keep the ':' in the class_name - - * zend_API.c: Correct fix - -2000-04-24 Thies C. Arntzen - - * zend_API.c: MODULE_TEMPORARY should get a call to RSHUTDOWN as well! - - * zend.c: - fixed shutdown crash if MSHUTDOWN tries to php_error() something. - -2000-04-21 Thies C. Arntzen - - * zend_variables.c - zend_variables.h: export zval_add-ref and zvale_del_ref - -2000-04-20 Zeev Suraski - - * zend_operators.h: - Change macro names from Z to Z_ - - * zend_operators.h: Add some macros for nicer zval handling - -2000-04-20 Andrei Zmievski - - * zend_operators.c: Do proper ieeefp.h check. - -2000-04-20 Thies C. Arntzen - - * zend_operators.c: - compile before commit! compile before commit! compile before commit! - - * zend_operators.c: - revert andrei's path (i can't compile anymore on linux) - we're always using #ifndef HAVE_BLA instead of if !HAVE_BLA and if we need ieeefp.h for some weird platform (which one is that?) we need an autoconf check for it. - -2000-04-19 Andrei Zmievski - - * zend_operators.c: Include proper files for finite. - -2000-04-19 Zeev Suraski - - * zend.c - zend.h - zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: - Initial support for trapping errors (not complete and disabled; will be enabled only - post-PHP 4.0.0) - - * zend_builtin_functions.c - zend_constants.c - zend_errors.h: - - Renamed get_used_files() to get_required_files() for consistency - - Documented some functions - - Added user-level warning messages - - Added user_error() - -2000-04-19 Andi Gutmans - - * zend_opcode.c - zend_compile.h: - Export pass_include() for Windows - -2000-04-18 Zeev Suraski - - * zend_operators.h: - Add convert_to_writable_*_ex() macros (unused at this time) - -2000-04-17 Andi Gutmans - - * zend_compile.c - zend_execute.c: - Fix order of JMPZNZ arguments - -2000-04-17 Thies C. Arntzen - - * zend_operators.c: ups, finite is already a macro on Win32 - - * Zend.m4 - zend_operators.c: HPUX11 only has isfinite() - -2000-04-15 Andi Gutmans - - * zend-scanner.l: - Fix leak in require_once() - -2000-04-15 Thies C. Arntzen - - * zend_extensions.c: fixes compile on platforms without dl() support. - -2000-04-15 Zeev Suraski - - * zend.c: Fix ZTS - -2000-04-15 Andi Gutmans - - * zend-scanner.l: - "use" is not yet supported; instead use include_once() or require_once() - for the time being (Andi, Zend library) - -2000-04-15 Zeev Suraski - - * zend.c - zend_API.c - zend_compile.c - zend_execute_API.c - zend_list.c - zend_list.h: - Clean up resource lists namespace - - Prepare extended resource list destructor APIs (currently unused) - -2000-04-13 Zeev Suraski - - * zend_operators.c: - Fix a memory leak when using assign-op bitwise operators on strings - -2000-04-12 Zeev Suraski - - * zend_execute.c: *** empty log message *** - -2000-04-11 Andi Gutmans - - * zend_execute_API.c: - Fix memory leak - -2000-04-11 Zeev Suraski - - * zend_execute.c: Fix warnings - - * zend_execute.c: Fix fd leak in include_once() - -2000-04-10 Andi Gutmans - - * zend-scanner.l - zend_execute.c: - - -2000-04-10 Zeev Suraski - - * zend.h - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_operators.c: Fix object overloading support - -2000-04-10 Andi Gutmans - - * zend_execute.c: - Add warnings - - * zend_compile.c: - Two more places needed changing - -2000-04-10 Zeev Suraski - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.h: Clean up last/size definitions - -2000-04-09 Zeev Suraski - - * zend_compile.h: *** empty log message *** - -2000-04-07 Zeev Suraski - - * zend_execute.c: Thoroughly fix include_once() - - * zend_execute.c: Fix include_once() - -2000-04-06 Andi Gutmans - - * zend-parser.y: *** empty log message *** - - * zend_execute.c - zend_execute.h: Initial preparation for OO overloading patch - -2000-04-05 Andi Gutmans - - * zend_extensions.h: - Bump up version number - - * zend_compile.c - zend_execute.c: - FIx JMPZNZ - -2000-04-03 Zeev Suraski - - * zend_list.c: - Fix the problem with dl()'d modules not freeing their resources properly - -2000-04-01 Zeev Suraski - - * zend_API.h - zend_config.w32.h: *** empty log message *** - - * acconfig.h: Have a standard way of exporting symbols - - * zend_modules.h: Use int - - * zend_API.h: Generalize some common thread-safety stuff - - * zend_modules.h: Have a standard entry for the globals id - -2000-03-31 Zeev Suraski - - * zend_compile.c: - The previous fix ended up being broken, this one should do it - -2000-03-31 Andi Gutmans - - * zend_compile.c: - Fix bug - -2000-03-30 Zeev Suraski - - * zend_extensions.c: Fix zend_register_extension() - -2000-03-30 Andi Gutmans - - * zend_extensions.h: - Bump up API number after Lars' change - -2000-03-30 sascha - - * Makefile.am: Give another hint to BSD makes - - * Makefile.am: - Specifically mention $(srcdir), so that OpenBSD's make gets it - -2000-03-29 Zeev Suraski - - * zend_stack.c - zend_stack.h - zend_compile.c: - - Make the argument order for the stack applies more consistent with other Zend - data structures - - Fix a possible corruption problem due to switch() C-level optimization - -2000-03-29 Torben Wilson - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Added !== (is not identical) operator. - -2000-03-29 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: *** empty log message *** - -2000-03-29 Andi Gutmans - - * zend_API.h: - - Make sure zend_API.h has Zend'ish versions of the ZEND macros so that - Zend'ish modules don't need to mix PHP & Zend notation. - -2000-03-28 Zeev Suraski - - * zend_builtin_functions.c: - The checks for func_num_args() and friends were broken - fixed - -2000-03-27 Sam Ruby - - * Zend.dsp: Remove debug libraries from debug build - -2000-03-26 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_API.c - zend_builtin_functions.c: - Stop zend_func_args() and co. from crashing - - * zend.h: - - Didn't see Thies' commit message although I can't really see how it would - make a difference - - * zend.h - zend_opcode.c: - Include Andrea's fix for alloca.h - -2000-03-26 Thies C. Arntzen - - * zend.h - zend_execute.c: - needs to be included before we define macros calling alloca() - atleast using SGI's cc - should not harm other platforms (i hope) - - * zend_opcode.c: fix cast - -2000-03-25 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: *** empty log message *** - -2000-03-25 Zeev Suraski - - * zend-parser.y - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: - Some header dependencies cleanup - - Generalize zval_print() and zval_print_r() - -2000-03-25 Sam Ruby - - * zend.h: RTLD_NOW => RTLD_LAZY|RTLD_GLOBAL - -2000-03-25 Zeev Suraski - - * Zend.dsp: Update dsp's - -2000-03-24 Zeev Suraski - - * zend_execute.c: - - Fixed a crash when sending a non-variable expression to a runtime-bound function - that expected a reference. - -2000-03-24 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Nuke hash_*_ptr functions - -2000-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Use WRONG_PARAM_COUNT. - -2000-03-23 Zeev Suraski - - * zend_builtin_functions.c: - Make it compile - -2000-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Added get_class_methods(). - -2000-03-22 Andi Gutmans - - * zend.h: - Change Zend version as API has changed - -2000-03-22 Zeev Suraski - - * zend_operators.c: - Wrong fix - - * zend_operators.c: - Only free when result != op1 - -2000-03-21 Andi Gutmans - - * zend.c - zend.h: - - Change zend_startup to accept a flag for starting builtin functions - - * zend.h - zend_API.h: - Move #defines - -2000-03-19 Thies C. Arntzen - - * zend_compile.h: kill warning - -2000-03-18 Andi Gutmans - - * zend.h: - Fix compile problem on FreeBSD - - * zend.h: - - No reason for refcount to be signed and move to zend_* typedefs - -2000-03-18 Thies C. Arntzen - - * zend.c: renamed _string_value_() to __string_value(). - -2000-03-18 Zeev Suraski - - * zend_builtin_functions.c: - The third argument to define() wasn't working right, fixed - - * zend_execute.c: - false wouldn't automaticaly switch to an array type, which resulted in an - incompatibility with PHP 3. Fixed. - -2000-03-16 Thies C. Arntzen - - * zend.c: renamed "to_string" -> "_string_value_" - -2000-03-15 Zeev Suraski - - * zend-scanner.l - zend.h - zend_execute.c: - Fix newly introduced problem reported by Sam Ruby - -2000-03-15 Andrei Zmievski - - * zend_hash.c - zend_hash.h: - Make zend_hash_move_forward()/zenv_hash_move_backwards() a little smarter. - -2000-03-15 Zeev Suraski - - * zend_opcode.c: - Fix warning (I thought I fixed this one before) - -2000-03-14 Andrei Zmievski - - * zend_llist.c - zend_llist.h: Implemented external list traversing. - -2000-03-14 Andi Gutmans - - * zend-parser.y: - - Allow array(1,2,3,) i.e. with trailing comma. You can only have one - trailing comma. - -2000-03-13 Zeev Suraski - - * zend_compile.c: - - - * zend_compile.c: - Spare a byte :) - -2000-03-13 Andi Gutmans - - * zend_compile.h - zend_modules.h: - Another zend_uchar - - * zend_compile.c: *** empty log message *** - - * zend.h - zend_compile.h: - - define zend_uint and zend_uchar and use them in a few places - -2000-03-13 Andrei Zmievski - - * zend_hash.c - zend_hash.h: - Introduced a way to traverse hashes through external pointers. - -2000-03-13 Andi Gutmans - - * zend_compile.h: - Change type from int -> char - -2000-03-13 Zeev Suraski - - * zend-scanner.l: - Fix filename/lineno initialization for do_return - -2000-03-12 Zeev Suraski - - * zend_builtin_functions.c - zend_modules.h: - - -2000-03-11 Andi Gutmans - - * zend_execute.c: - - Remove inline from functions which are pretty large and besides eating up - memory in compile time probably doesn't boost performance. - -2000-03-10 Andi Gutmans - - * zend_operators.c: - - Seems to be a problem here with the return value not being set - - * zend-parser.y - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - Quick way of supporting include_once(). - Good enough for RC1. - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h: - Support require_once(). - - * zend_compile.h - zend_execute.c: - Cleanup old IMPORT stuff - - * zend-parser.y - zend-scanner.l: - - Nuke import, add include_once and include_require scanner/parser rules. - Hope to nuke use too :) - - * zend_modules.h: - That broke the Win32 build - - * zend_modules.h: - Fix a bug and define an API_NO for the ZEND_MODULE_API - - * zend_modules.h: - zend_config.h is enough - - * zend_modules.h: - Save ZEND_DEBUG, ZTS, ZEND_API information - -2000-03-09 Andi Gutmans - - * zend_highlight.c: - Fix bug in syntax highlighter - -2000-03-06 stig - - * zend_modules.h: added GINIT_FUNC_ARGS and GINIT_FUNC_ARGS_PASSTHRU - -2000-03-06 Zeev Suraski - - * zend_extensions.h: - Bump up Zend's API version - -2000-03-06 stig - - * zend_modules.h: Added ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU. - -2000-03-06 Andi Gutmans - - * zend-scanner.l: - Fix memory leak - - * zend.c: - Missed one - -2000-03-06 Sam Ruby - - * zend.c - zend.h: Unresolved externs - -2000-03-06 Zeev Suraski - - * zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h - LICENSE - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_modules.h: It's official now... - -2000-03-05 Zeev Suraski - - * ZendTS.dsp - zend.c - zend.h: Wrap some commonly unused callbacks - -2000-03-04 Zeev Suraski - - * zend-scanner.l: - The default return value from include() and eval() changed from 1 to 0 - unintentionally after the old return-reference patches - fixed - -2000-03-02 Sam Ruby - - * zend_config.w32.h: Fix Win32 build breakage - -2000-03-01 Andi Gutmans - - * zend.c: - Upgrade to year 2000 - - * ZEND_CHANGES - zend_compile.c - zend_execute.c: - Fix typos - -2000-03-01 Thies C. Arntzen - - * zend_operators.c: now - -2000-02-27 Egon Schmid - - * zend_builtin_functions.c: Fixed some protos. - -2000-02-26 Sam Ruby - - * zend_builtin_functions.c: compilation error - Win32 - -2000-02-26 Andrei Zmievski - - * zend_builtin_functions.c: - Added get_class_vars() and get_object_vars() functions. - - * zend_execute.c: Fix typo. - -2000-02-26 Zeev Suraski - - * zend_operators.c: Fix comparisons of "inf"=="inf" and "-inf"=="-inf" - -2000-02-25 Zeev Suraski - - * zend_fast_cache.h - zend_variables.c: Use the fast cache here too - -2000-02-19 Zeev Suraski - - * zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: (c) patch - - * zend_API.c - zend_API.h - zend_fast_cache.h - zend_hash.c: - - Fix a nasty bug in the hash, introduced in the recent migration to macros - - Make array_init() and friends trackable - - * zend_API.c - zend_API.h - zend_execute.c - zend_operators.c - zend_operators.h: Generalize macros - -2000-02-18 Zeev Suraski - - * zend-scanner.l: *** empty log message *** - -2000-02-18 sascha - - * zend_llist.c - zend_llist.h: - Get rid of second declaration of compare_func_t. Either put in a common - header file or prefix it with i.e. zend_llist_ - -2000-02-18 Andi Gutmans - - * zend_llist.c - zend_llist.h: - - Quick and dirty hack for supporting sorts. Improve later on when I wake up. - - * ZendTS.dsp - zend_dynamic_array.c: - Didn't compile on Win32 - - * zend_dynamic_array.c: - - Tiny change (I know I don't have to cast malloc() to void * but I like - casting my malloc()'s) - - * Makefile.am - zend_dynamic_array.c - zend_dynamic_array.h: - - Preliminary support for dynamic arrays. I need it on order to try out a - new hash implementation. It isn't used anywhere. - -2000-02-17 Andi Gutmans - - * zend.c - zend.h: - Add ZEND_API - -2000-02-16 Andi Gutmans - - * zend_execute.c: -Fix bug 3504 concerning leaks with unset() - - * zend_execute.c - zend.h - zend_compile.h: - Hopefully fix Thies' bug report. - -2000-02-16 Zeev Suraski - - * zend_builtin_functions.c: - ZEND_TEST_EXCEPTIONS should be defined/undefined before it's checked - -2000-02-16 Andi Gutmans - - * zend_execute.c: - Fix bug #3309 - -2000-02-14 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Put in the infrastructure for the unset() fix. Right now it has the old - behavior but I just need time tomorrow to add the correct behavior. - - * zend_builtin_functions.c: - Fix bug in func_get_arg() - - Get rid of compiler warnings for unused function crash() - -2000-02-13 Zeev Suraski - - * zend_constants.c: Fix a memory leak - -2000-02-13 Andi Gutmans - - * zend_hash.c: - Save a function call one very hash_add - - * zend_hash.c - zend_hash.h: - - Make startup a bit faster by changing some hash_update()'s and hash_add()'s - to hash_update_ptr()/hash_add_ptr() - - * zend_hash.c: - - Fix a couple of potential bugs where we were using emalloc/efree instead - of pemalloc/pefree. - - Fix a bug were we potentially would be freeing the key by mistake - -2000-02-13 Zeev Suraski - - * zend_builtin_functions.c: *** empty log message *** - - * zend_operators.c: Make (array) false == array() and not array(false) - -2000-02-11 Andrei Zmievski - - * zend_hash.c - zend_hash.h: Made a couple of typedefs for zend_hash_apply_*() calls. - -2000-02-11 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: Update .dsp's - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_config.w32.h - zend_constants.c - zend_execute.c - zend_extensions.c: Fine tune Andi's patch - -2000-02-10 Andi Gutmans - - * zend.h: - #define ZEND_WIN32 differently - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_constants.c - zend_execute.c - zend_extensions.c: - Finally beautify those WIN32|WINNT checks - - * zend_execute.c: - Shouldn't be there - - * zend_execute.c: - Cleanup the code - -2000-02-09 Zeev Suraski - - * zend-parser.y - zend_execute.c: - Fix last known nasty bugs in Zend. It'll be cool if there are no new ones :) - -2000-02-09 Thies C. Arntzen - - * zend_execute.c: foreach() works now for objects as well. - -2000-02-08 Zeev Suraski - - * zend_operators.c: Fix declaration - - * zend_execute.c: Fix an elusive bug - -2000-02-08 Andrei Zmievski - - * zend_operators.c: Fix up the patch. - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Patches from Walter for strncmp() stuff. - -2000-02-07 Zeev Suraski - - * zend_highlight.c: Remove old unnecessary check - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_highlight.c: - Syntax highlighting was erronously emitting more than one semicolon and/or garbage with heredocs - -2000-02-06 Andi Gutmans - - * zend_compile.c: - - Support the string offset syntax $a{2} with the regular array opcodes. - Will need to write new opcodes sometime but right now it's good enough - to announce the change to this string offset syntax for beta 4. - -2000-02-05 Andi Gutmans - - * zend-parser.y - zend_compile.c: - - This hopefully fixes the list($a, $a) = array(1,2) crash, i.e. when list - by mistake contains the same variable twice. - - BTW, there is no defined order of assignment. The value of $a after the - previous example is undefined, and should not be assumed to be either 1 - nor 2. - -2000-02-05 Zeev Suraski - - * zend_execute.c: More cleanup - - * zend.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c: Pass the executor globals to internal functions - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_modules.h - zend_variables.c: - Stop passing list/plist to internal functions - - Add a typedef for the pCopyConstructor function pointer - - Minor hacks - - * zend-scanner.l: - That was the broken downcasting that prevented the interactive C++ mode from working properly under UNIX - -2000-02-04 Zeev Suraski - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Maintain a state of whether we're compiling and/or executing - -2000-02-03 Andrei Zmievski - - * zend_API.c - zend_API.h: *** empty log message *** - -2000-02-02 Zeev Suraski - - * zend_API.c: - Fix built-in classes with more than 5 methods - - * zend_compile.c: - - Fix the annoying problem with list(), that surfaced up after our recent cleaning - patches - -2000-02-01 Andrei Zmievski - - * zend_API.c - zend_API.h: Added add_property_unset() and add_property_bool(). - -2000-02-01 Zeev Suraski - - * ZendTS.dsp - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_execute_locks.h: Improve dependencies - - * zend_execute.c: Sort out a gdb problem - - * zend_execute.c: Fix warning - -2000-02-01 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_globals.h: - Get rid of remains of garbage. - - This should fix Thies' UMR - -2000-02-01 Thies C. Arntzen - - * zend_execute_API.c: - moved destroying of garbage before resource-list gets destroyed - (see my previous mail) - zeev, andi - please comment! - - * zend.c: added missing break. - - * zend_hash.c - zend_hash.h: - took out zend_hash_pointer_update() & zend_hash_pointer_index_update_or_next_insert() - i really prefer link-errors instead of runtime-errors, don't you? - -2000-01-31 Andi Gutmans - - * zend_compile.h: - This has to always be done. - -2000-01-31 Zeev Suraski - - * zend-parser.y - zend_compile.h - zend_execute.c - zend_execute_API.c: - Optimized garbage mechanism - - Fixed another buglet in the parser - - * zend-parser.y - zend_alloc.c - zend_execute.c - zend_fast_cache.h: - Fix foreach() - - Fix indirect reference with object properties - -2000-01-30 Andi Gutmans - - * zend_execute.c: - - Fix the bug Thies found where I forgot to change a break; to NEXT_OPCODE(); - - If you find anymore let me know - - * zend_alloc.h: - Run it on align_test - -2000-01-29 Zeev Suraski - - * zend_compile.c: Fix ``'s - - * zend-parser.y - zend-scanner.l - zend_compile.h: Fix require() - -2000-01-29 Andi Gutmans - - * zend-parser.y: - Get rid of another rule which isn't needed. - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Add parser support for string offsets. This added three shift/reduce - conflicts but they all seem to be fine. - - Cleaned up the parsing rules a bit and made them much more compact and - elegant. - - Please CVS update and see that I didn't break anything. - - * zend_alloc.h: - - This will save some memory w/ GCC compilers on some platforms - - * zend_execute.c: - Yet another tiny optimization. - -2000-01-28 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_execute.c: - Make loop a bit faster. - - * zend.h: - Make sure its use is understood. - - * zend.h - zend_execute.c: - Double the speed of some key switch() tests for Win32. - - * zend_execute.c: - - This makes the switch() statement twice as quick. Moving to enum - might make this a general speed up for other platforms too - -2000-01-26 Andi Gutmans - - * zend_execute_API.c: - Keep objects as references. - - * zend_execute_API.c - zend_opcode.c: - - Allow is_ref to become 0 in case the refcount is back to 1. - -2000-01-24 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Make foreach() now copy the array but use the original array. It can - still be optimized A LOT but it's only a performance issue and not - a feature issue. - -2000-01-24 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_operators.c - zend_operators.h: - Implement declare() with declarables framework - - Implement ticks - Germany&Norway - 5 points! - - * zend_execute.c - zend_execute_API.c: Fixes - -2000-01-22 Zeev Suraski - - * zend_execute_API.c: Fix an elusive bug - -2000-01-20 Zeev Suraski - - * zend_hash.c: Add some order... - - * zend_hash.c: Indentation fixes - -2000-01-19 Andi Gutmans - - * zend_hash.c: - Optimize zend_hash_del a tiny bit. - - * zend_hash.c - zend_hash.h: - Hopefully fix the hash problem. - - * zend_hash.c: - Hrm I'm not concentrating - - * zend_hash.c: - - Actually the destructor should run after the data is already detached - from the hash but before the bucket is freed. - - * zend_hash.c: - - Rollback hash_apply and friends. They assume now that hash_del is reentrant - as it first applies the destructor and only later nukes the bucket - - * zend_hash.c: - - Run destructor before the hash structure is modified, thus, making - hash_del, reentrant (BLOCK_INTERRUPTIONS needs to be made a counter now). - - * zend_hash.c: - Undo a bug we introduced. (Another one out there). - -2000-01-19 Thies C. Arntzen - - * zend_API.h: - RETURN_NULL -> RETURN_NULL() // we don't want macros without an argumnet - -2000-01-18 Zeev Suraski - - * zend_execute.c: Leak fix - -2000-01-18 Thies C. Arntzen - - * zend_API.h: RETURN_NULL & RETVAL_NULL don't need (). - -2000-01-17 Thies C. Arntzen - - * zend_hash.c: use defines - -2000-01-17 Zeev Suraski - - * zend_hash.c - zend_hash.h - zend_variables.c: Get rid of the IsPointer functionality in the hash. - - * zend_hash.c: - Fixes a newly introduced bug in the hash - - * zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: - Destructors no longer return ints, the low level problem it was intended to solve is long gone now... - -2000-01-16 Zeev Suraski - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: - - Make zend_hash_apply() (and friends) reentrant and much, much quicker - - Introduce zend_hash_graceful_destroy(), which allows the destructor functions to - use zend_hash_apply() and/or zend_hash_graceful_destroy() - - Switch to zend_hash_graceful_destroy() in the resource list shutdowns - - * zend.c - zend_compile.c - zend_compile.h: - Allow module startup to be separate from the compiler/executor startup - -2000-01-16 Thies C. Arntzen - - * zend_hash.c: make the ht->inconsistent stuff less ugly:) - -2000-01-15 Zeev Suraski - - * zend_execute_API.c - zend_list.c: Fix a bug in call_user_function_ex() - - * zend-parser.y: - Added support for $foo->{$bar}["foobar"] notation (was supported in PHP 3) - -2000-01-15 Thies C. Arntzen - - * zend_hash.c - zend_hash.h: - if ZEND_DEBUG mode is on we'll now see warnings when a HashTable is accessed - while it's inconsistent. - - Zeev, Andi - you welcome to revert this patch if you don't like it - i find it - useful! accesssing inconsistent hashtables is one of the hardest things to track! - -2000-01-14 Andrei Zmievski - - * zend_highlight.c: - Since we're highlighting code, put and around the code. - -2000-01-13 Zeev Suraski - - * zend.h - zend_config.w32.h: Make Win32 compile again - -2000-01-12 sascha - - * acconfig.h - zend.h: - Move dl stuff from acconfig.h into zend.h. That allows us finer control - when it comes to suppressing dlfcn.h. - -2000-01-09 Zeev Suraski - - * zend_execute.c: Functionality & crash fixes - -2000-01-04 Andi Gutmans - - * zend.h - zend_operators.c: - - Rename IS_BC to FLAG_IS_BC. We will probably nuke it. - -2000-01-04 Thies C. Arntzen - - * zend_API.h: added ZVAL_*() macros. - -2000-01-04 Andi Gutmans - - * zend.h - zend_execute.c: - - Separate the overloaded objects' types from Zend's data types. - There is no reason for them to be the same, and IS_METHOD just cluttered - there data types. - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend-parser.y - zend.c: - Change IS_UNSET -> IS_NULL - -2000-01-03 Zeev Suraski - - * zend_execute.c: Fix a bug when using [] on a string - -2000-01-03 Joey Smith - - * zend_operators.c: number.h comes from ext/bcmath, not functions/ - -2000-01-03 Zeev Suraski - - * zend_execute.c: Fix - -2000-01-03 Andi Gutmans - - * zend_operators.c: - Fix compare_function() for IS_UNSET - -2000-01-02 Zeev Suraski - - * zend_execute.c: Fix - -2000-01-02 Thies C. Arntzen - - * zend_API.h: renamed RET???_UNSET -> RET???_NULL - -2000-01-01 sascha - - * Zend.m4 - acconfig.h - acinclude.m4: Some cleanup - -2000-01-01 Andi Gutmans - - * zend_operators.c: - - IS_NULL should be 0 when converted to a long although I don't think it - really should be documented. - -2000-01-01 Zeev Suraski - - * zend_operators.c: Fix buglet - -1999-12-31 Zeev Suraski - - * Zend.dsp - ZendTS.dsp: .dsp updates - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: - Add Release_inline builds - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_operators.h - zend_variables.c: - Nuke undefined_variable_string - - Introduce IS_UNSET - -1999-12-31 Andi Gutmans - - * ZendTS.dsp - zend-parser.y - zend_compile.c - zend_compile.h: - - Fix bug #3073. continue in do..while() loops should work now - -1999-12-30 Zeev Suraski - - * zend.c - zend_alloc.c - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h: - This should enable people to use ALLOC_ZVAL() in code outside the php4.dll - -1999-12-30 sascha - - * Zend.m4: - Solaris' sed does not like this expression. Since -O0 is the default, - we can also omit it. - -1999-12-29 Zeev Suraski - - * zend_variables.c: - - Change var_reset() to set bool(0) instead of string("") - - Authors should go over their code and change it to use var_reset() instead of manually - setting it to string(""), in case they're interested in the false value. - - * zend_alloc.c: time_t is an int under Linux... this should always work. - -1999-12-28 sascha - - * zend_alloc.c: Fix warnings - -1999-12-28 Thies C. Arntzen - - * zend_API.h - zend_constants.c: new constant: SQL_NULL - new macros: RETURN_SQLNULL,RETVAL_SQLNULL,IS_SQLNULL - -1999-12-27 Zeev Suraski - - * zend_fast_cache.h: Fix - -1999-12-27 Andi Gutmans - - * zend_API.c: - Get rid of warning - -1999-12-27 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_fast_cache.h - zend_globals.h - zend_opcode.c - zend_operators.c - zend_variables.c - zend_zval_alloc.h: - Generalize the fast cache mechanism - - Add the HashTable struct to the fast cache mechanism - -1999-12-27 Andi Gutmans - - * zend_API.c: - - Make zend_internal_function allocate a full zend_function structure so - that we don't get memory overruns and Thies doesn't get angry :) - -1999-12-27 Zeev Suraski - - * zend_alloc.c: *** empty log message *** - - * zend_globals.h - zend_zval_alloc.h - zend_alloc.c: Add cache statistics support - -1999-12-27 Thies C. Arntzen - - * zend.c: fix UMR in ZTS mode - -1999-12-26 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_alloc.c - zend_globals.h - zend_zval_alloc.h: - - Enable the new zval cache on debug too. No real reason not to, and it keeps - the code cleaner. - - ZTS compile fixes - - * zend_alloc.c: Fix buglet - - * zend_zval_alloc.h: Add missing file - - * zend.h - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_globals.h - zend_operators.c: - Introduce a zval-specific cache - 5-15% speed improvement - -1999-12-26 sascha - - * Makefile.am - acinclude.m4: Makefile.am: Add dummy target for dependencies - acinclude.m4: Cache result of broken sprintf check - -1999-12-26 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c: Change ALLOC_ZVAL() semantics - - * zend_alloc.c - zend_alloc.h - zend_globals.h: namespace protection - -1999-12-25 Zeev Suraski - - * zend_ptr_stack.c - zend_ptr_stack.h: inline functions cannot accept varargs - -1999-12-25 Andi Gutmans - - * zend-parser.y: - Prepare Zend for the new $a{2} string offset syntax. - -1999-12-24 Zeev Suraski - - * zend_config.w32.h: - Use __forceinline under Win32 (inlining under Win32 gives roughly 30% performance - increase) - - * zend-scanner.l: Shut gcc up - - * zend_compile.c: Optimize - -1999-12-24 Andi Gutmans - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c: - - Create two new macro's. ALLOC_ZVAL() and FREE_ZVAL(z) and make Zend use - them. - -1999-12-24 Zeev Suraski - - * zend_compile.c: - Use function_add_ref() here too - -1999-12-23 Zeev Suraski - - * zend_compile.c - zend_opcode.c: - Fix a class inheritence leak, when using static varibles in a parent class member function - - * zend_compile.c: This one slipped away - -1999-12-23 sascha - - * Zend.m4: Rename option to match description string - -1999-12-23 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: - - require() of a dynamic expression now has the standard require() semantics - - Fixed a memory leak in require() of a dynamic expression - -1999-12-23 sascha - - * Makefile.am - Zend.m4: - Compile zend_execute.c with special CFLAGS. For GCC, INLINE_CFLAGS - contains -O0 to disable optimizations. This can be disabled by using - the appropiate parameter. - -1999-12-22 sascha - - * zend_builtin_functions.c: Kill compiler warning - - * Zend.m4: Don't set DEBUG_CFLAGS to -g, if -g is already in CFLAGS - -1999-12-22 Zeev Suraski - - * zend.c - zend.h: export - - * zend_extensions.h: Those void's don't belong in there - - * zend_API.h - zend_builtin_functions.c: - Fix function_exists() - - * zend_execute.c: - - Fix a very old legacy memory leak in break(n) statements - - * zend_execute.c: Fix for the array() initialization bug Stas found - -1999-12-22 Andi Gutmans - - * zend_compile.c: - Remove unused variable. - -1999-12-21 Zeev Suraski - - * zend-scanner.l - zend.h - zend_compile.c - zend_execute.c: - Fix the highlighting problem. STR_REALLOC() should be used instead of plain erealloc() - whenever you're dealing with strings that might be coming back from the engine - there seem - to be a few other places like this in PHP. - -1999-12-21 Andrei Zmievski - - * zend.c - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend_variables.h: We're using ZVAL's now. - -1999-12-21 Zeev Suraski - - * zend_execute.c: - Fix Sascha's leak. Good report! - - * zend_alloc.c: No need to block for interruptions so early - -1999-12-21 sascha - - * Zend.m4: - Explicitly check for C++ preprocessor, otherwise autoconf forces it onto - us at the wrong place (subsequent autoconf checks failed). - -1999-12-20 Zeev Suraski - - * zend_compile.c: - Fix @expr - - * zend.h - zend_compile.c - zend_execute.c: - - Fix the crash Thies was experiencing (returning a function call could cause a crash) - - Fix the leak Thies was experiencing (@fcall() leaked) - -1999-12-19 Zeev Suraski - - * Zend.dsp: Some updates - - * Zend.dsp - ZendTS.dsp: Make these work again - - * FlexLexer.h - Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - configure.in - flex.skl - libzend.dsp - libzend.m4 - libzendts.dsp: libzend -> Zend - - * zend.h - zend_API.h - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - - Made things work again (Thies, everybody - please check the latest CVS and see if you're - still getting any problems) - - Changed the interface of call_user_function_ex() to support returning of references - -1999-12-19 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - More fixes related to the return references patch - - eval_string() and call_user_function_ex() still don't work. - - The libzend tree is untested and might not be stabl yet. - -1999-12-19 sascha - - * Makefile.am: Add zend_sprintf.c - - * acconfig.h - zend_sprintf.c: configure sets ZEND_BROKEN_SPRINTF - - * acinclude.m4: Variables are not interpolated unless we use _UNQUOTED - -1999-12-18 Zeev Suraski - - * zend.h - zend_API.h: - The tree compiles again - -1999-12-18 sascha - - * libzend.m4: Let autoconf check for the proper inline keyword - - * Makefile.am - libzend.m4: - automake created illegal target names due to the ZEND_SCANNER definition. - We now substitute @ZEND_SCANNER@ directly - -1999-12-18 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c: - - Introduce ZEND_NUM_ARGS(), to replace ARG_COUNT(ht) - - Rename getParameters() and friends for consistency and namespace cleanliness - -1999-12-17 Zeev Suraski - - * zend_constants.c: - Made PHP_VERSION and PHP_OS work again - - More php3_ cleanup - - Restored the PHP_VERSION and PHP_OS constants - -1999-12-17 sascha - - * libzend.m4: Define inline to inline explicitly - - * Makefile.am - acinclude.m4 - configure.in - libzend.m4: Move config code into separate file - -1999-12-17 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h: - - By mistake commited this to the branch. It fixes a bug we introduced with - the return reference patch. - -1999-12-15 Andrei Zmievski - - * zend_builtin_functions.c: Doh! I'm an idiot. - - * zend_builtin_functions.c - zend_compile.c: - s/inheritence/inheritance/g - - Added is_subclass_of() function - -1999-12-15 Zeev Suraski - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Implement return by reference: - - In function declaration instead of the return statement - - In the assignment phase - - Implement ability to turn off support for call-time pass by reference - -1999-12-15 Andrei Zmievski - - * zend_builtin_functions.c: val->len - - * zend_builtin_functions.c: Faster, must go faster. - -1999-12-15 Andi Gutmans - - * zend_execute.c - zend_opcode.c - zend-parser.y - zend_compile.c - zend_compile.h: - - Preliminary return ref patch. It breaks libzend so don't use this branch - right now. - -1999-12-14 Andrei Zmievski - - * zend_builtin_functions.c: - Added class_exists() - - Moved function_exists() here from from the basic_functions.c - - Modified method_exists() to convert method name to lowercase - when checking - -1999-12-13 Andi Gutmans - - * zend_execute.c: - - Fix problem when return_value's is_ref/refcount is overwritten by the - internal function. - -1999-12-11 Andi Gutmans - - * zend_execute.c: - Another small fix. - - * zend_execute.c: - Support returning references - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - This is supposed to be commited to the RETURN_REF_PATCH branch which is - the beginning of work on allowing returning of references from functions. - -1999-12-07 Andi Gutmans - - * zend-scanner.l: - - opened_path should not be freed here as the zend_file_dtor() takes care - of it. This doesn't fix the bug report for the crash of highlight_file() - though. - -1999-12-07 Zeev Suraski - - * zend-parser.y: Support ZTS definition in zend_config.h - -1999-12-06 Zeev Suraski - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c: Move the #include of zend-parser.h out of zend_compile.h - - * zend-parser.y - zend_globals_macros.h: More localization - - * zend-parser.y - zend_compile.h - zend_globals_macros.h: Localize a couple of macros - -1999-12-05 Zeev Suraski - - * zend-scanner.l: *** empty log message *** - -1999-12-05 sascha - - * .cvsignore - zend-parser.y - zend.c - zend_API.c - zend_compile.c - zend_execute_API.c: Fix some warnings - -1999-12-04 Andrei Zmievski - - * zend_API.c: *** empty log message *** - - * zend_API.c - zend_API.h - zend_hash.h: Added zend_set_hash_symbol() function. - -1999-12-04 Thies C. Arntzen - - * zend_API.h: - backed out last change after andi decided on a different approach. - -1999-12-04 Andi Gutmans - - * zend_API.h: - - Call ZEND_SET_SYMBOL_WITH_LENGTH() with refcount 1 from the standard - ZEND_SET_SYMBOL() - -1999-12-04 Zeev Suraski - - * zend-scanner.l - zend_builtin_functions.c - zend_compile.c: - Implement get_used_files() and get_imported_files() - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h: - - Break the zend->PHP dependency introduced by the .php extension for use(), - by providing an API - - Enable Stig's patch for use() extensions (it wasn't refered to by the parser) - - Fix a memory leak in that code - -1999-12-04 Thies C. Arntzen - - * zend_API.h: the new SET_VAR_* macros forgot to set the refcount! - -1999-12-04 Sam Ruby - - * zend-scanner.l: build error - windows - -1999-12-04 stig - - * zend-scanner.l - zend_compile.h: Fix typo, add prototype for use_filename(). - - * zend-scanner.l: "use" should use arg+".php" as parameter to require - -1999-12-04 Zeev Suraski - - * zend-scanner.l: This should fix the fd leak with include()/require() - -1999-12-03 Andrei Zmievski - - * zend_API.h: *** empty log message *** - - * zend_API.h: Added ZEND_SET_GLOBAL_VAR_WITH_LENGTH_EX() macro. - -1999-12-03 Thies C. Arntzen - - * zend-scanner.l: revert my last patch - WARNING: we leak fd's again. - add initialzation of opened_path highlight_file() - -1999-12-03 Andi Gutmans - - * zend_API.h: - Remove _EX and make it the old _LENGTH - -1999-12-02 Andi Gutmans - - * zend_API.h: - Add _EX macro for Andrei - -1999-12-02 Zeev Suraski - - * zend-scanner.h - zend_compile.h: Solve a couple of compile issues - -1999-12-02 Thies C. Arntzen - - * zend-scanner.l: - php_fopen_wrapper_for_zend() does *NOT* insert the opened files into any list - the caller needs to fclose() the file. (not sure if this is desired) - fixed "Uninitialized memory read" when including URLs - -1999-12-01 stig - - * zend-scanner.h - zend.c - zend.h - zend_alloc.h - zend_builtin_functions.h - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_extensions.h - zend_globals_macros.h - zend_hash.h - zend_indent.h: Fix warnings surfacing in maintainer-mode. - -1999-12-01 Zeev Suraski - - * zend_API.h: - Make it possible to explicitly set refcount in ZEND_SET_SYMBOL_WITH_LENGTH(), part 2 - - * libzendts.dsp - zend_API.h: - Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_LENGTH() - -1999-12-01 Andi Gutmans - - * zend_execute.c: - - Forgot to check for BP_VAR_IS in the fix made for Thies' string offset - problem. - -1999-11-30 Andi Gutmans - - * zend_API.c: - Applied Thies' bug fix. Great work! - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Add use support (behaves like require, but will not use the same file twice) - - Add import support (behaves like include, but requires parentheses; will not - use the same file twice; Currently, it is not yet properly implemented, and - only behaves like include) - - * zend_execute.c: - - Fix problem Thies reported. We by mistake separated variables which were - being fetched for read only. - -1999-11-27 Zeev Suraski - - * zend_alloc.c: Add ability to disable the memory cache - -1999-11-26 Zeev Suraski - - * zend-scanner.l: - Fix fd leak in ZTS mode - - * zend-scanner.l - zend_compile.c: UNIX/non ZTS compile fixes - - * zend-scanner.l - zend_compile.c - zend_compile.h: - Improve the file handle closing code - - * zend_llist.c - zend_llist.h: - Modify zend_llist_del() to receive a comparison function - - * zend_API.c: - This request_shutdown() is no longer needed (never was needed really) - - * zend-scanner.l: This should get the file to close properly - -1999-11-26 sascha - - * Makefile.am: Rebuild libzend.la, if the scanner was rebuilt - -1999-11-26 Zeev Suraski - - * zend_API.c - zend_modules.h: Remove request_started, increase thread safety - -1999-11-25 Zeev Suraski - - * zend_execute.c: That's a more thorough fix... - - * zend_execute.c: - Fix bug #2817 - assignments to string offsets could erronously modify unrelated strings - -1999-11-22 Zeev Suraski - - * zend_alloc.c: Fix compile problem with enable-memory-limit - - * zend-scanner.l: Fix inconsistencies with here-docs implementation - - * zend-scanner.l - zend_globals.h: Fix #2744 - -1999-11-21 Andi Gutmans - - * zend_execute.c: That slipped away - -1999-11-21 Zeev Suraski - - * zend.h - zend_API.c - zend_compile.c - zend_execute.h - zend_execute_API.c: - Optimize class instanciation - - Fix constant instanciation for array elements inside objects - -1999-11-19 Andi Gutmans - - * zend_execute.c: - - Moved var_uninit() for return_value to the beginning of DO_FCALL. - We forgot to do it for overloaded methods - - * zend.h - zend_execute.c: - - Functions whose return values aren't used have them freed in DO_FCALL - and don't need a special ZEND_FREE opcode following them anymore - -1999-11-17 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - If a function's return value is unused then don't create a ZEND_FREE - opcode but free it after the function call in zend_execute. - - * zend_execute.c: - Forgot this - -1999-11-16 Andi Gutmans - - * zend_execute_API.c: - Weird that this compiled for me. - - * zend.h: - CHange used_return_value -> return_value_used - - * zend_compile.c: - - In any case create the free opcode. Need to allow the functions to - create a hint. - - * zend.h - zend_compile.c - zend_execute.c: - - Add support for used_return_value passed to internal functions. - -1999-11-14 Andi Gutmans - - * zend_compile.h: - Fix comment as to Joey's findings - -1999-11-13 Andi Gutmans - - * zend_execute.c: - Fix crash with string offset assignments. - -1999-11-04 Andrei Zmievski - - * zend_hash.c - zend_hash.h: Made zend_hash_rehash() callable from outside. - -1999-11-03 Andi Gutmans - - * zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - Add support for BYREF_FORCE_REST - -1999-10-28 Andi Gutmans - - * zend_compile.c - zend_execute.c: - Fix for Thies' leak and Andrei's crash - -1999-10-25 Zeev Suraski - - * zend_compile.h: *** empty log message *** - -1999-10-23 Sam Ruby - - * libzend.dsp - libzendts.dsp: - Allow CYGWIN directory to be specified as via environment variable - -1999-10-22 Andi Gutmans - - * zend_execute.c: - Fix isset() with string offsets. - -1999-10-19 Thies C. Arntzen - - * zend_operators.c: fixed is_identicat_function() - -1999-10-19 Andi Gutmans - - * zend_compile.h: - Move IS_IDENTICAL next to IS_EQUAL - - * zend_operators.c: - Fix is_identical function - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Preliminary submit of Thie's patch. Will fix the rest on Windows - as this was added on UNIX with patch. Changed IS_SAME -> IS_IDENTICAL - -1999-10-18 Andrei Zmievski - - * zend_API.h: Be safe, use (). - -1999-10-15 Andrei Zmievski - - * zend_operators.c - zend_operators.h: unstatic'fy is_numeric_string() - - * zend_hash.c - zend_hash.h - zend_compile.c: *** empty log message *** - -1999-10-15 Andi Gutmans - - * zend_operators.h: - Add convert_to_number_ex() - -1999-10-14 sascha - - * configure.in: - Add "--disable-inline" for low-memory machines (be it limited - RAM or virtual memory). It's also useful for Digital C where - the C++ compiler thinks "inline" is an invalid specifier. - - * Makefile.am: Use sources from $(srcdir) - -1999-10-13 sascha - - * Makefile.am: Do not use $< for anything but implicit rules. - -1999-10-13 Thies C. Arntzen - - * zend_list.c: - (zend_fetch_resource) added warinig if resource is of wrong type - -1999-10-13 sascha - - * acconfig.h: Disable ZEND_EXTENSIONS_SUPPORT, if RTLD_NOW is not defined. - - Note that this part could be made platform independent by using - libltdl (for Solaris, Linux, *BSD, HP-UX, Win16/32, BeOS). - -1999-10-12 Thies C. Arntzen - - * zend_list.c - zend_list.h: new improved resource-API - -1999-10-12 sascha - - * acconfig.h: - Use DL_LAZY for OpenBSD. This seems to be a compatibility flag which - should be used for the 2nd parameter to dlopen. - - http://www.openbsd.org/cgi-bin/cvsweb/src/share/man/man3/dlfcn.3?rev=1.8 - -1999-10-12 Andi Gutmans - - * zend_execute.c: - - object.ptr was made NULL in DO_FCALL but wasn't restored. Right now I - push it in DO_FCALL and at the end of do_fcall_common it always gets - popped. We might be able to optimize it out. - -1999-10-11 Andrei Zmievski - - * .cvsignore: *** empty log message *** - - * zend_hash.c - zend_hash.h: Modified zend_hash() to accept a pointer to sort function. - -1999-10-11 Andi Gutmans - - * zend_execute.c: - - No idea why this bug didn't exist before. But I'm too tired to think of it. - During a regular do_fcall we need to set object.ptr to NULL and, thus, - push it in the beginning and pop it in the end. - I hope this fix more or less cuts it. I just want to sleep :) - -1999-10-10 Andi Gutmans - - * zend_execute.c: - - Didn't lower refcount when doing an internal function call linked to a regular object. - -1999-10-10 Thies C. Arntzen - - * .cvsignore: added some more autoconf/libtool stuff to be ignored - -1999-10-10 Andi Gutmans - - * zend_execute.c: - - Clean up a bit. Separate before the locking so that we can use SEPARATE_ZVAL - macro. - -1999-10-10 sascha - - * build.mk: Add clean target which removes standard targets - - * build.mk: build.mk can be used to generate build tools. It is usually - faster than buildconf, since it rebuilds only components, if - it is necessary. To use it, run - - $ make -f build.mk - -1999-10-09 Andi Gutmans - - * zend_execute.c: - Shouldn't be needed - - * zend_execute.c: - - God damn this sucked. I hopefully fixed the problems with classes although - we might need to clean stuff up a bit. - -1999-10-09 sascha - - * acconfig.h: - Define RTLD_NOW to DL_NOW, if RTLD_NOW is not defined (for OpenBSD). - -1999-10-07 Thies C. Arntzen - - * zend_variables.c - zend_variables.h: added zval_del_ref() function - -1999-10-07 Andi Gutmans - - * zend_execute.c: - Reverse my patch - -1999-10-06 Andi Gutmans - - * zend_execute.c: - - Fixed memory leak with this pointer. It was somtimes initialized with refcount - of 2 instead of 1. - - Also fixed a place where object.ptr_ptr is set to pointing to a zval* instead - of zval**. I don't think this is ever used so we might be able to remove it - altogether. - -1999-10-06 Thies C. Arntzen - - * zend_execute.c: fix for using resources as array indices - -1999-10-05 sascha - - * configure.in - zend.h - zend_globals.h: More portability stuff - - * configure.in: OSF/1 V4.0 wants -lcxx - - * zend_compile.h: - This causes link problems with anything higher than -O0. - -1999-10-04 sascha - - * Makefile.am: Add necessary rule. - - * Makefile.am - acconfig.h - acinclude.m4 - buildconf - configure.in - zend_config.in: Use libtool to build. - -1999-10-04 Thies C. Arntzen - - * zend_builtin_functions.c: use getParametersEx for all builtin functions - - * zend_API.c - zend_API.h: added add_*_resource() and add_*_bool() functions - -1999-10-03 Andi Gutmans - - * zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - Hooray. This might actually work. (I hope) - -1999-10-03 sascha - - * configure.in: Make it executable. - -1999-10-02 Andi Gutmans - - * zend_execute.c: - Another locking fix. - - * zend_execute.c: - Fixed locking problem when fetching string offsets - -1999-10-02 Zeev Suraski - - * zend_execute.c: - Fix the leak reported on the PHP 3 list (isset() on string offsets) - -1999-10-01 Andi Gutmans - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.h: - - Move is_ref back to being an unsigned char and not a bit field. - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Remove locking support completely - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - For Andrei. Implement references in array() initializations - -1999-09-29 Zeev Suraski - - * zend_config.w32.h: *** empty log message *** - -1999-09-29 Andi Gutmans - - * zend_operators.c: Fix leak in += with arrays - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Fix SEND_VAR problem after fetch'ing a variable and not knowing the fetch type - -1999-09-29 Thies C. Arntzen - - * zend_API.c - zend_API.h: added add_property_resource - -1999-09-28 Andi Gutmans - - * zend_compile.h - zend_execute.c - zend_execute_API.c: - - Stop using the locking mechanism and start using refcount. - Now we know when we need to free but we still need to support it - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - First part of the patch which makes reads use ptr and not ptr_ptr. - -1999-09-28 sascha - - * acconfig.h - configure.in - zend-scanner.l: Provide alternative istdiostream. - - This has been tested with Sun WorkShop 4.2 C++ which does not - contain class istdiostream. - -1999-09-26 sascha - - * Makefile.am - configure.in: Actually allow to set CXXFLAGS - - * configure.in - zend_config.in: - Build communication channel and add checks for C++ library - -1999-09-26 Andi Gutmans - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Changed Ts{}.var to Ts{}.var.ptr_ptr. - -1999-09-24 sascha - - * zend_operators.h: Add _ex API implementation for booleans. - -1999-09-24 Zeev Suraski - - * zend_list.c - zend_list.h: Exify the standardized resource stuff - -1999-09-23 Andi Gutmans - - * zend_operators.c: - Fix bug #2364. - I haven't checked all of the conversion macros yet but there's a change - there are more such bugs there. - -1999-09-23 sascha - - * configure.in: Fix vpath build w/ thread-safe enabled on Unix. - -1999-09-22 Thies C. Arntzen - - * zend_builtin_functions.c: - preliminary fix for each until andi & zeev clean up! - - * zend_list.c: - if you pass NULL as the resource_type_name to zend_fetch_resource*&friends the functions will not print any warnings if the resource is not found! - -1999-09-21 Andi Gutmans - - * zend_compile.c: - - Fix problem where function parameter fetches were created too late. - -1999-09-21 Zeev Suraski - - * zend_builtin_functions.c: Add get_func_args() - - * zend_builtin_functions.c: *** empty log message *** - -1999-09-20 Andi Gutmans - - * zend_builtin_functions.c: - - Move some more Zend internal functions from PHP - - * zend-parser.y: - Next part of locking fix. - $var = expr; and $var += expr; first create code for expr and later on - for the fetch_w of $var. - - * zend_builtin_functions.c: - Newline for Sun's compiler - - * zend_API.h - zend_builtin_functions.c: - Add some internal functions to Zend - - * zend_compile.c - zend_compile.h - zend_opcode.c: - - First step in fixing locking problem. Array fetches are now always done last. - Later on we will want to delay the write fetches even longer until after their - resulting expression is parsed. The way it is now, will make it very easy - to delay as long as we need. - - * zend_compile.c - zend_compile.h: - - Indirect references had all of the fetches by mistakenly backpatched. - Actually all of the fetches are supposed to be read, except for the last - one. - -1999-09-20 Zeev Suraski - - * libzend.dsp - libzendts.dsp - zend_builtin_functions.c: Added zend_num_args() and zend_get_arg() - - * Makefile.am - zend.c - zend_builtin_functions.c - zend_builtin_functions.h: - Add a file in which we can put Zend builtin functions - -1999-09-18 Andi Gutmans - - * zend_execute.c: - - Try to fix the leak Rasmus reported. It's pretty sucky code so I'm really - not sure this fix is OK.I can't remember all of what we did there. - -1999-09-18 Zeev Suraski - - * zend_list.c: Safer behavior - -1999-09-17 Thies C. Arntzen - - * zend_execute.c: make SUNs c89 happy - - * zend_execute_API.c: no // in the sources please - - * zend_globals_macros.h: added newline at end of file - -1999-09-17 Zeev Suraski - - * zend_execute.c: - Fix bug #2318 - -1999-09-16 Zeev Suraski - - * zend_operators.h: Introduce convert_to_*_ex() - -1999-09-16 sascha - - * configure.in: this helps compiling on non-ANSI C compliant platforms - -1999-09-13 stig - - * acconfig.h - configure.in: Make sure HAVE_LIBDL gets defined. - Disable more C++ tests when not configured for thread safety. - -1999-09-12 Zeev Suraski - - * zend.c: Make this class instanciatable - -1999-09-12 sascha - - * configure.in: check for c++ only, if thread safety is enabled - -1999-09-10 Zeev Suraski - - * zend_compile.c: Shut up a warning - -1999-09-09 Andi Gutmans - - * zend_compile.c - zend_globals.h - zend_stack.c - zend_stack.h: - Add foreach() freeing code. - - Fix switch() freeing code to only free current function's switch expressions. - - I have a feeling break expr; in a switch where expr > 1 leaks because it - won't free all of the expressions. Fix is probably not trivial. - - * zend_operators.c: - - Fix leak when decrementing strings which actually are longs. - -1999-09-08 Andi Gutmans - - * zend_execute.c: - - Fix for floating point array offsets. Same behaviour as in PHP 3.0. We - casted to (long). - - * Makefile.am - libzendts.dsp: - Add -b option to flex++ - -1999-09-07 stig - - * acconfig.h: define tests first, use after. - -1999-09-06 Andi Gutmans - - * zend_config.w32.h: - Fix win32 compile - - * zend_config.w32.h: - Make zend compile again in Win32. - -1999-09-06 stig - - * .cvsignore: ignore zend-scanner.cc - - * ZendCore.dep - libzend.dsp - libzendts.dsp: hand-patched some MSVC files - - * Makefile.am - acconfig.h - acinclude.m4 - config.unix.h - config.w32.h - configure.in - zend-scanner.l - zend.h - zend_API.c - zend_alloc.c - zend_compile.h - zend_config.w32.h - zend_execute.c - zend_hash.c - zend_list.c - zend_ptr_stack.c - zend_sprintf.c: * header file cleanup - * fixed --enable-thread-safety build for UNIX - - I don't have a Win32 environment available, could someone please try - compiling on Win32 to see if I got all the header file stuff right there? - -1999-09-05 Andi Gutmans - - * zend_globals_macros.h: - Oops - - * libzendts.dsp - zend.c - zend.h - zend_alloc.c - zend_alloc.h - zend_globals.h: - Shift around header files. - -1999-09-04 Zeev Suraski - - * zend_list.c: Fix a stupid bug (from stefan@roehri.ch) - -1999-09-03 Zeev Suraski - - * zend_list.h: Damn, forgot to commit that - - * zend_list.c - zend_list.h - zend_modules.h: Add new API for resources - -1999-09-03 sascha - - * zend_modules.h: Add global startup/shutdown functions - -1999-09-03 Zeev Suraski - - * zend_operators.c: - Revert the IS_RESOURCE patch. It had some unintended behavior. - - * zend_variables.c: Let $GLOBALS actually work... - - * zend_operators.c: - Release resources when converting to other types (fix Thies's reported problem) - -1999-09-02 Zeev Suraski - - * zend_compile.c: - Use \0NameFilenameLineno as key instead of numeric index for runtime defined functions - -1999-08-28 Zeev Suraski - - * zend_extensions.c - zend.h - zend_alloc.c - zend_extensions.h - zend_variables.c - zend_variables.h: *** empty log message *** - - * zend.h - zend_alloc.c - zend_alloc.h - zend_variables.c: Beef up debug macros - -1999-08-27 Zeev Suraski - - * zend_execute_API.c: Fix a crash bug in case of aborted execution - - * zend.h - zend_alloc.c - zend_alloc.h - zend_execute_API.c - zend_variables.c - zend_variables.h: Better debug macros - -1999-08-26 Andi Gutmans - - * zend_execute_API.c: - Damn. It wasn't a correct fix. This should do it. - When the zval ** are equal we don't want to assign_ref, in any other case - I can think of we do want to assign_ref. - - * zend_execute_API.c: - Fix leak when global is used in the global scope. - - * zend_compile.c: - Fix when redefining classes at run-time. - -1999-08-25 sascha - - * zend.h: make it compile with gcc again - -1999-08-25 Andi Gutmans - - * zend_hash.c - zend_hash.h: - Add hash_apply_with_arguments() - - * zend-scanner.l: - More elegant fix for Win32 include_path - - * zend-scanner.l: - - Temporary fix to allow Win32 MT safe version to use zend_fopen(). - -1999-08-23 Andi Gutmans - - * zend_execute.c: - Fixed a specific memory leak linked to locking. - -1999-08-22 sascha - - * zend.h - zend_globals.h: This changes makes it work on egcs 1.1.2/Alpha - - * configure.in - zend.h: remove checks - -1999-08-20 Zeev Suraski - - * zend_constants.c - zend_constants.h - zend.c: Fix for Thies's UMR - -1999-08-19 Andi Gutmans - - * zend-parser.y - zend_opcode.c: - - Make sure expr_list and echo_list are either empty or comma seperated - expressions - -1999-08-18 Thies C. Arntzen - - * zend-scanner.l: on unix ZTS gets defined in zend_config.h - -1999-08-17 Zeev Suraski - - * zend_execute_API.c: Fix #2012 - - * zend_execute.c: Fix #2070 - -1999-08-17 Andi Gutmans - - * zend.c - zend.h: - Add some ZENDAPI's - -1999-08-15 Andi Gutmans - - * zend_execute.c: - Oopsie - - * zend.h - zend_compile.h - zend_execute.c - zend_globals.h: - Optimize the execute stack a bit. - -1999-08-14 Zeev Suraski - - * zend_compile.c: Fix several class issues - - * zend_compile.c - zend_compile.h: - Generate better warnings for class/function redefinitions - -1999-08-10 Andi Gutmans - - * zend_compile.c - zend_constants.c: - Got rid of the C++ comments. - -1999-08-09 Andi Gutmans - - * zend_execute.c: - Thies's crash fix. - -1999-08-07 Zeev Suraski - - * zend_compile.h - zend_execute.c - zend_execute_API.c: Fix a few leaks - -1999-08-06 Zeev Suraski - - * zend_execute_API.c: Fix a bug in call_user_func_ex() - - * zend_API.h: Now that's an annoying bug. - - * zend_API.h - zend_execute_API.c: Introduce call_user_func_ex() - - * zend_execute.c: *** empty log message *** - -1999-08-03 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - - Initialize extended value's and put the fetch_type in it's own variable - name. - -1999-08-02 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Make set_compiled_filename() return a pointer to the allocated file name - -1999-07-31 Zeev Suraski - - * zend_API.h: These aren't necessary - -1999-07-30 Zeev Suraski - - * zend_API.h: Support symbols in any symbol table, not just the active one - -1999-07-30 Andi Gutmans - - * zend_ptr_stack.c: - Damn that's more like it. - - * zend_ptr_stack.c: - Cut&paste crap - - * zend_execute.c - zend_ptr_stack.c - zend_ptr_stack.h: - - Add ptr_stack_n_{push,pop} in order to speed up function calls a bit. - There seems to be no reason for stack->top in the ptr_stack except for - when realloc()'in the stack. I think I'll remove it. - -1999-07-30 Zeev Suraski - - * zend_API.h: - * Setting variables in the global scope wasn't handling is_ref's properly - -1999-07-29 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Fixed a leak when doing inheritance. The parent class name wasn't being freed. - - Fixed a stack leak. Functions that had late argument binding were set up as - INIT_FCALL_BY_NAME but were using DO_FCALL and not the corresponding - DO_FCALL_BY_NAME. - -1999-07-28 Andi Gutmans - - * zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c: - Fixed various inheritance problems & Andrey's leak - -1999-07-27 Zeev Suraski - - * zend_compile.c: Inherit parent's constructor - - * zend_compile.c: - Fix runtime inheritence (child functions/members should have higher precedence) - -1999-07-27 Andi Gutmans - - * zend_execute.c: - Add missing lock - - * zend_execute.c: - Fix up the new operator a bit more. - -1999-07-27 Zeev Suraski - - * zend_execute.c: Set reference count and is_ref values for new objects - -1999-07-26 Zeev Suraski - - * zend_operators.c: - - Fixed a memory leak when using assignment-op operators with lvalue of type - string (or array/object) - - * zend_compile.c: *** empty log message *** - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a bug in inheritence from classes defined in include files, that are - inherited from require()'d files - -1999-07-26 Andi Gutmans - - * zend_execute.c: - Oops I erased this by mistake - - * zend_execute.c: - - Should be a complete fix now. This break away code should maybe be made - somewhat generic - - * zend_execute.c: - Temporary fix for "this". Have to fix it tomorrow. - - * zend_execute.c: - - Fix compile error. Weird that Visual didn't catch this one. - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c: - Fix the new operator incompatibility. - - I commented PHP_FUNCTION(strtotime) in datetime.c because it stopped - win32 from compiling. This needs to be fixed!!! - - Check out libzend to compile the tree now. - - * zend.h - zend_execute.c: - new operator fixes - -1999-07-25 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Commiting to branch newoperator. - - To check it out do cvs checkout -rnewoperator libzend - -1999-07-24 Zeev Suraski - - * zend_compile.c: Fix that memory leak... nested function issue remains - - * zend_compile.c - zend_stack.c - zend_stack.h: Fix RETURN & SWITCH memory leak issue - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Thoroughly fix the SWITCH problem. No RETURN handling yet. - -1999-07-23 Zeev Suraski - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: Fix bug #1812 - - * zend.h - zend_operators.c: - * Add an API macro users can use to ensure an array member can be modifed - before they modify it. - * Fix a bug and remove redundant code in convert_to_long() (booleans and - resources weren't changing their types - -1999-07-22 Zeev Suraski - - * zend_constants.c: New constants - -1999-07-22 stig - - * buildconf: identify ourselves - -1999-07-20 Andi Gutmans - - * zend_execute.c: - Include alloca.h when need and available. - - * zend_compile.c - zend_execute_API.c - zend_list.c - zend_operators.c: - Get rid of C++ comments - -1999-07-19 Zeev Suraski - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: 0.91 update - -1999-07-19 Andi Gutmans - - * zend.h - zend_execute.c - zend_extensions.h: * Fix Zend version - * Fix a method call bug - - * LICENSE - libzendts.dsp: License update - - * zend_errors.h: Make error codes PHP 3.0 compatible - -1999-07-18 Andi Gutmans - - * zend_execute_API.c: - - Should fix the memory leak when returning from the main scope. - -1999-07-17 Zeev Suraski - - * configure.in: Debug on by default - -1999-07-16 Zeev Suraski - - * zend_compile.c: - Ignore T_PHP_TRACK_VARS in the parser (handled in the scanner) - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: License update - -1999-07-15 Andi Gutmans - - * zend.c: Change true/false back to 1/"" - - * zend_execute.c: Fix a lock issue - -1999-07-15 sascha - - * zend_execute_API.c: disable zend_handle_sigsegv - -1999-07-14 Andi Gutmans - - * libzendts.dsp - zend.c: Fix thread unsafe constants startup - - * LICENSE - zend.c - zend_constants.c - zend_constants.h: - License update - - Fix multithreaded constants startup - - * zend_operators.c: - Fix for boolean convert to number - -1999-07-12 Andi Gutmans - - * zend_execute.c: - Fixed a purify warning - -1999-07-10 Zeev Suraski - - * zend_alloc.c: Oh, that dumb bug. - -1999-07-10 Andi Gutmans - - * zend_execute.c - zend_hash.c: Ok, so we do have to lock in there - - * zend.c - zend_execute.c: Fix assignments of reference variables - -1999-07-10 Zeev Suraski - - * zend_execute_API.c: Woops, fix. - - * zend_execute.c - zend_execute_API.c - zend_globals.h: Put the garbage in the garbage bin - - * zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_variables.c: Get rid of AiCount completely - - * zend_execute.c: Final tweaks - - * zend_execute.c - zend_hash.c: More locking work - -1999-07-09 Zeev Suraski - - * zend_execute.c: *** empty log message *** - - * zend_execute.c: More stuff - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c - zend_variables.c: Step 4: - Move to a 7-bit counter (not fully implemented yet) - - * zend_API.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: Phase 3: - Use a single bit to mark IS_REF variables - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c: Step 2: - Rename is_ref to EA - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: Step 1 in nuking the garbage collector: - - Change the hash destructor to return int - - Don't kill the bucket on hash_destroy if the destructor returns 0 - - * config.w32.h - configure.in - zend_alloc.c: *** empty log message *** - - * zend_alloc.c: Send a SIGSEGV instead of exiting, to trigger a core dump - - * zend_alloc.c - zend_alloc.h - zend_hash.c: * Support recoverable failure from erealloc() - * Fix the shutdown code on an unrecoverable erealloc() failure - - * zend_execute_API.c: Fix the mess in SIGSEGV handling, hopefully - -1999-07-08 Zeev Suraski - - * zend_compile.h - zend_compile.c: - Support definition of classes that are derived from classes that are defined in runtime - -1999-07-06 sascha - - * zend.h: enable it, until we find a better way - -1999-07-05 sascha - - * zend.h: make Solaris gcc happy - - * configure.in - zend.h: use void * instead of long for 64-bit test - -1999-07-05 Thies C. Arntzen - - * zend_API.h: added RETVAL_RESOURCE and RETURN_RESOURCE - -1999-07-04 Zeev Suraski - - * zend_operators.c: - Make convert_to_string() regard false as "" instead of "0" - -1999-07-03 sascha - - * Makefile.am: don't wipe files for distributions - - * configure.in - zend.h: - checking for ints won't work, since they are 32 bit on both platforms - -1999-07-03 Zeev Suraski - - * zend_execute.c: Support isset()/empty() for string offsets - - * zend-scanner.l: Fix a crash - -1999-07-03 sascha - - * configure.in: add usual rhapsody hack - - * config.unix.h: missing DL_HANDLE broke build - - * zend_extensions.c: typo - -1999-07-02 sascha - - * acconfig.h - configure.in - zend.h: workaround for 64-bit platforms - -1999-07-02 Zeev Suraski - - * acconfig.h - configure.in - zend_globals.h: define zend_bool - -1999-06-30 Zeev Suraski - - * zend-parser.y: Make require accept any parameter - -1999-06-26 Zeev Suraski - - * zend_alloc.h - zend_operators.c - zend_alloc.c: - * Make the memory leak reporting code much better with repeats - * Remove useless variables - -1999-06-22 Zeev Suraski - - * zend_compile.c: Fix Thies's bug report - - * zend_alloc.c - zend_compile.c - zend_operators.c: - * Fix concatenation of arrays (it was PHP 3.0 style, copying zval's instead - of zval *, and it wasn't using reference counting) - * Fix a memory leak in static array()'s with textual indices - -1999-06-19 Zeev Suraski - - * zend.c: *** empty log message *** - - * zend.h - zend_extensions.h: - Add a standard get_ini_entry() to interface between Zend and the outside world - - * configure.in: *** empty log message *** - -1999-06-16 stig - - * zend_modules.h: - added INIT_FUNC_ARGS_PASSTHRU and SHUTDOWN_FUNC_ARGS_PASSTHRU - -1999-06-15 stig - - * zend_operators.c - zend_operators.h: * added zend_binary_strcasecmp() - -1999-06-12 Zeev Suraski - - * zend-parser.y: - We can't quite go with expr there (shift/reduce conflict), go with scalar. - - * zend-parser.y: require() improvement as per Andi's suggestion - -1999-06-11 Zeev Suraski - - * zend_operators.c: - Make the concatenation operator use make_printable as well - - * zend-scanner.l: Don't take failing on an include file so badly - - * zend-scanner.l: Support E_COMPILE_ERROR in the compiler - - * zend_compile.c: Two fixes: - * The error generated by a failed class inheritence wasn't properly - displaying the file in which he error occured. - * Inheritence didn't work if the parent class had uppercase letters in it. - - * zend-parser.y - zend-scanner.l - zend_execute.c: * Use to_string() instead of __print() - * Support boolean casts ((bool) and (boolean)) - - * zend.c: Change __print into to_string() - - * zend.c - zend.h - zend_execute.c - zend_execute_API.c: - * Make the output handling of variables much, much cooler. - Uses zend_make_printable_zval() instead of convert_to_string() now: - - $foo = true; - print "\$foo is $foo"; - will now print - $foo is true - (instead of "$foo is 1", earlier). - - Also, with objects, it automatically tries to call __print() and use it as a printing - function. - - For example: - - class foo { - function __print() { return "Foo Object"; } - }; - - $foo = new foo; - print $foo; - - will print "Foo Object". - -1999-06-10 Zeev Suraski - - * zend_operators.c: Now THAT's an annoying bug. - -1999-06-09 Zeev Suraski - - * zend_extensions.c: Fix - - * zend_API.c - zend_execute.c: - * Fix cases where you assign an array element to the parent array (the array was - being erased before the assignment, so the element was being smashed). - - * zend_execute.c - zend_execute_API.c: * Fix foreach() that receives a non array argument - * Clean up some C++ comments - -1999-06-09 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_operators.c: - Fix the static array() initializing - -1999-06-08 Zeev Suraski - - * zend_extensions.c: Replace error messages - -1999-06-08 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: * Fix a by-name call/method call bug - * Clean and optimize the whole function call process - -1999-06-07 Zeev Suraski - - * zend_hash.c - zend_hash.h: Add zend_hash_get_current_key_type() - -1999-06-06 Andi Gutmans - - * zend_compile.c: - Work around a compiler bug - mark variables that are sent to functions that aren't yet - defined as FETCH_W (because they might end up being sent by reference) - -1999-06-05 Zeev Suraski - - * zend.c - zend.h - zend_compile.c - zend_compile.h: * Centralized shutdown - * Change shutdown order again - - * zend_compile.c: - Call the request_shutdown on modules before destroying symbol tables, so that - the session module can be implemented - - * zend-scanner.l - zend_compile.c - zend_execute.c: - - Fixed Karl's bug report. It's not really a thorough fix, we really need to rethink the INIT_FCALL/DO_FCALL issue. - - Fixed numerous AiCount problems - -1999-06-04 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: New $GLOBALS init - - * zend_execute_API.c: - Fix that GLOBALS leak. We were explicitly adding GLOBALS to the main symbol table, - but there's no reason to do it (INIT_GLOBALS takes care of it if necessary.) - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_list.c - zend_list.h - zend_opcode.c - zend_operators.c: Minor updates (mostly __declspec() stuff) - -1999-06-04 Thies C. Arntzen - - * zend_API.h: added is_ref=0 and refcount=1 to SET_VAR_* macros - -1999-06-03 Zeev Suraski - - * zend-parser.y: T_BAD_CHARACTER is actually a string. - -1999-06-03 Andi Gutmans - - * zend-scanner.l - zend_execute.c: - - We weren't counting newlines in heredocs. The only place which is still questionable - is when there's a \ followed by a newline but it seems we have a parse error in this - case anyways. - - Fixed the alloca() macros so that the alloca() #define in win32 mode won't clash - with the real win32 alloca(). - -1999-06-01 Andi Gutmans - - * zend_execute.c: - - Make execute() use less stack in thread-safe win32 due to Microsoft's shitty 256kb stack. - -1999-05-31 Zeev Suraski - - * zend.h - zend_alloc.c: *** empty log message *** - -1999-05-31 Andi Gutmans - - * zend-scanner.l - zend_compile.c - zend_execute.c - zend_execute_API.c: Fixes - -1999-05-30 sascha - - * zend_alloc.c - zend_compile.h - zend_execute_API.c - zend_indent.c - zend_opcode.c: * fix some casts - * introduce unary_op_type - cleaner than casting data voids to function ptrs - -1999-05-29 Zeev Suraski - - * zend_execute_API.c: - That got fucked up when we went back to using uninitialized_zval - -1999-05-29 sascha - - * Makefile.am: another VPATH related change - -1999-05-29 Zeev Suraski - - * zend-parser.y: Fix a bug - - * zend_hash.c - zend_hash.h - zend_operators.c: Support overwrite mode in zend_hash_merge() - -1999-05-29 sascha - - * Makefile.am: - clean is not called from automake. use CLEANFILES instead - - allow VPATH compilation - -1999-05-29 Zeev Suraski - - * zend_execute.c: Correct fix - - * zend_execute_API.c: *** empty log message *** - - * zend_execute.c: Fix a leak - -1999-05-28 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: * Support getThis() for internal functions. - * Fix 'new object or die' and AiCount issue thoroughly (earlier fix didn't - work with the optimizer). - * Add new macros for standardized definition of classes. - * Only report AiCount problems if shutdown was not silent. - -1999-05-27 Zeev Suraski - - * zend_execute.c: Fix the AiCount issue with objects - - * zend_API.h: Moved all #define's for SET_ and RETURN_ to zend_API.h - -1999-05-25 Zeev Suraski - - * zend_execute_API.c: - Avoid crashing if an error occurs before we open the first file. - -1999-05-24 Zeev Suraski - - * zend_operators.c: The last fix was wrong - - * zend_operators.c: Another operators fix - -1999-05-23 Zeev Suraski - - * zend_operators.c: - boolean comparison didn't work with smaller-than and greater-than, something that - fucked up berber's site a bit. fixed. - -1999-05-22 Zeev Suraski - - * zend_execute.c: - Sigh, another leak bites the dust. FREE_OP missing in case of a SEND_VAR. - - * zend-parser.y: I'm on a roll. Fix a nasty yet stupid AiCount bug - - * zend_alloc.c: Warn about AiCount not zeroing out - - * zend-parser.y - zend-scanner.h - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_highlight.h - zend_list.h - zend_llist.h - zend_ptr_stack.h - zend_stack.h: - * Add struct name to all typedef's so that they can be debugged with MSVC - * Fix an AiCount bug - list(...) = $var was using $var multiple times, and thus - causing AiCount to be decreased multiple times even though it was increased only - once for $var. Mark all FETCH_DIM's so that they won't decrease AiCount, and only - decrease AiCount on the last FETCH_DIM. - * Fix a stupid bug - forgot to pass CLS_C to some compiler function. For some reason - MSVC doesn't report these :I - - * zend.h - zend_alloc.c - zend_execute_API.c: - Give more information and save log lines in memory leak reports - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_globals.h - zend_llist.c - zend_llist.h: Avoid leaking fd's in case of failures - - * zend-scanner.l: more fixes - -1999-05-21 Zeev Suraski - - * zend-scanner.l: That wasn't supposed to slip in - - * zend-scanner.l: * Properly handle failed file opens in C++ - * Properly handle failed require()'s within libzend - - * zend-scanner.l: * Fix the comments issue. yymore() worked like a charm. - * Change all flex states to be prefixed with ST_ - -1999-05-20 Zeev Suraski - - * zend_compile.h - zend_execute.c: Optimize allocations into uninitialized_zval assignments - -1999-05-20 Andi Gutmans - - * config.w32.h - libzend.dsp - libzendts.dsp - zend_compile.c - zend_compile.h: - Updates we did today - - * zend_compile.c: - Fix a small problem with class decelerations. - - * zend-scanner.l: -Open curly braces fix? - -1999-05-15 Zeev Suraski - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_hash.c - zend-parser.y: - * Fix all hash checks that checked Bucket.arKey for NULL, when it was changed - to char[1], these checks should have been changed to Bucket.nKeyLength==0 - * Support runtime declaration of functions. I ended up changing the grammar - to catch top level functions vs. nested functions. The reason is simple - - if we don't have functions properly declared at compile-time, function calls - cannot be resolved at compile time, and have to be resolved at runtime, which - ends up being much much slower (without the optimizer, that is). - It's no biggy though, the grammar change isn't that bad. - -1999-05-14 Zeev Suraski - - * configure.in - zend-scanner.l: - If a require() dies, we must bail out (since it corrupts an existing op_array - - * zend-scanner.l: Fix a bug - -1999-05-14 stig - - * Makefile.am: don't install Zend on the system - -1999-05-14 Zeev Suraski - - * zend-scanner.l: - Add \012 and \xff missing support to constant quoted string - -1999-05-12 Zeev Suraski - - * zend.h: *** empty log message *** - -1999-05-12 stig - - * Makefile.am: install libzend.a and header files on "make install" - - * acconfig.h - configure.in: add --enable-thread-safety option - -1999-05-12 Zeev Suraski - - * zend_llist.c - zend_llist.h: Added prepend to llist - -1999-05-11 Zeev Suraski - - * zend-scanner.l - zend.c: Fixes: - * Avoid closing stdin (I could have sworn I've committed that already) - * unclean_shutdown patches - - * zend_alloc.c: Easier Win32 debug code - - * zend-scanner.l - zend_compile.c - zend_globals.h - zend_highlight.c: - * Fix a bug that occured in case of parse errors. We need to restore the lexical state - even if the compilation failed. - -1999-05-10 Zeev Suraski - - * zend-scanner.h - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h: - Weed out all BoundsChecker-found bugs (including a serious file descriptor leak - in the C++ scanner) - -1999-05-09 Zeev Suraski - - * zend_modules.h: Change argument name - - * zend.c - zend_API.c - zend_API.h - zend_modules.h: Almost forgot to commit those - -1999-05-06 Zeev Suraski - - * zend-scanner.l: Ok, I tested it now. It works very nicely! - -1999-05-05 Andi Gutmans - - * zend_llist.c - zend_llist.h: llist improvements - -1999-05-02 Andi Gutmans - - * zend.c - zend_compile.h: - Don't support interactive mode when thread safe. - -1999-05-01 Zeev Suraski - - * zend_operators.c: Several operator fixes. Should fix the MySQL problem. - -1999-04-30 Andi Gutmans - - * zend_opcode.c: - Free refcount when destroying the last class reference. - - * zend-parser.y: - Missed one place - - * zend-parser.y: - First try at fixing $a->foo[] syntax. - - * zend-scanner.l: - - Move back to yyless(). I haven't tested it yet because it's taking too long - to compile and I have to disconnect - -1999-04-30 Zeev Suraski - - * zend-parser.y - zend-scanner.l: - Fix Boris's problem (in my never ending struggle to show I never mean what I say - when I say something's not gonna happen :) - - * zend-scanner.l - zend_compile.c: - * Fix a problem with constant quoted strings, that was causing Thies's problem - * Remove a development-time printf - -1999-04-29 Andi Gutmans - - * zend-scanner.l: - No reason to handle newlines here. - -1999-04-28 Zeev Suraski - - * zend-scanner.l: Make the C++ scanner support interactive input - -1999-04-27 Zeev Suraski - - * zend-scanner.l - zend_compile.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_opcode.c: * Fix debugger+interactive mode bug - * Recognize whether an extension is with debug information or not - -1999-04-26 Zeev Suraski - - * libzendts.dsp: fix - - * config.w32.h - libzend.dsp - libzendts.dsp - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_opcode.c - zend_sprintf.c: Various thread safety fixes and DLL updates - -1999-04-26 Andi Gutmans - - * zend-scanner.l - zend.c - zend_alloc.c - zend_globals.h: -More commits - -1999-04-24 Zeev Suraski - - * zend_compile.c: Another small fix - - * libzendts.dsp: dsp update - - * zend.c - zend_globals.h: Thread safety fixes - - * zend_list.c: Remove redundant includes - -1999-04-24 zeevread - - * zend-scanner.l: g++ compile fix - -1999-04-24 Zeev Suraski - - * Makefile.am - zend-scanner.l: *** empty log message *** - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c - zend-parser.y - zend-scanner.l: Cleanups, remove old ts code - -1999-04-23 Zeev Suraski - - * zend_operators.c: Arithmetics bug fix - - * zend-scanner.h - zend-scanner.l: Support eval() and highlight_string() in the C++ scanner - -1999-04-23 Andi Gutmans - - * zend-scanner.l: - - Use yyless() instead of unput() where possible. I'll erase the commented - out code in a day or so. - -1999-04-23 Zeev Suraski - - * FlexLexer.h - flex.skl - zend-scanner.h - zend-scanner.l - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_operators.h - zend_variables.h: Ok, call me crazy, because I probably am. - Thread safe version now uses a C++ scanner object. Works fully. - -1999-04-22 Zeev Suraski - - * acconfig.h - zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_highlight.c - zend_indent.c - zend_opcode.c: Make token names uniform, they all begin with T_ now. - -1999-04-21 stig - - * buildconf: state which aclocal.m4 and configure files are created - - * Makefile.am: - zend-parser.o and zend-scanner.o were included twice in libzend.a - -1999-04-21 Zeev Suraski - - * FlexLexer.h - flex.skl - libzendts.dsp - zend_API.c - zend_API.h - zend_globals.h: - * Change the thread safe project to create a C++ scanner. - * Add in a slightly modified skeleton file (only a couple of #if's for #include's - that we dont have in Windows) - - It does NOT compile or work yet :) - - * zend_list.h: Fix - - * zend.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_list.c - zend_list.h: - Thread safety patch. It works now with 'just in time' resource initialization! - - * libzend.dsp - libzendts.dsp - zend_globals.h: Thread-safe project - -1999-04-21 stig - - * buildconf: move automake back to before autoconf - - * buildconf: - autoheader must be called after autoconf, automake after autoheader - - * zend_config.h.in: think before one commits - - * zend_config.h.in: doh. cvs appears to ignore .in files by default - -1999-04-21 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.c - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Thread safety patch. We're still not quite there but it compiles again, and - more logic has been implemented. - -1999-04-20 stig - - * .cvsignore - Makefile.am - Makefile.in - aclocal.m4 - buildconf: Makefile.in and aclocal.m4 are generated - added buildconf script - -1999-04-19 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: - Return a success value from the startup function, so we can unload immediately - if it fails. - -1999-04-19 stig - - * .cvsignore - Makefile.am - Makefile.in - acconfig.h - acinclude.m4 - aclocal.m4 - config.h.in - configure.in - zend.h: convert to automake - -1999-04-19 Andi Gutmans - - * zend_API.c - zend_API.h: Add a couple of ZEND_API's - - * config.w32.h - zend-parser.y - zend_compile.c - zend_execute.c: Support =unset as arguments - -1999-04-19 stig - - * acconfig.h - config.h.in - configure.in: removed -lnsl and -lsocket checks from zend - -1999-04-18 Zeev Suraski - - * zend_execute.c: AiCount needs to be decreased here - - * configure.in - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_llist.c - zend_modules.h - zend_opcode.c: Whatnot: - * updated alloc_persist to use critical sections - * changed extension shutdown to two-phase - * updated dependencies - * PR support (don't remember if there was any really) - -1999-04-15 Andi Gutmans - - * zend_execute.c: - - one more place which seems to have needed fixing. I don't have time to look - more into it. I hope we don't have anymore places which need fixing. - - * zend_compile.c: - - Should fix the pass by reference problem. This happened because we moved - start from arg 1 now and not arg 0. There might be more places which need fixing - like in the executor but the bug seems OK now. - -1999-04-14 Zeev Suraski - - * zend_compile.h: Compile fix - -1999-04-14 Andi Gutmans - - * config.w32.h - libzend.dsp - zend-scanner.l - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_opcode.c: -Tiny patches - -1999-04-13 Zeev Suraski - - * zend_execute.c: Better detection - - * zend_execute.c: - Move Ai stuff before get_zval_*(), like Andi suggested. Fixes Sascha's huge - memory leak - -1999-04-13 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c: - Fix various memory leaks. - - * zend_execute.c: Refcount bugfix - - * libzend.dsp - zend_API.c - zend_execute_API.c - zend_ptr_stack.c: * Optimize argument_stack top lookup - * Fix a nasty bug in zend_ptr_stack_clean() - -1999-04-12 Zeev Suraski - - * zend_execute_API.c - zend_globals.h: Remove unnecessary stack - - * zend_API.c: off by one - - * zend_execute.c: Minor optimization - - * zend_API.c: Make functions that don't take arguments somewhat happier:) - - * zend_execute.c: - This should take care of "this" for user-defined functions. It wasn't yet working - for built-in functions anyway, this one is coming soon. - - * zend_compile.c - zend_execute_API.c: - Destroy the resource list after destroying the symbol table, otherwise the - auto-destructor for resources are run when the resource list is no longer valid - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c: - This patch is a go. Not fully optimized yet, but working properly. - Prepatch tagged as BEFORE_STACK_PATCH. - - * zend_compile.c - zend_execute.c: Minor fixes: - missing zval_copy_ctor() - messed up AiCount fix - -1999-04-10 Zeev Suraski - - * zend_alloc.c - zend_alloc.h: Allow runtime setting of the memory limit - - * zend_alloc.c - zend_alloc.h - zend_globals.h: Get rid of php3_ini in Zend - - * zend.c - zend.h: - We need to initialize the utility values after we initialize the INI file, which in - turn, is after we initialize Zend. Set the utility values separately from Zend's - initialization - -1999-04-09 Andi Gutmans - - * zend-scanner.l: - Changed here-docs to <<< followed by whitespace. - -1999-04-09 stig - - * .cvsignore: ignore file - -1999-04-09 Andi Gutmans - - * zend-parser.y - zend_compile.h: - - I guess print $GLOBALS and print "$GLOBALS" should yield the same result - so I returned the one in encaps_var. - - Made INITAL_OP_ARRAY_SIZE smaller (64? can't remeber). I don't think the - erealloc()'s during compile time are such a biggy, we might make it even - smaller. We can have a configure time option as to it's size. - - * zend-parser.y: - - Support $GLOBALS in cvar's. Now list(..) = each($GLOBALS) will work. - - Remove support of $GLOBALS in enacapsed strings. print "$GLOBALS" isn't - supposed to work in any case. - -1999-04-09 Zeev Suraski - - * zend-scanner.l: - Honor a semicolon on the same line as an ending token of a heredoc - - * zend_compile.c: Prevent class redeclarations - -1999-04-08 Zeev Suraski - - * zend_API.c - zend_modules.h: * Add arguments to shutdown functions - * Remove traces of php_ini stuff - - * zend-parser.y: "Our favourite mistake" - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: $GLOBALS support - -1999-04-08 Andi Gutmans - - * ZEND_CHANGES: foreach() syntax has changed - -1999-04-08 Zeev Suraski - - * zend_compile.c - zend_execute.c: Fix static assignment - -1999-04-07 Zeev Suraski - - * zend_execute_API.c: Remove an unused variable - - * libzend.dsp: That's better. - - * libzend.dsp: We didn't save the .dsp back then... - - * ZendCore.dsp - ZendCore.dsw - ZendCore.mak - diffs - libzend.dsp: Cleanups: ZendCore->libzend - -1999-04-07 Rasmus Lerdorf - - * zend.c: *** empty log message *** - -1999-04-07 Andi Gutmans - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: New file. - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: Zend Library - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: New file. - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: Zend Library - diff -Nru php5-5.4.4/Zend/acinclude.m4 php5-5.4.9/Zend/acinclude.m4 --- php5-5.4.4/Zend/acinclude.m4 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/acinclude.m4 2012-11-21 05:12:20.000000000 +0000 @@ -4,7 +4,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[ # we only support certain bison versions - bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5" + bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2" # for standalone build of Zend Engine test -z "$SED" && SED=sed diff -Nru php5-5.4.4/Zend/tests/bug39018.phpt php5-5.4.9/Zend/tests/bug39018.phpt --- php5-5.4.4/Zend/tests/bug39018.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug39018.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -62,17 +62,17 @@ ?> --EXPECTF-- -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d Notice: Uninitialized string offset: 0 in %s on line %d Notice: Uninitialized string offset: 0 in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d Notice: Uninitialized string offset: %i in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d Notice: Uninitialized string offset: %i in %s on line %d @@ -88,16 +88,16 @@ Notice: Uninitialized string offset: 4 in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d Notice: Uninitialized string offset: 12 in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d Notice: Uninitialized string offset: 12 in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d b Done diff -Nru php5-5.4.4/Zend/tests/bug51394.phpt php5-5.4.9/Zend/tests/bug51394.phpt --- php5-5.4.4/Zend/tests/bug51394.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug51394.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -13,4 +13,10 @@ set_error_handler("eh"); $a = $empty($b); --EXPECTF-- +Warning: Uncaught exception 'Exception' with message 'error!' in %sbug51394.php:4 +Stack trace: +#0 %sbug51394.php(9): eh(8, 'Undefined varia...', '%s', 9, Array) +#1 {main} + thrown in %sbug51394.php on line 4 + Fatal error: Function name must be a string in %sbug51394.php on line 9 \ No newline at end of file diff -Nru php5-5.4.4/Zend/tests/bug55509.phpt php5-5.4.9/Zend/tests/bug55509.phpt --- php5-5.4.4/Zend/tests/bug55509.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug55509.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -5,6 +5,12 @@ if (PHP_INT_SIZE == 4) { die('skip Not for 32-bits OS'); } + +$zend_mm_enabled = getenv("USE_ZEND_ALLOC"); +if ($zend_mm_enabled === "0") { + die("skip Zend MM disabled"); +} + if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); // check the available memory if (PHP_OS == 'Linux') { diff -Nru php5-5.4.4/Zend/tests/bug60909_1.phpt php5-5.4.9/Zend/tests/bug60909_1.phpt --- php5-5.4.4/Zend/tests/bug60909_1.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug60909_1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,24 @@ +--TEST-- +Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function). +--FILE-- + +==DONE== --EXPECTF-- -Strict Standards: Declaration of B::test() should be compatible with A::test($a) in %sbug61761.php on line %d +==DONE== diff -Nru php5-5.4.4/Zend/tests/bug61767.phpt php5-5.4.9/Zend/tests/bug61767.phpt --- php5-5.4.4/Zend/tests/bug61767.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug61767.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,34 @@ +--TEST-- +Bug #61767 (Shutdown functions not called in certain error situation) +--FILE-- +foo(); +--EXPECTF-- +Error handler called (Undefined variable: undefined) + +Warning: Uncaught exception 'ErrorException' with message 'Undefined variable: undefined' in %sbug61767.php:13 +Stack trace: +#0 %sbug61767.php(13): {closure}(8, 'Undefined varia...', '%s', 13, Array) +#1 {main} + thrown in %sbug61767.php on line 13 + +Fatal error: Call to a member function foo() on a non-object in %sbug61767.php on line 13 +Shutting down +Array +( + [type] => 1 + [message] => Call to a member function foo() on a non-object + [file] => %sbug61767.php + [line] => 13 +) diff -Nru php5-5.4.4/Zend/tests/bug62358.phpt php5-5.4.9/Zend/tests/bug62358.phpt --- php5-5.4.4/Zend/tests/bug62358.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug62358.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,32 @@ +--TEST-- +Bug #62358 (Segfault when using traits a lot) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Strict Standards: Declaration of B::foo() should be compatible with A::foo() in %sbug62358.php on line %d diff -Nru php5-5.4.4/Zend/tests/bug62653.phpt php5-5.4.9/Zend/tests/bug62653.phpt --- php5-5.4.4/Zend/tests/bug62653.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug62653.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,33 @@ +--TEST-- +Bug #62653: unset($array[$float]) causes a crash +--FILE-- +"bar"); +$foo = "10.0000"; // gettype($foo) = "string" +$foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double" +unset($array[$foo]); +print_r($array); + +$array = array("5"=>"bar"); +$foo = "5"; +unset($array[(float)$foo]); +print_r($array); + +$array = array("5"=>"bar"); +$foo = "10.0000"; +$foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double" +$name = "foo"; +unset($array[$$name]); +print_r($array); + +?> +--EXPECT-- +Array +( +) +Array +( +) +Array +( +) diff -Nru php5-5.4.4/Zend/tests/bug62680.phpt php5-5.4.9/Zend/tests/bug62680.phpt --- php5-5.4.4/Zend/tests/bug62680.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug62680.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,11 @@ +--TEST-- +Bug #62680 (Function isset() throws fatal error on set array if non-existent key depth >= 3) +--FILE-- + +--EXPECT-- +bool(false) +bool(false) diff -Nru php5-5.4.4/Zend/tests/bug62763.phpt php5-5.4.9/Zend/tests/bug62763.phpt --- php5-5.4.4/Zend/tests/bug62763.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug62763.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,23 @@ +--TEST-- +Bug #62763 (register_shutdown_function and extending class) +--FILE-- + +--EXPECT-- +test1::shutdowntest2::__destruct diff -Nru php5-5.4.4/Zend/tests/bug62892.phpt php5-5.4.9/Zend/tests/bug62892.phpt --- php5-5.4.4/Zend/tests/bug62892.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug62892.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,21 @@ +--TEST-- +Bug #62892 (ReflectionClass::getTraitAliases crashes on importing trait methods as private) +--FILE-- +getTraitAliases()); + +?> +--EXPECTF-- +array(0) { +} diff -Nru php5-5.4.4/Zend/tests/bug62907.phpt php5-5.4.9/Zend/tests/bug62907.phpt --- php5-5.4.4/Zend/tests/bug62907.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug62907.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,22 @@ +--TEST-- +Bug #62907 (Double free when use traits) +--FILE-- + +==DONE== +--EXPECT-- +==DONE== diff -Nru php5-5.4.4/Zend/tests/bug63055.phpt php5-5.4.9/Zend/tests/bug63055.phpt --- php5-5.4.4/Zend/tests/bug63055.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug63055.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,23 @@ +--TEST-- +Bug #63055 (Segfault in zend_gc with SF2 testsuite) +--FILE-- + "bar"); /* this bucket will trigger the segfault */ +$dummy = array("dummy"); /* used to trigger gc_collect_cycles */ +$dummy[1] = &$dummy; + +$matches[1] = &$matches; +$matches[2] = $dummy; + +str_replace("foo", "bar", "foobar", $matches); +echo "okey"; +?> +--EXPECTF-- +okey diff -Nru php5-5.4.4/Zend/tests/bug63111.phpt php5-5.4.9/Zend/tests/bug63111.phpt --- php5-5.4.4/Zend/tests/bug63111.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug63111.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,36 @@ +--TEST-- +Bug #63111 (is_callable() lies for abstract static method) +--FILE-- + +--EXPECTF-- +Strict Standards: Static function Foo::bar() should not be abstract in %sbug63111.php on line 3 +bool(false) +bool(false) +bool(false) +bool(false) +bool(true) +bool(true) +ok + +Fatal error: Cannot call abstract method Foo::bar() in %sbug63111.php on line 20 + diff -Nru php5-5.4.4/Zend/tests/bug63173.phpt php5-5.4.9/Zend/tests/bug63173.phpt --- php5-5.4.4/Zend/tests/bug63173.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug63173.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,12 @@ +--TEST-- +Bug #63173: Crash when invoking invalid array callback +--FILE-- + 0, 2 => 0]; +$callback(); + +?> +--EXPECTF-- +Fatal error: Array callback has to contain indices 0 and 1 in %s on line %d diff -Nru php5-5.4.4/Zend/tests/bug63219.phpt php5-5.4.9/Zend/tests/bug63219.phpt --- php5-5.4.4/Zend/tests/bug63219.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug63219.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,18 @@ +--TEST-- +Bug #63219 (Segfault when aliasing trait method when autoloader throws excpetion) +--FILE-- + +--EXPECTF-- +Fatal error: Could not find trait Typo in %sbug63219.php on line %d diff -Nru php5-5.4.4/Zend/tests/bug63305.phpt php5-5.4.9/Zend/tests/bug63305.phpt --- php5-5.4.4/Zend/tests/bug63305.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug63305.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,43 @@ +--TEST-- +Bug #63305 (zend_mm_heap corrupted with traits) +--FILE-- + +--EXPECT-- +okey diff -Nru php5-5.4.4/Zend/tests/bug63336.phpt php5-5.4.9/Zend/tests/bug63336.phpt --- php5-5.4.4/Zend/tests/bug63336.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/bug63336.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,24 @@ +--TEST-- +Bug #63336 (invalid E_NOTICE error occur) +--XFAIL-- +Bug is not fixed yet +--FILE-- + +--EXPECT-- +Strict Standards: Declaration of Child::foo() should be compatible with Base::foo($var = '123', $more = NULL) in %sbug63336.php on line %d + +Strict Standards: Declaration of Child::bar() should be compatible with Base::bar($var, $more = 'XXX') in %sbug63336.php on line %d diff -Nru php5-5.4.4/Zend/tests/offset_string.phpt php5-5.4.9/Zend/tests/offset_string.phpt --- php5-5.4.4/Zend/tests/offset_string.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/tests/offset_string.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -30,10 +30,10 @@ --EXPECTF-- string(1) "i" -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d string(1) "S" -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d string(1) "S" Warning: Illegal string offset 'run away' in %s on line %d @@ -46,10 +46,10 @@ Notice: A non well formed numeric value encountered in %s on line %d string(1) "r" -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d string(1) "i" -Notice: String offset cast occured in %s on line %d +Notice: String offset cast occurred in %s on line %d string(1) "S" Warning: Illegal offset type in %s on line %d diff -Nru php5-5.4.4/Zend/tests/traits/bug61998.phpt php5-5.4.9/Zend/tests/traits/bug61998.phpt --- php5-5.4.4/Zend/tests/traits/bug61998.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/Zend/tests/traits/bug61998.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,68 @@ +--TEST-- +Bug #61998 (Using traits with method aliases appears to result in crash during execution) +--FILE-- +newFunc(); //from T1 +$f->func(); //from Foo + +$b = new Bar(); +$b->newFunc(); //from T1 +$b->func(); //from Bar +$b->func2(); //from Bar +$b->newFunc2(); //from T2 +$b->newFunc3(); //from T2 +$b->func3(); //from Bar +--EXPECTF-- +From T1 +From Foo +From T1 +From Bar +From Bar +From T2 +From T2 +From Bar diff -Nru php5-5.4.4/Zend/zend.c php5-5.4.9/Zend/zend.c --- php5-5.4.4/Zend/zend.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend.c 2012-11-21 05:12:20.000000000 +0000 @@ -258,6 +258,9 @@ { TSRMLS_FETCH(); + if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) { + break; + } if (Z_OBJ_HANDLER_P(expr, cast_object)) { zval *val; @@ -270,12 +273,6 @@ } zval_ptr_dtor(&val); } - /* Standard PHP objects */ - if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HANDLER_P(expr, cast_object)) { - if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - break; - } - } if (!Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, get)) { zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC); @@ -1031,6 +1028,29 @@ zend_stack context_stack; TSRMLS_FETCH(); + /* Report about uncaught exception in case of fatal errors */ + if (EG(exception)) { + switch (type) { + case E_CORE_ERROR: + case E_ERROR: + case E_RECOVERABLE_ERROR: + case E_PARSE: + case E_COMPILE_ERROR: + case E_USER_ERROR: + if (zend_is_executing(TSRMLS_C)) { + error_lineno = zend_get_executed_lineno(TSRMLS_C); + } + zend_exception_error(EG(exception), E_WARNING TSRMLS_CC); + EG(exception) = NULL; + if (zend_is_executing(TSRMLS_C) && EG(opline_ptr)) { + active_opline->lineno = error_lineno; + } + break; + default: + break; + } + } + /* Obtain relevant filename and lineno */ switch (type) { case E_CORE_ERROR: @@ -1261,6 +1281,7 @@ zend_file_handle *file_handle; zend_op_array *orig_op_array = EG(active_op_array); zval **orig_retval_ptr_ptr = EG(return_value_ptr_ptr); + long orig_interactive = CG(interactive); va_start(files, file_count); for (i = 0; i < file_count; i++) { @@ -1268,6 +1289,15 @@ if (!file_handle) { continue; } + + if (orig_interactive) { + if (file_handle->filename[0] != '-' || file_handle->filename[1]) { + CG(interactive) = 0; + } else { + CG(interactive) = 1; + } + } + EG(active_op_array) = zend_compile_file(file_handle, type TSRMLS_CC); if (file_handle->opened_path) { int dummy = 1; @@ -1309,12 +1339,14 @@ va_end(files); EG(active_op_array) = orig_op_array; EG(return_value_ptr_ptr) = orig_retval_ptr_ptr; + CG(interactive) = orig_interactive; return FAILURE; } } va_end(files); EG(active_op_array) = orig_op_array; EG(return_value_ptr_ptr) = orig_retval_ptr_ptr; + CG(interactive) = orig_interactive; return SUCCESS; } diff -Nru php5-5.4.4/Zend/zend_API.c php5-5.4.9/Zend/zend_API.c --- php5-5.4.4/Zend/zend_API.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_API.c 2012-11-21 05:12:20.000000000 +0000 @@ -2265,7 +2265,9 @@ /* Deinitilaise module globals */ if (module->globals_size) { #ifdef ZTS - ts_free_id(*module->globals_id_ptr); + if (*module->globals_id_ptr) { + ts_free_id(*module->globals_id_ptr); + } #else if (module->globals_dtor) { module->globals_dtor(module->globals_ptr TSRMLS_CC); @@ -2531,6 +2533,9 @@ } /* }}} */ +#ifdef ZEND_WIN32 +#pragma optimize("", off) +#endif static zend_object_value display_disabled_class(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ { zend_object_value retval; @@ -2539,6 +2544,9 @@ zend_error(E_WARNING, "%s() has been disabled for security reasons", class_type->name); return retval; } +#ifdef ZEND_WIN32 +#pragma optimize("", on) +#endif /* }}} */ static const zend_function_entry disabled_class_new[] = { @@ -2547,16 +2555,15 @@ ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */ { - zend_class_entry disabled_class; + zend_class_entry **disabled_class; zend_str_tolower(class_name, class_name_length); - if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) { + if (zend_hash_find(CG(class_table), class_name, class_name_length+1, (void **)&disabled_class)==FAILURE) { return FAILURE; } - INIT_OVERLOADED_CLASS_ENTRY_EX(disabled_class, class_name, class_name_length, disabled_class_new, NULL, NULL, NULL, NULL, NULL); - disabled_class.create_object = display_disabled_class; - disabled_class.name_length = class_name_length; - zend_register_internal_class(&disabled_class TSRMLS_CC); + INIT_CLASS_ENTRY_INIT_METHODS((**disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL); + (*disabled_class)->create_object = display_disabled_class; + zend_hash_clean(&((*disabled_class)->function_table)); return SUCCESS; } /* }}} */ @@ -2630,7 +2637,6 @@ } /* }}} */ - static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, int strict_class, char **error TSRMLS_DC) /* {{{ */ { zend_class_entry *ce_org = fcc->calling_scope; @@ -2653,11 +2659,9 @@ /* Skip leading \ */ if (Z_STRVAL_P(callable)[0] == '\\') { mlen = Z_STRLEN_P(callable) - 1; - mname = Z_STRVAL_P(callable) + 1; lmname = zend_str_tolower_dup(Z_STRVAL_P(callable) + 1, mlen); } else { mlen = Z_STRLEN_P(callable); - mname = Z_STRVAL_P(callable); lmname = zend_str_tolower_dup(Z_STRVAL_P(callable), mlen); } /* Check if function with given name exists. @@ -2809,7 +2813,14 @@ if (retval) { if (fcc->calling_scope && !call_via_handler) { - if (!fcc->object_ptr && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) { + if (!fcc->object_ptr && (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT)) { + if (error) { + zend_spprintf(error, 0, "cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name); + retval = 0; + } else { + zend_error(E_ERROR, "Cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name); + } + } else if (!fcc->object_ptr && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) { int severity; char *verb; if (fcc->function_handler->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { diff -Nru php5-5.4.4/Zend/zend_API.h php5-5.4.9/Zend/zend_API.h --- php5-5.4.4/Zend/zend_API.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_API.h 2012-11-21 05:12:20.000000000 +0000 @@ -175,6 +175,11 @@ class_container.name = zend_strndup(cl_name, _len); \ } \ class_container.name_length = _len; \ + INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \ + } + +#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \ + { \ class_container.constructor = NULL; \ class_container.destructor = NULL; \ class_container.clone = NULL; \ diff -Nru php5-5.4.4/Zend/zend_alloc.c php5-5.4.9/Zend/zend_alloc.c --- php5-5.4.4/Zend/zend_alloc.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_alloc.c 2012-11-21 05:12:20.000000000 +0000 @@ -664,7 +664,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size) { -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) unsigned int n; __asm__("bsrl %1,%0\n\t" : "=r" (n) : "rm" (_size)); @@ -690,7 +690,7 @@ static inline unsigned int zend_mm_low_bit(size_t _size) { -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) unsigned int n; __asm__("bsfl %1,%0\n\t" : "=r" (n) : "rm" (_size)); @@ -2454,7 +2454,7 @@ return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); } -#if defined(__GNUC__) && defined(i386) +#if defined(__GNUC__) && (defined(__native_client__) || defined(i386)) static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) { diff -Nru php5-5.4.4/Zend/zend_closures.c php5-5.4.9/Zend/zend_closures.c --- php5-5.4.4/Zend/zend_closures.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_closures.c 2012-11-21 05:12:20.000000000 +0000 @@ -78,7 +78,7 @@ /* {{{ proto Closure Closure::bind(Closure $old, object $to [, mixed $scope = "static" ] ) Create a closure from another one and bind to another object and scope */ -ZEND_METHOD(Closure, bind) /* {{{ */ +ZEND_METHOD(Closure, bind) { zval *newthis, *zclosure, *scope_arg = NULL; zend_closure *closure; diff -Nru php5-5.4.4/Zend/zend_compile.c php5-5.4.9/Zend/zend_compile.c --- php5-5.4.4/Zend/zend_compile.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_compile.c 2012-11-21 05:12:20.000000000 +0000 @@ -1685,7 +1685,7 @@ zval key; if (CG(current_namespace)) { - /* Prefix function name with current namespcae name */ + /* Prefix function name with current namespace name */ znode tmp; tmp.u.constant = *CG(current_namespace); @@ -2935,6 +2935,11 @@ return 1; } + /* If both methods are private do not enforce a signature */ + if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) { + return 1; + } + /* check number of arguments */ if (proto->common.required_num_args < fe->common.required_num_args || proto->common.num_args > fe->common.num_args) { @@ -3619,6 +3624,7 @@ } } ce->traits[ce->num_traits++] = trait; + trait->refcount++; } } /* }}} */ @@ -3711,7 +3717,7 @@ } else { /* Add it to result function table */ if (zend_hash_quick_add(resulting_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, fn, sizeof(zend_function), NULL)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occured during updating resulting trait method table", fn->common.function_name); + zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating resulting trait method table", fn->common.function_name); } } @@ -3800,9 +3806,12 @@ if (prototype) { do_inheritance_check_on_method(fn, prototype TSRMLS_CC); } + /* one more thing: make sure we properly implement an abstract method */ if (existing_fn && existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { + prototype = fn->common.prototype; do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC); + fn->common.prototype = prototype; } /* delete inherited fn if the function to be added is not abstract */ @@ -3828,11 +3837,11 @@ function_add_ref(&fn_copy); if (zend_hash_quick_update(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, &fn_copy, sizeof(zend_function), (void**)&fn_copy_p)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occured during updating class method table", hash_key->arKey); + zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating class method table", hash_key->arKey); } - + zend_add_magic_methods(ce, hash_key->arKey, hash_key->nKeyLength, fn_copy_p TSRMLS_CC); - + zend_function_dtor(fn); } else { zend_function_dtor(fn); @@ -3869,14 +3878,14 @@ && (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) { fn_copy = *fn; function_add_ref(&fn_copy); - /* this function_name is never destroyed, because its refcount - greater than 1, classes are always destoyed in reverse order - and trait is declared early than this class */ + /* this function_name is never destroyed, because ZEND_ACC_ALIAS + flag is set */ fn_copy.common.function_name = aliases[i]->alias; + fn_copy.common.fn_flags |= ZEND_ACC_ALIAS; /* if it is 0, no modifieres has been changed */ if (aliases[i]->modifiers) { - fn_copy.common.fn_flags = aliases[i]->modifiers; + fn_copy.common.fn_flags = aliases[i]->modifiers | ZEND_ACC_ALIAS; if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) { fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC; } @@ -3905,6 +3914,7 @@ /* is not in hashtable, thus, function is not to be excluded */ fn_copy = *fn; function_add_ref(&fn_copy); + fn_copy.common.fn_flags |= ZEND_ACC_ALIAS; /* apply aliases which are not qualified by a class name, or which have not * alias name, just setting visibility */ @@ -3916,7 +3926,7 @@ && (!aliases[i]->trait_method->ce || fn->common.scope == aliases[i]->trait_method->ce) && (aliases[i]->trait_method->mname_len == fnname_len) && (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) { - fn_copy.common.fn_flags = aliases[i]->modifiers; + fn_copy.common.fn_flags = aliases[i]->modifiers | ZEND_ACC_ALIAS; if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) { fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC; @@ -3965,8 +3975,10 @@ /** Resolve classes for all precedence operations. */ if (cur_precedence->exclude_from_classes) { cur_method_ref = cur_precedence->trait_method; - cur_precedence->trait_method->ce = zend_fetch_class(cur_method_ref->class_name, - cur_method_ref->cname_len, ZEND_FETCH_CLASS_TRAIT TSRMLS_CC); + if (!(cur_precedence->trait_method->ce = zend_fetch_class(cur_method_ref->class_name, cur_method_ref->cname_len, + ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { + zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name); + } /** Ensure that the prefered method is actually available. */ lcname = zend_str_tolower_dup(cur_method_ref->method_name, @@ -3993,7 +4005,9 @@ char* class_name = (char*)cur_precedence->exclude_from_classes[j]; zend_uint name_length = strlen(class_name); - cur_precedence->exclude_from_classes[j] = zend_fetch_class(class_name, name_length, ZEND_FETCH_CLASS_TRAIT TSRMLS_CC); + if (!(cur_precedence->exclude_from_classes[j] = zend_fetch_class(class_name, name_length, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { + zend_error(E_COMPILE_ERROR, "Could not find trait %s", class_name); + } /* make sure that the trait method is not from a class mentioned in exclude_from_classes, for consistency */ @@ -4020,13 +4034,15 @@ /** For all aliases with an explicit class name, resolve the class now. */ if (ce->trait_aliases[i]->trait_method->class_name) { cur_method_ref = ce->trait_aliases[i]->trait_method; - cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, cur_method_ref->cname_len, ZEND_FETCH_CLASS_TRAIT TSRMLS_CC); + if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, cur_method_ref->cname_len, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { + zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name); + } /** And, ensure that the referenced method is resolvable, too. */ lcname = zend_str_tolower_dup(cur_method_ref->method_name, - cur_method_ref->mname_len); + cur_method_ref->mname_len); method_exists = zend_hash_exists(&cur_method_ref->ce->function_table, - lcname, cur_method_ref->mname_len + 1); + lcname, cur_method_ref->mname_len + 1); efree(lcname); if (!method_exists) { @@ -4076,14 +4092,14 @@ size_t i; /* prepare copies of trait function tables for combination */ - function_tables = malloc(sizeof(HashTable*) * ce->num_traits); - resulting_table = (HashTable *) malloc(sizeof(HashTable)); + function_tables = emalloc(sizeof(HashTable*) * ce->num_traits); + resulting_table = (HashTable *)emalloc(sizeof(HashTable)); /* TODO: revisit this start size, may be its not optimal */ - zend_hash_init_ex(resulting_table, 10, NULL, NULL, 1, 0); + zend_hash_init_ex(resulting_table, 10, NULL, NULL, 0, 0); for (i = 0; i < ce->num_traits; i++) { - function_tables[i] = (HashTable *) malloc(sizeof(HashTable)); + function_tables[i] = (HashTable *)emalloc(sizeof(HashTable)); zend_hash_init_ex(function_tables[i], ce->traits[i]->function_table.nNumOfElements, NULL, NULL, 1, 0); if (ce->trait_precedences) { @@ -4116,14 +4132,14 @@ for (i = 0; i < ce->num_traits; i++) { /* zend_hash_destroy(function_tables[i]); */ zend_hash_graceful_destroy(function_tables[i]); - free(function_tables[i]); + efree(function_tables[i]); } - free(function_tables); + efree(function_tables); /* free temporary resulting table */ /* zend_hash_destroy(resulting_table); */ zend_hash_graceful_destroy(resulting_table); - free(resulting_table); + efree(resulting_table); } /* }}} */ @@ -5008,11 +5024,11 @@ opline->op2_type = IS_CONST; if (doing_inheritance) { - /* Make sure a trait does not try to extend a class */ - if ((new_class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name); - } - + /* Make sure a trait does not try to extend a class */ + if ((new_class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { + zend_error(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name); + } + opline->extended_value = parent_class_name->u.op.var; opline->opcode = ZEND_DECLARE_INHERITED_CLASS; } else { @@ -6957,9 +6973,9 @@ lcname = zend_str_tolower_dup(Z_STRVAL_P(name), Z_STRLEN_P(name)); if (((Z_STRLEN_P(name) == sizeof("self")-1) && - !memcmp(lcname, "self", sizeof("self")-1)) || - ((Z_STRLEN_P(name) == sizeof("parent")-1) && - !memcmp(lcname, "parent", sizeof("parent")-1))) { + !memcmp(lcname, "self", sizeof("self")-1)) || + ((Z_STRLEN_P(name) == sizeof("parent")-1) && + !memcmp(lcname, "parent", sizeof("parent")-1))) { zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name)); } diff -Nru php5-5.4.4/Zend/zend_compile.h php5-5.4.9/Zend/zend_compile.h --- php5-5.4.4/Zend/zend_compile.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_compile.h 2012-11-21 05:12:20.000000000 +0000 @@ -207,6 +207,8 @@ #define ZEND_ACC_RETURN_REFERENCE 0x4000000 #define ZEND_ACC_DONE_PASS_TWO 0x8000000 +#define ZEND_ACC_ALIAS 0x10000000 + char *zend_visibility_string(zend_uint fn_flags); diff -Nru php5-5.4.4/Zend/zend_exceptions.c php5-5.4.9/Zend/zend_exceptions.c --- php5-5.4.4/Zend/zend_exceptions.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_exceptions.c 2012-11-21 05:12:20.000000000 +0000 @@ -29,8 +29,8 @@ #include "zend_vm.h" #include "zend_dtrace.h" -zend_class_entry *default_exception_ce; -zend_class_entry *error_exception_ce; +static zend_class_entry *default_exception_ce; +static zend_class_entry *error_exception_ce; static zend_object_handlers default_exception_handlers; ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC); diff -Nru php5-5.4.4/Zend/zend_execute.c php5-5.4.9/Zend/zend_execute.c --- php5-5.4.4/Zend/zend_execute.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_execute.c 2012-11-21 05:12:20.000000000 +0000 @@ -1161,7 +1161,7 @@ case IS_DOUBLE: case IS_NULL: case IS_BOOL: - zend_error(E_NOTICE, "String offset cast occured"); + zend_error(E_NOTICE, "String offset cast occurred"); break; default: zend_error(E_WARNING, "Illegal offset type"); @@ -1284,7 +1284,7 @@ case IS_NULL: case IS_BOOL: if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "String offset cast occured"); + zend_error(E_NOTICE, "String offset cast occurred"); } break; default: diff -Nru php5-5.4.4/Zend/zend_hash.h php5-5.4.9/Zend/zend_hash.h --- php5-5.4.4/Zend/zend_hash.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_hash.h 2012-11-21 05:12:20.000000000 +0000 @@ -330,7 +330,7 @@ if (idx-1 > LONG_MAX) { /* overflow */ \ break; \ } \ - idx = (ulong)(-(long)idx); \ + idx = 0 - idx; \ } else if (idx > LONG_MAX) { /* overflow */ \ break; \ } \ diff -Nru php5-5.4.4/Zend/zend_ini_scanner.c php5-5.4.9/Zend/zend_ini_scanner.c --- php5-5.4.4/Zend/zend_ini_scanner.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_ini_scanner.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Fri Mar 2 11:49:21 2012 */ +/* Generated by re2c 0.13.5 on Thu Jun 7 17:48:25 2012 */ #line 1 "Zend/zend_ini_scanner.l" /* +----------------------------------------------------------------------+ @@ -481,7 +481,7 @@ yy5: YYDEBUG(5, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 547 "Zend/zend_ini_scanner.l" +#line 568 "Zend/zend_ini_scanner.l" { /* eat whitespace */ goto restart; @@ -493,7 +493,7 @@ yy7: YYDEBUG(7, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 552 "Zend/zend_ini_scanner.l" +#line 573 "Zend/zend_ini_scanner.l" { SCNG(lineno)++; return END_OF_LINE; @@ -533,7 +533,7 @@ ++YYCURSOR; YYDEBUG(11, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 475 "Zend/zend_ini_scanner.l" +#line 496 "Zend/zend_ini_scanner.l" { /* Disallow these chars outside option values */ return yytext[0]; } @@ -554,7 +554,7 @@ goto yy54; YYDEBUG(15, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" +#line 596 "Zend/zend_ini_scanner.l" { return 0; } @@ -926,7 +926,7 @@ yy56: YYDEBUG(56, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 557 "Zend/zend_ini_scanner.l" +#line 578 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; @@ -1012,7 +1012,7 @@ yy65: YYDEBUG(65, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 563 "Zend/zend_ini_scanner.l" +#line 584 "Zend/zend_ini_scanner.l" { /* #Comment */ zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno)); BEGIN(INITIAL); @@ -1159,7 +1159,7 @@ yy76: YYDEBUG(76, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 507 "Zend/zend_ini_scanner.l" +#line 528 "Zend/zend_ini_scanner.l" { /* Escape double quoted string contents */ if (YYCURSOR > YYLIMIT) { return 0; @@ -1204,7 +1204,7 @@ yy78: YYDEBUG(78, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 502 "Zend/zend_ini_scanner.l" +#line 523 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string ends */ yy_pop_state(TSRMLS_C); return '"'; @@ -1323,7 +1323,7 @@ yy87: YYDEBUG(87, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 493 "Zend/zend_ini_scanner.l" +#line 514 "Zend/zend_ini_scanner.l" { /* Get rest as section/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } @@ -1344,7 +1344,7 @@ yy90: YYDEBUG(90, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" +#line 596 "Zend/zend_ini_scanner.l" { return 0; } @@ -1355,7 +1355,7 @@ yy92: YYDEBUG(92, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 497 "Zend/zend_ini_scanner.l" +#line 518 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; @@ -1422,7 +1422,7 @@ yy98: YYDEBUG(98, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 471 "Zend/zend_ini_scanner.l" +#line 492 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } @@ -1452,7 +1452,7 @@ yy100: YYDEBUG(100, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 467 "Zend/zend_ini_scanner.l" +#line 488 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } @@ -1833,7 +1833,7 @@ 160, 224, 0, 160, 160, 0, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 224, 160, 160, 160, 160, 160, 160, 160, + 224, 160, 32, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 32, 160, 160, 160, 160, @@ -1865,66 +1865,64 @@ YYDEBUG(135, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; - if (yych <= '\f') { - if (yych <= 0x08) { - if (yych >= 0x01) goto yy139; + if (yych <= '\r') { + if (yych <= '\t') { + if (yych <= 0x00) goto yy137; + if (yych <= 0x08) goto yy139; + goto yy141; } else { - if (yych <= '\t') goto yy141; if (yych <= '\n') goto yy142; - goto yy139; + if (yych <= '\f') goto yy139; + goto yy144; } } else { - if (yych <= ' ') { - if (yych <= '\r') goto yy144; - if (yych <= 0x1F) goto yy139; - goto yy141; + if (yych <= '!') { + if (yych == ' ') goto yy141; + goto yy139; } else { - if (yych == ';') goto yy145; + if (yych <= '"') goto yy145; + if (yych == ';') goto yy147; goto yy139; } } +yy137: YYDEBUG(137, *YYCURSOR); ++YYCURSOR; YYDEBUG(138, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 570 "Zend/zend_ini_scanner.l" +#line 591 "Zend/zend_ini_scanner.l" { /* End of option value (if EOF is reached before EOL */ BEGIN(INITIAL); return END_OF_LINE; } -#line 1896 "Zend/zend_ini_scanner.c" +#line 1899 "Zend/zend_ini_scanner.c" yy139: YYDEBUG(139, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy156; + goto yy158; yy140: YYDEBUG(140, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 448 "Zend/zend_ini_scanner.l" +#line 474 "Zend/zend_ini_scanner.l" { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ - /* Eat leading and trailing double quotes */ - if (yytext[0] == '"' && yytext[yyleng - 1] == '"') { - SCNG(yy_text)++; - yyleng = yyleng - 2; - } RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 1914 "Zend/zend_ini_scanner.c" +#line 1912 "Zend/zend_ini_scanner.c" yy141: YYDEBUG(141, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 64) { - goto yy152; + goto yy154; } if (yych <= '\f') { - if (yych == '\n') goto yy151; - goto yy156; + if (yych == '\n') goto yy153; + goto yy158; } else { - if (yych <= '\r') goto yy154; - if (yych == ';') goto yy146; - goto yy156; + if (yych <= '\r') goto yy156; + if (yych == ';') goto yy148; + goto yy158; } yy142: YYDEBUG(142, *YYCURSOR); @@ -1932,89 +1930,129 @@ yy143: YYDEBUG(143, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 461 "Zend/zend_ini_scanner.l" +#line 482 "Zend/zend_ini_scanner.l" { /* End of option value */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 1942 "Zend/zend_ini_scanner.c" +#line 1940 "Zend/zend_ini_scanner.c" yy144: YYDEBUG(144, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy151; + if (yych == '\n') goto yy153; goto yy143; yy145: YYDEBUG(145, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - goto yy147; -yy146: - YYDEBUG(146, *YYCURSOR); ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; + YYDEBUG(146, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 448 "Zend/zend_ini_scanner.l" + { + while (YYCURSOR < YYLIMIT) { + switch (*YYCURSOR++) { + case '\n': + SCNG(lineno)++; + break; + case '\r': + if (*YYCURSOR != '\n') { + SCNG(lineno)++; + } + break; + case '"': + yyleng = YYCURSOR - SCNG(yy_text) - 2; + SCNG(yy_text)++; + RETURN_TOKEN(TC_RAW, yytext, yyleng); + case '\\': + if (YYCURSOR < YYLIMIT) { + YYCURSOR++; + } + break; + } + } + yyleng = YYCURSOR - SCNG(yy_text); + RETURN_TOKEN(TC_RAW, yytext, yyleng); +} +#line 1977 "Zend/zend_ini_scanner.c" yy147: YYDEBUG(147, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy146; - } - if (yych >= '\r') goto yy150; + yyaccept = 1; + yych = *(YYMARKER = ++YYCURSOR); + goto yy149; yy148: YYDEBUG(148, *YYCURSOR); ++YYCURSOR; + YYFILL(2); + yych = *YYCURSOR; yy149: YYDEBUG(149, *YYCURSOR); + if (yybm[0+yych] & 32) { + goto yy148; + } + if (yych >= '\r') goto yy152; +yy150: + YYDEBUG(150, *YYCURSOR); + ++YYCURSOR; +yy151: + YYDEBUG(151, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 557 "Zend/zend_ini_scanner.l" +#line 578 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 1976 "Zend/zend_ini_scanner.c" -yy150: - YYDEBUG(150, *YYCURSOR); +#line 2006 "Zend/zend_ini_scanner.c" +yy152: + YYDEBUG(152, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy148; - goto yy149; -yy151: - YYDEBUG(151, *YYCURSOR); + if (yych == '\n') goto yy150; + goto yy151; +yy153: + YYDEBUG(153, *YYCURSOR); yych = *++YYCURSOR; goto yy143; -yy152: - YYDEBUG(152, *YYCURSOR); +yy154: + YYDEBUG(154, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; - YYDEBUG(153, *YYCURSOR); + YYDEBUG(155, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy152; + goto yy154; } - if (yych <= '\f') { - if (yych <= 0x00) goto yy140; - if (yych == '\n') goto yy151; - goto yy155; - } else { - if (yych <= '\r') goto yy154; - if (yych == ';') goto yy146; - goto yy155; + if (yych <= '\r') { + if (yych <= '\t') { + if (yych <= 0x00) goto yy140; + goto yy157; + } else { + if (yych <= '\n') goto yy153; + if (yych <= '\f') goto yy157; + } + } else { + if (yych <= '"') { + if (yych <= '!') goto yy157; + goto yy140; + } else { + if (yych == ';') goto yy148; + goto yy157; + } } -yy154: - YYDEBUG(154, *YYCURSOR); +yy156: + YYDEBUG(156, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy151; + if (yych == '\n') goto yy153; goto yy143; -yy155: - YYDEBUG(155, *YYCURSOR); +yy157: + YYDEBUG(157, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy156: - YYDEBUG(156, *YYCURSOR); +yy158: + YYDEBUG(158, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy155; + goto yy157; } goto yy140; } @@ -2055,44 +2093,44 @@ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(157, *YYCURSOR); + YYDEBUG(159, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '\f') { - if (yych == '\n') goto yy161; + if (yych == '\n') goto yy163; } else { - if (yych <= '\r') goto yy161; - if (yych == ']') goto yy163; + if (yych <= '\r') goto yy163; + if (yych == ']') goto yy165; } - YYDEBUG(159, *YYCURSOR); + YYDEBUG(161, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy170; -yy160: - YYDEBUG(160, *YYCURSOR); + goto yy172; +yy162: + YYDEBUG(162, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 457 "Zend/zend_ini_scanner.l" +#line 478 "Zend/zend_ini_scanner.l" { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 2079 "Zend/zend_ini_scanner.c" -yy161: - YYDEBUG(161, *YYCURSOR); +#line 2117 "Zend/zend_ini_scanner.c" +yy163: + YYDEBUG(163, *YYCURSOR); ++YYCURSOR; - YYDEBUG(162, *YYCURSOR); + YYDEBUG(164, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" +#line 596 "Zend/zend_ini_scanner.l" { return 0; } -#line 2089 "Zend/zend_ini_scanner.c" -yy163: - YYDEBUG(163, *YYCURSOR); +#line 2127 "Zend/zend_ini_scanner.c" +yy165: + YYDEBUG(165, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy166; -yy164: - YYDEBUG(164, *YYCURSOR); + goto yy168; +yy166: + YYDEBUG(166, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 377 "Zend/zend_ini_scanner.l" { /* End of section */ @@ -2100,40 +2138,40 @@ SCNG(lineno)++; return ']'; } -#line 2104 "Zend/zend_ini_scanner.c" -yy165: - YYDEBUG(165, *YYCURSOR); +#line 2142 "Zend/zend_ini_scanner.c" +yy167: + YYDEBUG(167, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy166: - YYDEBUG(166, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy165; - } - if (yych == '\n') goto yy167; - if (yych == '\r') goto yy168; - goto yy164; -yy167: - YYDEBUG(167, *YYCURSOR); - yych = *++YYCURSOR; - goto yy164; yy168: YYDEBUG(168, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy167; - goto yy164; + if (yybm[0+yych] & 64) { + goto yy167; + } + if (yych == '\n') goto yy169; + if (yych == '\r') goto yy170; + goto yy166; yy169: YYDEBUG(169, *YYCURSOR); + yych = *++YYCURSOR; + goto yy166; +yy170: + YYDEBUG(170, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == '\n') goto yy169; + goto yy166; +yy171: + YYDEBUG(171, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy170: - YYDEBUG(170, *YYCURSOR); +yy172: + YYDEBUG(172, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy169; + goto yy171; } - goto yy160; + goto yy162; } /* *********************************** */ yyc_ST_SECTION_VALUE: @@ -2172,203 +2210,203 @@ 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, }; - YYDEBUG(171, *YYCURSOR); + YYDEBUG(173, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '-') { if (yych <= ' ') { if (yych <= '\n') { - if (yych <= 0x08) goto yy173; - if (yych <= '\t') goto yy175; - goto yy176; + if (yych <= 0x08) goto yy175; + if (yych <= '\t') goto yy177; + goto yy178; } else { - if (yych == '\r') goto yy176; - if (yych >= ' ') goto yy175; + if (yych == '\r') goto yy178; + if (yych >= ' ') goto yy177; } } else { if (yych <= '$') { - if (yych == '"') goto yy178; - if (yych >= '$') goto yy180; + if (yych == '"') goto yy180; + if (yych >= '$') goto yy182; } else { - if (yych == '\'') goto yy181; - if (yych >= '-') goto yy182; + if (yych == '\'') goto yy183; + if (yych >= '-') goto yy184; } } } else { if (yych <= 'Z') { if (yych <= '9') { - if (yych <= '.') goto yy183; - if (yych >= '0') goto yy184; + if (yych <= '.') goto yy185; + if (yych >= '0') goto yy186; } else { - if (yych == ';') goto yy176; - if (yych >= 'A') goto yy186; + if (yych == ';') goto yy178; + if (yych >= 'A') goto yy188; } } else { if (yych <= '^') { - if (yych <= '[') goto yy173; - if (yych <= '\\') goto yy188; - if (yych <= ']') goto yy189; + if (yych <= '[') goto yy175; + if (yych <= '\\') goto yy190; + if (yych <= ']') goto yy191; } else { - if (yych == '`') goto yy173; - if (yych <= 'z') goto yy186; + if (yych == '`') goto yy175; + if (yych <= 'z') goto yy188; } } } -yy173: - YYDEBUG(173, *YYCURSOR); +yy175: + YYDEBUG(175, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - goto yy196; -yy174: - YYDEBUG(174, *YYCURSOR); + goto yy198; +yy176: + YYDEBUG(176, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 493 "Zend/zend_ini_scanner.l" +#line 514 "Zend/zend_ini_scanner.l" { /* Get rest as section/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } -#line 2230 "Zend/zend_ini_scanner.c" -yy175: - YYDEBUG(175, *YYCURSOR); +#line 2268 "Zend/zend_ini_scanner.c" +yy177: + YYDEBUG(177, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy222; - goto yy196; + if (yych == '\t') goto yy224; + goto yy198; } else { - if (yych <= ' ') goto yy222; - if (yych == '"') goto yy224; - goto yy196; + if (yych <= ' ') goto yy224; + if (yych == '"') goto yy226; + goto yy198; } -yy176: - YYDEBUG(176, *YYCURSOR); +yy178: + YYDEBUG(178, *YYCURSOR); ++YYCURSOR; -yy177: - YYDEBUG(177, *YYCURSOR); +yy179: + YYDEBUG(179, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" +#line 596 "Zend/zend_ini_scanner.l" { return 0; } -#line 2253 "Zend/zend_ini_scanner.c" -yy178: - YYDEBUG(178, *YYCURSOR); +#line 2291 "Zend/zend_ini_scanner.c" +yy180: + YYDEBUG(180, *YYCURSOR); ++YYCURSOR; -yy179: - YYDEBUG(179, *YYCURSOR); +yy181: + YYDEBUG(181, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 497 "Zend/zend_ini_scanner.l" +#line 518 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; } -#line 2265 "Zend/zend_ini_scanner.c" -yy180: - YYDEBUG(180, *YYCURSOR); +#line 2303 "Zend/zend_ini_scanner.c" +yy182: + YYDEBUG(182, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy177; - if (yych <= '[') goto yy195; - goto yy200; + if (yych <= 0x00) goto yy179; + if (yych <= '[') goto yy197; + goto yy202; } else { - if (yych == '{') goto yy220; - goto yy195; + if (yych == '{') goto yy222; + goto yy197; } -yy181: - YYDEBUG(181, *YYCURSOR); +yy183: + YYDEBUG(183, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { - goto yy216; + goto yy218; } - goto yy177; -yy182: - YYDEBUG(182, *YYCURSOR); + goto yy179; +yy184: + YYDEBUG(184, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy196; - if (yych <= '9') goto yy214; - goto yy196; -yy183: - YYDEBUG(183, *YYCURSOR); + if (yych <= '/') goto yy198; + if (yych <= '9') goto yy216; + goto yy198; +yy185: + YYDEBUG(185, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy196; - if (yych <= '9') goto yy212; - goto yy196; -yy184: - YYDEBUG(184, *YYCURSOR); + if (yych <= '/') goto yy198; + if (yych <= '9') goto yy214; + goto yy198; +yy186: + YYDEBUG(186, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '\'') { if (yych <= '\r') { - if (yych == '\n') goto yy185; - if (yych <= '\f') goto yy196; + if (yych == '\n') goto yy187; + if (yych <= '\f') goto yy198; } else { - if (yych == '"') goto yy185; - if (yych <= '&') goto yy196; + if (yych == '"') goto yy187; + if (yych <= '&') goto yy198; } } else { if (yych <= '9') { - if (yych == '.') goto yy208; - if (yych <= '/') goto yy196; - goto yy210; + if (yych == '.') goto yy210; + if (yych <= '/') goto yy198; + goto yy212; } else { if (yych <= ';') { - if (yych <= ':') goto yy196; + if (yych <= ':') goto yy198; } else { - if (yych != ']') goto yy196; + if (yych != ']') goto yy198; } } } -yy185: - YYDEBUG(185, *YYCURSOR); +yy187: + YYDEBUG(187, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 471 "Zend/zend_ini_scanner.l" +#line 492 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } -#line 2331 "Zend/zend_ini_scanner.c" -yy186: - YYDEBUG(186, *YYCURSOR); +#line 2369 "Zend/zend_ini_scanner.c" +yy188: + YYDEBUG(188, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { - goto yy206; + goto yy208; } if (yych <= '"') { if (yych <= '\f') { - if (yych != '\n') goto yy196; + if (yych != '\n') goto yy198; } else { - if (yych <= '\r') goto yy187; - if (yych <= '!') goto yy196; + if (yych <= '\r') goto yy189; + if (yych <= '!') goto yy198; } } else { if (yych <= ':') { - if (yych != '\'') goto yy196; + if (yych != '\'') goto yy198; } else { - if (yych <= ';') goto yy187; - if (yych != ']') goto yy196; + if (yych <= ';') goto yy189; + if (yych != ']') goto yy198; } } -yy187: - YYDEBUG(187, *YYCURSOR); +yy189: + YYDEBUG(189, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 467 "Zend/zend_ini_scanner.l" +#line 488 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } -#line 2361 "Zend/zend_ini_scanner.c" -yy188: - YYDEBUG(188, *YYCURSOR); +#line 2399 "Zend/zend_ini_scanner.c" +yy190: + YYDEBUG(190, *YYCURSOR); yych = *++YYCURSOR; - goto yy195; -yy189: - YYDEBUG(189, *YYCURSOR); + goto yy197; +yy191: + YYDEBUG(191, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy192; -yy190: - YYDEBUG(190, *YYCURSOR); + goto yy194; +yy192: + YYDEBUG(192, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 377 "Zend/zend_ini_scanner.l" { /* End of section */ @@ -2376,97 +2414,86 @@ SCNG(lineno)++; return ']'; } -#line 2380 "Zend/zend_ini_scanner.c" -yy191: - YYDEBUG(191, *YYCURSOR); +#line 2418 "Zend/zend_ini_scanner.c" +yy193: + YYDEBUG(193, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy192: - YYDEBUG(192, *YYCURSOR); - if (yybm[0+yych] & 2) { - goto yy191; - } - if (yych == '\n') goto yy193; - if (yych == '\r') goto yy194; - goto yy190; -yy193: - YYDEBUG(193, *YYCURSOR); - yych = *++YYCURSOR; - goto yy190; yy194: YYDEBUG(194, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy193; - goto yy190; + if (yybm[0+yych] & 2) { + goto yy193; + } + if (yych == '\n') goto yy195; + if (yych == '\r') goto yy196; + goto yy192; yy195: YYDEBUG(195, *YYCURSOR); + yych = *++YYCURSOR; + goto yy192; +yy196: + YYDEBUG(196, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == '\n') goto yy195; + goto yy192; +yy197: + YYDEBUG(197, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy196: - YYDEBUG(196, *YYCURSOR); +yy198: + YYDEBUG(198, *YYCURSOR); if (yybm[0+yych] & 4) { - goto yy195; + goto yy197; } - if (yych == '$') goto yy198; - if (yych != '\\') goto yy174; -yy197: - YYDEBUG(197, *YYCURSOR); + if (yych == '$') goto yy200; + if (yych != '\\') goto yy176; +yy199: + YYDEBUG(199, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - goto yy195; -yy198: - YYDEBUG(198, *YYCURSOR); + goto yy197; +yy200: + YYDEBUG(200, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy199; - if (yych <= '[') goto yy195; - goto yy200; + if (yych <= 0x00) goto yy201; + if (yych <= '[') goto yy197; + goto yy202; } else { - if (yych != '{') goto yy195; + if (yych != '{') goto yy197; } -yy199: - YYDEBUG(199, *YYCURSOR); +yy201: + YYDEBUG(201, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 1) { if (yyaccept <= 0) { - goto yy174; + goto yy176; } else { - goto yy177; + goto yy179; } } else { if (yyaccept <= 2) { - goto yy185; - } else { goto yy187; + } else { + goto yy189; } } -yy200: - YYDEBUG(200, *YYCURSOR); +yy202: + YYDEBUG(202, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 8) { - goto yy201; - } - if (yych == '\\') goto yy203; - goto yy195; -yy201: - YYDEBUG(201, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(202, *YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy201; + goto yy203; } if (yych == '\\') goto yy205; - goto yy195; + goto yy197; yy203: YYDEBUG(203, *YYCURSOR); ++YYCURSOR; @@ -2474,219 +2501,230 @@ yych = *YYCURSOR; YYDEBUG(204, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy201; + goto yy203; } - if (yych == '\\') goto yy203; - goto yy195; + if (yych == '\\') goto yy207; + goto yy197; yy205: YYDEBUG(205, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; + YYDEBUG(206, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy201; + goto yy203; } - if (yych == '\\') goto yy203; - goto yy195; -yy206: - YYDEBUG(206, *YYCURSOR); + if (yych == '\\') goto yy205; + goto yy197; +yy207: + YYDEBUG(207, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + if (yybm[0+yych] & 8) { + goto yy203; + } + if (yych == '\\') goto yy205; + goto yy197; +yy208: + YYDEBUG(208, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(207, *YYCURSOR); + YYDEBUG(209, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy206; + goto yy208; } if (yych <= '$') { if (yych <= '\r') { - if (yych == '\n') goto yy187; - if (yych <= '\f') goto yy195; - goto yy187; - } else { - if (yych == '"') goto yy187; - if (yych <= '#') goto yy195; - goto yy198; + if (yych == '\n') goto yy189; + if (yych <= '\f') goto yy197; + goto yy189; + } else { + if (yych == '"') goto yy189; + if (yych <= '#') goto yy197; + goto yy200; } } else { if (yych <= ';') { - if (yych == '\'') goto yy187; - if (yych <= ':') goto yy195; - goto yy187; - } else { - if (yych <= '[') goto yy195; - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy187; - goto yy195; + if (yych == '\'') goto yy189; + if (yych <= ':') goto yy197; + goto yy189; + } else { + if (yych <= '[') goto yy197; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy189; + goto yy197; } } -yy208: - YYDEBUG(208, *YYCURSOR); +yy210: + YYDEBUG(210, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(209, *YYCURSOR); + YYDEBUG(211, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy208; + goto yy210; } if (yych <= '$') { if (yych <= '\r') { - if (yych == '\n') goto yy185; - if (yych <= '\f') goto yy195; - goto yy185; - } else { - if (yych == '"') goto yy185; - if (yych <= '#') goto yy195; - goto yy198; + if (yych == '\n') goto yy187; + if (yych <= '\f') goto yy197; + goto yy187; + } else { + if (yych == '"') goto yy187; + if (yych <= '#') goto yy197; + goto yy200; } } else { if (yych <= ';') { - if (yych == '\'') goto yy185; - if (yych <= ':') goto yy195; - goto yy185; - } else { - if (yych <= '[') goto yy195; - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy185; - goto yy195; + if (yych == '\'') goto yy187; + if (yych <= ':') goto yy197; + goto yy187; + } else { + if (yych <= '[') goto yy197; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy187; + goto yy197; } } -yy210: - YYDEBUG(210, *YYCURSOR); +yy212: + YYDEBUG(212, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(211, *YYCURSOR); + YYDEBUG(213, *YYCURSOR); if (yych <= '\'') { if (yych <= '!') { if (yych <= '\n') { - if (yych <= '\t') goto yy195; - goto yy185; + if (yych <= '\t') goto yy197; + goto yy187; } else { - if (yych == '\r') goto yy185; - goto yy195; + if (yych == '\r') goto yy187; + goto yy197; } } else { if (yych <= '#') { - if (yych <= '"') goto yy185; - goto yy195; + if (yych <= '"') goto yy187; + goto yy197; } else { - if (yych <= '$') goto yy198; - if (yych <= '&') goto yy195; - goto yy185; + if (yych <= '$') goto yy200; + if (yych <= '&') goto yy197; + goto yy187; } } } else { if (yych <= ':') { if (yych <= '.') { - if (yych <= '-') goto yy195; - goto yy208; + if (yych <= '-') goto yy197; + goto yy210; } else { - if (yych <= '/') goto yy195; - if (yych <= '9') goto yy210; - goto yy195; + if (yych <= '/') goto yy197; + if (yych <= '9') goto yy212; + goto yy197; } } else { if (yych <= '[') { - if (yych <= ';') goto yy185; - goto yy195; + if (yych <= ';') goto yy187; + goto yy197; } else { - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy185; - goto yy195; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy187; + goto yy197; } } } -yy212: - YYDEBUG(212, *YYCURSOR); +yy214: + YYDEBUG(214, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(213, *YYCURSOR); + YYDEBUG(215, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { - if (yych == '\n') goto yy185; - if (yych <= '\f') goto yy195; - goto yy185; + if (yych == '\n') goto yy187; + if (yych <= '\f') goto yy197; + goto yy187; } else { if (yych <= '"') { - if (yych <= '!') goto yy195; - goto yy185; + if (yych <= '!') goto yy197; + goto yy187; } else { - if (yych == '$') goto yy198; - goto yy195; + if (yych == '$') goto yy200; + goto yy197; } } } else { if (yych <= ':') { - if (yych <= '\'') goto yy185; - if (yych <= '/') goto yy195; - if (yych <= '9') goto yy212; - goto yy195; + if (yych <= '\'') goto yy187; + if (yych <= '/') goto yy197; + if (yych <= '9') goto yy214; + goto yy197; } else { if (yych <= '[') { - if (yych <= ';') goto yy185; - goto yy195; + if (yych <= ';') goto yy187; + goto yy197; } else { - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy185; - goto yy195; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy187; + goto yy197; } } } -yy214: - YYDEBUG(214, *YYCURSOR); +yy216: + YYDEBUG(216, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(215, *YYCURSOR); + YYDEBUG(217, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { - if (yych == '\n') goto yy185; - if (yych <= '\f') goto yy195; - goto yy185; + if (yych == '\n') goto yy187; + if (yych <= '\f') goto yy197; + goto yy187; } else { if (yych <= '"') { - if (yych <= '!') goto yy195; - goto yy185; + if (yych <= '!') goto yy197; + goto yy187; } else { - if (yych == '$') goto yy198; - goto yy195; + if (yych == '$') goto yy200; + goto yy197; } } } else { if (yych <= ':') { - if (yych <= '\'') goto yy185; - if (yych <= '/') goto yy195; - if (yych <= '9') goto yy214; - goto yy195; + if (yych <= '\'') goto yy187; + if (yych <= '/') goto yy197; + if (yych <= '9') goto yy216; + goto yy197; } else { if (yych <= '[') { - if (yych <= ';') goto yy185; - goto yy195; + if (yych <= ';') goto yy187; + goto yy197; } else { - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy185; - goto yy195; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy187; + goto yy197; } } } -yy216: - YYDEBUG(216, *YYCURSOR); +yy218: + YYDEBUG(218, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(217, *YYCURSOR); + YYDEBUG(219, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy216; + goto yy218; } - YYDEBUG(218, *YYCURSOR); + YYDEBUG(220, *YYCURSOR); ++YYCURSOR; - YYDEBUG(219, *YYCURSOR); + YYDEBUG(221, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 368 "Zend/zend_ini_scanner.l" { /* Raw string */ @@ -2697,65 +2735,65 @@ } RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 2701 "Zend/zend_ini_scanner.c" -yy220: - YYDEBUG(220, *YYCURSOR); +#line 2739 "Zend/zend_ini_scanner.c" +yy222: + YYDEBUG(222, *YYCURSOR); ++YYCURSOR; - YYDEBUG(221, *YYCURSOR); + YYDEBUG(223, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 401 "Zend/zend_ini_scanner.l" { /* Variable start */ yy_push_state(ST_VARNAME TSRMLS_CC); return TC_DOLLAR_CURLY; } -#line 2712 "Zend/zend_ini_scanner.c" -yy222: - YYDEBUG(222, *YYCURSOR); +#line 2750 "Zend/zend_ini_scanner.c" +yy224: + YYDEBUG(224, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(223, *YYCURSOR); + YYDEBUG(225, *YYCURSOR); if (yych <= '"') { if (yych <= '\f') { - if (yych <= 0x08) goto yy195; - if (yych <= '\t') goto yy222; - if (yych <= '\n') goto yy174; - goto yy195; + if (yych <= 0x08) goto yy197; + if (yych <= '\t') goto yy224; + if (yych <= '\n') goto yy176; + goto yy197; } else { if (yych <= 0x1F) { - if (yych <= '\r') goto yy174; - goto yy195; + if (yych <= '\r') goto yy176; + goto yy197; } else { - if (yych <= ' ') goto yy222; - if (yych <= '!') goto yy195; + if (yych <= ' ') goto yy224; + if (yych <= '!') goto yy197; } } } else { if (yych <= ':') { if (yych <= '$') { - if (yych <= '#') goto yy195; - goto yy198; + if (yych <= '#') goto yy197; + goto yy200; } else { - if (yych == '\'') goto yy174; - goto yy195; + if (yych == '\'') goto yy176; + goto yy197; } } else { if (yych <= '[') { - if (yych <= ';') goto yy174; - goto yy195; + if (yych <= ';') goto yy176; + goto yy197; } else { - if (yych <= '\\') goto yy197; - if (yych <= ']') goto yy174; - goto yy195; + if (yych <= '\\') goto yy199; + if (yych <= ']') goto yy176; + goto yy197; } } } -yy224: - YYDEBUG(224, *YYCURSOR); +yy226: + YYDEBUG(226, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy179; + goto yy181; } /* *********************************** */ yyc_ST_VALUE: @@ -2794,27 +2832,27 @@ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, }; - YYDEBUG(225, *YYCURSOR); + YYDEBUG(227, *YYCURSOR); YYFILL(6); yych = *YYCURSOR; YYDEBUG(-1, yych); switch (yych) { - case 0x00: goto yy227; + case 0x00: goto yy229; case '\t': - case ' ': goto yy231; - case '\n': goto yy233; - case '\r': goto yy235; + case ' ': goto yy233; + case '\n': goto yy235; + case '\r': goto yy237; case '!': case '&': case '(': case ')': case '|': - case '~': goto yy236; - case '"': goto yy238; - case '$': goto yy240; - case '\'': goto yy241; - case '-': goto yy242; - case '.': goto yy243; + case '~': goto yy238; + case '"': goto yy240; + case '$': goto yy242; + case '\'': goto yy243; + case '-': goto yy244; + case '.': goto yy245; case '0': case '1': case '2': @@ -2824,9 +2862,9 @@ case '6': case '7': case '8': - case '9': goto yy244; - case ';': goto yy246; - case '=': goto yy247; + case '9': goto yy246; + case ';': goto yy248; + case '=': goto yy249; case 'A': case 'B': case 'C': @@ -2869,1529 +2907,1529 @@ case 'v': case 'w': case 'x': - case 'z': goto yy249; + case 'z': goto yy251; case 'F': - case 'f': goto yy251; + case 'f': goto yy253; case 'N': - case 'n': goto yy252; + case 'n': goto yy254; case 'O': - case 'o': goto yy253; + case 'o': goto yy255; case 'T': - case 't': goto yy254; + case 't': goto yy256; case 'Y': - case 'y': goto yy255; - default: goto yy229; + case 'y': goto yy257; + default: goto yy231; } -yy227: - YYDEBUG(227, *YYCURSOR); +yy229: + YYDEBUG(229, *YYCURSOR); ++YYCURSOR; -yy228: - YYDEBUG(228, *YYCURSOR); +yy230: + YYDEBUG(230, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 570 "Zend/zend_ini_scanner.l" +#line 591 "Zend/zend_ini_scanner.l" { /* End of option value (if EOF is reached before EOL */ BEGIN(INITIAL); return END_OF_LINE; } -#line 2897 "Zend/zend_ini_scanner.c" -yy229: - YYDEBUG(229, *YYCURSOR); +#line 2935 "Zend/zend_ini_scanner.c" +yy231: + YYDEBUG(231, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - goto yy257; -yy230: - YYDEBUG(230, *YYCURSOR); + goto yy259; +yy232: + YYDEBUG(232, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 489 "Zend/zend_ini_scanner.l" +#line 510 "Zend/zend_ini_scanner.l" { /* Get everything else as option/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } -#line 2910 "Zend/zend_ini_scanner.c" -yy231: - YYDEBUG(231, *YYCURSOR); +#line 2948 "Zend/zend_ini_scanner.c" +yy233: + YYDEBUG(233, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - goto yy307; -yy232: - YYDEBUG(232, *YYCURSOR); + goto yy309; +yy234: + YYDEBUG(234, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 543 "Zend/zend_ini_scanner.l" +#line 564 "Zend/zend_ini_scanner.l" { RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng); } -#line 2923 "Zend/zend_ini_scanner.c" -yy233: - YYDEBUG(233, *YYCURSOR); +#line 2961 "Zend/zend_ini_scanner.c" +yy235: + YYDEBUG(235, *YYCURSOR); ++YYCURSOR; -yy234: - YYDEBUG(234, *YYCURSOR); +yy236: + YYDEBUG(236, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 461 "Zend/zend_ini_scanner.l" +#line 482 "Zend/zend_ini_scanner.l" { /* End of option value */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 2936 "Zend/zend_ini_scanner.c" -yy235: - YYDEBUG(235, *YYCURSOR); +#line 2974 "Zend/zend_ini_scanner.c" +yy237: + YYDEBUG(237, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy305; - goto yy234; -yy236: - YYDEBUG(236, *YYCURSOR); + if (yych == '\n') goto yy307; + goto yy236; +yy238: + YYDEBUG(238, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy304; -yy237: - YYDEBUG(237, *YYCURSOR); + goto yy306; +yy239: + YYDEBUG(239, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 479 "Zend/zend_ini_scanner.l" +#line 500 "Zend/zend_ini_scanner.l" { /* Boolean operators */ return yytext[0]; } -#line 2954 "Zend/zend_ini_scanner.c" -yy238: - YYDEBUG(238, *YYCURSOR); +#line 2992 "Zend/zend_ini_scanner.c" +yy240: + YYDEBUG(240, *YYCURSOR); ++YYCURSOR; -yy239: - YYDEBUG(239, *YYCURSOR); +yy241: + YYDEBUG(241, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 497 "Zend/zend_ini_scanner.l" +#line 518 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; } -#line 2966 "Zend/zend_ini_scanner.c" -yy240: - YYDEBUG(240, *YYCURSOR); +#line 3004 "Zend/zend_ini_scanner.c" +yy242: + YYDEBUG(242, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy228; - if (yych <= '[') goto yy256; - goto yy263; + if (yych <= 0x00) goto yy230; + if (yych <= '[') goto yy258; + goto yy265; } else { - if (yych == '{') goto yy301; - goto yy256; + if (yych == '{') goto yy303; + goto yy258; } -yy241: - YYDEBUG(241, *YYCURSOR); +yy243: + YYDEBUG(243, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { - goto yy297; + goto yy299; } - goto yy228; -yy242: - YYDEBUG(242, *YYCURSOR); + goto yy230; +yy244: + YYDEBUG(244, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy257; - if (yych <= '9') goto yy295; - goto yy257; -yy243: - YYDEBUG(243, *YYCURSOR); + if (yych <= '/') goto yy259; + if (yych <= '9') goto yy297; + goto yy259; +yy245: + YYDEBUG(245, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy257; - if (yych <= '9') goto yy293; - goto yy257; -yy244: - YYDEBUG(244, *YYCURSOR); + if (yych <= '/') goto yy259; + if (yych <= '9') goto yy295; + goto yy259; +yy246: + YYDEBUG(246, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych >= 0x01) goto yy257; + if (yych >= 0x01) goto yy259; } else { - if (yych <= '\n') goto yy245; - if (yych <= '\f') goto yy257; + if (yych <= '\n') goto yy247; + if (yych <= '\f') goto yy259; } } else { if (yych <= '%') { - if (yych <= 0x1F) goto yy257; - if (yych >= '#') goto yy257; + if (yych <= 0x1F) goto yy259; + if (yych >= '#') goto yy259; } else { - if (yych <= ')') goto yy245; - if (yych <= '-') goto yy257; - goto yy289; + if (yych <= ')') goto yy247; + if (yych <= '-') goto yy259; + goto yy291; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '/') goto yy257; - goto yy291; + if (yych <= '/') goto yy259; + goto yy293; } else { - if (yych != ';') goto yy257; + if (yych != ';') goto yy259; } } else { if (yych <= '|') { - if (yych <= '=') goto yy245; - if (yych <= '{') goto yy257; + if (yych <= '=') goto yy247; + if (yych <= '{') goto yy259; } else { - if (yych != '~') goto yy257; + if (yych != '~') goto yy259; } } } -yy245: - YYDEBUG(245, *YYCURSOR); +yy247: + YYDEBUG(247, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 471 "Zend/zend_ini_scanner.l" +#line 492 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } -#line 3046 "Zend/zend_ini_scanner.c" -yy246: - YYDEBUG(246, *YYCURSOR); +#line 3084 "Zend/zend_ini_scanner.c" +yy248: + YYDEBUG(248, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - goto yy285; -yy247: - YYDEBUG(247, *YYCURSOR); + goto yy287; +yy249: + YYDEBUG(249, *YYCURSOR); ++YYCURSOR; - YYDEBUG(248, *YYCURSOR); + YYDEBUG(250, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 483 "Zend/zend_ini_scanner.l" +#line 504 "Zend/zend_ini_scanner.l" { /* Make = used in option value to trigger error */ yyless(0); BEGIN(INITIAL); return END_OF_LINE; } -#line 3063 "Zend/zend_ini_scanner.c" -yy249: - YYDEBUG(249, *YYCURSOR); +#line 3101 "Zend/zend_ini_scanner.c" +yy251: + YYDEBUG(251, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 4) { - goto yy258; + goto yy260; } if (yych <= ')') { if (yych <= '\f') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - if (yych >= '\v') goto yy257; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + if (yych >= '\v') goto yy259; } else { if (yych <= 0x1F) { - if (yych >= 0x0E) goto yy257; + if (yych >= 0x0E) goto yy259; } else { - if (yych <= '"') goto yy250; - if (yych <= '%') goto yy257; + if (yych <= '"') goto yy252; + if (yych <= '%') goto yy259; } } } else { if (yych <= '=') { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; } else { if (yych <= '|') { - if (yych <= '{') goto yy257; + if (yych <= '{') goto yy259; } else { - if (yych != '~') goto yy257; + if (yych != '~') goto yy259; } } } -yy250: - YYDEBUG(250, *YYCURSOR); +yy252: + YYDEBUG(252, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 467 "Zend/zend_ini_scanner.l" +#line 488 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } -#line 3103 "Zend/zend_ini_scanner.c" -yy251: - YYDEBUG(251, *YYCURSOR); +#line 3141 "Zend/zend_ini_scanner.c" +yy253: + YYDEBUG(253, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '<') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '/') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - goto yy257; - } else { - if (yych <= '9') goto yy258; - if (yych == ';') goto yy250; - goto yy257; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + goto yy259; + } else { + if (yych <= '9') goto yy260; + if (yych == ';') goto yy252; + goto yy259; } } } else { if (yych <= '`') { if (yych <= 'A') { - if (yych <= '=') goto yy250; - if (yych <= '@') goto yy257; - goto yy281; - } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= '=') goto yy252; + if (yych <= '@') goto yy259; + goto yy283; + } else { + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych <= 'a') goto yy281; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych <= 'a') goto yy283; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy252: - YYDEBUG(252, *YYCURSOR); +yy254: + YYDEBUG(254, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { if (yych <= '%') { if (yych <= '\f') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - if (yych <= '\n') goto yy250; - goto yy257; - } else { - if (yych <= '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - if (yych <= '"') goto yy250; - goto yy257; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + if (yych <= '\n') goto yy252; + goto yy259; + } else { + if (yych <= '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + if (yych <= '"') goto yy252; + goto yy259; } } else { if (yych <= ':') { - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - if (yych <= '9') goto yy258; - goto yy257; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + if (yych <= '9') goto yy260; + goto yy259; } else { if (yych <= '<') { - if (yych <= ';') goto yy250; - goto yy257; + if (yych <= ';') goto yy252; + goto yy259; } else { - if (yych <= '=') goto yy250; - if (yych <= '@') goto yy257; - goto yy258; + if (yych <= '=') goto yy252; + if (yych <= '@') goto yy259; + goto yy260; } } } } else { if (yych <= 'n') { if (yych <= 'Z') { - if (yych <= 'O') goto yy277; - if (yych == 'U') goto yy278; - goto yy258; + if (yych <= 'O') goto yy279; + if (yych == 'U') goto yy280; + goto yy260; } else { - if (yych == '_') goto yy258; - if (yych <= '`') goto yy257; - goto yy258; + if (yych == '_') goto yy260; + if (yych <= '`') goto yy259; + goto yy260; } } else { if (yych <= 'z') { - if (yych <= 'o') goto yy277; - if (yych == 'u') goto yy278; - goto yy258; + if (yych <= 'o') goto yy279; + if (yych == 'u') goto yy280; + goto yy260; } else { if (yych <= '|') { - if (yych <= '{') goto yy257; - goto yy250; + if (yych <= '{') goto yy259; + goto yy252; } else { - if (yych == '~') goto yy250; - goto yy257; + if (yych == '~') goto yy252; + goto yy259; } } } } -yy253: - YYDEBUG(253, *YYCURSOR); +yy255: + YYDEBUG(255, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'E') { if (yych <= '%') { if (yych <= '\f') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - if (yych <= '\n') goto yy250; - goto yy257; - } else { - if (yych <= '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - if (yych <= '"') goto yy250; - goto yy257; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + if (yych <= '\n') goto yy252; + goto yy259; + } else { + if (yych <= '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + if (yych <= '"') goto yy252; + goto yy259; } } else { if (yych <= ':') { - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - if (yych <= '9') goto yy258; - goto yy257; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + if (yych <= '9') goto yy260; + goto yy259; } else { if (yych <= '<') { - if (yych <= ';') goto yy250; - goto yy257; + if (yych <= ';') goto yy252; + goto yy259; } else { - if (yych <= '=') goto yy250; - if (yych <= '@') goto yy257; - goto yy258; + if (yych <= '=') goto yy252; + if (yych <= '@') goto yy259; + goto yy260; } } } } else { if (yych <= 'e') { if (yych <= 'Z') { - if (yych <= 'F') goto yy272; - if (yych == 'N') goto yy266; - goto yy258; + if (yych <= 'F') goto yy274; + if (yych == 'N') goto yy268; + goto yy260; } else { - if (yych == '_') goto yy258; - if (yych <= '`') goto yy257; - goto yy258; + if (yych == '_') goto yy260; + if (yych <= '`') goto yy259; + goto yy260; } } else { if (yych <= 'z') { - if (yych <= 'f') goto yy272; - if (yych == 'n') goto yy266; - goto yy258; + if (yych <= 'f') goto yy274; + if (yych == 'n') goto yy268; + goto yy260; } else { if (yych <= '|') { - if (yych <= '{') goto yy257; - goto yy250; + if (yych <= '{') goto yy259; + goto yy252; } else { - if (yych == '~') goto yy250; - goto yy257; + if (yych == '~') goto yy252; + goto yy259; } } } } -yy254: - YYDEBUG(254, *YYCURSOR); +yy256: + YYDEBUG(256, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'R') { - if (yych <= '@') goto yy257; - if (yych <= 'Q') goto yy258; - goto yy270; - } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= '@') goto yy259; + if (yych <= 'Q') goto yy260; + goto yy272; + } else { + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'r') goto yy270; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 'r') goto yy272; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy255: - YYDEBUG(255, *YYCURSOR); +yy257: + YYDEBUG(257, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy257; - if (yych <= 'D') goto yy258; - goto yy260; - } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= '@') goto yy259; + if (yych <= 'D') goto yy260; + goto yy262; + } else { + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'e') goto yy260; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 'e') goto yy262; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy256: - YYDEBUG(256, *YYCURSOR); +yy258: + YYDEBUG(258, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy257: - YYDEBUG(257, *YYCURSOR); +yy259: + YYDEBUG(259, *YYCURSOR); if (yybm[0+yych] & 2) { - goto yy256; + goto yy258; } - if (yych == '$') goto yy261; - goto yy230; -yy258: - YYDEBUG(258, *YYCURSOR); + if (yych == '$') goto yy263; + goto yy232; +yy260: + YYDEBUG(260, *YYCURSOR); yyaccept = 4; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(259, *YYCURSOR); + YYDEBUG(261, *YYCURSOR); if (yybm[0+yych] & 4) { - goto yy258; + goto yy260; } if (yych <= '%') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy250; - goto yy256; + if (yych <= 0x00) goto yy252; + goto yy258; } else { - if (yych <= '\n') goto yy250; - if (yych <= '\f') goto yy256; - goto yy250; + if (yych <= '\n') goto yy252; + if (yych <= '\f') goto yy258; + goto yy252; } } else { if (yych <= '"') { - if (yych <= 0x1F) goto yy256; - goto yy250; + if (yych <= 0x1F) goto yy258; + goto yy252; } else { - if (yych == '$') goto yy261; - goto yy256; + if (yych == '$') goto yy263; + goto yy258; } } } else { if (yych <= '=') { if (yych <= ':') { - if (yych <= ')') goto yy250; - goto yy256; + if (yych <= ')') goto yy252; + goto yy258; } else { - if (yych == '<') goto yy256; - goto yy250; + if (yych == '<') goto yy258; + goto yy252; } } else { if (yych <= '|') { - if (yych <= '{') goto yy256; - goto yy250; + if (yych <= '{') goto yy258; + goto yy252; } else { - if (yych == '~') goto yy250; - goto yy256; + if (yych == '~') goto yy252; + goto yy258; } } } -yy260: - YYDEBUG(260, *YYCURSOR); +yy262: + YYDEBUG(262, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'S') { - if (yych <= '@') goto yy257; - if (yych <= 'R') goto yy258; - goto yy266; - } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= '@') goto yy259; + if (yych <= 'R') goto yy260; + goto yy268; + } else { + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 's') goto yy266; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 's') goto yy268; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy261: - YYDEBUG(261, *YYCURSOR); +yy263: + YYDEBUG(263, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy262; - if (yych <= '[') goto yy256; - goto yy263; + if (yych <= 0x00) goto yy264; + if (yych <= '[') goto yy258; + goto yy265; } else { - if (yych != '{') goto yy256; + if (yych != '{') goto yy258; } -yy262: - YYDEBUG(262, *YYCURSOR); +yy264: + YYDEBUG(264, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 3) { if (yyaccept <= 1) { if (yyaccept <= 0) { - goto yy230; - } else { goto yy232; + } else { + goto yy234; } } else { if (yyaccept <= 2) { - goto yy228; + goto yy230; } else { - goto yy245; + goto yy247; } } } else { if (yyaccept <= 5) { if (yyaccept <= 4) { - goto yy250; + goto yy252; } else { - goto yy267; + goto yy269; } } else { - goto yy274; + goto yy276; } } -yy263: - YYDEBUG(263, *YYCURSOR); +yy265: + YYDEBUG(265, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 8) { - goto yy264; + goto yy266; } - goto yy256; -yy264: - YYDEBUG(264, *YYCURSOR); + goto yy258; +yy266: + YYDEBUG(266, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(265, *YYCURSOR); + YYDEBUG(267, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy264; + goto yy266; } - if (yych <= 0x00) goto yy230; - if (yych == '\\') goto yy263; - goto yy256; -yy266: - YYDEBUG(266, *YYCURSOR); + if (yych <= 0x00) goto yy232; + if (yych == '\\') goto yy265; + goto yy258; +yy268: + YYDEBUG(268, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { - goto yy268; + goto yy270; } if (yych <= ';') { if (yych <= ' ') { if (yych <= '\n') { - if (yych <= 0x00) goto yy267; - if (yych <= '\t') goto yy257; + if (yych <= 0x00) goto yy269; + if (yych <= '\t') goto yy259; } else { - if (yych != '\r') goto yy257; + if (yych != '\r') goto yy259; } } else { if (yych <= ')') { - if (yych <= '"') goto yy267; - if (yych <= '%') goto yy257; + if (yych <= '"') goto yy269; + if (yych <= '%') goto yy259; } else { - if (yych <= '/') goto yy257; - if (yych <= '9') goto yy258; - if (yych <= ':') goto yy257; + if (yych <= '/') goto yy259; + if (yych <= '9') goto yy260; + if (yych <= ':') goto yy259; } } } else { if (yych <= '_') { if (yych <= '@') { - if (yych != '=') goto yy257; + if (yych != '=') goto yy259; } else { - if (yych <= 'Z') goto yy258; - if (yych <= '^') goto yy257; - goto yy258; + if (yych <= 'Z') goto yy260; + if (yych <= '^') goto yy259; + goto yy260; } } else { if (yych <= '{') { - if (yych <= '`') goto yy257; - if (yych <= 'z') goto yy258; - goto yy257; + if (yych <= '`') goto yy259; + if (yych <= 'z') goto yy260; + goto yy259; } else { - if (yych == '}') goto yy257; - if (yych >= 0x7F) goto yy257; + if (yych == '}') goto yy259; + if (yych >= 0x7F) goto yy259; } } } -yy267: - YYDEBUG(267, *YYCURSOR); +yy269: + YYDEBUG(269, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 421 "Zend/zend_ini_scanner.l" { /* TRUE value (when used outside option value/offset this causes parse error!) */ RETURN_TOKEN(BOOL_TRUE, "1", 1); } -#line 3599 "Zend/zend_ini_scanner.c" -yy268: - YYDEBUG(268, *YYCURSOR); +#line 3637 "Zend/zend_ini_scanner.c" +yy270: + YYDEBUG(270, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(269, *YYCURSOR); + YYDEBUG(271, *YYCURSOR); if (yybm[0+yych] & 16) { - goto yy268; + goto yy270; } - goto yy267; -yy270: - YYDEBUG(270, *YYCURSOR); + goto yy269; +yy272: + YYDEBUG(272, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'U') { - if (yych <= '@') goto yy257; - if (yych <= 'T') goto yy258; + if (yych <= '@') goto yy259; + if (yych <= 'T') goto yy260; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'u') goto yy271; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 'u') goto yy273; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy271: - YYDEBUG(271, *YYCURSOR); +yy273: + YYDEBUG(273, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy257; - if (yych <= 'D') goto yy258; - goto yy266; - } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= '@') goto yy259; + if (yych <= 'D') goto yy260; + goto yy268; + } else { + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'e') goto yy266; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 'e') goto yy268; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy272: - YYDEBUG(272, *YYCURSOR); +yy274: + YYDEBUG(274, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'F') { - if (yych <= '@') goto yy257; - if (yych <= 'E') goto yy258; + if (yych <= '@') goto yy259; + if (yych <= 'E') goto yy260; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'f') goto yy273; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 'f') goto yy275; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy273: - YYDEBUG(273, *YYCURSOR); +yy275: + YYDEBUG(275, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 4) { - goto yy258; + goto yy260; } if (yych <= '%') { if (yych <= '\f') { if (yych <= 0x08) { - if (yych >= 0x01) goto yy257; + if (yych >= 0x01) goto yy259; } else { - if (yych <= '\t') goto yy275; - if (yych >= '\v') goto yy257; + if (yych <= '\t') goto yy277; + if (yych >= '\v') goto yy259; } } else { if (yych <= 0x1F) { - if (yych >= 0x0E) goto yy257; + if (yych >= 0x0E) goto yy259; } else { - if (yych <= ' ') goto yy275; - if (yych >= '#') goto yy257; + if (yych <= ' ') goto yy277; + if (yych >= '#') goto yy259; } } } else { if (yych <= '=') { if (yych <= ':') { - if (yych >= '*') goto yy257; + if (yych >= '*') goto yy259; } else { - if (yych == '<') goto yy257; + if (yych == '<') goto yy259; } } else { if (yych <= '|') { - if (yych <= '{') goto yy257; + if (yych <= '{') goto yy259; } else { - if (yych != '~') goto yy257; + if (yych != '~') goto yy259; } } } -yy274: - YYDEBUG(274, *YYCURSOR); +yy276: + YYDEBUG(276, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 425 "Zend/zend_ini_scanner.l" { /* FALSE value (when used outside option value/offset this causes parse error!)*/ RETURN_TOKEN(BOOL_FALSE, "", 0); } -#line 3803 "Zend/zend_ini_scanner.c" -yy275: - YYDEBUG(275, *YYCURSOR); +#line 3841 "Zend/zend_ini_scanner.c" +yy277: + YYDEBUG(277, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(276, *YYCURSOR); - if (yych == '\t') goto yy275; - if (yych == ' ') goto yy275; - goto yy274; -yy277: - YYDEBUG(277, *YYCURSOR); + YYDEBUG(278, *YYCURSOR); + if (yych == '\t') goto yy277; + if (yych == ' ') goto yy277; + goto yy276; +yy279: + YYDEBUG(279, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '<') { if (yych <= ' ') { if (yych <= '\n') { - if (yych <= 0x00) goto yy274; - if (yych <= 0x08) goto yy257; - if (yych <= '\t') goto yy275; - goto yy274; - } else { - if (yych == '\r') goto yy274; - if (yych <= 0x1F) goto yy257; - goto yy275; + if (yych <= 0x00) goto yy276; + if (yych <= 0x08) goto yy259; + if (yych <= '\t') goto yy277; + goto yy276; + } else { + if (yych == '\r') goto yy276; + if (yych <= 0x1F) goto yy259; + goto yy277; } } else { if (yych <= '/') { - if (yych <= '"') goto yy274; - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy274; - goto yy257; - } else { - if (yych <= '9') goto yy258; - if (yych == ';') goto yy274; - goto yy257; + if (yych <= '"') goto yy276; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy276; + goto yy259; + } else { + if (yych <= '9') goto yy260; + if (yych == ';') goto yy276; + goto yy259; } } } else { if (yych <= '`') { if (yych <= 'N') { - if (yych <= '=') goto yy274; - if (yych <= '@') goto yy257; - if (yych <= 'M') goto yy258; - goto yy280; - } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= '=') goto yy276; + if (yych <= '@') goto yy259; + if (yych <= 'M') goto yy260; + goto yy282; + } else { + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'n') goto yy280; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy274; - goto yy257; + if (yych == 'n') goto yy282; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy276; + goto yy259; } } } -yy278: - YYDEBUG(278, *YYCURSOR); +yy280: + YYDEBUG(280, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'L') { - if (yych <= '@') goto yy257; - if (yych <= 'K') goto yy258; + if (yych <= '@') goto yy259; + if (yych <= 'K') goto yy260; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'l') goto yy279; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 'l') goto yy281; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy279: - YYDEBUG(279, *YYCURSOR); +yy281: + YYDEBUG(281, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'L') { - if (yych <= '@') goto yy257; - if (yych <= 'K') goto yy258; - goto yy273; - } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= '@') goto yy259; + if (yych <= 'K') goto yy260; + goto yy275; + } else { + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'l') goto yy273; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 'l') goto yy275; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy280: - YYDEBUG(280, *YYCURSOR); +yy282: + YYDEBUG(282, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy257; - if (yych <= 'D') goto yy258; - goto yy273; - } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= '@') goto yy259; + if (yych <= 'D') goto yy260; + goto yy275; + } else { + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'e') goto yy273; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 'e') goto yy275; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy281: - YYDEBUG(281, *YYCURSOR); +yy283: + YYDEBUG(283, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'L') { - if (yych <= '@') goto yy257; - if (yych <= 'K') goto yy258; + if (yych <= '@') goto yy259; + if (yych <= 'K') goto yy260; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'l') goto yy282; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 'l') goto yy284; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy282: - YYDEBUG(282, *YYCURSOR); +yy284: + YYDEBUG(284, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'S') { - if (yych <= '@') goto yy257; - if (yych <= 'R') goto yy258; + if (yych <= '@') goto yy259; + if (yych <= 'R') goto yy260; } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 's') goto yy283; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 's') goto yy285; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy283: - YYDEBUG(283, *YYCURSOR); +yy285: + YYDEBUG(285, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy250; - if (yych <= 0x08) goto yy257; - goto yy250; - } else { - if (yych == '\r') goto yy250; - if (yych <= 0x1F) goto yy257; - goto yy250; + if (yych <= 0x00) goto yy252; + if (yych <= 0x08) goto yy259; + goto yy252; + } else { + if (yych == '\r') goto yy252; + if (yych <= 0x1F) goto yy259; + goto yy252; } } else { if (yych <= '9') { - if (yych <= '%') goto yy257; - if (yych <= ')') goto yy250; - if (yych <= '/') goto yy257; - goto yy258; + if (yych <= '%') goto yy259; + if (yych <= ')') goto yy252; + if (yych <= '/') goto yy259; + goto yy260; } else { - if (yych == ';') goto yy250; - if (yych <= '<') goto yy257; - goto yy250; + if (yych == ';') goto yy252; + if (yych <= '<') goto yy259; + goto yy252; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy257; - if (yych <= 'D') goto yy258; - goto yy273; - } else { - if (yych <= 'Z') goto yy258; - if (yych == '_') goto yy258; - goto yy257; + if (yych <= '@') goto yy259; + if (yych <= 'D') goto yy260; + goto yy275; + } else { + if (yych <= 'Z') goto yy260; + if (yych == '_') goto yy260; + goto yy259; } } else { if (yych <= '{') { - if (yych == 'e') goto yy273; - if (yych <= 'z') goto yy258; - goto yy257; - } else { - if (yych == '}') goto yy257; - if (yych <= '~') goto yy250; - goto yy257; + if (yych == 'e') goto yy275; + if (yych <= 'z') goto yy260; + goto yy259; + } else { + if (yych == '}') goto yy259; + if (yych <= '~') goto yy252; + goto yy259; } } } -yy284: - YYDEBUG(284, *YYCURSOR); +yy286: + YYDEBUG(286, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy285: - YYDEBUG(285, *YYCURSOR); +yy287: + YYDEBUG(287, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy284; + goto yy286; } - if (yych >= '\r') goto yy288; -yy286: - YYDEBUG(286, *YYCURSOR); + if (yych >= '\r') goto yy290; +yy288: + YYDEBUG(288, *YYCURSOR); ++YYCURSOR; -yy287: - YYDEBUG(287, *YYCURSOR); +yy289: + YYDEBUG(289, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 557 "Zend/zend_ini_scanner.l" +#line 578 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 4185 "Zend/zend_ini_scanner.c" -yy288: - YYDEBUG(288, *YYCURSOR); +#line 4223 "Zend/zend_ini_scanner.c" +yy290: + YYDEBUG(290, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy286; - goto yy287; -yy289: - YYDEBUG(289, *YYCURSOR); + if (yych == '\n') goto yy288; + goto yy289; +yy291: + YYDEBUG(291, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(290, *YYCURSOR); + YYDEBUG(292, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy289; + goto yy291; } if (yych <= '%') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy245; - goto yy256; + if (yych <= 0x00) goto yy247; + goto yy258; } else { - if (yych <= '\n') goto yy245; - if (yych <= '\f') goto yy256; - goto yy245; + if (yych <= '\n') goto yy247; + if (yych <= '\f') goto yy258; + goto yy247; } } else { if (yych <= '"') { - if (yych <= 0x1F) goto yy256; - goto yy245; + if (yych <= 0x1F) goto yy258; + goto yy247; } else { - if (yych == '$') goto yy261; - goto yy256; + if (yych == '$') goto yy263; + goto yy258; } } } else { if (yych <= '=') { if (yych <= ':') { - if (yych <= ')') goto yy245; - goto yy256; + if (yych <= ')') goto yy247; + goto yy258; } else { - if (yych == '<') goto yy256; - goto yy245; + if (yych == '<') goto yy258; + goto yy247; } } else { if (yych <= '|') { - if (yych <= '{') goto yy256; - goto yy245; + if (yych <= '{') goto yy258; + goto yy247; } else { - if (yych == '~') goto yy245; - goto yy256; + if (yych == '~') goto yy247; + goto yy258; } } } -yy291: - YYDEBUG(291, *YYCURSOR); +yy293: + YYDEBUG(293, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(292, *YYCURSOR); + YYDEBUG(294, *YYCURSOR); if (yych <= '-') { if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy256; - goto yy245; + if (yych <= 0x00) goto yy247; + if (yych <= 0x08) goto yy258; + goto yy247; } else { - if (yych == '\r') goto yy245; - goto yy256; + if (yych == '\r') goto yy247; + goto yy258; } } else { if (yych <= '$') { - if (yych <= '"') goto yy245; - if (yych <= '#') goto yy256; - goto yy261; - } else { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy245; - goto yy256; + if (yych <= '"') goto yy247; + if (yych <= '#') goto yy258; + goto yy263; + } else { + if (yych <= '%') goto yy258; + if (yych <= ')') goto yy247; + goto yy258; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '.') goto yy289; - if (yych <= '/') goto yy256; - goto yy291; + if (yych <= '.') goto yy291; + if (yych <= '/') goto yy258; + goto yy293; } else { - if (yych == ';') goto yy245; - goto yy256; + if (yych == ';') goto yy247; + goto yy258; } } else { if (yych <= '|') { - if (yych <= '=') goto yy245; - if (yych <= '{') goto yy256; - goto yy245; + if (yych <= '=') goto yy247; + if (yych <= '{') goto yy258; + goto yy247; } else { - if (yych == '~') goto yy245; - goto yy256; + if (yych == '~') goto yy247; + goto yy258; } } } -yy293: - YYDEBUG(293, *YYCURSOR); +yy295: + YYDEBUG(295, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(294, *YYCURSOR); + YYDEBUG(296, *YYCURSOR); if (yych <= ')') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy245; - goto yy256; + if (yych <= 0x00) goto yy247; + goto yy258; } else { - if (yych <= '\n') goto yy245; - if (yych <= '\f') goto yy256; - goto yy245; + if (yych <= '\n') goto yy247; + if (yych <= '\f') goto yy258; + goto yy247; } } else { if (yych <= '#') { - if (yych <= 0x1F) goto yy256; - if (yych <= '"') goto yy245; - goto yy256; - } else { - if (yych <= '$') goto yy261; - if (yych <= '%') goto yy256; - goto yy245; + if (yych <= 0x1F) goto yy258; + if (yych <= '"') goto yy247; + goto yy258; + } else { + if (yych <= '$') goto yy263; + if (yych <= '%') goto yy258; + goto yy247; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '/') goto yy256; - goto yy293; + if (yych <= '/') goto yy258; + goto yy295; } else { - if (yych == ';') goto yy245; - goto yy256; + if (yych == ';') goto yy247; + goto yy258; } } else { if (yych <= '|') { - if (yych <= '=') goto yy245; - if (yych <= '{') goto yy256; - goto yy245; + if (yych <= '=') goto yy247; + if (yych <= '{') goto yy258; + goto yy247; } else { - if (yych == '~') goto yy245; - goto yy256; + if (yych == '~') goto yy247; + goto yy258; } } } -yy295: - YYDEBUG(295, *YYCURSOR); +yy297: + YYDEBUG(297, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(296, *YYCURSOR); + YYDEBUG(298, *YYCURSOR); if (yych <= ')') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy245; - goto yy256; + if (yych <= 0x00) goto yy247; + goto yy258; } else { - if (yych <= '\n') goto yy245; - if (yych <= '\f') goto yy256; - goto yy245; + if (yych <= '\n') goto yy247; + if (yych <= '\f') goto yy258; + goto yy247; } } else { if (yych <= '#') { - if (yych <= 0x1F) goto yy256; - if (yych <= '"') goto yy245; - goto yy256; - } else { - if (yych <= '$') goto yy261; - if (yych <= '%') goto yy256; - goto yy245; + if (yych <= 0x1F) goto yy258; + if (yych <= '"') goto yy247; + goto yy258; + } else { + if (yych <= '$') goto yy263; + if (yych <= '%') goto yy258; + goto yy247; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '/') goto yy256; - goto yy295; + if (yych <= '/') goto yy258; + goto yy297; } else { - if (yych == ';') goto yy245; - goto yy256; + if (yych == ';') goto yy247; + goto yy258; } } else { if (yych <= '|') { - if (yych <= '=') goto yy245; - if (yych <= '{') goto yy256; - goto yy245; + if (yych <= '=') goto yy247; + if (yych <= '{') goto yy258; + goto yy247; } else { - if (yych == '~') goto yy245; - goto yy256; + if (yych == '~') goto yy247; + goto yy258; } } } -yy297: - YYDEBUG(297, *YYCURSOR); +yy299: + YYDEBUG(299, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(298, *YYCURSOR); + YYDEBUG(300, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy297; + goto yy299; } - YYDEBUG(299, *YYCURSOR); + YYDEBUG(301, *YYCURSOR); ++YYCURSOR; - YYDEBUG(300, *YYCURSOR); + YYDEBUG(302, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 368 "Zend/zend_ini_scanner.l" { /* Raw string */ @@ -4402,66 +4440,66 @@ } RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 4406 "Zend/zend_ini_scanner.c" -yy301: - YYDEBUG(301, *YYCURSOR); +#line 4444 "Zend/zend_ini_scanner.c" +yy303: + YYDEBUG(303, *YYCURSOR); ++YYCURSOR; - YYDEBUG(302, *YYCURSOR); + YYDEBUG(304, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 401 "Zend/zend_ini_scanner.l" { /* Variable start */ yy_push_state(ST_VARNAME TSRMLS_CC); return TC_DOLLAR_CURLY; } -#line 4417 "Zend/zend_ini_scanner.c" -yy303: - YYDEBUG(303, *YYCURSOR); +#line 4455 "Zend/zend_ini_scanner.c" +yy305: + YYDEBUG(305, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy304: - YYDEBUG(304, *YYCURSOR); - if (yych == '\t') goto yy303; - if (yych == ' ') goto yy303; - goto yy237; -yy305: - YYDEBUG(305, *YYCURSOR); - yych = *++YYCURSOR; - goto yy234; yy306: YYDEBUG(306, *YYCURSOR); + if (yych == '\t') goto yy305; + if (yych == ' ') goto yy305; + goto yy239; +yy307: + YYDEBUG(307, *YYCURSOR); + yych = *++YYCURSOR; + goto yy236; +yy308: + YYDEBUG(308, *YYCURSOR); yyaccept = 1; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy307: - YYDEBUG(307, *YYCURSOR); +yy309: + YYDEBUG(309, *YYCURSOR); if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x08) goto yy232; - if (yych <= '\t') goto yy306; - goto yy305; + if (yych <= 0x08) goto yy234; + if (yych <= '\t') goto yy308; + goto yy307; } else { - if (yych == '\r') goto yy309; - goto yy232; + if (yych == '\r') goto yy311; + goto yy234; } } else { if (yych <= '"') { - if (yych <= ' ') goto yy306; - if (yych <= '!') goto yy232; + if (yych <= ' ') goto yy308; + if (yych <= '!') goto yy234; } else { - if (yych == ';') goto yy284; - goto yy232; + if (yych == ';') goto yy286; + goto yy234; } } - YYDEBUG(308, *YYCURSOR); + YYDEBUG(310, *YYCURSOR); yych = *++YYCURSOR; - goto yy239; -yy309: - YYDEBUG(309, *YYCURSOR); + goto yy241; +yy311: + YYDEBUG(311, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy305; - goto yy234; + if ((yych = *YYCURSOR) == '\n') goto yy307; + goto yy236; } /* *********************************** */ yyc_ST_VARNAME: @@ -4500,47 +4538,47 @@ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(310, *YYCURSOR); + YYDEBUG(312, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '\'') { if (yych <= ' ') { if (yych <= '\n') { - if (yych >= '\t') goto yy314; + if (yych >= '\t') goto yy316; } else { - if (yych == '\r') goto yy314; + if (yych == '\r') goto yy316; } } else { if (yych <= '$') { - if (yych != '#') goto yy314; + if (yych != '#') goto yy316; } else { - if (yych == '&') goto yy314; + if (yych == '&') goto yy316; } } } else { if (yych <= 'Z') { if (yych <= ';') { - if (yych <= ')') goto yy314; - if (yych >= ';') goto yy314; + if (yych <= ')') goto yy316; + if (yych >= ';') goto yy316; } else { - if (yych == '=') goto yy314; + if (yych == '=') goto yy316; } } else { if (yych <= '|') { - if (yych <= '[') goto yy314; - if (yych >= '{') goto yy314; + if (yych <= '[') goto yy316; + if (yych >= '{') goto yy316; } else { - if (yych <= '}') goto yy316; - if (yych <= '~') goto yy314; + if (yych <= '}') goto yy318; + if (yych <= '~') goto yy316; } } } - YYDEBUG(312, *YYCURSOR); + YYDEBUG(314, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy319; -yy313: - YYDEBUG(313, *YYCURSOR); + goto yy321; +yy315: + YYDEBUG(315, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 406 "Zend/zend_ini_scanner.l" { /* Variable name */ @@ -4552,41 +4590,41 @@ RETURN_TOKEN(TC_VARNAME, yytext, yyleng); } -#line 4556 "Zend/zend_ini_scanner.c" -yy314: - YYDEBUG(314, *YYCURSOR); +#line 4594 "Zend/zend_ini_scanner.c" +yy316: + YYDEBUG(316, *YYCURSOR); ++YYCURSOR; - YYDEBUG(315, *YYCURSOR); + YYDEBUG(317, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" +#line 596 "Zend/zend_ini_scanner.l" { return 0; } -#line 4566 "Zend/zend_ini_scanner.c" -yy316: - YYDEBUG(316, *YYCURSOR); +#line 4604 "Zend/zend_ini_scanner.c" +yy318: + YYDEBUG(318, *YYCURSOR); ++YYCURSOR; - YYDEBUG(317, *YYCURSOR); + YYDEBUG(319, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 416 "Zend/zend_ini_scanner.l" { /* Variable end */ yy_pop_state(TSRMLS_C); return '}'; } -#line 4577 "Zend/zend_ini_scanner.c" -yy318: - YYDEBUG(318, *YYCURSOR); +#line 4615 "Zend/zend_ini_scanner.c" +yy320: + YYDEBUG(320, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy319: - YYDEBUG(319, *YYCURSOR); +yy321: + YYDEBUG(321, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy318; + goto yy320; } - goto yy313; + goto yy315; } } -#line 579 "Zend/zend_ini_scanner.l" +#line 600 "Zend/zend_ini_scanner.l" } diff -Nru php5-5.4.4/Zend/zend_ini_scanner.l php5-5.4.9/Zend/zend_ini_scanner.l --- php5-5.4.4/Zend/zend_ini_scanner.l 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_ini_scanner.l 2012-11-21 05:12:20.000000000 +0000 @@ -347,7 +347,7 @@ SECTION_RAW_CHARS [^\]\n\r] SINGLE_QUOTED_CHARS [^'] -RAW_VALUE_CHARS [^\n\r;\000] +RAW_VALUE_CHARS [^"\n\r;\000] LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR}))) VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR}) @@ -445,12 +445,33 @@ return '='; } -{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ - /* Eat leading and trailing double quotes */ - if (yytext[0] == '"' && yytext[yyleng - 1] == '"') { - SCNG(yy_text)++; - yyleng = yyleng - 2; +["] { + while (YYCURSOR < YYLIMIT) { + switch (*YYCURSOR++) { + case '\n': + SCNG(lineno)++; + break; + case '\r': + if (*YYCURSOR != '\n') { + SCNG(lineno)++; + } + break; + case '"': + yyleng = YYCURSOR - SCNG(yy_text) - 2; + SCNG(yy_text)++; + RETURN_TOKEN(TC_RAW, yytext, yyleng); + case '\\': + if (YYCURSOR < YYLIMIT) { + YYCURSOR++; + } + break; + } } + yyleng = YYCURSOR - SCNG(yy_text); + RETURN_TOKEN(TC_RAW, yytext, yyleng); +} + +{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ RETURN_TOKEN(TC_RAW, yytext, yyleng); } diff -Nru php5-5.4.4/Zend/zend_ini_scanner_defs.h php5-5.4.9/Zend/zend_ini_scanner_defs.h --- php5-5.4.4/Zend/zend_ini_scanner_defs.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_ini_scanner_defs.h 2012-11-21 05:12:20.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Fri Mar 2 11:49:21 2012 */ +/* Generated by re2c 0.13.5 on Thu Jun 7 17:48:25 2012 */ #line 3 "Zend/zend_ini_scanner_defs.h" enum YYCONDTYPE { diff -Nru php5-5.4.4/Zend/zend_language_parser.c php5-5.4.9/Zend/zend_language_parser.c --- php5-5.4.4/Zend/zend_language_parser.c 2012-06-13 06:08:08.000000000 +0000 +++ php5-5.4.9/Zend/zend_language_parser.c 2012-11-21 05:53:10.000000000 +0000 @@ -6041,7 +6041,7 @@ if (LANG_SCNG(yy_text)[0] == 0 && LANG_SCNG(yy_leng) == 1 && - memcmp(yystr, ZEND_STRL("\"end of file\"")) == 0) { + memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) { yystpcpy(yyres, "end of file"); return sizeof("end of file")-1; } diff -Nru php5-5.4.4/Zend/zend_language_parser.y php5-5.4.9/Zend/zend_language_parser.y --- php5-5.4.4/Zend/zend_language_parser.y 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_language_parser.y 2012-11-21 05:12:20.000000000 +0000 @@ -1191,7 +1191,7 @@ if (LANG_SCNG(yy_text)[0] == 0 && LANG_SCNG(yy_leng) == 1 && - memcmp(yystr, ZEND_STRL("\"end of file\"")) == 0) { + memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) { yystpcpy(yyres, "end of file"); return sizeof("end of file")-1; } diff -Nru php5-5.4.4/Zend/zend_multibyte.c php5-5.4.9/Zend/zend_multibyte.c --- php5-5.4.4/Zend/zend_multibyte.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_multibyte.c 2012-11-21 05:12:20.000000000 +0000 @@ -168,7 +168,7 @@ ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size TSRMLS_DC) { if (CG(script_encoding_list)) { - efree(CG(script_encoding_list)); + free(CG(script_encoding_list)); } CG(script_encoding_list) = encoding_list; CG(script_encoding_list_size) = encoding_list_size; diff -Nru php5-5.4.4/Zend/zend_object_handlers.c php5-5.4.9/Zend/zend_object_handlers.c --- php5-5.4.4/Zend/zend_object_handlers.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_object_handlers.c 2012-11-21 05:12:20.000000000 +0000 @@ -1490,6 +1490,7 @@ if (retval) { zval_ptr_dtor(&retval); } + EG(exception) = NULL; zend_error_noreturn(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name); return FAILURE; } diff -Nru php5-5.4.4/Zend/zend_opcode.c php5-5.4.9/Zend/zend_opcode.c --- php5-5.4.4/Zend/zend_opcode.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_opcode.c 2012-11-21 05:12:20.000000000 +0000 @@ -215,6 +215,12 @@ void _destroy_zend_class_traits_info(zend_class_entry *ce) { if (ce->num_traits > 0 && ce->traits) { + size_t i; + for (i = 0; i < ce->num_traits; i++) { + if (ce->traits[i]) { + destroy_zend_class(&ce->traits[i]); + } + } efree(ce->traits); } @@ -261,6 +267,15 @@ } } +static int zend_clear_trait_method_name(zend_op_array *op_array TSRMLS_DC) +{ + if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) { + efree(op_array->function_name); + op_array->function_name = NULL; + } + return 0; +} + ZEND_API void destroy_zend_class(zend_class_entry **pce) { zend_class_entry *ce = *pce; @@ -292,6 +307,10 @@ } zend_hash_destroy(&ce->properties_info); str_efree(ce->name); + if ((ce->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { + TSRMLS_FETCH(); + zend_hash_apply(&ce->function_table, (apply_func_t)zend_clear_trait_method_name TSRMLS_CC); + } zend_hash_destroy(&ce->function_table); zend_hash_destroy(&ce->constants_table); if (ce->num_interfaces > 0 && ce->interfaces) { @@ -381,7 +400,7 @@ } efree(op_array->opcodes); - if (op_array->function_name) { + if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) { efree((char*)op_array->function_name); } if (op_array->doc_comment) { diff -Nru php5-5.4.4/Zend/zend_operators.c php5-5.4.9/Zend/zend_operators.c --- php5-5.4.4/Zend/zend_operators.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_operators.c 2012-11-21 05:12:20.000000000 +0000 @@ -1519,6 +1519,9 @@ ret = compare_function(result, op1, op_free TSRMLS_CC); zend_free_obj_get_result(op_free TSRMLS_CC); return ret; + } else if (Z_TYPE_P(op1) == IS_OBJECT) { + ZVAL_LONG(result, 1); + return SUCCESS; } } if (!converted) { @@ -1605,7 +1608,8 @@ && (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)))); break; case IS_ARRAY: - Z_LVAL_P(result) = zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0; + Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) || + zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0); break; case IS_OBJECT: if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) { @@ -2097,13 +2101,13 @@ ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */ { - return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); + return ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); } /* }}} */ ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */ { - ZVAL_LONG(result, zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC)); + ZVAL_LONG(result, ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC)); } /* }}} */ diff -Nru php5-5.4.4/Zend/zend_stream.c php5-5.4.9/Zend/zend_stream.c --- php5-5.4.4/Zend/zend_stream.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_stream.c 2012-11-21 05:12:20.000000000 +0000 @@ -79,7 +79,7 @@ static void zend_stream_unmap(zend_stream *stream TSRMLS_DC) { /* {{{ */ #if HAVE_MMAP if (stream->mmap.map) { - munmap(stream->mmap.map, stream->mmap.len); + munmap(stream->mmap.map, stream->mmap.len + ZEND_MMAP_AHEAD); } else #endif if (stream->mmap.buf) { diff -Nru php5-5.4.4/Zend/zend_string.h php5-5.4.9/Zend/zend_string.h --- php5-5.4.4/Zend/zend_string.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_string.h 2012-11-21 05:12:20.000000000 +0000 @@ -23,12 +23,14 @@ #include "zend.h" +BEGIN_EXTERN_C() ZEND_API extern const char *(*zend_new_interned_string)(const char *str, int len, int free_src TSRMLS_DC); ZEND_API extern void (*zend_interned_strings_snapshot)(TSRMLS_D); ZEND_API extern void (*zend_interned_strings_restore)(TSRMLS_D); void zend_interned_strings_init(TSRMLS_D); void zend_interned_strings_dtor(TSRMLS_D); +END_EXTERN_C() #ifndef ZTS diff -Nru php5-5.4.4/Zend/zend_variables.c php5-5.4.9/Zend/zend_variables.c --- php5-5.4.4/Zend/zend_variables.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_variables.c 2012-11-21 05:12:20.000000000 +0000 @@ -40,6 +40,8 @@ TSRMLS_FETCH(); if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) { + /* break possible cycles */ + Z_TYPE_P(zvalue) = IS_NULL; zend_hash_destroy(zvalue->value.ht); FREE_HASHTABLE(zvalue->value.ht); } diff -Nru php5-5.4.4/Zend/zend_vm_def.h php5-5.4.9/Zend/zend_vm_def.h --- php5-5.4.4/Zend/zend_vm_def.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_vm_def.h 2012-11-21 05:12:20.000000000 +0000 @@ -2412,6 +2412,10 @@ zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj); zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method); + if (!obj || !method) { + zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1"); + } + if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) { zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object"); } @@ -3947,7 +3951,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - ZEND_VM_C_GOTO(num_index_dim); + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: diff -Nru php5-5.4.4/Zend/zend_vm_execute.h php5-5.4.9/Zend/zend_vm_execute.h --- php5-5.4.4/Zend/zend_vm_execute.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_vm_execute.h 2012-11-21 05:12:20.000000000 +0000 @@ -1256,6 +1256,10 @@ zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj); zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method); + if (!obj || !method) { + zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1"); + } + if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) { zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object"); } @@ -1558,6 +1562,10 @@ zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj); zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method); + if (!obj || !method) { + zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1"); + } + if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) { zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object"); } @@ -1722,6 +1730,10 @@ zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj); zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method); + if (!obj || !method) { + zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1"); + } + if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) { zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object"); } @@ -1919,6 +1931,10 @@ zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj); zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method); + if (!obj || !method) { + zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1"); + } + if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) { zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object"); } @@ -13917,7 +13933,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -15919,7 +15936,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -18131,7 +18149,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -21166,7 +21185,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -22504,7 +22524,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -23662,7 +23683,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -24820,7 +24842,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -26244,7 +26267,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -29498,7 +29522,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -31371,7 +31396,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -33453,7 +33479,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -36219,7 +36246,8 @@ switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: diff -Nru php5-5.4.4/Zend/zend_vm_execute.skl php5-5.4.9/Zend/zend_vm_execute.skl --- php5-5.4.4/Zend/zend_vm_execute.skl 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_vm_execute.skl 2012-11-21 05:12:20.000000000 +0000 @@ -5,8 +5,8 @@ DCL_OPLINE zend_execute_data *execute_data; zend_bool nested = 0; - zend_bool original_in_execution = EG(in_execution); {%HELPER_VARS%} + {%EXECUTION_STATUS%} {%INTERNAL_LABELS%} diff -Nru php5-5.4.4/Zend/zend_vm_gen.php php5-5.4.9/Zend/zend_vm_gen.php --- php5-5.4.4/Zend/zend_vm_gen.php 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/Zend/zend_vm_gen.php 2012-11-21 05:12:20.000000000 +0000 @@ -927,6 +927,13 @@ skip_blanks($f, $m[1], $m[3]."\n"); } break; + case "EXECUTION_STATUS": + if ($kind != ZEND_VM_KIND_GOTO) { + out($f, $m[1] . "zend_bool original_in_execution = EG(in_execution);\n"); + } else { + out($f, $m[1] . "zend_bool original_in_execution = op_array? EG(in_execution) : 0;\n"); + } + break; case "INTERNAL_LABELS": if ($kind == ZEND_VM_KIND_GOTO) { // Emit array of labels of opcode handlers and code for diff -Nru php5-5.4.4/configure php5-5.4.9/configure --- php5-5.4.4/configure 2012-06-13 06:08:07.000000000 +0000 +++ php5-5.4.9/configure 2012-11-21 05:53:07.000000000 +0000 @@ -3636,7 +3636,7 @@ PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=4 -PHP_RELEASE_VERSION=4 +PHP_RELEASE_VERSION=9 PHP_EXTRA_VERSION="" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr $PHP_MAJOR_VERSION \* 10000 + $PHP_MINOR_VERSION \* 100 + $PHP_RELEASE_VERSION` @@ -5195,7 +5195,7 @@ # we only support certain bison versions - bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5" + bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2" # for standalone build of Zend Engine test -z "$SED" && SED=sed @@ -10899,6 +10899,25 @@ PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES sapi/cli/php.1" + + + + for header_file in sapi/cli/cli.h; do + + + unique=`echo $header_file|$SED 's/[^a-zA-Z0-9]/_/g'` + + cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\"" + if test -n "$unique" && test "`eval $cmd`" = "" ; then + eval "INSTALLHEADERS$unique=set" + + INSTALL_HEADERS="$INSTALL_HEADERS $header_file" + + fi + + done + + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_CLI" >&5 $as_echo "$PHP_CLI" >&6; } @@ -11598,6 +11617,18 @@ done + for ac_header in sysexits.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sysexits.h" "ac_cv_header_sysexits_h" "$ac_includes_default" +if test "x$ac_cv_header_sysexits_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYSEXITS_H 1 +_ACEOF + +fi + +done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prctl" >&5 @@ -11802,10 +11833,10 @@ $as_echo_n "checking whether ptrace works... " >&6; } if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: skipped (cross compiling)" >&5 +$as_echo "skipped (cross compiling)" >&6; } + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11960,10 +11991,10 @@ $as_echo_n "checking for proc mem file... " >&6; } if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: skipped (cross compiling)" >&5 +$as_echo "skipped (cross compiling)" >&6; } + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12578,6 +12609,17 @@ +cat >>confdefs.h <<_ACEOF +#define PHP_FPM_USER "$php_fpm_user" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PHP_FPM_GROUP "$php_fpm_group" +_ACEOF + + + BUILD_DIR="$BUILD_DIR sapi/fpm/fpm" @@ -12588,7 +12630,7 @@ - PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.8 sapi/fpm/status.html" + PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html" src=$abs_srcdir/sapi/fpm/Makefile.frag @@ -12599,6 +12641,7 @@ SAPI_FPM_PATH=sapi/fpm/php-fpm + if test "$fpm_trace_type" && test -f "$abs_srcdir/sapi/fpm/fpm/fpm_trace_$fpm_trace_type.c"; then PHP_FPM_TRACE_FILES="fpm/fpm_trace.c fpm/fpm_trace_$fpm_trace_type.c" fi @@ -24294,9 +24337,9 @@ 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 \ + pcrelib/pcre_maketables.c pcrelib/pcre_newline.c \ pcrelib/pcre_ord2utf8.c pcrelib/pcre_refcount.c pcrelib/pcre_study.c \ - pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c \ + pcrelib/pcre_tables.c pcrelib/pcre_valid_utf8.c \ pcrelib/pcre_version.c pcrelib/pcre_xclass.c" ext_builddir=ext/pcre @@ -61124,6 +61167,29 @@ done if test -z "$MYSQL_LIB_DIR"; then + + str="$MYSQL_DIR/lib/x86_64-linux-gnu/lib$MYSQL_LIBNAME.*" + for j in `echo $str`; do + if test -r $j; then + MYSQL_LIB_DIR=$MYSQL_DIR/lib/x86_64-linux-gnu + break 2 + fi + done + + fi + if test -z "$MYSQL_LIB_DIR"; then + + str="$MYSQL_DIR/lib/i386-linux-gnu/lib$MYSQL_LIBNAME.*" + for j in `echo $str`; do + if test -r $j; then + MYSQL_LIB_DIR=$MYSQL_DIR/lib/i386-linux-gnu + break 2 + fi + done + + fi + + if test -z "$MYSQL_LIB_DIR"; then as_fn_error "Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR. Note that the MySQL client library is not bundled anymore!" "$LINENO" 5 fi @@ -63286,6 +63352,13 @@ PHP_OCI8_SED="$SED"; fi +PHP_OCI8_TAIL1=`echo a | tail -n1 2>/dev/null` +if test "$PHP_OCI8_TAIL1" = "a"; then + PHP_OCI8_TAIL1="tail -n1" +else + PHP_OCI8_TAIL1="tail -1" +fi + @@ -63818,7 +63891,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Oracle library version compatibility" >&5 $as_echo_n "checking Oracle library version compatibility... " >&6; } OCI8_LCS_BASE=$OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME - OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -1` # Oracle 10g, 11g etc + OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | $PHP_OCI8_TAIL1` # Oracle 10g, 11g etc if test -s "$OCI8_DIR/orainst/unix.rgs"; then OCI8_ORACLE_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/ */:/g' | cut -d: -f 6 | cut -c 2-4` test -z "$OCI8_ORACLE_VERSION" && OCI8_ORACLE_VERSION=7.3 @@ -64404,7 +64477,7 @@ $as_echo_n "checking Oracle Instant Client directory... " >&6; } if test "$PHP_OCI8_INSTANT_CLIENT" = "yes"; then - PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | tail -1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'` + PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | $PHP_OCI8_TAIL1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'` if test -z "$PHP_OCI8_INSTANT_CLIENT"; then as_fn_error "Oracle Instant Client directory /usr/lib/oracle/.../client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib libraries not found. Try --with-oci8=instantclient,DIR" "$LINENO" 5 fi @@ -64629,8 +64702,8 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Oracle Instant Client library version compatibility" >&5 $as_echo_n "checking Oracle Instant Client library version compatibility... " >&6; } OCI8_LCS_BASE=$PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME - OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -1` # Oracle 10g, 11g etc - OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | tail -1` + OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | $PHP_OCI8_TAIL1` # Oracle 10g, 11g etc + OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | $PHP_OCI8_TAIL1` if test -f "$OCI8_NNZ" && test -f "$OCI8_LCS"; then if test ! -f "$OCI8_LCS_BASE"; then as_fn_error "Link from $OCI8_LCS_BASE to $OCI8_LCS_BASE.*.1 not found" "$LINENO" 5 @@ -86485,6 +86558,44 @@ $as_echo "#define HAVE_SOCKETS 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for field ss_family in struct sockaddr_storage" >&5 +$as_echo_n "checking for field ss_family in struct sockaddr_storage... " >&6; } +if test "${ac_cv_ss_family+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ +struct sockaddr_storage sa_store; sa_store.ss_family = AF_INET6; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_ss_family=yes +else + ac_cv_ss_family=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ss_family" >&5 +$as_echo "$ac_cv_ss_family" >&6; } + + if test "$ac_cv_ss_family" = yes; then + +$as_echo "#define HAVE_SA_SS_FAMILY 1" >>confdefs.h + + fi + ext_builddir=ext/sockets ext_srcdir=$abs_srcdir/ext/sockets @@ -101686,7 +101797,14 @@ lib/zip_new.c lib/zip_source_file.c lib/zip_stat_index.c \ lib/zip_set_archive_comment.c lib/zip_set_file_comment.c \ lib/zip_unchange_archive.c lib/zip_memdup.c lib/zip_stat_init.c lib/zip_add_dir.c \ - lib/zip_error_clear.c lib/zip_file_error_clear.c" + lib/zip_error_clear.c lib/zip_file_error_clear.c \ + lib/zip_fdopen.c lib/zip_fopen_encrypted.c lib/zip_fopen_index_encrypted.c \ + lib/zip_get_compression_implementation.c lib/zip_get_encryption_implementation.c \ + lib/zip_get_file_extra.c lib/zip_get_num_entries.c lib/zip_set_default_password.c \ + lib/zip_set_file_extra.c lib/zip_source_close.c lib/zip_source_crc.c \ + lib/zip_source_deflate.c lib/zip_source_error.c lib/zip_source_layered.c \ + lib/zip_source_open.c lib/zip_source_pkware.c lib/zip_source_pop.c \ + lib/zip_source_read.c lib/zip_source_stat.c" $as_echo "#define HAVE_ZIP 1" >>confdefs.h @@ -102849,7 +102967,7 @@ # we only support certain bison versions - bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5" + bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2" # for standalone build of Zend Engine test -z "$SED" && SED=sed @@ -103763,7 +103881,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext + echo '#line 105796 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -107067,7 +107185,7 @@ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat > conftest.$ac_ext <&5) + (eval echo "\"configure:107346: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "configure:107232: \$? = $ac_status" >&5 + echo "configure:107350: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -107523,11 +107641,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:107526: $lt_compile\"" >&5) + (eval echo "\"configure:107644: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "configure:107530: \$? = $ac_status" >&5 + echo "configure:107648: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -107627,11 +107745,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:107630: $lt_compile\"" >&5) + (eval echo "\"configure:107748: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "configure:107634: \$? = $ac_status" >&5 + echo "configure:107752: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -108091,7 +108209,7 @@ # Determine the default libpath from the value encoded in an empty executable. cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"configure:112239: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "configure:112125: \$? = $ac_status" >&5 + echo "configure:112243: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -112222,11 +112340,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:112225: $lt_compile\"" >&5) + (eval echo "\"configure:112343: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "configure:112229: \$? = $ac_status" >&5 + echo "configure:112347: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized diff -Nru php5-5.4.4/configure.in php5-5.4.9/configure.in --- php5-5.4.4/configure.in 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/configure.in 2012-11-21 05:12:20.000000000 +0000 @@ -119,7 +119,7 @@ PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=4 -PHP_RELEASE_VERSION=4 +PHP_RELEASE_VERSION=9 PHP_EXTRA_VERSION="" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` diff -Nru php5-5.4.4/debian/NEWS php5-5.4.9/debian/NEWS --- php5-5.4.4/debian/NEWS 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/NEWS 2012-11-28 21:33:33.000000000 +0000 @@ -1,3 +1,50 @@ +php5 (5.4.4-7) unstable; urgency=low + + * As a side effect of the MIME-Type changes in the mime-support package, + the default Apache 2 configuration will no longer perform HTTP content + negotiation on the PHP file extensions, which was very questionable + anyway. If you really want to re-enable this support then please read + /usr/share/doc/php5-common/README.Debian file for further + instructions. + + -- Ondřej Surý Wed, 29 Aug 2012 09:18:41 +0200 + +php5 (5.4.4-5) unstable; urgency=low + + * As a security measure the default configuration for Apache 2 has been + changed to a stricter model. Only files which have the correct + rightmost extension, and at least one character in the filename before + that extension, are now interpreted by PHP. For a full list of + handled extensions please see the Apache 2 configuration. At the time + of writing this paragraph, the list includes the following regular + expressions: + + 1. .+\.ph(p[345]?|t|tml)$ for PHP files (application/x-httpd-php) + 2. .+\.phps$ for PHP source files (application/x-httpd-php-source) + + Previously, as a side effect of system MIME type definitions, the + default configuration would allow the interpreting of files with a + double extension, where the second extension was either unrecognised + or a language or content encoding to be interpreted; e.g. an uploaded + file named blackhat.php.foobar or index.php.cs would be interpreted by + PHP. These non-standard definitions have been removed from the + mime-support packages and all configuration of PHP handlers is now + defined in the Apache 2 configuration files. + + The standard configuration now also denies access to files with names + which consist of an extension and nothing more; e.g. accessing '/.php' + will now return Access Denied instead of the output of the PHP script. + + You can use the following command to find whether there are any files + on your system which would be affected by this change (change + to the directory name where you store PHP files on your system): + + # find -name '*.ph[pt].*' -o -name '*.php[345s].*' -o \ + -name '*.phtml.*' -o -name '.ph[pt]' -o \ + -name '.php[345s]' -o -name '.phtml' + + -- Ondřej Surý Tue, 21 Aug 2012 09:14:47 +0200 + php5 (5.4.4-1ubuntu1) quantal; urgency=low Because upstream has not produced a stable PHP 5.4 patch, and it has diff -Nru php5-5.4.4/debian/README.source php5-5.4.9/debian/README.source --- php5-5.4.4/debian/README.source 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/README.source 2012-11-28 21:33:33.000000000 +0000 @@ -7,14 +7,6 @@ egrep -v '(^php5|dbg|dev|common|pear)$' | tr "\n" "|" | sed 's/|$//' |\ sed -r 's/([^|]+)(\||$)/ \1 (= ${binary:Version}) \2/g'; echo - == Used patch system == - -This package uses quilt to manage all modifications to the upstream -source. Changes are stored in the source package as diffs in -debian/patches and applied during the build. - -See /usr/share/doc/quilt/README.source for a detailed explanation. - == Making some sense out of the configure options == The COMMON_CONFIG variable contains the configure options that are to @@ -50,4 +42,4 @@ * The CLI SAPI is built on the build-cli-stamp AND build-cgi-stamp, with different configure options. - -- Ondřej Surý , Wed, 16 Feb 2011 15:24:44 +0100 + -- Ondřej Surý , Tue, 27 Nov 2012 17:01:53 +0100 diff -Nru php5-5.4.4/debian/changelog php5-5.4.9/debian/changelog --- php5-5.4.4/debian/changelog 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/changelog 2012-12-13 16:44:06.000000000 +0000 @@ -1,8 +1,216 @@ -php5 (5.4.4-3ubuntu1~precise1~ppa1) precise; urgency=low +php5 (5.4.9-4ubuntu1~precise1~ppa1) precise; urgency=low * No-change backport to precise - -- Daniel Hahler Fri, 17 Aug 2012 17:33:20 +0200 + -- Daniel Hahler Thu, 13 Dec 2012 17:44:06 +0100 + +php5 (5.4.9-4ubuntu1) raring; urgency=low + + * Merge from Debian experimental. Remaining changes: + - d/rules: Simplify apache config settings since we never build + interbase or firebird. + - debian/rules: export DEB_HOST_MULTIARCH properly. + - Add build-dependency on lemon, which we now need. + - Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is + in universe. + - Dropped libcurl-dev not in the archive. + - debian/control: replace build-depends on mysql-server with + mysql-server-core-5.5 and mysql-client-5.5 to avoid upstart and + mysql-server-5.5 postinst confusion with starting up multiple + mysqlds listening on the same port. + - Dropped php5-imap, php5-interbase, php5-mcrypt since we have + versions already in universe. + - Dropped libonig-dev and libqgdbm since its in universe. (libonig + MIR has been declined due to an inactive upstream. So this is + probably a permanent change). + - modulelist: Drop imap, interbase, sybase, and mcrypt. + - debian/rules: + - Dropped building of mcrypt, imap, and interbase. + - Install apport hook for php5. + - stop mysql instance on clean just in case we failed in tests + - debian/control, debian/rules: Re-enable libedit-dev. + * Dropped changes: + - Re-add logic to guess default timezone from system to fix default + timezone regression Cherry-picked from Debian 5.4.4-6 (also in + Debian 5.4.6-2). + - debian/patches/libxml290.patch: Fix FTBFS with libxml 2.9.0. + (included upstream) + + -- Clint Byrum Tue, 04 Dec 2012 13:57:33 -0800 + +php5 (5.4.9-4) experimental; urgency=low + + * Make the sessionclean script compatible with awk != gawk + + -- Ondřej Surý Fri, 30 Nov 2012 11:13:40 +0100 + +php5 (5.4.9-3) experimental; urgency=low + + * Fix typo in path to session clean script in cron file + (Closes: #694736) + + -- Ondřej Surý Thu, 29 Nov 2012 20:43:55 +0100 + +php5 (5.4.9-2) experimental; urgency=low + + * Introduce new (hopefully slightly smarter) way of not deleting still + used session files + + -- Ondřej Surý Thu, 29 Nov 2012 08:48:24 +0100 + +php5 (5.4.9-1) experimental; urgency=low + + [ Lior Kaplan ] + * Support removing dangling symlinks, users are allowed to remove + configuration files + * Exit with code 0 even if module symlink doesn't exist (Closes: #692013) + + [ Ondřej Surý ] + * Imported Upstream version 5.4.9 + * Remove all traces of suhosin patch from debian sources + * Convert to 3.0 (quilt) debian source format (Closes: #694543) + * Remove broken MultiArch patch from upstream and replace it with new + Debian's version + * Replace Breaks with Conflict for php5-suhosin + * Remove useless .la file from libphp5-embed + + -- Ondřej Surý Tue, 27 Nov 2012 16:54:48 +0100 + +php5 (5.4.8-1) experimental; urgency=low + + * Imported Upstream version 5.4.8 + + Update patches for new release + * Remove IfModule to always interpret PHP if the module is enabled + * Fix extended DES crypt when salt != 9 + * Fix libphp5-embed linking: + + Expose all installed (and not built time) SAPIs via php-config --php-sapis + + Add /usr/lib/php5 to php-config --ldflags output to allow linking with libphp5.so + * Add new lintian-overrides for libphp5-embed + * Add logrotate script for php5-fpm (Closes: #683415) + * Add more warning text about new php5_cgi apache2 module (Closes: #687307) + * Add Breaks: php5-suhosin so people don't try to use it with PHP 5.4 + + -- Ondřej Surý Thu, 25 Oct 2012 16:05:34 +0200 + +php5 (5.4.6-2) experimental; urgency=low + + * Merge 5.4.4-5, 5.4.4-6 and 5.4.4-7 changes + + -- Ondřej Surý Thu, 30 Aug 2012 13:30:54 +0200 + +php5 (5.4.6-1ubuntu2) raring; urgency=low + + [ Robie Basak ] + * Re-add logic to guess default timezone from system to fix default timezone + regression (LP: #1069529). Cherry-picked from Debian 5.4.4-6 (also in + Debian 5.4.6-2). + + [ Marc Deslauriers ] + * debian/patches/libxml290.patch: Fix FTBFS with libxml 2.9.0. + + -- Marc Deslauriers Wed, 07 Nov 2012 11:54:55 -0500 + +php5 (5.4.6-1ubuntu1) quantal; urgency=low + + * Merge from Debian experimental (LP: #1006738 , LP: #1040212) + Remaining changes: + - d/rules: Simplify apache config settings since we never build + interbase or firebird. + - debian/rules: export DEB_HOST_MULTIARCH properly. + - Add build-dependency on lemon, which we now need. + - Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is + in universe. + - Dropped libcurl-dev not in the archive. + - debian/control: replace build-depends on mysql-server with + mysql-server-core-5.5 and mysql-client-5.5 to avoid upstart and + mysql-server-5.5 postinst confusion with starting up multiple + mysqlds listening on the same port. + - Dropped php5-imap, php5-interbase, php5-mcrypt since we have + versions already in universe. + - Dropped libonig-dev and libqgdbm since its in universe. (libonig + MIR has been declined due to an inactive upstream. So this is + probably a permanent change). + - modulelist: Drop imap, interbase, sybase, and mcrypt. + - debian/rules: + - Dropped building of mcrypt, imap, and interbase. + - Install apport hook for php5. + - stop mysql instance on clean just in case we failed in tests + - debian/control, debian/rules: Re-enable libedit-dev. + * Dropped Changes: + - debian/rules: change memory limits on example .ini files. + + -- Clint Byrum Wed, 22 Aug 2012 13:40:18 -0700 + +php5 (5.4.6-1) experimental; urgency=low + + * Imported Upstream version 5.4.6 + * Apply another fix to compile --without-system-tzdata + (Courtesy of Michael Heimpold) + + -- Ondřej Surý Tue, 21 Aug 2012 12:37:12 +0200 + +php5 (5.4.5-1) experimental; urgency=low + + * Imported Upstream version 5.4.5 + * Update patches for PHP 5.4.5 release + * Compile with system libzip (upstream has added support for that) + + -- Ondřej Surý Mon, 23 Jul 2012 11:12:08 +0200 + +php5 (5.4.4-7) unstable; urgency=low + + * Add explanatory text about MultiViews negotiation support to + README.Debian with additions from Christoph Anton Mitterer + (Closes: #670945) + + -- Ondřej Surý Wed, 29 Aug 2012 09:18:14 +0200 + +php5 (5.4.4-6) unstable; urgency=low + + * Merge a fix for zlib.output_compression from the upstream git + (Closes: #683432) + * Re-add logic to guess default timezone from system (Closes: #673763) + and remove the spurious warning about the selection. + * Fix invalid generated tar files from PEAR Archive/Tar package + (Closes: #680251) + * Merge a couple of upstream fixes from PHP 5.4.5 and 5.4.6: + + Fixed bug #62653: (unset($array[$float]) causes a crash). + + Fixed bug #62565 (Crashes due non-initialized internal + properties_table). + + Fixed bug #61964 (finfo_open with directory causes invalid free). + + Fixed bug #62564 (Extending MessageFormatter and adding property causes + crash). + + Fixed bug #62594 (segfault in mysqlnd_res_meta::set_mode). + + Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance + gives Segmentation fault). + + Fixed bug #62373 (serialize() generates wrong reference to the object). + + Fixed bug #61998 (Using traits with method aliases appears to result in + crash during execution). + + Fixed bug #55042 (Erealloc in iconv.c unsafe). + + Fixed bug #62266 (Custom extension segfaults during xmlParseFile with + FPM SAPI) + + -- Ondřej Surý Thu, 23 Aug 2012 13:59:49 +0200 + +php5 (5.4.4-5) unstable; urgency=low + + * Get rid of empty examples directory (Closes: #684108) + * Provide sensible default configuration for PHP MIME-types inside + Apache 2 configuration (Closes: #685340) + * Add NEWS text about more strict extension configuration + * Update NEWS and README.Debian based on debian-l10n-english review + (Courtesy of Justing B Rye) + + -- Ondřej Surý Tue, 21 Aug 2012 17:05:06 +0200 + +php5 (5.4.4-4) unstable; urgency=low + + * Fix php5-fpm segfault (PHP#62205) + * CVE-2012-2688: potential overflow in _php_stream_scandir + (Closes: #683274) + * Improve security in CGI section in README.Debian (Closes: #674205) + + -- Ondřej Surý Mon, 06 Aug 2012 13:01:42 +0200 php5 (5.4.4-3ubuntu1) quantal; urgency=low diff -Nru php5-5.4.4/debian/control php5-5.4.9/debian/control --- php5-5.4.4/debian/control 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/control 2012-11-28 21:37:15.000000000 +0000 @@ -57,7 +57,6 @@ locales-all | language-pack-de, netbase, netcat-openbsd | netcat, - quilt, re2c, unixodbc-dev, zlib1g-dev, @@ -87,7 +86,7 @@ Depends: ${misc:Depends}, sed (>= 4.1.1-1), psmisc (>= 22.15-1~), ${shlibs:Depends}, ucf Pre-Depends: dpkg (>= 1.15.7.2~) Provides: php5-json, php5-mhash -Conflicts: php5-json, php5-mhash +Conflicts: php5-json, php5-mhash, php5-suhosin Breaks: jffnms (<= 0.9.1-1), d-push (<= 1.5.5-1), dotclear (<= 2.4.0+dfsg-1), diff -Nru php5-5.4.4/debian/copyright.header php5-5.4.9/debian/copyright.header --- php5-5.4.4/debian/copyright.header 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/copyright.header 2012-11-28 21:33:33.000000000 +0000 @@ -14,11 +14,6 @@ Changes: removed ext/dbase dir (non-free) Noteworthy/non-trivial patches: - patch: suhosin.patch - contributor: http://www.hardened-php.net/ - copyright © 2006-2007 Stefan Esser - may be used/modified/redistributed under the terms of PHP itself - patch: use_embedded_timezonedb.patch contributor: Joe Orton copyright © 2008 Red Hat, Inc. diff -Nru php5-5.4.4/debian/libapache2-mod-php5.conf php5-5.4.9/debian/libapache2-mod-php5.conf --- php5-5.4.4/debian/libapache2-mod-php5.conf 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/libapache2-mod-php5.conf 2012-11-28 21:33:33.000000000 +0000 @@ -1,16 +1,27 @@ - - - SetHandler application/x-httpd-php - - - SetHandler application/x-httpd-php-source - - # To re-enable php in user directories comment the following lines - # (from to .) Do NOT set it to On as it - # prevents .htaccess files from disabling it. - - - php_admin_value engine Off - - + + SetHandler application/x-httpd-php + + + SetHandler application/x-httpd-php-source + # Deny access to raw php sources by default + # To re-enable it's recommended to enable access to the files + # only in specific virtual host or directory + Order Deny,Allow + Deny from all + +# Deny access to files without filename (e.g. '.php') + + Order Deny,Allow + Deny from all + + +# Running PHP scripts in user directories is disabled by default +# +# To re-enable PHP in user directories comment the following lines +# (from to .) Do NOT set it to On as it +# prevents .htaccess files from disabling it. + + + php_admin_value engine Off + diff -Nru php5-5.4.4/debian/libapache2-mod-php5filter.conf php5-5.4.9/debian/libapache2-mod-php5filter.conf --- php5-5.4.4/debian/libapache2-mod-php5filter.conf 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/libapache2-mod-php5filter.conf 2012-11-28 21:33:33.000000000 +0000 @@ -1,6 +1,9 @@ - - - SetInputFilter PHP - SetOutputFilter PHP - - + + SetInputFilter PHP + SetOutputFilter PHP + +# Deny access to files without filename (e.g. '.php') + + Order Deny,Allow + Deny from all + diff -Nru php5-5.4.4/debian/patches/006-debian_quirks.patch php5-5.4.9/debian/patches/006-debian_quirks.patch --- php5-5.4.4/debian/patches/006-debian_quirks.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/006-debian_quirks.patch 2012-11-28 21:33:33.000000000 +0000 @@ -194,17 +194,19 @@ scripts/phpize.m4 \ --- a/scripts/php-config.in +++ b/scripts/php-config.in -@@ -6,8 +6,8 @@ datarootdir="@datarootdir@" +@@ -6,9 +6,9 @@ datarootdir="@datarootdir@" exec_prefix="@exec_prefix@" version="@PHP_VERSION@" vernum="@PHP_VERSION_ID@" -include_dir="@includedir@/php" -includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib" +-ldflags="@PHP_LDFLAGS@" +include_dir="@includedir@/php5" +includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib $(getconf LFS_CFLAGS)" - ldflags="@PHP_LDFLAGS@" ++ldflags="-L$prefix/lib/php5 @PHP_LDFLAGS@" libs="@EXTRA_LIBS@" extension_dir='@EXTENSION_DIR@' + man_dir=`eval echo @mandir@` --- a/scripts/phpize.in +++ b/scripts/phpize.in @@ -4,8 +4,8 @@ diff -Nru php5-5.4.4/debian/patches/036-fd_setsize_fix.patch php5-5.4.9/debian/patches/036-fd_setsize_fix.patch --- php5-5.4.4/debian/patches/036-fd_setsize_fix.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/036-fd_setsize_fix.patch 2012-11-28 20:21:06.000000000 +0000 @@ -5,7 +5,7 @@ --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c -@@ -889,6 +889,7 @@ static int php_sock_array_to_fd_set(zval +@@ -892,6 +892,7 @@ static int php_sock_array_to_fd_set(zval php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1, le_socket); if (!php_sock) continue; /* If element is not a resource, skip it */ diff -Nru php5-5.4.4/debian/patches/expose_all_built_and_installed_apis.patch php5-5.4.9/debian/patches/expose_all_built_and_installed_apis.patch --- php5-5.4.4/debian/patches/expose_all_built_and_installed_apis.patch 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/debian/patches/expose_all_built_and_installed_apis.patch 2012-11-28 21:33:33.000000000 +0000 @@ -0,0 +1,27 @@ +--- a/scripts/man1/php-config.1.in ++++ b/scripts/man1/php-config.1.in +@@ -44,7 +44,7 @@ Full path to php CLI or CGI binary + .TP + .PD 0 + .B \-\-php-sapis +-Show all SAPI modules available ++Show all SAPI modules installed on the Debian system + .TP + .PD 0 + .B \-\-configure-options +--- a/scripts/php-config.in ++++ b/scripts/php-config.in +@@ -18,9 +18,12 @@ exe_extension="@EXEEXT@" + php_cli_binary=NONE + php_cgi_binary=NONE + configure_options="@CONFIGURE_OPTIONS@" +-php_sapis="@PHP_INSTALLED_SAPIS@" ++#php_sapis="@PHP_INSTALLED_SAPIS@" + phpapi="@DEBIAN_PHP_API@" + ++# Query the dpkg database for available PHP5 sapis ++php_sapis=$(dpkg-query -W -f='${binary:Package} ' libapache2-mod-php5 libapache2-mod-php5filter php5-cgi php5-cli php5-fpm libphp5-embed 2>/dev/null | sed -e 's|libapache2-mod-php5|apache2handler|;s|libapache2-mod-php5filter|apache2filter|;s|php5-cgi|cgi|;s|php5-cli|cli|;s|php5-fpm|fpm|;s|libphp5-embed|embed|;') ++ + # Set php_cli_binary and php_cgi_binary if available + for sapi in $php_sapis; do + case $sapi in diff -Nru php5-5.4.4/debian/patches/fpm-config.patch php5-5.4.9/debian/patches/fpm-config.patch --- php5-5.4.4/debian/patches/fpm-config.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/fpm-config.patch 2012-11-28 20:21:06.000000000 +0000 @@ -32,7 +32,7 @@ ; syslog_facility is used to specify what type of program is logging the ; message. This lets syslogd specify that messages from different facilities -@@ -108,6 +108,10 @@ +@@ -116,6 +116,10 @@ ; used in logs and stats. There is no limitation on the number of pools which ; FPM can handle. Your system will tell you anyway :) @@ -43,7 +43,7 @@ ; Start a new pool named 'www'. ; the variable $pool can we used in any directive and will be replaced by the ; pool name ('www' here) -@@ -442,7 +446,7 @@ pm.max_spare_servers = 3 +@@ -458,7 +462,7 @@ pm.max_spare_servers = 3 ; Chdir to this directory at the start. ; Note: relative path can be used. ; Default Value: current directory or / when chroot diff -Nru php5-5.4.4/debian/patches/hurd-noptrace.diff php5-5.4.9/debian/patches/hurd-noptrace.diff --- php5-5.4.4/debian/patches/hurd-noptrace.diff 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/hurd-noptrace.diff 2012-11-28 20:21:06.000000000 +0000 @@ -1,6 +1,6 @@ --- a/sapi/fpm/config.m4 +++ b/sapi/fpm/config.m4 -@@ -146,6 +146,11 @@ AC_DEFUN([AC_FPM_TRACE], +@@ -147,6 +147,11 @@ AC_DEFUN([AC_FPM_TRACE], pid_t child; int status; diff -Nru php5-5.4.4/debian/patches/libxml-reset-the-handler.patch php5-5.4.9/debian/patches/libxml-reset-the-handler.patch --- php5-5.4.4/debian/patches/libxml-reset-the-handler.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/libxml-reset-the-handler.patch 2012-11-28 20:21:06.000000000 +0000 @@ -1,6 +1,6 @@ --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c -@@ -851,7 +851,6 @@ static PHP_MSHUTDOWN_FUNCTION(libxml) +@@ -860,7 +860,6 @@ static PHP_MSHUTDOWN_FUNCTION(libxml) { if (!_php_libxml_per_request_initialization) { xmlSetGenericErrorFunc(NULL, NULL); @@ -8,7 +8,7 @@ xmlParserInputBufferCreateFilenameDefault(NULL); xmlOutputBufferCreateFilenameDefault(NULL); -@@ -867,11 +866,11 @@ static int php_libxml_post_deactivate() +@@ -876,11 +875,11 @@ static int php_libxml_post_deactivate() /* reset libxml generic error handling */ if (_php_libxml_per_request_initialization) { xmlSetGenericErrorFunc(NULL, NULL); diff -Nru php5-5.4.4/debian/patches/php-5.3.9-mysqlnd.patch php5-5.4.9/debian/patches/php-5.3.9-mysqlnd.patch --- php5-5.4.4/debian/patches/php-5.3.9-mysqlnd.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/php-5.3.9-mysqlnd.patch 2012-11-28 20:21:06.000000000 +0000 @@ -11,7 +11,7 @@ unix_socket = TRUE; --- a/ext/pdo_mysql/pdo_mysql.c +++ b/ext/pdo_mysql/pdo_mysql.c -@@ -50,7 +50,7 @@ ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql); +@@ -50,7 +50,7 @@ ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql) # define PDO_MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR # else # if !PHP_WIN32 diff -Nru php5-5.4.4/debian/patches/php-fpm-listen-on-unix-socket.patch php5-5.4.9/debian/patches/php-fpm-listen-on-unix-socket.patch --- php5-5.4.4/debian/patches/php-fpm-listen-on-unix-socket.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/php-fpm-listen-on-unix-socket.patch 2012-11-28 20:21:06.000000000 +0000 @@ -1,6 +1,6 @@ --- a/sapi/fpm/php-fpm.conf.in +++ b/sapi/fpm/php-fpm.conf.in -@@ -144,7 +144,7 @@ group = @php_fpm_group@ +@@ -152,7 +152,7 @@ group = @php_fpm_group@ ; specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. diff -Nru php5-5.4.4/debian/patches/php-fpm-man-section-and-cleanup.patch php5-5.4.9/debian/patches/php-fpm-man-section-and-cleanup.patch --- php5-5.4.4/debian/patches/php-fpm-man-section-and-cleanup.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/php-fpm-man-section-and-cleanup.patch 2012-11-28 21:33:33.000000000 +0000 @@ -7,25 +7,32 @@ --- a/sapi/fpm/php-fpm.8.in +++ b/sapi/fpm/php-fpm.8.in -@@ -112,15 +112,8 @@ The configuration file for the php-fpm d +@@ -126,22 +126,8 @@ The configuration file for the php-fpm d .TP .B php.ini The standard php configuration file. -.SH EXAMPLES --You should use the init script provided to start and stop the php-fpm daemon. This situation applies for any unix systems which use init.d for their main process manager. +-For any unix systems which use init.d for their main process manager, you should use the init script provided to start and stop the php-fpm daemon. -.P -.PD 1 -.RS -sudo /etc/init.d/php-fpm start -.RE -.TP +-For any unix systems which use systemd for their main process manager, you should use the unit file provided to start and stop the php-fpm daemon. +-.P +-.PD 1 +-.RS +-sudo systemctl start php-fpm.service +-.RE +-.TP -If your installation has no appropriate init script, launch php-fpm with no arguments. It will launch as a daemon (background process) by default. The file @php_fpm_localstatedir@/run/php-fpm.pid determines whether php-fpm is already up and running. Once started, php-fpm then responds to several POSIX signals: +.SH SIGNAL +Once started, php-fpm then responds to several POSIX signals: .P .PD 0 .RS -@@ -134,10 +127,6 @@ If your installation has no appropriate +@@ -155,10 +141,6 @@ If your installation has no appropriate .RE .PD 1 .P diff -Nru php5-5.4.4/debian/patches/php-fpm-sysconfdir.patch php5-5.4.9/debian/patches/php-fpm-sysconfdir.patch --- php5-5.4.4/debian/patches/php-fpm-sysconfdir.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/php-fpm-sysconfdir.patch 2012-11-28 21:33:33.000000000 +0000 @@ -1,6 +1,6 @@ --- a/sapi/fpm/fpm/fpm_conf.c +++ b/sapi/fpm/fpm/fpm_conf.c -@@ -1562,7 +1562,7 @@ int fpm_conf_init_main(int test_conf) /* +@@ -1609,7 +1609,7 @@ int fpm_conf_init_main(int test_conf, in char *tmp; if (fpm_globals.prefix == NULL) { diff -Nru php5-5.4.4/debian/patches/php_crypt_revamped.patch php5-5.4.9/debian/patches/php_crypt_revamped.patch --- php5-5.4.4/debian/patches/php_crypt_revamped.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/php_crypt_revamped.patch 2012-11-28 21:33:33.000000000 +0000 @@ -289,7 +289,7 @@ static unsigned char itoa64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; -@@ -150,160 +143,158 @@ static void php_to64(char *s, long v, in +@@ -150,160 +143,157 @@ static void php_to64(char *s, long v, in PHP_FUNCTION(crypt) { char salt[PHP_MAX_SALT_LEN + 1]; @@ -391,7 +391,7 @@ - char *output; - int needed = (sizeof(sha512_salt_prefix) - 1 - + sizeof(sha512_rounds_prefix) + 9 + 1 -- + strlen(salt) + 1 + 43 + 1); +- + salt_in_len + 1 + 86 + 1); - output = emalloc(needed); - salt[salt_in_len] = '\0'; - @@ -406,7 +406,7 @@ - RETVAL_STRING(output, 1); - } - -- memset(output, 0, PHP_MAX_SALT_LEN + 1); +- memset(output, 0, needed); - efree(output); + /* CRYPT_SHA512 */ +#if PHP_SHA512_CRYPT @@ -426,7 +426,7 @@ - char *output; - int needed = (sizeof(sha256_salt_prefix) - 1 - + sizeof(sha256_rounds_prefix) + 9 + 1 -- + strlen(salt) + 1 + 43 + 1); +- + salt_in_len + 1 + 43 + 1); - output = emalloc(needed); - salt[salt_in_len] = '\0'; - @@ -441,7 +441,7 @@ - RETVAL_STRING(output, 1); - } - -- memset(output, 0, PHP_MAX_SALT_LEN + 1); +- memset(output, 0, needed); - efree(output); + /* CRYPT_SHA256 */ +#if PHP_SHA256_CRYPT @@ -490,8 +490,7 @@ - - memset(output, 0, PHP_MAX_SALT_LEN + 1); +#endif -+ } else if (salt[0]=='_' && -+ salt_len == 9) { ++ } else if (salt[0]=='_') { + /* CRYPT_EXT_DES */ +#if PHP_EXT_DES_CRYPT +# error Using system extended DES crypt function, should not happen on Debian system diff -Nru php5-5.4.4/debian/patches/series php5-5.4.9/debian/patches/series --- php5-5.4.4/debian/patches/series 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/series 2012-11-28 21:37:35.000000000 +0000 @@ -38,7 +38,6 @@ use_embedded_timezonedb_fixes.patch fix_broken_sha2_test.patch php_crypt_revamped.patch -use_system_crypt_fixes.patch session_save_path.patch #install-programs_parallel_FTBFS.patch php-fpm-man-section-and-cleanup.patch @@ -60,4 +59,4 @@ php-5.4.0-dlopen.patch php-fpm-m68k.patch libxml-reset-the-handler.patch -php-fpm-error-reporting.patch +expose_all_built_and_installed_apis.patch diff -Nru php5-5.4.4/debian/patches/session_save_path.patch php5-5.4.9/debian/patches/session_save_path.patch --- php5-5.4.4/debian/patches/session_save_path.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/session_save_path.patch 2012-11-28 20:21:06.000000000 +0000 @@ -18,7 +18,7 @@ STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_ALL, OnUpdateBool, auto_start, php_ps_globals, ps_globals) --- a/php.ini-development +++ b/php.ini-development -@@ -1397,7 +1397,7 @@ session.save_handler = files +@@ -1399,7 +1399,7 @@ session.save_handler = files ; where MODE is the octal representation of the mode. Note that this ; does not overwrite the process's umask. ; http://php.net/session.save-path @@ -29,7 +29,7 @@ ; http://php.net/session.use-cookies --- a/php.ini-production +++ b/php.ini-production -@@ -1346,7 +1346,7 @@ session.save_handler = files +@@ -1348,7 +1348,7 @@ session.save_handler = files ; where MODE is the octal representation of the mode. Note that this ; does not overwrite the process's umask. ; http://php.net/session.save-path diff -Nru php5-5.4.4/debian/patches/suhosin.patch php5-5.4.9/debian/patches/suhosin.patch --- php5-5.4.4/debian/patches/suhosin.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/suhosin.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,5683 +0,0 @@ -suhosin hardening patch - -this patch was downloaded from: - - http://download.suhosin.org/suhosin-patch-5.3.4-0.9.10.patch.gz - -the following modifications have been made: - - * removed changes to ./configure & ./main/php_config.h.in since those - files are autogenerated - * "quilt refresh" has been run to clean up the offsets, etc ---- a/Zend/Makefile.am -+++ b/Zend/Makefile.am -@@ -17,7 +17,8 @@ libZend_la_SOURCES=\ - zend_objects_API.c zend_ts_hash.c zend_stream.c \ - zend_default_classes.c \ - zend_iterators.c zend_interfaces.c zend_exceptions.c \ -- zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c -+ zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c \ -+ zend_canary.c zend_alloc_canary.c - - libZend_la_LDFLAGS = - libZend_la_LIBADD = @ZEND_EXTRA_LIBS@ ---- a/Zend/Zend.dsp -+++ b/Zend/Zend.dsp -@@ -251,6 +251,14 @@ SOURCE=.\zend_strtod.c - # End Source File - # Begin Source File - -+SOURCE=.\zend_canary.c -+# End Source File -+# Begin Source File -+ -+SOURCE=.\zend_alloc_canary.c -+# End Source File -+# Begin Source File -+ - SOURCE=.\zend_ts_hash.c - # End Source File - # Begin Source File ---- a/Zend/ZendTS.dsp -+++ b/Zend/ZendTS.dsp -@@ -281,6 +281,14 @@ SOURCE=.\zend_strtod.c - # End Source File - # Begin Source File - -+SOURCE=.\zend_canary.c -+# End Source File -+# Begin Source File -+ -+SOURCE=.\zend_alloc_canary.c -+# End Source File -+# Begin Source File -+ - SOURCE=.\zend_ts_hash.c - # End Source File - # Begin Source File ---- a/Zend/zend.c -+++ b/Zend/zend.c -@@ -61,6 +61,10 @@ int (*zend_vspprintf)(char **pbuf, size_ - ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC); - ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC); - -+#if SUHOSIN_PATCH -+ZEND_API void (*zend_suhosin_log)(int loglevel, char *fmt, ...); -+#endif -+ - void (*zend_on_timeout)(int seconds TSRMLS_DC); - - static void (*zend_message_dispatcher_p)(long message, const void *data TSRMLS_DC); -@@ -102,6 +106,74 @@ static ZEND_INI_MH(OnUpdateScriptEncodin - /* }}} */ - - -+#if SUHOSIN_PATCH -+static ZEND_INI_MH(OnUpdateSuhosin_log_syslog) -+{ -+ if (!new_value) { -+ SPG(log_syslog) = S_ALL & ~S_SQL | S_MEMORY; -+ } else { -+ SPG(log_syslog) = atoi(new_value) | S_MEMORY; -+ } -+ return SUCCESS; -+} -+static ZEND_INI_MH(OnUpdateSuhosin_log_syslog_facility) -+{ -+ if (!new_value) { -+ SPG(log_syslog_facility) = LOG_USER; -+ } else { -+ SPG(log_syslog_facility) = atoi(new_value); -+ } -+ return SUCCESS; -+} -+static ZEND_INI_MH(OnUpdateSuhosin_log_syslog_priority) -+{ -+ if (!new_value) { -+ SPG(log_syslog_priority) = LOG_ALERT; -+ } else { -+ SPG(log_syslog_priority) = atoi(new_value); -+ } -+ return SUCCESS; -+} -+static ZEND_INI_MH(OnUpdateSuhosin_log_sapi) -+{ -+ if (!new_value) { -+ SPG(log_sapi) = S_ALL & ~S_SQL; -+ } else { -+ SPG(log_sapi) = atoi(new_value); -+ } -+ return SUCCESS; -+} -+static ZEND_INI_MH(OnUpdateSuhosin_log_script) -+{ -+ if (!new_value) { -+ SPG(log_script) = S_ALL & ~S_MEMORY; -+ } else { -+ SPG(log_script) = atoi(new_value) & (~S_MEMORY) & (~S_INTERNAL); -+ } -+ return SUCCESS; -+} -+static ZEND_INI_MH(OnUpdateSuhosin_log_scriptname) -+{ -+ if (SPG(log_scriptname)) { -+ pefree(SPG(log_scriptname),1); -+ } -+ SPG(log_scriptname) = NULL; -+ if (new_value) { -+ SPG(log_scriptname) = pestrdup(new_value,1); -+ } -+ return SUCCESS; -+} -+static ZEND_INI_MH(OnUpdateSuhosin_log_phpscript) -+{ -+ if (!new_value) { -+ SPG(log_phpscript) = S_ALL & ~S_MEMORY; -+ } else { -+ SPG(log_phpscript) = atoi(new_value) & (~S_MEMORY) & (~S_INTERNAL); -+ } -+ return SUCCESS; -+} -+#endif -+ - ZEND_INI_BEGIN() - ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting) - STD_ZEND_INI_BOOLEAN("zend.enable_gc", "1", ZEND_INI_ALL, OnUpdateGCEnabled, gc_enabled, zend_gc_globals, gc_globals) ---- a/Zend/zend.h -+++ b/Zend/zend.h -@@ -688,6 +688,9 @@ extern ZEND_API int (*zend_stream_open_f - extern int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap); - extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC); - extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC); -+#if SUHOSIN_PATCH -+extern ZEND_API void (*zend_suhosin_log)(int loglevel, char *fmt, ...); -+#endif - - ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); - -@@ -849,6 +852,16 @@ ZEND_API void zend_restore_error_handlin - #define DEBUG_BACKTRACE_PROVIDE_OBJECT (1<<0) - #define DEBUG_BACKTRACE_IGNORE_ARGS (1<<1) - -+#if SUHOSIN_PATCH -+#include "suhosin_globals.h" -+#include "suhosin_patch.h" -+#include "php_syslog.h" -+ -+ZEND_API void zend_canary(void *buf, int len); -+ZEND_API char suhosin_get_config(int element); -+ -+#endif -+ - #endif /* ZEND_H */ - - /* ---- a/Zend/zend_alloc.c -+++ b/Zend/zend_alloc.c -@@ -32,6 +32,10 @@ - # include - #endif - -+#if SUHOSIN_PATCH -+#include "suhosin_patch.h" -+#endif -+ - #ifdef ZEND_WIN32 - # include - # include -@@ -59,6 +63,7 @@ - # define PTR_FMT "0x%0.8lx" - #endif - -+#ifndef SUHOSIN_MM_CLONE_FILE - #if ZEND_DEBUG - void zend_debug_alloc_output(char *format, ...) - { -@@ -76,6 +81,7 @@ void zend_debug_alloc_output(char *forma - #endif - } - #endif -+#endif - - #if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) - static void zend_mm_panic(const char *message) __attribute__ ((noreturn)); -@@ -134,6 +140,8 @@ static void zend_mm_panic(const char *me - # endif - #endif - -+static zend_intptr_t SUHOSIN_POINTER_GUARD = 0; -+ - static zend_mm_storage* zend_mm_mem_dummy_init(void *params) - { - return malloc(sizeof(zend_mm_storage)); -@@ -332,13 +340,28 @@ static const zend_mm_mem_handlers mem_ha - #define MEM_BLOCK_GUARD 0x2A8FCC84 - #define MEM_BLOCK_LEAK 0x6C5E8F2D - -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+# define CANARY_SIZE sizeof(size_t) -+#else -+# define CANARY_SIZE 0 -+#endif -+ - /* mm block type */ - typedef struct _zend_mm_block_info { - #if ZEND_MM_COOKIES - size_t _cookie; - #endif -- size_t _size; -- size_t _prev; -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+ size_t canary_1; -+#endif -+ size_t _size; -+ size_t _prev; -+#if SUHOSIN_PATCH -+ size_t size; -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+ size_t canary_2; -+#endif -+#endif - } zend_mm_block_info; - - #if ZEND_DEBUG -@@ -412,7 +435,7 @@ typedef struct _zend_mm_free_block { - # define ZEND_MM_CACHE_STAT 0 - #endif - --struct _zend_mm_heap { -+typedef struct _zend_mm_heap { - int use_zend_alloc; - void *(*_malloc)(size_t); - void (*_free)(void*); -@@ -448,6 +471,9 @@ struct _zend_mm_heap { - int miss; - } cache_stat[ZEND_MM_NUM_BUCKETS+1]; - #endif -+#if SUHOSIN_PATCH -+ size_t canary_1,canary_2,canary_3; -+#endif - }; - - #define ZEND_MM_SMALL_FREE_BUCKET(heap, index) \ -@@ -525,18 +551,31 @@ static unsigned int _zend_mm_cookie = 0; - /* optimized access */ - #define ZEND_MM_FREE_BLOCK_SIZE(b) (b)->info._size - -+#ifndef ZEND_MM_ALIGNMENT -+# define ZEND_MM_ALIGNMENT 8 -+# define ZEND_MM_ALIGNMENT_LOG2 3 -+#elif ZEND_MM_ALIGNMENT < 4 -+# undef ZEND_MM_ALIGNMENT -+# undef ZEND_MM_ALIGNMENT_LOG2 -+# define ZEND_MM_ALIGNMENT 4 -+# define ZEND_MM_ALIGNMENT_LOG2 2 -+#endif -+ -+#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1) -+ - /* Aligned header size */ -+#define ZEND_MM_ALIGNED_SIZE(size) ((size + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK) - #define ZEND_MM_ALIGNED_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_block)) - #define ZEND_MM_ALIGNED_FREE_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_small_free_block)) --#define ZEND_MM_MIN_ALLOC_BLOCK_SIZE ZEND_MM_ALIGNED_SIZE(ZEND_MM_ALIGNED_HEADER_SIZE + END_MAGIC_SIZE) -+#define ZEND_MM_MIN_ALLOC_BLOCK_SIZE ZEND_MM_ALIGNED_SIZE(ZEND_MM_ALIGNED_HEADER_SIZE + END_MAGIC_SIZE + CANARY_SIZE) - #define ZEND_MM_ALIGNED_MIN_HEADER_SIZE (ZEND_MM_MIN_ALLOC_BLOCK_SIZE>ZEND_MM_ALIGNED_FREE_HEADER_SIZE?ZEND_MM_MIN_ALLOC_BLOCK_SIZE:ZEND_MM_ALIGNED_FREE_HEADER_SIZE) - #define ZEND_MM_ALIGNED_SEGMENT_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_segment)) - --#define ZEND_MM_MIN_SIZE ((ZEND_MM_ALIGNED_MIN_HEADER_SIZE>(ZEND_MM_ALIGNED_HEADER_SIZE+END_MAGIC_SIZE))?(ZEND_MM_ALIGNED_MIN_HEADER_SIZE-(ZEND_MM_ALIGNED_HEADER_SIZE+END_MAGIC_SIZE)):0) -+#define ZEND_MM_MIN_SIZE ((ZEND_MM_ALIGNED_MIN_HEADER_SIZE>(ZEND_MM_ALIGNED_HEADER_SIZE+END_MAGIC_SIZE+CANARY_SIZE))?(ZEND_MM_ALIGNED_MIN_HEADER_SIZE-(ZEND_MM_ALIGNED_HEADER_SIZE+END_MAGIC_SIZE+CANARY_SIZE)):0) - - #define ZEND_MM_MAX_SMALL_SIZE ((ZEND_MM_NUM_BUCKETS<>ZEND_MM_ALIGNMENT_LOG2)-(ZEND_MM_ALIGNED_MIN_HEADER_SIZE>>ZEND_MM_ALIGNMENT_LOG2)) - -@@ -598,6 +637,44 @@ static unsigned int _zend_mm_cookie = 0; - - #endif - -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+ -+# define SUHOSIN_MM_CHECK_CANARIES(block, MFUNCTION) do { \ -+ char *p = SUHOSIN_MM_END_CANARY_PTR(block); size_t check; \ -+ if (((block)->info.canary_1 != heap->canary_1) || ((block)->info.canary_2 != heap->canary_2)) { \ -+ canary_mismatch: \ -+ zend_suhosin_log(S_MEMORY, "canary mismatch on " MFUNCTION " - heap overflow detected at %p", (block)); \ -+ if (SUHOSIN_CONFIG(SUHOSIN_MM_IGNORE_CANARY_VIOLATION) == 0) { _exit(1); } else { (block)->info.canary_1 = heap->canary_1; (block)->info.canary_2 = heap->canary_2; }\ -+ } \ -+ memcpy(&check, p, CANARY_SIZE); \ -+ if (check != heap->canary_3) { \ -+ zend_suhosin_log(S_MEMORY, "end canary mismatch on " MFUNCTION " - heap overflow detected at %p", (block)); \ -+ if (SUHOSIN_CONFIG(SUHOSIN_MM_IGNORE_CANARY_VIOLATION) == 0) { _exit(1); } else { memcpy(p, heap->canary_3, CANARY_SIZE); } \ -+ } \ -+ } while (0) -+ -+# define SUHOSIN_MM_SET_CANARIES(block) do { \ -+ (block)->info.canary_1 = heap->canary_1; \ -+ (block)->info.canary_2 = heap->canary_2; \ -+ } while (0) -+ -+# define SUHOSIN_MM_END_CANARY_PTR(block) \ -+ (char *)(((char*)(ZEND_MM_DATA_OF(block))) + ((zend_mm_block*)(block))->info.size + END_MAGIC_SIZE) -+ -+# define SUHOSIN_MM_SET_END_CANARY(block) do { \ -+ char *p = SUHOSIN_MM_END_CANARY_PTR(block); \ -+ memcpy(p, &heap->canary_3, CANARY_SIZE); \ -+ } while (0) -+ -+#else -+ -+# define SUHOSIN_MM_CHECK_CANARIES(block, MFUNCTION) -+# define SUHOSIN_MM_SET_CANARIES(block) -+# define SUHOSIN_MM_END_CANARY_PTR(block) -+# define SUHOSIN_MM_SET_END_CANARY(block) -+ -+#endif -+ - - #if ZEND_MM_HEAP_PROTECTION - -@@ -720,7 +797,7 @@ static inline unsigned int zend_mm_low_b - #endif - } - --static inline void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) -+static void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) - { - size_t size; - size_t index; -@@ -737,7 +814,7 @@ static inline void zend_mm_add_to_free_l - if (!*p) { - *p = mm_block; - mm_block->parent = p; -- mm_block->prev_free_block = mm_block->next_free_block = mm_block; -+ mm_block->prev_free_block = mm_block->next_free_block = SUHOSIN_MANGLE_PTR(mm_block); - heap->large_free_bitmap |= (ZEND_MM_LONG_CONST(1) << index); - } else { - size_t m; -@@ -750,15 +827,15 @@ static inline void zend_mm_add_to_free_l - if (!*p) { - *p = mm_block; - mm_block->parent = p; -- mm_block->prev_free_block = mm_block->next_free_block = mm_block; -+ mm_block->prev_free_block = mm_block->next_free_block = SUHOSIN_MANGLE_PTR(mm_block); - break; - } - } else { -- zend_mm_free_block *next = prev->next_free_block; -+ zend_mm_free_block *next = SUHOSIN_MANGLE_PTR(prev->next_free_block); - -- prev->next_free_block = next->prev_free_block = mm_block; -- mm_block->next_free_block = next; -- mm_block->prev_free_block = prev; -+ prev->next_free_block = next->prev_free_block = SUHOSIN_MANGLE_PTR(mm_block); -+ mm_block->next_free_block = SUHOSIN_MANGLE_PTR(next); -+ mm_block->prev_free_block = SUHOSIN_MANGLE_PTR(prev); - mm_block->parent = NULL; - break; - } -@@ -770,14 +847,14 @@ static inline void zend_mm_add_to_free_l - index = ZEND_MM_BUCKET_INDEX(size); - - prev = ZEND_MM_SMALL_FREE_BUCKET(heap, index); -- if (prev->prev_free_block == prev) { -+ if (SUHOSIN_MANGLE_PTR(prev->prev_free_block) == prev) { - heap->free_bitmap |= (ZEND_MM_LONG_CONST(1) << index); - } -- next = prev->next_free_block; -+ next = SUHOSIN_MANGLE_PTR(prev->next_free_block); - -- mm_block->prev_free_block = prev; -- mm_block->next_free_block = next; -- prev->next_free_block = next->prev_free_block = mm_block; -+ mm_block->prev_free_block = SUHOSIN_MANGLE_PTR(prev); -+ mm_block->next_free_block = SUHOSIN_MANGLE_PTR(next); -+ prev->next_free_block = next->prev_free_block = SUHOSIN_MANGLE_PTR(mm_block); - } - } - -@@ -791,6 +868,12 @@ static inline void zend_mm_remove_from_f - if (EXPECTED(prev == mm_block)) { - zend_mm_free_block **rp, **cp; - -+#if SUHOSIN_PATCH -+ if (next != mm_block) { -+ zend_suhosin_log(S_MEMORY, "zend_mm_heap corrupted at %p", mm_block); -+ _exit(1); -+ } -+#endif - #if ZEND_MM_SAFE_UNLINKING - if (UNEXPECTED(next != mm_block)) { - zend_mm_panic("zend_mm_heap corrupted"); -@@ -829,14 +912,21 @@ subst_block: - } - } else { - -+#if SUHOSIN_PATCH -+ if (SUHOSIN_MANGLE_PTR(prev->next_free_block) != mm_block || SUHOSIN_MANGLE_PTR(next->prev_free_block) != mm_block) { -+ zend_suhosin_log(S_MEMORY, "zend_mm_head corrupted at %p", mm_block); -+ _exit(1); -+ } -+#endif -+ - #if ZEND_MM_SAFE_UNLINKING -- if (UNEXPECTED(prev->next_free_block != mm_block) || UNEXPECTED(next->prev_free_block != mm_block)) { -+ if (UNEXPECTED(SUHOSIN_MANGLE_PTR(prev->next_free_block) != mm_block) || UNEXPECTED(SUHOSIN_MANGLE_PTR(next->prev_free_block) != mm_block)) { - zend_mm_panic("zend_mm_heap corrupted"); - } - #endif - -- prev->next_free_block = next; -- next->prev_free_block = prev; -+ prev->next_free_block = SUHOSIN_MANGLE_PTR(next); -+ next->prev_free_block = SUHOSIN_MANGLE_PTR(prev); - - if (EXPECTED(ZEND_MM_SMALL_SIZE(ZEND_MM_FREE_BLOCK_SIZE(mm_block)))) { - if (EXPECTED(prev == next)) { -@@ -854,7 +944,7 @@ subst_block: - } - } - --static inline void zend_mm_add_to_rest_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) -+static void zend_mm_add_to_rest_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) - { - zend_mm_free_block *prev, *next; - -@@ -878,14 +968,14 @@ static inline void zend_mm_add_to_rest_l - - ZEND_MM_SET_MAGIC(mm_block, MEM_BLOCK_FREED); - -- prev = heap->rest_buckets[0]; -- next = prev->next_free_block; -- mm_block->prev_free_block = prev; -- mm_block->next_free_block = next; -- prev->next_free_block = next->prev_free_block = mm_block; -+ prev = SUHOSIN_MANGLE_PTR(heap->rest_buckets[0]); -+ next = SUHOSIN_MANGLE_PTR(prev->next_free_block); -+ mm_block->prev_free_block = SUHOSIN_MANGLE_PTR(prev); -+ mm_block->next_free_block = SUHOSIN_MANGLE_PTR(next); -+ prev->next_free_block = next->prev_free_block = SUHOSIN_MANGLE_PTR(mm_block); - } - --static inline void zend_mm_init(zend_mm_heap *heap) -+static void zend_mm_init(zend_mm_heap *heap) - { - zend_mm_free_block* p; - int i; -@@ -903,13 +993,21 @@ static inline void zend_mm_init(zend_mm_ - #endif - p = ZEND_MM_SMALL_FREE_BUCKET(heap, 0); - for (i = 0; i < ZEND_MM_NUM_BUCKETS; i++) { -- p->next_free_block = p; -- p->prev_free_block = p; -+ p->next_free_block = SUHOSIN_MANGLE_PTR(p); -+ p->prev_free_block = SUHOSIN_MANGLE_PTR(p); - p = (zend_mm_free_block*)((char*)p + sizeof(zend_mm_free_block*) * 2); - heap->large_free_buckets[i] = NULL; - } -- heap->rest_buckets[0] = heap->rest_buckets[1] = ZEND_MM_REST_BUCKET(heap); -+ heap->rest_buckets[0] = heap->rest_buckets[1] = SUHOSIN_MANGLE_PTR(ZEND_MM_REST_BUCKET(heap)); - heap->rest_count = 0; -+ -+#if SUHOSIN_PATCH -+ if (SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION)) { -+ zend_canary(&heap->canary_1, sizeof(heap->canary_1)); -+ zend_canary(&heap->canary_2, sizeof(heap->canary_2)); -+ zend_canary(&heap->canary_3, sizeof(heap->canary_3)); -+ } -+#endif - } - - static void zend_mm_del_segment(zend_mm_heap *heap, zend_mm_segment *segment) -@@ -930,12 +1028,13 @@ static void zend_mm_free_cache(zend_mm_h - int i; - - for (i = 0; i < ZEND_MM_NUM_BUCKETS; i++) { -+ /* NULL means NULL even MANGLED */ - if (heap->cache[i]) { -- zend_mm_free_block *mm_block = heap->cache[i]; -+ zend_mm_free_block *mm_block = SUHOSIN_MANGLE_PTR(heap->cache[i]); - - while (mm_block) { - size_t size = ZEND_MM_BLOCK_SIZE(mm_block); -- zend_mm_free_block *q = mm_block->prev_free_block; -+ zend_mm_free_block *q = SUHOSIN_MANGLE_PTR(mm_block->prev_free_block); - zend_mm_block *next_block = ZEND_MM_NEXT_BLOCK(mm_block); - - heap->cached -= size; -@@ -1031,14 +1130,20 @@ static void zend_mm_random(unsigned char - /* }}} */ - #endif - -+ - /* Notes: - * - This function may alter the block_sizes values to match platform alignment - * - This function does *not* perform sanity checks on the arguments - */ --ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers, size_t block_size, size_t reserve_size, int internal, void *params) -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+zend_mm_heap *__zend_mm_startup_canary_ex(const zend_mm_mem_handlers *handlers, size_t block_size, size_t reserve_size, int internal, void *params) -+#else -+static zend_mm_heap *__zend_mm_startup_ex(const zend_mm_mem_handlers *handlers, size_t block_size, size_t reserve_size, int internal, void *params) -+#endif - { - zend_mm_storage *storage; - zend_mm_heap *heap; -+ zend_mm_free_block *tmp; - - #if 0 - int i; -@@ -1072,6 +1177,12 @@ ZEND_API zend_mm_heap *zend_mm_startup_e - } - #endif - -+ /* get the pointer guardian and ensure low 3 bits are 1 */ -+ if (SUHOSIN_POINTER_GUARD == 0) { -+ zend_canary(&SUHOSIN_POINTER_GUARD, sizeof(SUHOSIN_POINTER_GUARD)); -+ SUHOSIN_POINTER_GUARD |= 7; -+ } -+ - if (zend_mm_low_bit(block_size) != zend_mm_high_bit(block_size)) { - fprintf(stderr, "'block_size' must be a power of two\n"); - /* See http://support.microsoft.com/kb/190351 */ -@@ -1119,12 +1230,12 @@ ZEND_API zend_mm_heap *zend_mm_startup_e - heap->reserve = NULL; - heap->reserve_size = reserve_size; - if (reserve_size > 0) { -- heap->reserve = _zend_mm_alloc_int(heap, reserve_size ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -+ heap->reserve = _zend_mm_alloc(heap, reserve_size ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); - } - if (internal) { - int i; - zend_mm_free_block *p, *q, *orig; -- zend_mm_heap *mm_heap = _zend_mm_alloc_int(heap, sizeof(zend_mm_heap) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -+ zend_mm_heap *mm_heap = _zend_mm_alloc(heap, sizeof(zend_mm_heap) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); - - *mm_heap = *heap; - -@@ -1132,22 +1243,22 @@ ZEND_API zend_mm_heap *zend_mm_startup_e - orig = ZEND_MM_SMALL_FREE_BUCKET(heap, 0); - for (i = 0; i < ZEND_MM_NUM_BUCKETS; i++) { - q = p; -- while (q->prev_free_block != orig) { -- q = q->prev_free_block; -+ while (SUHOSIN_MANGLE_PTR(q->prev_free_block) != orig) { -+ q = SUHOSIN_MANGLE_PTR(q->prev_free_block); - } -- q->prev_free_block = p; -+ q->prev_free_block = SUHOSIN_MANGLE_PTR(p); - q = p; -- while (q->next_free_block != orig) { -- q = q->next_free_block; -+ while (SUHOSIN_MANGLE_PTR(q->next_free_block) != orig) { -+ q = SUHOSIN_MANGLE_PTR(q->next_free_block); - } -- q->next_free_block = p; -+ q->next_free_block = SUHOSIN_MANGLE_PTR(p); - p = (zend_mm_free_block*)((char*)p + sizeof(zend_mm_free_block*) * 2); - orig = (zend_mm_free_block*)((char*)orig + sizeof(zend_mm_free_block*) * 2); - if (mm_heap->large_free_buckets[i]) { - mm_heap->large_free_buckets[i]->parent = &mm_heap->large_free_buckets[i]; - } - } -- mm_heap->rest_buckets[0] = mm_heap->rest_buckets[1] = ZEND_MM_REST_BUCKET(mm_heap); -+ mm_heap->rest_buckets[0] = mm_heap->rest_buckets[1] = SUHOSIN_MANGLE_PTR(ZEND_MM_REST_BUCKET(mm_heap)); - mm_heap->rest_count = 0; - - free(heap); -@@ -1156,7 +1267,11 @@ ZEND_API zend_mm_heap *zend_mm_startup_e - return heap; - } - --ZEND_API zend_mm_heap *zend_mm_startup(void) -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+zend_mm_heap *__zend_mm_startup_canary(void) -+#else -+static zend_mm_heap *__zend_mm_startup(void) -+#endif - { - int i; - size_t seg_size; -@@ -1226,6 +1341,27 @@ ZEND_API zend_mm_heap *zend_mm_startup(v - return heap; - } - -+#ifndef SUHOSIN_MM_CLONE_FILE -+zend_mm_heap_canary *__zend_mm_startup_canary_ex(const zend_mm_mem_handlers *handlers, size_t block_size, size_t reserve_size, int internal, void *params); -+zend_mm_heap_canary *__zend_mm_startup_canary(void); -+ -+ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers, size_t block_size, size_t reserve_size, int internal, void *params) -+{ -+ if (SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION)) { -+ return (zend_mm_heap *)__zend_mm_startup_canary_ex(handlers, block_size, reserve_size, internal, params); -+ } -+ return __zend_mm_startup_ex(handlers, block_size, reserve_size, internal, params); -+} -+ZEND_API zend_mm_heap *zend_mm_startup(void) -+{ -+ if (SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION)) { -+ return (zend_mm_heap *)__zend_mm_startup_canary(); -+ } -+ return __zend_mm_startup(); -+} -+ -+#endif -+ - #if ZEND_DEBUG - static long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b) - { -@@ -1594,7 +1730,11 @@ static int zend_mm_check_heap(zend_mm_he - } - #endif - --ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent TSRMLS_DC) -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+void __zend_mm_shutdown_canary(zend_mm_heap *heap, int full_shutdown, int silent TSRMLS_DC) -+#else -+static void __zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent TSRMLS_DC) -+#endif - { - zend_mm_storage *storage; - zend_mm_segment *segment; -@@ -1611,7 +1751,7 @@ ZEND_API void zend_mm_shutdown(zend_mm_h - if (heap->reserve) { - #if ZEND_DEBUG - if (!silent) { -- _zend_mm_free_int(heap, heap->reserve ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -+ _zend_mm_free(heap, heap->reserve ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); - } - #endif - heap->reserve = NULL; -@@ -1730,12 +1870,23 @@ ZEND_API void zend_mm_shutdown(zend_mm_h - zend_mm_add_to_free_list(heap, b); - } - if (heap->reserve_size) { -- heap->reserve = _zend_mm_alloc_int(heap, heap->reserve_size ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -+ heap->reserve = _zend_mm_alloc(heap, heap->reserve_size ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); - } - heap->overflow = 0; - } - } - -+#ifndef SUHOSIN_MM_CLONE_FILE -+ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent TSRMLS_DC) -+{ -+ if (SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION)) { -+ __zend_mm_shutdown_canary(heap, full_shutdown, silent TSRMLS_CC); -+ return; -+ } -+ __zend_mm_shutdown(heap, full_shutdown, silent TSRMLS_CC); -+} -+#endif -+ - static void zend_mm_safe_error(zend_mm_heap *heap, - const char *format, - size_t limit, -@@ -1746,7 +1897,11 @@ static void zend_mm_safe_error(zend_mm_h - size_t size) - { - if (heap->reserve) { -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+ _zend_mm_free_canary_int(heap, heap->reserve ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -+#else - _zend_mm_free_int(heap, heap->reserve ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -+#endif - heap->reserve = NULL; - } - if (heap->overflow == 0) { -@@ -1821,7 +1976,7 @@ static zend_mm_free_block *zend_mm_searc - p = heap->large_free_buckets[index]; - for (m = true_size << (ZEND_MM_NUM_BUCKETS - index); ; m <<= 1) { - if (UNEXPECTED(ZEND_MM_FREE_BLOCK_SIZE(p) == true_size)) { -- return p->next_free_block; -+ return SUHOSIN_MANGLE_PTR(p->next_free_block); - } else if (ZEND_MM_FREE_BLOCK_SIZE(p) >= true_size && - ZEND_MM_FREE_BLOCK_SIZE(p) < best_size) { - best_size = ZEND_MM_FREE_BLOCK_SIZE(p); -@@ -1845,7 +2000,7 @@ static zend_mm_free_block *zend_mm_searc - - for (p = rst; p; p = p->child[p->child[0] != NULL]) { - if (UNEXPECTED(ZEND_MM_FREE_BLOCK_SIZE(p) == true_size)) { -- return p->next_free_block; -+ return SUHOSIN_MANGLE_PTR(p->next_free_block); - } else if (ZEND_MM_FREE_BLOCK_SIZE(p) > true_size && - ZEND_MM_FREE_BLOCK_SIZE(p) < best_size) { - best_size = ZEND_MM_FREE_BLOCK_SIZE(p); -@@ -1854,7 +2009,7 @@ static zend_mm_free_block *zend_mm_searc - } - - if (best_fit) { -- return best_fit->next_free_block; -+ return SUHOSIN_MANGLE_PTR(best_fit->next_free_block); - } - bitmap = bitmap >> 1; - if (!bitmap) { -@@ -1870,9 +2025,12 @@ static zend_mm_free_block *zend_mm_searc - best_fit = p; - } - } -- return best_fit->next_free_block; -+ return SUHOSIN_MANGLE_PTR(best_fit->next_free_block); - } - -+#if SUHOSIN_PATCH -+void *_zend_mm_alloc_canary_int(zend_mm_heap_canary *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -+#endif - static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) - { - zend_mm_free_block *best_fit; -@@ -1902,9 +2060,14 @@ static void *_zend_mm_alloc_int(zend_mm_ - heap->cache_stat[index].count--; - heap->cache_stat[index].hit++; - #endif -- best_fit = heap->cache[index]; -+ best_fit = SUHOSIN_MANGLE_PTR(heap->cache[index]); - heap->cache[index] = best_fit->prev_free_block; - heap->cached -= true_size; -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(best_fit); -+ ((zend_mm_block*)best_fit)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(best_fit); -+#endif - ZEND_MM_CHECK_MAGIC(best_fit, MEM_BLOCK_CACHED); - ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 0); - HANDLE_UNBLOCK_INTERRUPTIONS(); -@@ -1919,7 +2082,7 @@ static void *_zend_mm_alloc_int(zend_mm_ - if (bitmap) { - /* Found some "small" free block that can be used */ - index += zend_mm_low_bit(bitmap); -- best_fit = heap->free_buckets[index*2]; -+ best_fit = SUHOSIN_MANGLE_PTR(heap->free_buckets[index*2]); - #if ZEND_MM_CACHE_STAT - heap->cache_stat[ZEND_MM_NUM_BUCKETS].hit++; - #endif -@@ -1934,7 +2097,7 @@ static void *_zend_mm_alloc_int(zend_mm_ - best_fit = zend_mm_search_large_block(heap, true_size); - - if (!best_fit && heap->real_size >= heap->limit - heap->block_size) { -- zend_mm_free_block *p = heap->rest_buckets[0]; -+ zend_mm_free_block *p = SUHOSIN_MANGLE_PTR(heap->rest_buckets[0]); - size_t best_size = -1; - - while (p != ZEND_MM_REST_BUCKET(heap)) { -@@ -1946,7 +2109,7 @@ static void *_zend_mm_alloc_int(zend_mm_ - best_size = ZEND_MM_FREE_BLOCK_SIZE(p); - best_fit = p; - } -- p = p->prev_free_block; -+ p = SUHOSIN_MANGLE_PTR(p->prev_free_block); - } - } - -@@ -2042,13 +2205,19 @@ zend_mm_finished_searching_for_block: - - ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 1); - -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(best_fit); -+ ((zend_mm_block*)best_fit)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(best_fit); -+#endif -+ - heap->size += true_size; - if (heap->peak < heap->size) { - heap->peak = heap->size; - } - - HANDLE_UNBLOCK_INTERRUPTIONS(); -- -+ - return ZEND_MM_DATA_OF(best_fit); - } - -@@ -2069,19 +2238,26 @@ static void _zend_mm_free_int(zend_mm_he - - mm_block = ZEND_MM_HEADER_OF(p); - size = ZEND_MM_BLOCK_SIZE(mm_block); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_CHECK_CANARIES(mm_block, "efree()"); -+#endif - ZEND_MM_CHECK_PROTECTION(mm_block); - - #if ZEND_DEBUG || ZEND_MM_HEAP_PROTECTION - memset(ZEND_MM_DATA_OF(mm_block), 0x5a, mm_block->debug.size); - #endif -- -+#if SUHOSIN_PATCH -+ if (UNEXPECTED(SUHOSIN_CONFIG(SUHOSIN_MM_DESTROY_FREE_MEMORY))) { -+ memset(ZEND_MM_DATA_OF(mm_block), 0x5a, mm_block->info.size); -+ } -+#endif - #if ZEND_MM_CACHE - if (EXPECTED(ZEND_MM_SMALL_SIZE(size)) && EXPECTED(heap->cached < ZEND_MM_CACHE_SIZE)) { - size_t index = ZEND_MM_BUCKET_INDEX(size); - zend_mm_free_block **cache = &heap->cache[index]; - - ((zend_mm_free_block*)mm_block)->prev_free_block = *cache; -- *cache = (zend_mm_free_block*)mm_block; -+ *cache = (zend_mm_free_block*)SUHOSIN_MANGLE_PTR(mm_block); - heap->cached += size; - ZEND_MM_SET_MAGIC(mm_block, MEM_BLOCK_CACHED); - #if ZEND_MM_CACHE_STAT -@@ -2116,6 +2292,9 @@ static void _zend_mm_free_int(zend_mm_he - HANDLE_UNBLOCK_INTERRUPTIONS(); - } - -+#if SUHOSIN_PATCH -+void *_zend_mm_realloc_canary_int(zend_mm_heap_canary *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -+#endif - static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) - { - zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p); -@@ -2127,7 +2306,11 @@ static void *_zend_mm_realloc_int(zend_m - TSRMLS_FETCH(); - #endif - if (UNEXPECTED(!p) || !ZEND_MM_VALID_PTR(p)) { -+#ifdef SUHOSIN_MM_WITH_CANARY_PROTECTION -+ return _zend_mm_alloc_canary_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#else - return _zend_mm_alloc_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#endif - } - - HANDLE_BLOCK_INTERRUPTIONS(); -@@ -2135,6 +2318,9 @@ static void *_zend_mm_realloc_int(zend_m - mm_block = ZEND_MM_HEADER_OF(p); - true_size = ZEND_MM_TRUE_SIZE(size); - orig_size = ZEND_MM_BLOCK_SIZE(mm_block); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_CHECK_CANARIES(mm_block, "erealloc()"); -+#endif - ZEND_MM_CHECK_PROTECTION(mm_block); - - if (UNEXPECTED(true_size < size)) { -@@ -2165,6 +2351,11 @@ static void *_zend_mm_realloc_int(zend_m - } - ZEND_MM_SET_DEBUG_INFO(mm_block, size, 0, 0); - HANDLE_UNBLOCK_INTERRUPTIONS(); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(mm_block); -+ ((zend_mm_block*)mm_block)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(mm_block); -+#endif - return p; - } - -@@ -2180,17 +2371,22 @@ static void *_zend_mm_realloc_int(zend_m - heap->cache_stat[index].count--; - heap->cache_stat[index].hit++; - #endif -- best_fit = heap->cache[index]; -+ best_fit = SUHOSIN_MANGLE_PTR(heap->cache[index]); - heap->cache[index] = best_fit->prev_free_block; - ZEND_MM_CHECK_MAGIC(best_fit, MEM_BLOCK_CACHED); -- ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 0); -- -+ ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 0); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(best_fit); -+ ((zend_mm_block*)best_fit)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(best_fit); -+#endif -+ - ptr = ZEND_MM_DATA_OF(best_fit); - - #if ZEND_DEBUG || ZEND_MM_HEAP_PROTECTION - memcpy(ptr, p, mm_block->debug.size); - #else -- memcpy(ptr, p, orig_size - ZEND_MM_ALIGNED_HEADER_SIZE); -+ memcpy(ptr, p, orig_size - ZEND_MM_ALIGNED_HEADER_SIZE - CANARY_SIZE); - #endif - - heap->cached -= true_size - orig_size; -@@ -2199,7 +2395,7 @@ static void *_zend_mm_realloc_int(zend_m - cache = &heap->cache[index]; - - ((zend_mm_free_block*)mm_block)->prev_free_block = *cache; -- *cache = (zend_mm_free_block*)mm_block; -+ *cache = (zend_mm_free_block*)SUHOSIN_MANGLE_PTR(mm_block); - ZEND_MM_SET_MAGIC(mm_block, MEM_BLOCK_CACHED); - #if ZEND_MM_CACHE_STAT - if (++heap->cache_stat[index].count > heap->cache_stat[index].max_count) { -@@ -2249,6 +2445,11 @@ static void *_zend_mm_realloc_int(zend_m - heap->peak = heap->size; - } - HANDLE_UNBLOCK_INTERRUPTIONS(); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(mm_block); -+ ((zend_mm_block*)mm_block)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(mm_block); -+#endif - return p; - } else if (ZEND_MM_IS_FIRST_BLOCK(mm_block) && - ZEND_MM_IS_GUARD_BLOCK(ZEND_MM_BLOCK_AT(next_block, ZEND_MM_FREE_BLOCK_SIZE(next_block)))) { -@@ -2349,39 +2550,75 @@ out_of_memory: - } - - HANDLE_UNBLOCK_INTERRUPTIONS(); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(mm_block); -+ ((zend_mm_block*)mm_block)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(mm_block); -+#endif - return ZEND_MM_DATA_OF(mm_block); - } - -+#ifdef SUHOSIN_MM_WITH_CANARY_PROTECTION -+ ptr = _zend_mm_alloc_canary_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#else - ptr = _zend_mm_alloc_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#endif - #if ZEND_DEBUG || ZEND_MM_HEAP_PROTECTION - memcpy(ptr, p, mm_block->debug.size); - #else -- memcpy(ptr, p, orig_size - ZEND_MM_ALIGNED_HEADER_SIZE); -+ memcpy(ptr, p, orig_size - ZEND_MM_ALIGNED_HEADER_SIZE - CANARY_SIZE); -+#endif -+#ifdef SUHOSIN_MM_WITH_CANARY_PROTECTION -+ _zend_mm_free_canary_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#else -+ _zend_mm_free_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); - #endif -- _zend_mm_free_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return ptr; - } - -+#ifndef SUHOSIN_MM_CLONE_FILE - ZEND_API void *_zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) - { -- return _zend_mm_alloc_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#if SUHOSIN_PATCH -+ if (UNEXPECTED(SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION) == 0)) -+#endif -+ return _zend_mm_alloc_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#if SUHOSIN_PATCH -+ return _zend_mm_alloc_canary_int((zend_mm_heap_canary *)heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#endif - } - - ZEND_API void _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) - { -- _zend_mm_free_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#if SUHOSIN_PATCH -+ if (UNEXPECTED(SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION) == 0)) -+#endif -+ { _zend_mm_free_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); return; } -+#if SUHOSIN_PATCH -+ _zend_mm_free_canary_int((zend_mm_heap_canary *)heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#endif - } - - ZEND_API void *_zend_mm_realloc(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) - { -- return _zend_mm_realloc_int(heap, ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#if SUHOSIN_PATCH -+ if (UNEXPECTED(SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION) == 0)) -+#endif -+ return _zend_mm_realloc_int(heap, ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#if SUHOSIN_PATCH -+ return _zend_mm_realloc_canary_int((zend_mm_heap_canary *)heap, ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#endif - } - - ZEND_API size_t _zend_mm_block_size(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) - { - zend_mm_block *mm_block; - -+ if (SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION) != 0) { -+ return _zend_mm_block_size_canary((zend_mm_heap_canary *)heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ - if (!ZEND_MM_VALID_PTR(p)) { - return 0; - } -@@ -2393,6 +2630,24 @@ ZEND_API size_t _zend_mm_block_size(zend - return ZEND_MM_BLOCK_SIZE(mm_block); - #endif - } -+#else -+ZEND_API size_t _zend_mm_block_size_canary(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -+{ -+ zend_mm_block *mm_block; -+ -+ if (!ZEND_MM_VALID_PTR(p)) { -+ return 0; -+ } -+ mm_block = ZEND_MM_HEADER_OF(p); -+ ZEND_MM_CHECK_PROTECTION(mm_block); -+#if ZEND_DEBUG || ZEND_MM_HEAP_PROTECTION -+ return mm_block->debug.size; -+#else -+ return ZEND_MM_BLOCK_SIZE(mm_block); -+#endif -+} -+ -+#endif - - /**********************/ - /* Allocation Manager */ -@@ -2410,6 +2665,7 @@ static int alloc_globals_id; - static zend_alloc_globals alloc_globals; - #endif - -+#ifndef SUHOSIN_MM_CLONE_FILE - ZEND_API int is_zend_mm(TSRMLS_D) - { - return AG(mm_heap)->use_zend_alloc; -@@ -2422,7 +2678,13 @@ ZEND_API void *_emalloc(size_t size ZEND - if (UNEXPECTED(!AG(mm_heap)->use_zend_alloc)) { - return AG(mm_heap)->_malloc(size); - } -+#if SUHOSIN_PATCH -+ if (UNEXPECTED(SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION) == 0)) -+#endif - return _zend_mm_alloc_int(AG(mm_heap), size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#if SUHOSIN_PATCH -+ return _zend_mm_alloc_canary_int((zend_mm_heap_canary *)AG(mm_heap), size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#endif - } - - ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -@@ -2433,7 +2695,13 @@ ZEND_API void _efree(void *ptr ZEND_FILE - AG(mm_heap)->_free(ptr); - return; - } -- _zend_mm_free_int(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#if SUHOSIN_PATCH -+ if (UNEXPECTED(SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION) == 0)) -+#endif -+ { _zend_mm_free_int(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); return; } -+#if SUHOSIN_PATCH -+ _zend_mm_free_canary_int((zend_mm_heap_canary *)AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#endif - } - - ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -@@ -2443,7 +2711,13 @@ ZEND_API void *_erealloc(void *ptr, size - if (UNEXPECTED(!AG(mm_heap)->use_zend_alloc)) { - return AG(mm_heap)->_realloc(ptr, size); - } -+#if SUHOSIN_PATCH -+ if (UNEXPECTED(SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION) == 0)) -+#endif - return _zend_mm_realloc_int(AG(mm_heap), ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#if SUHOSIN_PATCH -+ return _zend_mm_realloc_canary_int((zend_mm_heap_canary *)AG(mm_heap), ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#endif - } - - ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -@@ -2451,8 +2725,15 @@ ZEND_API size_t _zend_mem_block_size(voi - if (UNEXPECTED(!AG(mm_heap)->use_zend_alloc)) { - return 0; - } -- return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#if SUHOSIN_PATCH -+ if (UNEXPECTED(SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION) == 0)) -+#endif -+ return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#if SUHOSIN_PATCH -+ return _zend_mm_block_size_canary((zend_mm_heap_canary *)AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#endif - } -+#endif - - #if defined(__GNUC__) && defined(i386) - -@@ -2523,7 +2804,7 @@ static inline size_t safe_address(size_t - } - #endif - -- -+#ifndef SUHOSIN_MM_CLONE_FILE - ZEND_API void *_safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) - { - return emalloc_rel(safe_address(nmemb, size, offset)); -@@ -2663,6 +2944,7 @@ ZEND_API void shutdown_memory_manager(in - { - zend_mm_shutdown(AG(mm_heap), full_shutdown, silent TSRMLS_CC); - } -+#endif - - static void alloc_globals_ctor(zend_alloc_globals *alloc_globals TSRMLS_DC) - { -@@ -2687,6 +2969,7 @@ static void alloc_globals_dtor(zend_allo - } - #endif - -+#ifndef SUHOSIN_MM_CLONE_FILE - ZEND_API void start_memory_manager(TSRMLS_D) - { - #ifdef ZTS -@@ -2751,6 +3034,7 @@ ZEND_API void _full_mem_check(int silent - zend_debug_alloc_output("------------------------------------------------\n"); - } - #endif -+#endif - - /* - * Local variables: ---- a/Zend/zend_alloc.h -+++ b/Zend/zend_alloc.h -@@ -189,6 +189,8 @@ END_EXTERN_C() - - /* Heap functions */ - typedef struct _zend_mm_heap zend_mm_heap; -+typedef struct _zend_mm_heap_canary zend_mm_heap_canary; -+ - - ZEND_API zend_mm_heap *zend_mm_startup(void); - ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent TSRMLS_DC); ---- /dev/null -+++ b/Zend/zend_alloc_canary.c -@@ -0,0 +1,2498 @@ -+/* -+ +----------------------------------------------------------------------+ -+ | Suhosin-Patch for PHP | -+ +----------------------------------------------------------------------+ -+ | Copyright (c) 2004-2010 Stefan Esser | -+ +----------------------------------------------------------------------+ -+ | This source file is subject to version 2.02 of the PHP license, | -+ | that is bundled with this package in the file LICENSE, and is | -+ | available at through the world-wide-web at | -+ | http://www.php.net/license/2_02.txt. | -+ | If you did not receive a copy of the PHP license and are unable to | -+ | obtain it through the world-wide-web, please send a note to | -+ | license@php.net so we can mail you a copy immediately. | -+ +----------------------------------------------------------------------+ -+ | Author: Stefan Esser | -+ +----------------------------------------------------------------------+ -+ */ -+/* $Id: zend_alloc_canary.c, $ */ -+ -+#include "zend.h" -+#include "zend_alloc.h" -+#include "zend_globals.h" -+#include "zend_operators.h" -+ -+#ifdef HAVE_SIGNAL_H -+# include -+#endif -+#ifdef HAVE_UNISTD_H -+# include -+#endif -+ -+#if SUHOSIN_PATCH -+#include "suhosin_patch.h" -+#endif -+ -+#ifdef ZEND_WIN32 -+# include -+# include -+#endif -+ -+#ifndef ZEND_MM_HEAP_PROTECTION -+# define ZEND_MM_HEAP_PROTECTION ZEND_DEBUG -+#endif -+ -+#ifndef ZEND_MM_SAFE_UNLINKING -+# define ZEND_MM_SAFE_UNLINKING 1 -+#endif -+ -+#ifndef ZEND_MM_COOKIES -+# define ZEND_MM_COOKIES ZEND_DEBUG -+#endif -+ -+#ifdef _WIN64 -+# define PTR_FMT "0x%0.16I64x" -+/* -+#elif sizeof(long) == 8 -+# define PTR_FMT "0x%0.16lx" -+*/ -+#else -+# define PTR_FMT "0x%0.8lx" -+#endif -+ -+#define SUHOSIN_MM_WITH_CANARY_PROTECTION 1 -+ -+#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) -+static void zend_mm_panic(const char *message) __attribute__ ((noreturn)); -+#endif -+ -+static void zend_mm_panic(const char *message) -+{ -+ fprintf(stderr, "%s\n", message); -+/* See http://support.microsoft.com/kb/190351 */ -+#ifdef PHP_WIN32 -+ fflush(stderr); -+#endif -+#if ZEND_DEBUG && defined(HAVE_KILL) && defined(HAVE_GETPID) -+ kill(getpid(), SIGSEGV); -+#endif -+ exit(1); -+} -+ -+/*******************/ -+/* Storage Manager */ -+/*******************/ -+ -+#ifdef ZEND_WIN32 -+# define HAVE_MEM_WIN32 /* use VirtualAlloc() to allocate memory */ -+#endif -+#define HAVE_MEM_MALLOC /* use malloc() to allocate segments */ -+ -+#include -+#include -+#if HAVE_LIMITS_H -+#include -+#endif -+#include -+#include -+ -+#if defined(HAVE_MEM_MMAP_ANON) || defined(HAVE_MEM_MMAP_ZERO) -+# ifdef HAVE_MREMAP -+# ifndef _GNU_SOURCE -+# define _GNU_SOURCE -+# endif -+# ifndef __USE_GNU -+# define __USE_GNU -+# endif -+# endif -+# include -+# ifndef MAP_ANON -+# ifdef MAP_ANONYMOUS -+# define MAP_ANON MAP_ANONYMOUS -+# endif -+# endif -+# ifndef MREMAP_MAYMOVE -+# define MREMAP_MAYMOVE 0 -+# endif -+# ifndef MAP_FAILED -+# define MAP_FAILED ((void*)-1) -+# endif -+#endif -+ -+static zend_intptr_t SUHOSIN_POINTER_GUARD = 0; -+ -+static zend_mm_storage* zend_mm_mem_dummy_init(void *params) -+{ -+ return malloc(sizeof(zend_mm_storage)); -+} -+ -+static void zend_mm_mem_dummy_dtor(zend_mm_storage *storage) -+{ -+ free(storage); -+} -+ -+static void zend_mm_mem_dummy_compact(zend_mm_storage *storage) -+{ -+} -+ -+#if defined(HAVE_MEM_MMAP_ANON) || defined(HAVE_MEM_MMAP_ZERO) -+ -+static zend_mm_segment* zend_mm_mem_mmap_realloc(zend_mm_storage *storage, zend_mm_segment* segment, size_t size) -+{ -+ zend_mm_segment *ret; -+#ifdef HAVE_MREMAP -+#if defined(__NetBSD__) -+ /* NetBSD 5 supports mremap but takes an extra newp argument */ -+ ret = (zend_mm_segment*)mremap(segment, segment->size, segment, size, MREMAP_MAYMOVE); -+#else -+ ret = (zend_mm_segment*)mremap(segment, segment->size, size, MREMAP_MAYMOVE); -+#endif -+ if (ret == MAP_FAILED) { -+#endif -+ ret = storage->handlers->_alloc(storage, size); -+ if (ret) { -+ memcpy(ret, segment, size > segment->size ? segment->size : size); -+ storage->handlers->_free(storage, segment); -+ } -+#ifdef HAVE_MREMAP -+ } -+#endif -+ return ret; -+} -+ -+static void zend_mm_mem_mmap_free(zend_mm_storage *storage, zend_mm_segment* segment) -+{ -+ munmap((void*)segment, segment->size); -+} -+ -+#endif -+ -+#ifdef HAVE_MEM_MMAP_ANON -+ -+static zend_mm_segment* zend_mm_mem_mmap_anon_alloc(zend_mm_storage *storage, size_t size) -+{ -+ zend_mm_segment *ret = (zend_mm_segment*)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); -+ if (ret == MAP_FAILED) { -+ ret = NULL; -+ } -+ return ret; -+} -+ -+# define ZEND_MM_MEM_MMAP_ANON_DSC {"mmap_anon", zend_mm_mem_dummy_init, zend_mm_mem_dummy_dtor, zend_mm_mem_dummy_compact, zend_mm_mem_mmap_anon_alloc, zend_mm_mem_mmap_realloc, zend_mm_mem_mmap_free} -+ -+#endif -+ -+#ifdef HAVE_MEM_MMAP_ZERO -+ -+static int zend_mm_dev_zero_fd = -1; -+ -+static zend_mm_storage* zend_mm_mem_mmap_zero_init(void *params) -+{ -+ if (zend_mm_dev_zero_fd != -1) { -+ zend_mm_dev_zero_fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR); -+ } -+ if (zend_mm_dev_zero_fd >= 0) { -+ return malloc(sizeof(zend_mm_storage)); -+ } else { -+ return NULL; -+ } -+} -+ -+static void zend_mm_mem_mmap_zero_dtor(zend_mm_storage *storage) -+{ -+ close(zend_mm_dev_zero_fd); -+ free(storage); -+} -+ -+static zend_mm_segment* zend_mm_mem_mmap_zero_alloc(zend_mm_storage *storage, size_t size) -+{ -+ zend_mm_segment *ret = (zend_mm_segment*)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, zend_mm_dev_zero_fd, 0); -+ if (ret == MAP_FAILED) { -+ ret = NULL; -+ } -+ return ret; -+} -+ -+# define ZEND_MM_MEM_MMAP_ZERO_DSC {"mmap_zero", zend_mm_mem_mmap_zero_init, zend_mm_mem_mmap_zero_dtor, zend_mm_mem_dummy_compact, zend_mm_mem_mmap_zero_alloc, zend_mm_mem_mmap_realloc, zend_mm_mem_mmap_free} -+ -+#endif -+ -+#ifdef HAVE_MEM_WIN32 -+ -+static zend_mm_storage* zend_mm_mem_win32_init(void *params) -+{ -+ HANDLE heap = HeapCreate(HEAP_NO_SERIALIZE, 0, 0); -+ zend_mm_storage* storage; -+ -+ if (heap == NULL) { -+ return NULL; -+ } -+ storage = (zend_mm_storage*)malloc(sizeof(zend_mm_storage)); -+ storage->data = (void*) heap; -+ return storage; -+} -+ -+static void zend_mm_mem_win32_dtor(zend_mm_storage *storage) -+{ -+ HeapDestroy((HANDLE)storage->data); -+ free(storage); -+} -+ -+static void zend_mm_mem_win32_compact(zend_mm_storage *storage) -+{ -+ HeapDestroy((HANDLE)storage->data); -+ storage->data = (void*)HeapCreate(HEAP_NO_SERIALIZE, 0, 0); -+} -+ -+static zend_mm_segment* zend_mm_mem_win32_alloc(zend_mm_storage *storage, size_t size) -+{ -+ return (zend_mm_segment*) HeapAlloc((HANDLE)storage->data, HEAP_NO_SERIALIZE, size); -+} -+ -+static void zend_mm_mem_win32_free(zend_mm_storage *storage, zend_mm_segment* segment) -+{ -+ HeapFree((HANDLE)storage->data, HEAP_NO_SERIALIZE, segment); -+} -+ -+static zend_mm_segment* zend_mm_mem_win32_realloc(zend_mm_storage *storage, zend_mm_segment* segment, size_t size) -+{ -+ return (zend_mm_segment*) HeapReAlloc((HANDLE)storage->data, HEAP_NO_SERIALIZE, segment, size); -+} -+ -+# define ZEND_MM_MEM_WIN32_DSC {"win32", zend_mm_mem_win32_init, zend_mm_mem_win32_dtor, zend_mm_mem_win32_compact, zend_mm_mem_win32_alloc, zend_mm_mem_win32_realloc, zend_mm_mem_win32_free} -+ -+#endif -+ -+#ifdef HAVE_MEM_MALLOC -+ -+static zend_mm_segment* zend_mm_mem_malloc_alloc(zend_mm_storage *storage, size_t size) -+{ -+ return (zend_mm_segment*)malloc(size); -+} -+ -+static zend_mm_segment* zend_mm_mem_malloc_realloc(zend_mm_storage *storage, zend_mm_segment *ptr, size_t size) -+{ -+ return (zend_mm_segment*)realloc(ptr, size); -+} -+ -+static void zend_mm_mem_malloc_free(zend_mm_storage *storage, zend_mm_segment *ptr) -+{ -+ free(ptr); -+} -+ -+# define ZEND_MM_MEM_MALLOC_DSC {"malloc", zend_mm_mem_dummy_init, zend_mm_mem_dummy_dtor, zend_mm_mem_dummy_compact, zend_mm_mem_malloc_alloc, zend_mm_mem_malloc_realloc, zend_mm_mem_malloc_free} -+ -+#endif -+ -+static const zend_mm_mem_handlers mem_handlers[] = { -+#ifdef HAVE_MEM_WIN32 -+ ZEND_MM_MEM_WIN32_DSC, -+#endif -+#ifdef HAVE_MEM_MALLOC -+ ZEND_MM_MEM_MALLOC_DSC, -+#endif -+#ifdef HAVE_MEM_MMAP_ANON -+ ZEND_MM_MEM_MMAP_ANON_DSC, -+#endif -+#ifdef HAVE_MEM_MMAP_ZERO -+ ZEND_MM_MEM_MMAP_ZERO_DSC, -+#endif -+ {NULL, NULL, NULL, NULL, NULL, NULL} -+}; -+ -+# define ZEND_MM_STORAGE_DTOR() heap->storage->handlers->dtor(heap->storage) -+# define ZEND_MM_STORAGE_ALLOC(size) heap->storage->handlers->_alloc(heap->storage, size) -+# define ZEND_MM_STORAGE_REALLOC(ptr, size) heap->storage->handlers->_realloc(heap->storage, ptr, size) -+# define ZEND_MM_STORAGE_FREE(ptr) heap->storage->handlers->_free(heap->storage, ptr) -+ -+/****************/ -+/* Heap Manager */ -+/****************/ -+ -+#define MEM_BLOCK_VALID 0x7312F8DC -+#define MEM_BLOCK_FREED 0x99954317 -+#define MEM_BLOCK_CACHED 0xFB8277DC -+#define MEM_BLOCK_GUARD 0x2A8FCC84 -+#define MEM_BLOCK_LEAK 0x6C5E8F2D -+ -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+# define CANARY_SIZE sizeof(size_t) -+#else -+# define CANARY_SIZE 0 -+#endif -+ -+/* mm block type */ -+typedef struct _zend_mm_block_info_canary { -+#if ZEND_MM_COOKIES -+ size_t _cookie; -+#endif -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+ size_t canary_1; -+#endif -+ size_t _size; -+ size_t _prev; -+#if SUHOSIN_PATCH -+ size_t size; -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+ size_t canary_2; -+#endif -+#endif -+} zend_mm_block_info_canary; -+ -+#if ZEND_DEBUG -+ -+typedef struct _zend_mm_debug_info_canary { -+ char *filename; -+ uint lineno; -+ char *orig_filename; -+ uint orig_lineno; -+ size_t size; -+#if ZEND_MM_HEAP_PROTECTION -+ unsigned int start_magic; -+#endif -+} zend_mm_debug_info_canary; -+ -+#elif ZEND_MM_HEAP_PROTECTION -+ -+typedef struct _zend_mm_debug_info_canary { -+ size_t size; -+ unsigned int start_magic; -+} zend_mm_debug_info_canary; -+ -+#endif -+ -+typedef struct _zend_mm_block_canary { -+ zend_mm_block_info_canary info; -+#if ZEND_DEBUG -+ unsigned int magic; -+# ifdef ZTS -+ THREAD_T thread_id; -+# endif -+ zend_mm_debug_info_canary debug; -+#elif ZEND_MM_HEAP_PROTECTION -+ zend_mm_debug_info_canary debug; -+#endif -+} zend_mm_block_canary; -+ -+typedef struct _zend_mm_small_free_block_canary { -+ zend_mm_block_info_canary info; -+#if ZEND_DEBUG -+ unsigned int magic; -+# ifdef ZTS -+ THREAD_T thread_id; -+# endif -+#endif -+ struct _zend_mm_free_block_canary *prev_free_block; -+ struct _zend_mm_free_block_canary *next_free_block; -+} zend_mm_small_free_block_canary; -+ -+typedef struct _zend_mm_free_block_canary { -+ zend_mm_block_info_canary info; -+#if ZEND_DEBUG -+ unsigned int magic; -+# ifdef ZTS -+ THREAD_T thread_id; -+# endif -+#endif -+ struct _zend_mm_free_block_canary *prev_free_block; -+ struct _zend_mm_free_block_canary *next_free_block; -+ -+ struct _zend_mm_free_block_canary **parent; -+ struct _zend_mm_free_block_canary *child[2]; -+} zend_mm_free_block_canary; -+ -+#define ZEND_MM_NUM_BUCKETS (sizeof(size_t) << 3) -+ -+#define ZEND_MM_CACHE 1 -+#define ZEND_MM_CACHE_SIZE (ZEND_MM_NUM_BUCKETS * 4 * 1024) -+ -+#ifndef ZEND_MM_CACHE_STAT -+# define ZEND_MM_CACHE_STAT 0 -+#endif -+ -+typedef struct _zend_mm_heap_canary { -+ int use_zend_alloc; -+ void *(*_malloc)(size_t); -+ void (*_free)(void*); -+ void *(*_realloc)(void*, size_t); -+ size_t free_bitmap; -+ size_t large_free_bitmap; -+ size_t block_size; -+ size_t compact_size; -+ zend_mm_segment *segments_list; -+ zend_mm_storage *storage; -+ size_t real_size; -+ size_t real_peak; -+ size_t limit; -+ size_t size; -+ size_t peak; -+ size_t reserve_size; -+ void *reserve; -+ int overflow; -+ int internal; -+#if ZEND_MM_CACHE -+ unsigned int cached; -+ zend_mm_free_block_canary *cache[ZEND_MM_NUM_BUCKETS]; -+#endif -+ zend_mm_free_block_canary *free_buckets[ZEND_MM_NUM_BUCKETS*2]; -+ zend_mm_free_block_canary *large_free_buckets[ZEND_MM_NUM_BUCKETS]; -+ zend_mm_free_block_canary *rest_buckets[2]; -+#if ZEND_MM_CACHE_STAT -+ struct { -+ int count; -+ int max_count; -+ int hit; -+ int miss; -+ } cache_stat[ZEND_MM_NUM_BUCKETS+1]; -+#endif -+#if SUHOSIN_PATCH -+ size_t canary_1,canary_2,canary_3; -+#endif -+}; -+ -+#define ZEND_MM_SMALL_FREE_BUCKET(heap, index) \ -+ (zend_mm_free_block_canary*) ((char*)&heap->free_buckets[index * 2] + \ -+ sizeof(zend_mm_free_block_canary*) * 2 - \ -+ sizeof(zend_mm_small_free_block_canary)) -+ -+#define ZEND_MM_REST_BUCKET(heap) \ -+ (zend_mm_free_block_canary*)((char*)&heap->rest_buckets[0] + \ -+ sizeof(zend_mm_free_block_canary*) * 2 - \ -+ sizeof(zend_mm_small_free_block_canary)) -+ -+#if ZEND_MM_COOKIES -+ -+static unsigned int _zend_mm_cookie = 0; -+ -+# define ZEND_MM_COOKIE(block) \ -+ (((size_t)(block)) ^ _zend_mm_cookie) -+# define ZEND_MM_SET_COOKIE(block) \ -+ (block)->info._cookie = ZEND_MM_COOKIE(block) -+# define ZEND_MM_CHECK_COOKIE(block) \ -+ if (UNEXPECTED((block)->info._cookie != ZEND_MM_COOKIE(block))) { \ -+ zend_mm_panic("zend_mm_heap corrupted"); \ -+ } -+#else -+# define ZEND_MM_SET_COOKIE(block) -+# define ZEND_MM_CHECK_COOKIE(block) -+#endif -+ -+/* Default memory segment size */ -+#define ZEND_MM_SEG_SIZE (256 * 1024) -+ -+/* Reserved space for error reporting in case of memory overflow */ -+#define ZEND_MM_RESERVE_SIZE (8*1024) -+ -+#ifdef _WIN64 -+# define ZEND_MM_LONG_CONST(x) (x##i64) -+#else -+# define ZEND_MM_LONG_CONST(x) (x##L) -+#endif -+ -+#define ZEND_MM_TYPE_MASK ZEND_MM_LONG_CONST(0x3) -+ -+#define ZEND_MM_FREE_BLOCK ZEND_MM_LONG_CONST(0x0) -+#define ZEND_MM_USED_BLOCK ZEND_MM_LONG_CONST(0x1) -+#define ZEND_MM_GUARD_BLOCK ZEND_MM_LONG_CONST(0x3) -+ -+#define ZEND_MM_BLOCK(b, type, size) do { \ -+ size_t _size = (size); \ -+ (b)->info._size = (type) | _size; \ -+ ZEND_MM_BLOCK_AT(b, _size)->info._prev = (type) | _size; \ -+ ZEND_MM_SET_COOKIE(b); \ -+ } while (0); -+#define ZEND_MM_LAST_BLOCK(b) do { \ -+ (b)->info._size = ZEND_MM_GUARD_BLOCK | ZEND_MM_ALIGNED_HEADER_SIZE; \ -+ ZEND_MM_SET_MAGIC(b, MEM_BLOCK_GUARD); \ -+ } while (0); -+#define ZEND_MM_BLOCK_SIZE(b) ((b)->info._size & ~ZEND_MM_TYPE_MASK) -+#define ZEND_MM_IS_FREE_BLOCK(b) (!((b)->info._size & ZEND_MM_USED_BLOCK)) -+#define ZEND_MM_IS_USED_BLOCK(b) ((b)->info._size & ZEND_MM_USED_BLOCK) -+#define ZEND_MM_IS_GUARD_BLOCK(b) (((b)->info._size & ZEND_MM_TYPE_MASK) == ZEND_MM_GUARD_BLOCK) -+ -+#define ZEND_MM_NEXT_BLOCK(b) ZEND_MM_BLOCK_AT(b, ZEND_MM_BLOCK_SIZE(b)) -+#define ZEND_MM_PREV_BLOCK(b) ZEND_MM_BLOCK_AT(b, -(int)((b)->info._prev & ~ZEND_MM_TYPE_MASK)) -+ -+#define ZEND_MM_PREV_BLOCK_IS_FREE(b) (!((b)->info._prev & ZEND_MM_USED_BLOCK)) -+ -+#define ZEND_MM_MARK_FIRST_BLOCK(b) ((b)->info._prev = ZEND_MM_GUARD_BLOCK) -+#define ZEND_MM_IS_FIRST_BLOCK(b) ((b)->info._prev == ZEND_MM_GUARD_BLOCK) -+ -+/* optimized access */ -+#define ZEND_MM_FREE_BLOCK_SIZE(b) (b)->info._size -+ -+#ifndef ZEND_MM_ALIGNMENT -+# define ZEND_MM_ALIGNMENT 8 -+# define ZEND_MM_ALIGNMENT_LOG2 3 -+#elif ZEND_MM_ALIGNMENT < 4 -+# undef ZEND_MM_ALIGNMENT -+# undef ZEND_MM_ALIGNMENT_LOG2 -+# define ZEND_MM_ALIGNMENT 4 -+# define ZEND_MM_ALIGNMENT_LOG2 2 -+#endif -+ -+#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1) -+ -+/* Aligned header size */ -+#define ZEND_MM_ALIGNED_SIZE(size) ((size + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK) -+#define ZEND_MM_ALIGNED_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_block_canary)) -+#define ZEND_MM_ALIGNED_FREE_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_small_free_block_canary)) -+#define ZEND_MM_MIN_ALLOC_BLOCK_SIZE ZEND_MM_ALIGNED_SIZE(ZEND_MM_ALIGNED_HEADER_SIZE + END_MAGIC_SIZE + CANARY_SIZE) -+#define ZEND_MM_ALIGNED_MIN_HEADER_SIZE (ZEND_MM_MIN_ALLOC_BLOCK_SIZE>ZEND_MM_ALIGNED_FREE_HEADER_SIZE?ZEND_MM_MIN_ALLOC_BLOCK_SIZE:ZEND_MM_ALIGNED_FREE_HEADER_SIZE) -+#define ZEND_MM_ALIGNED_SEGMENT_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_segment)) -+ -+#define ZEND_MM_MIN_SIZE ((ZEND_MM_ALIGNED_MIN_HEADER_SIZE>(ZEND_MM_ALIGNED_HEADER_SIZE+END_MAGIC_SIZE+CANARY_SIZE))?(ZEND_MM_ALIGNED_MIN_HEADER_SIZE-(ZEND_MM_ALIGNED_HEADER_SIZE+END_MAGIC_SIZE+CANARY_SIZE)):0) -+ -+#define ZEND_MM_MAX_SMALL_SIZE ((ZEND_MM_NUM_BUCKETS<>ZEND_MM_ALIGNMENT_LOG2)-(ZEND_MM_ALIGNED_MIN_HEADER_SIZE>>ZEND_MM_ALIGNMENT_LOG2)) -+ -+#define ZEND_MM_SMALL_SIZE(true_size) (true_size < ZEND_MM_MAX_SMALL_SIZE) -+ -+/* Memory calculations */ -+#define ZEND_MM_BLOCK_AT(blk, offset) ((zend_mm_block_canary *) (((char *) (blk))+(offset))) -+#define ZEND_MM_DATA_OF(p) ((void *) (((char *) (p))+ZEND_MM_ALIGNED_HEADER_SIZE)) -+#define ZEND_MM_HEADER_OF(blk) ZEND_MM_BLOCK_AT(blk, -(int)ZEND_MM_ALIGNED_HEADER_SIZE) -+ -+/* Debug output */ -+#if ZEND_DEBUG -+ -+# ifdef ZTS -+# define ZEND_MM_SET_THREAD_ID(block) \ -+ ((zend_mm_block_canary*)(block))->thread_id = tsrm_thread_id() -+# define ZEND_MM_BAD_THREAD_ID(block) ((block)->thread_id != tsrm_thread_id()) -+# else -+# define ZEND_MM_SET_THREAD_ID(block) -+# define ZEND_MM_BAD_THREAD_ID(block) 0 -+# endif -+ -+# define ZEND_MM_VALID_PTR(block) \ -+ zend_mm_check_ptr(heap, block, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC) -+ -+# define ZEND_MM_SET_MAGIC(block, val) do { \ -+ (block)->magic = (val); \ -+ } while (0) -+ -+# define ZEND_MM_CHECK_MAGIC(block, val) do { \ -+ if ((block)->magic != (val)) { \ -+ zend_mm_panic("zend_mm_heap corrupted"); \ -+ } \ -+ } while (0) -+ -+# define ZEND_MM_SET_DEBUG_INFO(block, __size, set_valid, set_thread) do { \ -+ ((zend_mm_block_canary*)(block))->debug.filename = __zend_filename; \ -+ ((zend_mm_block_canary*)(block))->debug.lineno = __zend_lineno; \ -+ ((zend_mm_block_canary*)(block))->debug.orig_filename = __zend_orig_filename; \ -+ ((zend_mm_block_canary*)(block))->debug.orig_lineno = __zend_orig_lineno; \ -+ ZEND_MM_SET_BLOCK_SIZE(block, __size); \ -+ if (set_valid) { \ -+ ZEND_MM_SET_MAGIC(block, MEM_BLOCK_VALID); \ -+ } \ -+ if (set_thread) { \ -+ ZEND_MM_SET_THREAD_ID(block); \ -+ } \ -+ } while (0) -+ -+#else -+ -+# define ZEND_MM_VALID_PTR(ptr) EXPECTED(ptr != NULL) -+ -+# define ZEND_MM_SET_MAGIC(block, val) -+ -+# define ZEND_MM_CHECK_MAGIC(block, val) -+ -+# define ZEND_MM_SET_DEBUG_INFO(block, __size, set_valid, set_thread) ZEND_MM_SET_BLOCK_SIZE(block, __size) -+ -+#endif -+ -+#if SUHOSIN_MM_WITH_CANARY_PROTECTION -+ -+# define SUHOSIN_MM_CHECK_CANARIES(block, MFUNCTION) do { \ -+ char *p = SUHOSIN_MM_END_CANARY_PTR(block); size_t check; \ -+ if (((block)->info.canary_1 != heap->canary_1) || ((block)->info.canary_2 != heap->canary_2)) { \ -+ canary_mismatch: \ -+ zend_suhosin_log(S_MEMORY, "canary mismatch on " MFUNCTION " - heap overflow detected at %p", (block)); \ -+ if (SUHOSIN_CONFIG(SUHOSIN_MM_IGNORE_CANARY_VIOLATION) == 0) { _exit(1); } else { (block)->info.canary_1 = heap->canary_1; (block)->info.canary_2 = heap->canary_2; }\ -+ } \ -+ memcpy(&check, p, CANARY_SIZE); \ -+ if (check != heap->canary_3) { \ -+ zend_suhosin_log(S_MEMORY, "end canary mismatch on " MFUNCTION " - heap overflow detected at %p", (block)); \ -+ if (SUHOSIN_CONFIG(SUHOSIN_MM_IGNORE_CANARY_VIOLATION) == 0) { _exit(1); } else { memcpy(p, heap->canary_3, CANARY_SIZE); } \ -+ } \ -+ } while (0) -+ -+# define SUHOSIN_MM_SET_CANARIES(block) do { \ -+ (block)->info.canary_1 = heap->canary_1; \ -+ (block)->info.canary_2 = heap->canary_2; \ -+ } while (0) -+ -+# define SUHOSIN_MM_END_CANARY_PTR(block) \ -+ (char *)(((char*)(ZEND_MM_DATA_OF(block))) + ((zend_mm_block_canary*)(block))->info.size + END_MAGIC_SIZE) -+ -+# define SUHOSIN_MM_SET_END_CANARY(block) do { \ -+ char *p = SUHOSIN_MM_END_CANARY_PTR(block); \ -+ memcpy(p, &heap->canary_3, CANARY_SIZE); \ -+ } while (0) -+ -+#else -+ -+# define SUHOSIN_MM_CHECK_CANARIES(block, MFUNCTION) -+# define SUHOSIN_MM_SET_CANARIES(block) -+# define SUHOSIN_MM_END_CANARY_PTR(block) -+# define SUHOSIN_MM_SET_END_CANARY(block) -+ -+#endif -+ -+ -+#if ZEND_MM_HEAP_PROTECTION -+ -+# define ZEND_MM_CHECK_PROTECTION(block) \ -+ do { \ -+ if ((block)->debug.start_magic != _mem_block_start_magic || \ -+ memcmp(ZEND_MM_END_MAGIC_PTR(block), &_mem_block_end_magic, END_MAGIC_SIZE) != 0) { \ -+ zend_mm_panic("zend_mm_heap corrupted"); \ -+ } \ -+ } while (0) -+ -+# define ZEND_MM_END_MAGIC_PTR(block) \ -+ (((char*)(ZEND_MM_DATA_OF(block))) + ((zend_mm_block_canary*)(block))->debug.size) -+ -+# define END_MAGIC_SIZE sizeof(unsigned int) -+ -+# define ZEND_MM_SET_BLOCK_SIZE(block, __size) do { \ -+ char *p; \ -+ ((zend_mm_block_canary*)(block))->debug.size = (__size); \ -+ p = ZEND_MM_END_MAGIC_PTR(block); \ -+ ((zend_mm_block_canary*)(block))->debug.start_magic = _mem_block_start_magic; \ -+ memcpy(p, &_mem_block_end_magic, END_MAGIC_SIZE); \ -+ } while (0) -+ -+static unsigned int _mem_block_start_magic = 0; -+static unsigned int _mem_block_end_magic = 0; -+ -+#else -+ -+# if ZEND_DEBUG -+# define ZEND_MM_SET_BLOCK_SIZE(block, _size) \ -+ ((zend_mm_block_canary*)(block))->debug.size = (_size) -+# else -+# define ZEND_MM_SET_BLOCK_SIZE(block, _size) -+# endif -+ -+# define ZEND_MM_CHECK_PROTECTION(block) -+ -+# define END_MAGIC_SIZE 0 -+ -+#endif -+ -+#if ZEND_MM_SAFE_UNLINKING -+# define ZEND_MM_CHECK_BLOCK_LINKAGE(block) \ -+ if (UNEXPECTED((block)->info._size != ZEND_MM_BLOCK_AT(block, ZEND_MM_FREE_BLOCK_SIZE(block))->info._prev) || \ -+ UNEXPECTED(!UNEXPECTED(ZEND_MM_IS_FIRST_BLOCK(block)) && \ -+ UNEXPECTED(ZEND_MM_PREV_BLOCK(block)->info._size != (block)->info._prev))) { \ -+ zend_mm_panic("zend_mm_heap corrupted"); \ -+ } -+#define ZEND_MM_CHECK_TREE(block) \ -+ if (UNEXPECTED(*((block)->parent) != (block))) { \ -+ zend_mm_panic("zend_mm_heap corrupted"); \ -+ } -+#else -+# define ZEND_MM_CHECK_BLOCK_LINKAGE(block) -+# define ZEND_MM_CHECK_TREE(block) -+#endif -+ -+#define ZEND_MM_LARGE_BUCKET_INDEX(S) zend_mm_high_bit(S) -+ -+void *_zend_mm_alloc_canary_int(zend_mm_heap_canary *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC; -+void _zend_mm_free_canary_int(zend_mm_heap_canary *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -+void *_zend_mm_realloc_canary_int(zend_mm_heap_canary *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -+ -+ -+static inline unsigned int zend_mm_high_bit(size_t _size) -+{ -+#if defined(__GNUC__) && defined(i386) -+ unsigned int n; -+ -+ __asm__("bsrl %1,%0\n\t" : "=r" (n) : "rm" (_size)); -+ return n; -+#elif defined(__GNUC__) && defined(__x86_64__) -+ unsigned long n; -+ -+ __asm__("bsrq %1,%0\n\t" : "=r" (n) : "rm" (_size)); -+ return (unsigned int)n; -+#elif defined(_MSC_VER) && defined(_M_IX86) -+ __asm { -+ bsr eax, _size -+ } -+#else -+ unsigned int n = 0; -+ while (_size != 0) { -+ _size = _size >> 1; -+ n++; -+ } -+ return n-1; -+#endif -+} -+ -+static inline unsigned int zend_mm_low_bit(size_t _size) -+{ -+#if defined(__GNUC__) && defined(i386) -+ unsigned int n; -+ -+ __asm__("bsfl %1,%0\n\t" : "=r" (n) : "rm" (_size)); -+ return n; -+#elif defined(__GNUC__) && defined(__x86_64__) -+ unsigned long n; -+ -+ __asm__("bsfq %1,%0\n\t" : "=r" (n) : "rm" (_size)); -+ return (unsigned int)n; -+#elif defined(_MSC_VER) && defined(_M_IX86) -+ __asm { -+ bsf eax, _size -+ } -+#else -+ static const int offset[16] = {4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0}; -+ unsigned int n; -+ unsigned int index = 0; -+ -+ n = offset[_size & 15]; -+ while (n == 4) { -+ _size >>= 4; -+ index += n; -+ n = offset[_size & 15]; -+ } -+ -+ return index + n; -+#endif -+} -+ -+static void zend_mm_add_to_rest_list(zend_mm_heap_canary *heap, zend_mm_free_block_canary *mm_block) -+{ -+ zend_mm_free_block_canary *prev, *next; -+ -+ ZEND_MM_SET_MAGIC(mm_block, MEM_BLOCK_FREED); -+ -+ if (!ZEND_MM_SMALL_SIZE(ZEND_MM_FREE_BLOCK_SIZE(mm_block))) { -+ mm_block->parent = NULL; -+ } -+ -+ prev = SUHOSIN_MANGLE_PTR(heap->rest_buckets[0]); -+ next = SUHOSIN_MANGLE_PTR(prev->next_free_block); -+ mm_block->prev_free_block = SUHOSIN_MANGLE_PTR(prev); -+ mm_block->next_free_block = SUHOSIN_MANGLE_PTR(next); -+ prev->next_free_block = next->prev_free_block = SUHOSIN_MANGLE_PTR(mm_block); -+} -+ -+static void zend_mm_add_to_free_list(zend_mm_heap_canary *heap, zend_mm_free_block_canary *mm_block) -+{ -+ size_t size; -+ size_t index; -+ -+ ZEND_MM_SET_MAGIC(mm_block, MEM_BLOCK_FREED); -+ -+ size = ZEND_MM_FREE_BLOCK_SIZE(mm_block); -+ if (EXPECTED(!ZEND_MM_SMALL_SIZE(size))) { -+ zend_mm_free_block_canary **p; -+ -+ index = ZEND_MM_LARGE_BUCKET_INDEX(size); -+ p = &heap->large_free_buckets[index]; -+ mm_block->child[0] = mm_block->child[1] = NULL; -+ if (!*p) { -+ *p = mm_block; -+ mm_block->parent = p; -+ mm_block->prev_free_block = mm_block->next_free_block = SUHOSIN_MANGLE_PTR(mm_block); -+ heap->large_free_bitmap |= (ZEND_MM_LONG_CONST(1) << index); -+ } else { -+ size_t m; -+ -+ for (m = size << (ZEND_MM_NUM_BUCKETS - index); ; m <<= 1) { -+ zend_mm_free_block_canary *prev = *p; -+ -+ if (ZEND_MM_FREE_BLOCK_SIZE(prev) != size) { -+ p = &prev->child[(m >> (ZEND_MM_NUM_BUCKETS-1)) & 1]; -+ if (!*p) { -+ *p = mm_block; -+ mm_block->parent = p; -+ mm_block->prev_free_block = mm_block->next_free_block = SUHOSIN_MANGLE_PTR(mm_block); -+ break; -+ } -+ } else { -+ zend_mm_free_block_canary *next = SUHOSIN_MANGLE_PTR(prev->next_free_block); -+ -+ prev->next_free_block = next->prev_free_block = SUHOSIN_MANGLE_PTR(mm_block); -+ mm_block->next_free_block = SUHOSIN_MANGLE_PTR(next); -+ mm_block->prev_free_block = SUHOSIN_MANGLE_PTR(prev); -+ mm_block->parent = NULL; -+ break; -+ } -+ } -+ } -+ } else { -+ zend_mm_free_block_canary *prev, *next; -+ -+ index = ZEND_MM_BUCKET_INDEX(size); -+ -+ prev = ZEND_MM_SMALL_FREE_BUCKET(heap, index); -+ if (SUHOSIN_MANGLE_PTR(prev->prev_free_block) == prev) { -+ heap->free_bitmap |= (ZEND_MM_LONG_CONST(1) << index); -+ } -+ next = SUHOSIN_MANGLE_PTR(prev->next_free_block); -+ -+ mm_block->prev_free_block = SUHOSIN_MANGLE_PTR(prev); -+ mm_block->next_free_block = SUHOSIN_MANGLE_PTR(next); -+ prev->next_free_block = next->prev_free_block = SUHOSIN_MANGLE_PTR(mm_block); -+ } -+} -+ -+static void zend_mm_remove_from_free_list(zend_mm_heap_canary *heap, zend_mm_free_block_canary *mm_block) -+{ -+ zend_mm_free_block_canary *prev = SUHOSIN_MANGLE_PTR(mm_block->prev_free_block); -+ zend_mm_free_block_canary *next = SUHOSIN_MANGLE_PTR(mm_block->next_free_block); -+ -+ ZEND_MM_CHECK_MAGIC(mm_block, MEM_BLOCK_FREED); -+ -+ if (EXPECTED(prev == mm_block)) { -+ zend_mm_free_block_canary **rp, **cp; -+ -+#if SUHOSIN_PATCH -+ if (next != mm_block) { -+ zend_suhosin_log(S_MEMORY, "zend_mm_heap corrupted at %p", mm_block); -+ _exit(1); -+ } -+#endif -+#if ZEND_MM_SAFE_UNLINKING -+ if (UNEXPECTED(next != mm_block)) { -+ zend_mm_panic("zend_mm_heap corrupted"); -+ } -+#endif -+ -+ rp = &mm_block->child[mm_block->child[1] != NULL]; -+ prev = *rp; -+ if (EXPECTED(prev == NULL)) { -+ size_t index = ZEND_MM_LARGE_BUCKET_INDEX(ZEND_MM_FREE_BLOCK_SIZE(mm_block)); -+ -+ ZEND_MM_CHECK_TREE(mm_block); -+ *mm_block->parent = NULL; -+ if (mm_block->parent == &heap->large_free_buckets[index]) { -+ heap->large_free_bitmap &= ~(ZEND_MM_LONG_CONST(1) << index); -+ } -+ } else { -+ while (*(cp = &(prev->child[prev->child[1] != NULL])) != NULL) { -+ prev = *cp; -+ rp = cp; -+ } -+ *rp = NULL; -+ -+subst_block: -+ ZEND_MM_CHECK_TREE(mm_block); -+ *mm_block->parent = prev; -+ prev->parent = mm_block->parent; -+ if ((prev->child[0] = mm_block->child[0])) { -+ ZEND_MM_CHECK_TREE(prev->child[0]); -+ prev->child[0]->parent = &prev->child[0]; -+ } -+ if ((prev->child[1] = mm_block->child[1])) { -+ ZEND_MM_CHECK_TREE(prev->child[1]); -+ prev->child[1]->parent = &prev->child[1]; -+ } -+ } -+ } else { -+ -+#if SUHOSIN_PATCH -+ if (SUHOSIN_MANGLE_PTR(prev->next_free_block) != mm_block || SUHOSIN_MANGLE_PTR(next->prev_free_block) != mm_block) { -+ zend_suhosin_log(S_MEMORY, "zend_mm_head corrupted at %p", mm_block); -+ _exit(1); -+ } -+#endif -+ -+#if ZEND_MM_SAFE_UNLINKING -+ if (UNEXPECTED(SUHOSIN_MANGLE_PTR(prev->next_free_block) != mm_block) || UNEXPECTED(SUHOSIN_MANGLE_PTR(next->prev_free_block) != mm_block)) { -+ zend_mm_panic("zend_mm_heap corrupted"); -+ } -+#endif -+ -+ prev->next_free_block = SUHOSIN_MANGLE_PTR(next); -+ next->prev_free_block = SUHOSIN_MANGLE_PTR(prev); -+ -+ if (EXPECTED(ZEND_MM_SMALL_SIZE(ZEND_MM_FREE_BLOCK_SIZE(mm_block)))) { -+ if (EXPECTED(prev == next)) { -+ size_t index = ZEND_MM_BUCKET_INDEX(ZEND_MM_FREE_BLOCK_SIZE(mm_block)); -+ -+ if (EXPECTED(heap->free_buckets[index*2] == heap->free_buckets[index*2+1])) { -+ heap->free_bitmap &= ~(ZEND_MM_LONG_CONST(1) << index); -+ } -+ } -+ } else if (UNEXPECTED(mm_block->parent != NULL)) { -+ goto subst_block; -+ } -+ } -+} -+ -+static void zend_mm_init(zend_mm_heap_canary *heap) -+{ -+ zend_mm_free_block_canary* p; -+ int i; -+ -+ heap->free_bitmap = 0; -+ heap->large_free_bitmap = 0; -+#if ZEND_MM_CACHE -+ heap->cached = 0; -+ memset(heap->cache, 0, sizeof(heap->cache)); -+#endif -+#if ZEND_MM_CACHE_STAT -+ for (i = 0; i < ZEND_MM_NUM_BUCKETS; i++) { -+ heap->cache_stat[i].count = 0; -+ } -+#endif -+ p = ZEND_MM_SMALL_FREE_BUCKET(heap, 0); -+ for (i = 0; i < ZEND_MM_NUM_BUCKETS; i++) { -+ p->next_free_block = SUHOSIN_MANGLE_PTR(p); -+ p->prev_free_block = SUHOSIN_MANGLE_PTR(p); -+ p = (zend_mm_free_block_canary*)((char*)p + sizeof(zend_mm_free_block_canary*) * 2); -+ heap->large_free_buckets[i] = NULL; -+ } -+ heap->rest_buckets[0] = heap->rest_buckets[1] = SUHOSIN_MANGLE_PTR(ZEND_MM_REST_BUCKET(heap)); -+#if SUHOSIN_PATCH -+ if (SUHOSIN_CONFIG(SUHOSIN_MM_USE_CANARY_PROTECTION)) { -+ zend_canary(&heap->canary_1, sizeof(heap->canary_1)); -+ zend_canary(&heap->canary_2, sizeof(heap->canary_2)); -+ zend_canary(&heap->canary_3, sizeof(heap->canary_3)); -+ } -+#endif -+} -+ -+static void zend_mm_del_segment(zend_mm_heap_canary *heap, zend_mm_segment *segment) -+{ -+ zend_mm_segment **p = &heap->segments_list; -+ -+ while (*p != segment) { -+ p = &(*p)->next_segment; -+ } -+ *p = segment->next_segment; -+ heap->real_size -= segment->size; -+ ZEND_MM_STORAGE_FREE(segment); -+} -+ -+#if ZEND_MM_CACHE -+static void zend_mm_free_cache(zend_mm_heap_canary *heap) -+{ -+ int i; -+ -+ for (i = 0; i < ZEND_MM_NUM_BUCKETS; i++) { -+ /* SUHOSIN_MANGLE_PTR should NOT affect NULL pointers */ -+ if (heap->cache[i]) { -+ zend_mm_free_block_canary *mm_block = SUHOSIN_MANGLE_PTR(heap->cache[i]); -+ -+ while (mm_block) { -+ size_t size = ZEND_MM_BLOCK_SIZE(mm_block); -+ zend_mm_free_block_canary *q = SUHOSIN_MANGLE_PTR(mm_block->prev_free_block); -+ zend_mm_block_canary *next_block = ZEND_MM_NEXT_BLOCK(mm_block); -+ -+ heap->cached -= size; -+ -+ if (ZEND_MM_PREV_BLOCK_IS_FREE(mm_block)) { -+ mm_block = (zend_mm_free_block_canary*)ZEND_MM_PREV_BLOCK(mm_block); -+ size += ZEND_MM_FREE_BLOCK_SIZE(mm_block); -+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block_canary *) mm_block); -+ } -+ if (ZEND_MM_IS_FREE_BLOCK(next_block)) { -+ size += ZEND_MM_FREE_BLOCK_SIZE(next_block); -+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block_canary *) next_block); -+ } -+ ZEND_MM_BLOCK(mm_block, ZEND_MM_FREE_BLOCK, size); -+ -+ if (ZEND_MM_IS_FIRST_BLOCK(mm_block) && -+ ZEND_MM_IS_GUARD_BLOCK(ZEND_MM_NEXT_BLOCK(mm_block))) { -+ zend_mm_del_segment(heap, (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE)); -+ } else { -+ zend_mm_add_to_free_list(heap, (zend_mm_free_block_canary *) mm_block); -+ } -+ -+ mm_block = q; -+ } -+ heap->cache[i] = NULL; -+#if ZEND_MM_CACHE_STAT -+ heap->cache_stat[i].count = 0; -+#endif -+ } -+ } -+} -+#endif -+ -+#if ZEND_MM_HEAP_PROTECTION || ZEND_MM_COOKIES -+static void zend_mm_random(unsigned char *buf, size_t size) /* {{{ */ -+{ -+ size_t i = 0; -+ unsigned char t; -+ -+#ifdef ZEND_WIN32 -+ HCRYPTPROV hCryptProv; -+ int has_context = 0; -+ -+ if (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, 0)) { -+ /* Could mean that the key container does not exist, let try -+ again by asking for a new one */ -+ if (GetLastError() == NTE_BAD_KEYSET) { -+ if (CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET)) { -+ has_context = 1; -+ } -+ } -+ } else { -+ has_context = 1; -+ } -+ if (has_context) { -+ do { -+ BOOL ret = CryptGenRandom(hCryptProv, size, buf); -+ CryptReleaseContext(hCryptProv, 0); -+ if (ret) { -+ while (i < size && buf[i] != 0) { -+ i++; -+ } -+ if (i == size) { -+ return; -+ } -+ } -+ } while (0); -+ } -+#elif defined(HAVE_DEV_URANDOM) -+ int fd = open("/dev/urandom", 0); -+ -+ if (fd >= 0) { -+ if (read(fd, buf, size) == size) { -+ while (i < size && buf[i] != 0) { -+ i++; -+ } -+ if (i == size) { -+ close(fd); -+ return; -+ } -+ } -+ close(fd); -+ } -+#endif -+ t = (unsigned char)getpid(); -+ while (i < size) { -+ do { -+ buf[i] = ((unsigned char)rand()) ^ t; -+ } while (buf[i] == 0); -+ t = buf[i++] << 1; -+ } -+} -+/* }}} */ -+#endif -+ -+ -+/* Notes: -+ * - This function may alter the block_sizes values to match platform alignment -+ * - This function does *not* perform sanity checks on the arguments -+ */ -+zend_mm_heap_canary *__zend_mm_startup_canary_ex(const zend_mm_mem_handlers *handlers, size_t block_size, size_t reserve_size, int internal, void *params) -+{ -+ zend_mm_storage *storage; -+ zend_mm_heap_canary *heap; -+ zend_mm_free_block_canary *tmp; -+ -+#if 0 -+ int i; -+ -+ printf("ZEND_MM_ALIGNMENT=%d\n", ZEND_MM_ALIGNMENT); -+ printf("ZEND_MM_ALIGNMENT_LOG2=%d\n", ZEND_MM_ALIGNMENT_LOG2); -+ printf("ZEND_MM_MIN_SIZE=%d\n", ZEND_MM_MIN_SIZE); -+ printf("ZEND_MM_MAX_SMALL_SIZE=%d\n", ZEND_MM_MAX_SMALL_SIZE); -+ printf("ZEND_MM_ALIGNED_HEADER_SIZE=%d\n", ZEND_MM_ALIGNED_HEADER_SIZE); -+ printf("ZEND_MM_ALIGNED_FREE_HEADER_SIZE=%d\n", ZEND_MM_ALIGNED_FREE_HEADER_SIZE); -+ printf("ZEND_MM_MIN_ALLOC_BLOCK_SIZE=%d\n", ZEND_MM_MIN_ALLOC_BLOCK_SIZE); -+ printf("ZEND_MM_ALIGNED_MIN_HEADER_SIZE=%d\n", ZEND_MM_ALIGNED_MIN_HEADER_SIZE); -+ printf("ZEND_MM_ALIGNED_SEGMENT_SIZE=%d\n", ZEND_MM_ALIGNED_SEGMENT_SIZE); -+ for (i = 0; i < ZEND_MM_MAX_SMALL_SIZE; i++) { -+ printf("%3d%c: %3ld %d %2ld\n", i, (i == ZEND_MM_MIN_SIZE?'*':' '), (long)ZEND_MM_TRUE_SIZE(i), ZEND_MM_SMALL_SIZE(ZEND_MM_TRUE_SIZE(i)), (long)ZEND_MM_BUCKET_INDEX(ZEND_MM_TRUE_SIZE(i))); -+ } -+ exit(0); -+#endif -+ -+#if ZEND_MM_HEAP_PROTECTION -+ if (_mem_block_start_magic == 0) { -+ zend_mm_random((unsigned char*)&_mem_block_start_magic, sizeof(_mem_block_start_magic)); -+ } -+ if (_mem_block_end_magic == 0) { -+ zend_mm_random((unsigned char*)&_mem_block_end_magic, sizeof(_mem_block_end_magic)); -+ } -+#endif -+#if ZEND_MM_COOKIES -+ if (_zend_mm_cookie == 0) { -+ zend_mm_random((unsigned char*)&_zend_mm_cookie, sizeof(_zend_mm_cookie)); -+ } -+#endif -+ -+ /* get the pointer guardian and ensure low 3 bits are 1 */ -+ if (SUHOSIN_POINTER_GUARD == 0) { -+ zend_canary(&SUHOSIN_POINTER_GUARD, sizeof(SUHOSIN_POINTER_GUARD)); -+ SUHOSIN_POINTER_GUARD |= 7; -+ } -+ -+ if (zend_mm_low_bit(block_size) != zend_mm_high_bit(block_size)) { -+ fprintf(stderr, "'block_size' must be a power of two\n"); -+/* See http://support.microsoft.com/kb/190351 */ -+#ifdef PHP_WIN32 -+ fflush(stderr); -+#endif -+ exit(255); -+ } -+ storage = handlers->init(params); -+ if (!storage) { -+ fprintf(stderr, "Cannot initialize zend_mm storage [%s]\n", handlers->name); -+/* See http://support.microsoft.com/kb/190351 */ -+#ifdef PHP_WIN32 -+ fflush(stderr); -+#endif -+ exit(255); -+ } -+ storage->handlers = handlers; -+ -+ heap = malloc(sizeof(struct _zend_mm_heap_canary)); -+ -+ heap->storage = storage; -+ heap->block_size = block_size; -+ heap->compact_size = 0; -+ heap->segments_list = NULL; -+ zend_mm_init(heap); -+# if ZEND_MM_CACHE_STAT -+ memset(heap->cache_stat, 0, sizeof(heap->cache_stat)); -+# endif -+ -+ heap->use_zend_alloc = 1; -+ heap->real_size = 0; -+ heap->overflow = 0; -+ heap->real_peak = 0; -+ heap->limit = ZEND_MM_LONG_CONST(1)<<(ZEND_MM_NUM_BUCKETS-2); -+ heap->size = 0; -+ heap->peak = 0; -+ heap->internal = internal; -+ heap->reserve = NULL; -+ heap->reserve_size = reserve_size; -+ if (reserve_size > 0) { -+ heap->reserve = _zend_mm_alloc((zend_mm_heap *)heap, reserve_size ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -+ } -+ if (internal) { -+ int i; -+ zend_mm_free_block_canary *p, *q, *orig; -+ zend_mm_heap_canary *mm_heap = _zend_mm_alloc((zend_mm_heap *)heap, sizeof(zend_mm_heap_canary) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -+ -+ *mm_heap = *heap; -+ -+ p = ZEND_MM_SMALL_FREE_BUCKET(mm_heap, 0); -+ orig = ZEND_MM_SMALL_FREE_BUCKET(heap, 0); -+ for (i = 0; i < ZEND_MM_NUM_BUCKETS; i++) { -+ q = p; -+ while (SUHOSIN_MANGLE_PTR(q->prev_free_block) != orig) { -+ q = SUHOSIN_MANGLE_PTR(q->prev_free_block); -+ } -+ q->prev_free_block = SUHOSIN_MANGLE_PTR(p); -+ q = p; -+ while (SUHOSIN_MANGLE_PTR(q->next_free_block) != orig) { -+ q = SUHOSIN_MANGLE_PTR(q->next_free_block); -+ } -+ q->next_free_block = SUHOSIN_MANGLE_PTR(p); -+ p = (zend_mm_free_block_canary*)((char*)p + sizeof(zend_mm_free_block_canary*) * 2); -+ orig = (zend_mm_free_block_canary*)((char*)orig + sizeof(zend_mm_free_block_canary*) * 2); -+ if (mm_heap->large_free_buckets[i]) { -+ mm_heap->large_free_buckets[i]->parent = &mm_heap->large_free_buckets[i]; -+ } -+ } -+ mm_heap->rest_buckets[0] = mm_heap->rest_buckets[1] = SUHOSIN_MANGLE_PTR(ZEND_MM_REST_BUCKET(mm_heap)); -+ -+ free(heap); -+ heap = mm_heap; -+ } -+ return heap; -+} -+ -+zend_mm_heap_canary *__zend_mm_startup_canary(void) -+{ -+ int i; -+ size_t seg_size; -+ char *mem_type = getenv("ZEND_MM_MEM_TYPE"); -+ char *tmp; -+ const zend_mm_mem_handlers *handlers; -+ zend_mm_heap_canary *heap; -+ -+ if (mem_type == NULL) { -+ i = 0; -+ } else { -+ for (i = 0; mem_handlers[i].name; i++) { -+ if (strcmp(mem_handlers[i].name, mem_type) == 0) { -+ break; -+ } -+ } -+ if (!mem_handlers[i].name) { -+ fprintf(stderr, "Wrong or unsupported zend_mm storage type '%s'\n", mem_type); -+ fprintf(stderr, " supported types:\n"); -+/* See http://support.microsoft.com/kb/190351 */ -+#ifdef PHP_WIN32 -+ fflush(stderr); -+#endif -+ for (i = 0; mem_handlers[i].name; i++) { -+ fprintf(stderr, " '%s'\n", mem_handlers[i].name); -+ } -+/* See http://support.microsoft.com/kb/190351 */ -+#ifdef PHP_WIN32 -+ fflush(stderr); -+#endif -+ exit(255); -+ } -+ } -+ handlers = &mem_handlers[i]; -+ -+ tmp = getenv("ZEND_MM_SEG_SIZE"); -+ if (tmp) { -+ seg_size = zend_atoi(tmp, 0); -+ if (zend_mm_low_bit(seg_size) != zend_mm_high_bit(seg_size)) { -+ fprintf(stderr, "ZEND_MM_SEG_SIZE must be a power of two\n"); -+/* See http://support.microsoft.com/kb/190351 */ -+#ifdef PHP_WIN32 -+ fflush(stderr); -+#endif -+ exit(255); -+ } else if (seg_size < ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE) { -+ fprintf(stderr, "ZEND_MM_SEG_SIZE is too small\n"); -+/* See http://support.microsoft.com/kb/190351 */ -+#ifdef PHP_WIN32 -+ fflush(stderr); -+#endif -+ exit(255); -+ } -+ } else { -+ seg_size = ZEND_MM_SEG_SIZE; -+ } -+ -+ heap = __zend_mm_startup_canary_ex(handlers, seg_size, ZEND_MM_RESERVE_SIZE, 0, NULL); -+ if (heap) { -+ tmp = getenv("ZEND_MM_COMPACT"); -+ if (tmp) { -+ heap->compact_size = zend_atoi(tmp, 0); -+ } else { -+ heap->compact_size = 2 * 1024 * 1024; -+ } -+ } -+ return heap; -+} -+ -+#if ZEND_DEBUG -+static long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block_canary *b) -+{ -+ long leaks = 0; -+ zend_mm_block_canary *p, *q; -+ -+ p = ZEND_MM_NEXT_BLOCK(b); -+ while (1) { -+ if (ZEND_MM_IS_GUARD_BLOCK(p)) { -+ ZEND_MM_CHECK_MAGIC(p, MEM_BLOCK_GUARD); -+ segment = segment->next_segment; -+ if (!segment) { -+ break; -+ } -+ p = (zend_mm_block_canary *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); -+ continue; -+ } -+ q = ZEND_MM_NEXT_BLOCK(p); -+ if (q <= p || -+ (char*)q > (char*)segment + segment->size || -+ p->info._size != q->info._prev) { -+ zend_mm_panic("zend_mm_heap corrupted"); -+ } -+ if (!ZEND_MM_IS_FREE_BLOCK(p)) { -+ if (p->magic == MEM_BLOCK_VALID) { -+ if (p->debug.filename==b->debug.filename && p->debug.lineno==b->debug.lineno) { -+ ZEND_MM_SET_MAGIC(p, MEM_BLOCK_LEAK); -+ leaks++; -+ } -+#if ZEND_MM_CACHE -+ } else if (p->magic == MEM_BLOCK_CACHED) { -+ /* skip it */ -+#endif -+ } else if (p->magic != MEM_BLOCK_LEAK) { -+ zend_mm_panic("zend_mm_heap corrupted"); -+ } -+ } -+ p = q; -+ } -+ return leaks; -+} -+ -+static void zend_mm_check_leaks(zend_mm_heap_canary *heap TSRMLS_DC) -+{ -+ zend_mm_segment *segment = heap->segments_list; -+ zend_mm_block_canary *p, *q; -+ zend_uint total = 0; -+ -+ if (!segment) { -+ return; -+ } -+ p = (zend_mm_block_canary *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); -+ while (1) { -+ q = ZEND_MM_NEXT_BLOCK(p); -+ if (q <= p || -+ (char*)q > (char*)segment + segment->size || -+ p->info._size != q->info._prev) { -+ zend_mm_panic("zend_mm_heap corrupted"); -+ } -+ if (!ZEND_MM_IS_FREE_BLOCK(p)) { -+ if (p->magic == MEM_BLOCK_VALID) { -+ long repeated; -+ zend_leak_info leak; -+ -+ ZEND_MM_SET_MAGIC(p, MEM_BLOCK_LEAK); -+ -+ leak.addr = ZEND_MM_DATA_OF(p); -+ leak.size = p->debug.size; -+ leak.filename = p->debug.filename; -+ leak.lineno = p->debug.lineno; -+ leak.orig_filename = p->debug.orig_filename; -+ leak.orig_lineno = p->debug.orig_lineno; -+ -+ zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL TSRMLS_CC); -+ zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, &leak TSRMLS_CC); -+ repeated = zend_mm_find_leaks(segment, p); -+ total += 1 + repeated; -+ if (repeated) { -+ zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)(zend_uintptr_t)repeated TSRMLS_CC); -+ } -+#if ZEND_MM_CACHE -+ } else if (p->magic == MEM_BLOCK_CACHED) { -+ /* skip it */ -+#endif -+ } else if (p->magic != MEM_BLOCK_LEAK) { -+ zend_mm_panic("zend_mm_heap corrupted"); -+ } -+ } -+ if (ZEND_MM_IS_GUARD_BLOCK(q)) { -+ segment = segment->next_segment; -+ if (!segment) { -+ break; -+ } -+ q = (zend_mm_block_canary *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); -+ } -+ p = q; -+ } -+ if (total) { -+ zend_message_dispatcher(ZMSG_MEMORY_LEAKS_GRAND_TOTAL, &total TSRMLS_CC); -+ } -+} -+ -+static int zend_mm_check_ptr(zend_mm_heap_canary *heap, void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -+{ -+ zend_mm_block_canary *p; -+ int no_cache_notice = 0; -+ int had_problems = 0; -+ int valid_beginning = 1; -+ -+ if (silent==2) { -+ silent = 1; -+ no_cache_notice = 1; -+ } else if (silent==3) { -+ silent = 0; -+ no_cache_notice = 1; -+ } -+ if (!silent) { -+ TSRMLS_FETCH(); -+ -+ zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL TSRMLS_CC); -+ zend_debug_alloc_output("---------------------------------------\n"); -+ zend_debug_alloc_output("%s(%d) : Block "PTR_FMT" status:\n" ZEND_FILE_LINE_RELAY_CC, ptr); -+ if (__zend_orig_filename) { -+ zend_debug_alloc_output("%s(%d) : Actual location (location was relayed)\n" ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ if (!ptr) { -+ zend_debug_alloc_output("NULL\n"); -+ zend_debug_alloc_output("---------------------------------------\n"); -+ return 0; -+ } -+ } -+ -+ if (!ptr) { -+ if (silent) { -+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ } -+ -+ p = ZEND_MM_HEADER_OF(ptr); -+ -+#ifdef ZTS -+ if (ZEND_MM_BAD_THREAD_ID(p)) { -+ if (!silent) { -+ zend_debug_alloc_output("Invalid pointer: ((thread_id=0x%0.8X) != (expected=0x%0.8X))\n", (long)p->thread_id, (long)tsrm_thread_id()); -+ had_problems = 1; -+ } else { -+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ } -+#endif -+ -+ if (p->info._size != ZEND_MM_NEXT_BLOCK(p)->info._prev) { -+ if (!silent) { -+ zend_debug_alloc_output("Invalid pointer: ((size="PTR_FMT") != (next.prev="PTR_FMT"))\n", p->info._size, ZEND_MM_NEXT_BLOCK(p)->info._prev); -+ had_problems = 1; -+ } else { -+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ } -+ if (p->info._prev != ZEND_MM_GUARD_BLOCK && -+ ZEND_MM_PREV_BLOCK(p)->info._size != p->info._prev) { -+ if (!silent) { -+ zend_debug_alloc_output("Invalid pointer: ((prev="PTR_FMT") != (prev.size="PTR_FMT"))\n", p->info._prev, ZEND_MM_PREV_BLOCK(p)->info._size); -+ had_problems = 1; -+ } else { -+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ } -+ -+ if (had_problems) { -+ zend_debug_alloc_output("---------------------------------------\n"); -+ return 0; -+ } -+ -+ if (!silent) { -+ zend_debug_alloc_output("%10s\t","Beginning: "); -+ } -+ -+ if (!ZEND_MM_IS_USED_BLOCK(p)) { -+ if (!silent) { -+ if (p->magic != MEM_BLOCK_FREED) { -+ zend_debug_alloc_output("Freed (magic=0x%0.8X, expected=0x%0.8X)\n", p->magic, MEM_BLOCK_FREED); -+ } else { -+ zend_debug_alloc_output("Freed\n"); -+ } -+ had_problems = 1; -+ } else { -+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ } else if (ZEND_MM_IS_GUARD_BLOCK(p)) { -+ if (!silent) { -+ if (p->magic != MEM_BLOCK_FREED) { -+ zend_debug_alloc_output("Guard (magic=0x%0.8X, expected=0x%0.8X)\n", p->magic, MEM_BLOCK_FREED); -+ } else { -+ zend_debug_alloc_output("Guard\n"); -+ } -+ had_problems = 1; -+ } else { -+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ } else { -+ switch (p->magic) { -+ case MEM_BLOCK_VALID: -+ case MEM_BLOCK_LEAK: -+ if (!silent) { -+ zend_debug_alloc_output("OK (allocated on %s:%d, %d bytes)\n", p->debug.filename, p->debug.lineno, (int)p->debug.size); -+ } -+ break; /* ok */ -+ case MEM_BLOCK_CACHED: -+ if (!no_cache_notice) { -+ if (!silent) { -+ zend_debug_alloc_output("Cached\n"); -+ had_problems = 1; -+ } else { -+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ } -+ case MEM_BLOCK_FREED: -+ if (!silent) { -+ zend_debug_alloc_output("Freed (invalid)\n"); -+ had_problems = 1; -+ } else { -+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ break; -+ case MEM_BLOCK_GUARD: -+ if (!silent) { -+ zend_debug_alloc_output("Guard (invalid)\n"); -+ had_problems = 1; -+ } else { -+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ break; -+ default: -+ if (!silent) { -+ zend_debug_alloc_output("Unknown (magic=0x%0.8X, expected=0x%0.8X)\n", p->magic, MEM_BLOCK_VALID); -+ had_problems = 1; -+ valid_beginning = 0; -+ } else { -+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ break; -+ } -+ } -+ -+#if ZEND_MM_HEAP_PROTECTION -+ if (!valid_beginning) { -+ if (!silent) { -+ zend_debug_alloc_output("%10s\t", "Start:"); -+ zend_debug_alloc_output("Unknown\n"); -+ zend_debug_alloc_output("%10s\t", "End:"); -+ zend_debug_alloc_output("Unknown\n"); -+ } -+ } else { -+ char *end_magic = ZEND_MM_END_MAGIC_PTR(p); -+ -+ if (p->debug.start_magic == _mem_block_start_magic) { -+ if (!silent) { -+ zend_debug_alloc_output("%10s\t", "Start:"); -+ zend_debug_alloc_output("OK\n"); -+ } -+ } else { -+ char *overflow_ptr, *magic_ptr=(char *) &_mem_block_start_magic; -+ int overflows=0; -+ int i; -+ -+ if (silent) { -+ return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ had_problems = 1; -+ overflow_ptr = (char *) &p->debug.start_magic; -+ i = END_MAGIC_SIZE; -+ while (--i >= 0) { -+ if (overflow_ptr[i]!=magic_ptr[i]) { -+ overflows++; -+ } -+ } -+ zend_debug_alloc_output("%10s\t", "Start:"); -+ zend_debug_alloc_output("Overflown (magic=0x%0.8X instead of 0x%0.8X)\n", p->debug.start_magic, _mem_block_start_magic); -+ zend_debug_alloc_output("%10s\t",""); -+ if (overflows >= END_MAGIC_SIZE) { -+ zend_debug_alloc_output("At least %d bytes overflown\n", END_MAGIC_SIZE); -+ } else { -+ zend_debug_alloc_output("%d byte(s) overflown\n", overflows); -+ } -+ } -+ if (memcmp(end_magic, &_mem_block_end_magic, END_MAGIC_SIZE)==0) { -+ if (!silent) { -+ zend_debug_alloc_output("%10s\t", "End:"); -+ zend_debug_alloc_output("OK\n"); -+ } -+ } else { -+ char *overflow_ptr, *magic_ptr=(char *) &_mem_block_end_magic; -+ int overflows=0; -+ int i; -+ -+ if (silent) { -+ return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ had_problems = 1; -+ overflow_ptr = (char *) end_magic; -+ -+ for (i=0; i < END_MAGIC_SIZE; i++) { -+ if (overflow_ptr[i]!=magic_ptr[i]) { -+ overflows++; -+ } -+ } -+ -+ zend_debug_alloc_output("%10s\t", "End:"); -+ zend_debug_alloc_output("Overflown (magic=0x%0.8X instead of 0x%0.8X)\n", *end_magic, _mem_block_end_magic); -+ zend_debug_alloc_output("%10s\t",""); -+ if (overflows >= END_MAGIC_SIZE) { -+ zend_debug_alloc_output("At least %d bytes overflown\n", END_MAGIC_SIZE); -+ } else { -+ zend_debug_alloc_output("%d byte(s) overflown\n", overflows); -+ } -+ } -+ } -+#endif -+ -+ if (!silent) { -+ zend_debug_alloc_output("---------------------------------------\n"); -+ } -+ return ((!had_problems) ? 1 : 0); -+} -+ -+static int zend_mm_check_heap(zend_mm_heap_canary *heap, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -+{ -+ zend_mm_segment *segment = heap->segments_list; -+ zend_mm_block_canary *p, *q; -+ int errors = 0; -+ -+ if (!segment) { -+ return 0; -+ } -+ p = (zend_mm_block_canary *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); -+ while (1) { -+ q = ZEND_MM_NEXT_BLOCK(p); -+ if (q <= p || -+ (char*)q > (char*)segment + segment->size || -+ p->info._size != q->info._prev) { -+ zend_mm_panic("zend_mm_heap corrupted"); -+ } -+ if (!ZEND_MM_IS_FREE_BLOCK(p)) { -+ if (p->magic == MEM_BLOCK_VALID || p->magic == MEM_BLOCK_LEAK) { -+ if (!zend_mm_check_ptr(heap, ZEND_MM_DATA_OF(p), (silent?2:3) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) { -+ errors++; -+ } -+#if ZEND_MM_CACHE -+ } else if (p->magic == MEM_BLOCK_CACHED) { -+ /* skip it */ -+#endif -+ } else if (p->magic != MEM_BLOCK_LEAK) { -+ zend_mm_panic("zend_mm_heap corrupted"); -+ } -+ } -+ if (ZEND_MM_IS_GUARD_BLOCK(q)) { -+ segment = segment->next_segment; -+ if (!segment) { -+ return errors; -+ } -+ q = (zend_mm_block_canary *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); -+ } -+ p = q; -+ } -+} -+#endif -+ -+void __zend_mm_shutdown_canary(zend_mm_heap_canary *heap, int full_shutdown, int silent TSRMLS_DC) -+{ -+ zend_mm_storage *storage; -+ zend_mm_segment *segment; -+ zend_mm_segment *prev; -+ int internal; -+ -+ if (heap->reserve) { -+#if ZEND_DEBUG -+ if (!silent) { -+ _zend_mm_free(heap, heap->reserve ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -+ } -+#endif -+ heap->reserve = NULL; -+ } -+ -+#if ZEND_MM_CACHE_STAT -+ if (full_shutdown) { -+ FILE *f; -+ -+ f = fopen("zend_mm.log", "w"); -+ if (f) { -+ int i,j; -+ size_t size, true_size, min_size, max_size; -+ int hit = 0, miss = 0; -+ -+ fprintf(f, "\nidx min_size max_size true_size max_len hits misses\n"); -+ size = 0; -+ while (1) { -+ true_size = ZEND_MM_TRUE_SIZE(size); -+ if (ZEND_MM_SMALL_SIZE(true_size)) { -+ min_size = size; -+ i = ZEND_MM_BUCKET_INDEX(true_size); -+ size++; -+ while (1) { -+ true_size = ZEND_MM_TRUE_SIZE(size); -+ if (ZEND_MM_SMALL_SIZE(true_size)) { -+ j = ZEND_MM_BUCKET_INDEX(true_size); -+ if (j > i) { -+ max_size = size-1; -+ break; -+ } -+ } else { -+ max_size = size-1; -+ break; -+ } -+ size++; -+ } -+ hit += heap->cache_stat[i].hit; -+ miss += heap->cache_stat[i].miss; -+ fprintf(f, "%2d %8d %8d %9d %8d %8d %8d\n", i, (int)min_size, (int)max_size, ZEND_MM_TRUE_SIZE(max_size), heap->cache_stat[i].max_count, heap->cache_stat[i].hit, heap->cache_stat[i].miss); -+ } else { -+ break; -+ } -+ } -+ fprintf(f, " %8d %8d\n", hit, miss); -+ fprintf(f, " %8d %8d\n", heap->cache_stat[ZEND_MM_NUM_BUCKETS].hit, heap->cache_stat[ZEND_MM_NUM_BUCKETS].miss); -+ fclose(f); -+ } -+ } -+#endif -+ -+#if ZEND_DEBUG -+ if (!silent) { -+ zend_mm_check_leaks(heap TSRMLS_CC); -+ } -+#endif -+ -+ internal = heap->internal; -+ storage = heap->storage; -+ segment = heap->segments_list; -+ while (segment) { -+ prev = segment; -+ segment = segment->next_segment; -+ ZEND_MM_STORAGE_FREE(prev); -+ } -+ if (full_shutdown) { -+ storage->handlers->dtor(storage); -+ if (!internal) { -+ free(heap); -+ } -+ } else { -+ if (heap->compact_size && -+ heap->real_peak > heap->compact_size) { -+ storage->handlers->compact(storage); -+ } -+ heap->segments_list = NULL; -+ zend_mm_init(heap); -+ heap->real_size = 0; -+ heap->real_peak = 0; -+ heap->size = 0; -+ heap->peak = 0; -+ if (heap->reserve_size) { -+ heap->reserve = _zend_mm_alloc((zend_mm_heap *)heap, heap->reserve_size ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -+ } -+ heap->overflow = 0; -+ } -+} -+ -+static void zend_mm_safe_error(zend_mm_heap_canary *heap, -+ const char *format, -+ size_t limit, -+#if ZEND_DEBUG -+ const char *filename, -+ uint lineno, -+#endif -+ size_t size) -+{ -+ if (heap->reserve) { -+ _zend_mm_free_canary_int(heap, heap->reserve ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -+ heap->reserve = NULL; -+ } -+ if (heap->overflow == 0) { -+ char *error_filename; -+ uint error_lineno; -+ TSRMLS_FETCH(); -+ if (zend_is_compiling(TSRMLS_C)) { -+ error_filename = zend_get_compiled_filename(TSRMLS_C); -+ error_lineno = zend_get_compiled_lineno(TSRMLS_C); -+ } else if (EG(in_execution)) { -+ error_filename = EG(active_op_array)?EG(active_op_array)->filename:NULL; -+ error_lineno = EG(opline_ptr)?(*EG(opline_ptr))->lineno:0; -+ } else { -+ error_filename = NULL; -+ error_lineno = 0; -+ } -+ if (!error_filename) { -+ error_filename = "Unknown"; -+ } -+ heap->overflow = 1; -+ zend_try { -+ zend_error_noreturn(E_ERROR, -+ format, -+ limit, -+#if ZEND_DEBUG -+ filename, -+ lineno, -+#endif -+ size); -+ } zend_catch { -+ if (heap->overflow == 2) { -+ fprintf(stderr, "\nFatal error: "); -+ fprintf(stderr, -+ format, -+ limit, -+#if ZEND_DEBUG -+ filename, -+ lineno, -+#endif -+ size); -+ fprintf(stderr, " in %s on line %d\n", error_filename, error_lineno); -+ } -+/* See http://support.microsoft.com/kb/190351 */ -+#ifdef PHP_WIN32 -+ fflush(stderr); -+#endif -+ } zend_end_try(); -+ } else { -+ heap->overflow = 2; -+ } -+ zend_bailout(); -+} -+ -+static zend_mm_free_block_canary *zend_mm_search_large_block(zend_mm_heap_canary *heap, size_t true_size) -+{ -+ zend_mm_free_block_canary *best_fit; -+ size_t index = ZEND_MM_LARGE_BUCKET_INDEX(true_size); -+ size_t bitmap = heap->large_free_bitmap >> index; -+ zend_mm_free_block_canary *p; -+ -+ if (bitmap == 0) { -+ return NULL; -+ } -+ -+ if (UNEXPECTED((bitmap & 1) != 0)) { -+ /* Search for best "large" free block */ -+ zend_mm_free_block_canary *rst = NULL; -+ size_t m; -+ size_t best_size = -1; -+ -+ best_fit = NULL; -+ p = heap->large_free_buckets[index]; -+ for (m = true_size << (ZEND_MM_NUM_BUCKETS - index); ; m <<= 1) { -+ if (UNEXPECTED(ZEND_MM_FREE_BLOCK_SIZE(p) == true_size)) { -+ return SUHOSIN_MANGLE_PTR(p->next_free_block); -+ } else if (ZEND_MM_FREE_BLOCK_SIZE(p) >= true_size && -+ ZEND_MM_FREE_BLOCK_SIZE(p) < best_size) { -+ best_size = ZEND_MM_FREE_BLOCK_SIZE(p); -+ best_fit = p; -+ } -+ if ((m & (ZEND_MM_LONG_CONST(1) << (ZEND_MM_NUM_BUCKETS-1))) == 0) { -+ if (p->child[1]) { -+ rst = p->child[1]; -+ } -+ if (p->child[0]) { -+ p = p->child[0]; -+ } else { -+ break; -+ } -+ } else if (p->child[1]) { -+ p = p->child[1]; -+ } else { -+ break; -+ } -+ } -+ -+ for (p = rst; p; p = p->child[p->child[0] != NULL]) { -+ if (UNEXPECTED(ZEND_MM_FREE_BLOCK_SIZE(p) == true_size)) { -+ return SUHOSIN_MANGLE_PTR(p->next_free_block); -+ } else if (ZEND_MM_FREE_BLOCK_SIZE(p) > true_size && -+ ZEND_MM_FREE_BLOCK_SIZE(p) < best_size) { -+ best_size = ZEND_MM_FREE_BLOCK_SIZE(p); -+ best_fit = p; -+ } -+ } -+ -+ if (best_fit) { -+ return SUHOSIN_MANGLE_PTR(best_fit->next_free_block); -+ } -+ bitmap = bitmap >> 1; -+ if (!bitmap) { -+ return NULL; -+ } -+ index++; -+ } -+ -+ /* Search for smallest "large" free block */ -+ best_fit = p = heap->large_free_buckets[index + zend_mm_low_bit(bitmap)]; -+ while ((p = p->child[p->child[0] != NULL])) { -+ if (ZEND_MM_FREE_BLOCK_SIZE(p) < ZEND_MM_FREE_BLOCK_SIZE(best_fit)) { -+ best_fit = p; -+ } -+ } -+ return SUHOSIN_MANGLE_PTR(best_fit->next_free_block); -+} -+ -+void *_zend_mm_alloc_canary_int(zend_mm_heap_canary *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -+{ -+ zend_mm_free_block_canary *best_fit; -+ size_t true_size = ZEND_MM_TRUE_SIZE(size); -+ size_t block_size; -+ size_t remaining_size; -+ size_t segment_size; -+ zend_mm_segment *segment; -+ int keep_rest = 0; -+ -+ if (EXPECTED(ZEND_MM_SMALL_SIZE(true_size))) { -+ size_t index = ZEND_MM_BUCKET_INDEX(true_size); -+ size_t bitmap; -+ -+ if (UNEXPECTED(true_size < size)) { -+ goto out_of_memory; -+ } -+#if ZEND_MM_CACHE -+ if (EXPECTED(heap->cache[index] != NULL)) { -+ /* Get block from cache */ -+#if ZEND_MM_CACHE_STAT -+ heap->cache_stat[index].count--; -+ heap->cache_stat[index].hit++; -+#endif -+ best_fit = SUHOSIN_MANGLE_PTR(heap->cache[index]); -+ heap->cache[index] = best_fit->prev_free_block; -+ heap->cached -= true_size; -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(best_fit); -+ ((zend_mm_block_canary*)best_fit)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(best_fit); -+#endif -+ ZEND_MM_CHECK_MAGIC(best_fit, MEM_BLOCK_CACHED); -+ ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 0); -+ return ZEND_MM_DATA_OF(best_fit); -+ } -+#if ZEND_MM_CACHE_STAT -+ heap->cache_stat[index].miss++; -+#endif -+#endif -+ -+ bitmap = heap->free_bitmap >> index; -+ if (bitmap) { -+ /* Found some "small" free block that can be used */ -+ index += zend_mm_low_bit(bitmap); -+ best_fit = SUHOSIN_MANGLE_PTR(heap->free_buckets[index*2]); -+#if ZEND_MM_CACHE_STAT -+ heap->cache_stat[ZEND_MM_NUM_BUCKETS].hit++; -+#endif -+ goto zend_mm_finished_searching_for_block; -+ } -+ } -+ -+#if ZEND_MM_CACHE_STAT -+ heap->cache_stat[ZEND_MM_NUM_BUCKETS].miss++; -+#endif -+ -+ best_fit = zend_mm_search_large_block(heap, true_size); -+ -+ if (!best_fit && heap->real_size >= heap->limit - heap->block_size) { -+ zend_mm_free_block_canary *p = SUHOSIN_MANGLE_PTR(heap->rest_buckets[0]); -+ size_t best_size = -1; -+ -+ while (p != ZEND_MM_REST_BUCKET(heap)) { -+ if (UNEXPECTED(ZEND_MM_FREE_BLOCK_SIZE(p) == true_size)) { -+ best_fit = p; -+ goto zend_mm_finished_searching_for_block; -+ } else if (ZEND_MM_FREE_BLOCK_SIZE(p) > true_size && -+ ZEND_MM_FREE_BLOCK_SIZE(p) < best_size) { -+ best_size = ZEND_MM_FREE_BLOCK_SIZE(p); -+ best_fit = p; -+ } -+ p = SUHOSIN_MANGLE_PTR(p->prev_free_block); -+ } -+ } -+ -+ if (!best_fit) { -+ if (true_size > heap->block_size - (ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE)) { -+ /* Make sure we add a memory block which is big enough, -+ segment must have header "size" and trailer "guard" block */ -+ segment_size = true_size + ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE; -+ segment_size = (segment_size + (heap->block_size-1)) & ~(heap->block_size-1); -+ keep_rest = 1; -+ } else { -+ segment_size = heap->block_size; -+ } -+ -+ HANDLE_BLOCK_INTERRUPTIONS(); -+ -+ if (segment_size < true_size || -+ heap->real_size + segment_size > heap->limit) { -+ /* Memory limit overflow */ -+#if ZEND_MM_CACHE -+ zend_mm_free_cache(heap); -+#endif -+ HANDLE_UNBLOCK_INTERRUPTIONS(); -+#if ZEND_DEBUG -+ zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted at %s:%d (tried to allocate %lu bytes)", heap->limit, __zend_filename, __zend_lineno, size); -+#else -+ zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted (tried to allocate %lu bytes)", heap->limit, size); -+#endif -+ } -+ -+ segment = (zend_mm_segment *) ZEND_MM_STORAGE_ALLOC(segment_size); -+ -+ if (!segment) { -+ /* Storage manager cannot allocate memory */ -+#if ZEND_MM_CACHE -+ zend_mm_free_cache(heap); -+#endif -+ HANDLE_UNBLOCK_INTERRUPTIONS(); -+out_of_memory: -+#if ZEND_DEBUG -+ zend_mm_safe_error(heap, "Out of memory (allocated %ld) at %s:%d (tried to allocate %lu bytes)", heap->real_size, __zend_filename, __zend_lineno, size); -+#else -+ zend_mm_safe_error(heap, "Out of memory (allocated %ld) (tried to allocate %lu bytes)", heap->real_size, size); -+#endif -+ return NULL; -+ } -+ -+ heap->real_size += segment_size; -+ if (heap->real_size > heap->real_peak) { -+ heap->real_peak = heap->real_size; -+ } -+ -+ segment->size = segment_size; -+ segment->next_segment = heap->segments_list; -+ heap->segments_list = segment; -+ -+ best_fit = (zend_mm_free_block_canary *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); -+ ZEND_MM_MARK_FIRST_BLOCK(best_fit); -+ -+ block_size = segment_size - ZEND_MM_ALIGNED_SEGMENT_SIZE - ZEND_MM_ALIGNED_HEADER_SIZE; -+ -+ ZEND_MM_LAST_BLOCK(ZEND_MM_BLOCK_AT(best_fit, block_size)); -+ -+ } else { -+zend_mm_finished_searching_for_block: -+ /* remove from free list */ -+ HANDLE_BLOCK_INTERRUPTIONS(); -+ ZEND_MM_CHECK_MAGIC(best_fit, MEM_BLOCK_FREED); -+ ZEND_MM_CHECK_COOKIE(best_fit); -+ ZEND_MM_CHECK_BLOCK_LINKAGE(best_fit); -+ zend_mm_remove_from_free_list(heap, best_fit); -+ -+ block_size = ZEND_MM_FREE_BLOCK_SIZE(best_fit); -+ } -+ -+ remaining_size = block_size - true_size; -+ -+ if (remaining_size < ZEND_MM_ALIGNED_MIN_HEADER_SIZE) { -+ true_size = block_size; -+ ZEND_MM_BLOCK(best_fit, ZEND_MM_USED_BLOCK, true_size); -+ } else { -+ zend_mm_free_block_canary *new_free_block; -+ -+ /* prepare new free block */ -+ ZEND_MM_BLOCK(best_fit, ZEND_MM_USED_BLOCK, true_size); -+ new_free_block = (zend_mm_free_block_canary *) ZEND_MM_BLOCK_AT(best_fit, true_size); -+ ZEND_MM_BLOCK(new_free_block, ZEND_MM_FREE_BLOCK, remaining_size); -+ -+ /* add the new free block to the free list */ -+ if (EXPECTED(!keep_rest)) { -+ zend_mm_add_to_free_list(heap, new_free_block); -+ } else { -+ zend_mm_add_to_rest_list(heap, new_free_block); -+ } -+ } -+ -+ ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 1); -+ -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(best_fit); -+ ((zend_mm_block_canary*)best_fit)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(best_fit); -+#endif -+ -+ heap->size += true_size; -+ if (heap->peak < heap->size) { -+ heap->peak = heap->size; -+ } -+ -+ HANDLE_UNBLOCK_INTERRUPTIONS(); -+ return ZEND_MM_DATA_OF(best_fit); -+} -+ -+ -+void _zend_mm_free_canary_int(zend_mm_heap_canary *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -+{ -+ zend_mm_block_canary *mm_block; -+ zend_mm_block_canary *next_block; -+ size_t size; -+ -+ if (!ZEND_MM_VALID_PTR(p)) { -+ return; -+ } -+ -+ mm_block = ZEND_MM_HEADER_OF(p); -+ size = ZEND_MM_BLOCK_SIZE(mm_block); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_CHECK_CANARIES(mm_block, "efree()"); -+#endif -+ ZEND_MM_CHECK_PROTECTION(mm_block); -+ -+#if ZEND_DEBUG || ZEND_MM_HEAP_PROTECTION -+ memset(ZEND_MM_DATA_OF(mm_block), 0x5a, mm_block->debug.size); -+#endif -+#if SUHOSIN_PATCH -+ if (UNEXPECTED(SUHOSIN_CONFIG(SUHOSIN_MM_DESTROY_FREE_MEMORY))) { -+ memset(ZEND_MM_DATA_OF(mm_block), 0x5a, mm_block->info.size); -+ } -+#endif -+#if ZEND_MM_CACHE -+ if (EXPECTED(ZEND_MM_SMALL_SIZE(size)) && EXPECTED(heap->cached < ZEND_MM_CACHE_SIZE)) { -+ size_t index = ZEND_MM_BUCKET_INDEX(size); -+ zend_mm_free_block_canary **cache = &heap->cache[index]; -+ -+ ((zend_mm_free_block_canary*)mm_block)->prev_free_block = *cache; -+ *cache = (zend_mm_free_block_canary*)SUHOSIN_MANGLE_PTR(mm_block); -+ heap->cached += size; -+ ZEND_MM_SET_MAGIC(mm_block, MEM_BLOCK_CACHED); -+#if ZEND_MM_CACHE_STAT -+ if (++heap->cache_stat[index].count > heap->cache_stat[index].max_count) { -+ heap->cache_stat[index].max_count = heap->cache_stat[index].count; -+ } -+#endif -+ return; -+ } -+#endif -+ -+ HANDLE_BLOCK_INTERRUPTIONS(); -+ -+ heap->size -= size; -+ -+ next_block = ZEND_MM_BLOCK_AT(mm_block, size); -+ if (ZEND_MM_IS_FREE_BLOCK(next_block)) { -+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block_canary *) next_block); -+ size += ZEND_MM_FREE_BLOCK_SIZE(next_block); -+ } -+ if (ZEND_MM_PREV_BLOCK_IS_FREE(mm_block)) { -+ mm_block = ZEND_MM_PREV_BLOCK(mm_block); -+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block_canary *) mm_block); -+ size += ZEND_MM_FREE_BLOCK_SIZE(mm_block); -+ } -+ if (ZEND_MM_IS_FIRST_BLOCK(mm_block) && -+ ZEND_MM_IS_GUARD_BLOCK(ZEND_MM_BLOCK_AT(mm_block, size))) { -+ zend_mm_del_segment(heap, (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE)); -+ } else { -+ ZEND_MM_BLOCK(mm_block, ZEND_MM_FREE_BLOCK, size); -+ zend_mm_add_to_free_list(heap, (zend_mm_free_block_canary *) mm_block); -+ } -+ HANDLE_UNBLOCK_INTERRUPTIONS(); -+} -+ -+void *_zend_mm_realloc_canary_int(zend_mm_heap_canary *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -+{ -+ zend_mm_block_canary *mm_block = ZEND_MM_HEADER_OF(p); -+ zend_mm_block_canary *next_block; -+ size_t true_size; -+ size_t orig_size; -+ void *ptr; -+ -+ if (UNEXPECTED(!p) || !ZEND_MM_VALID_PTR(p)) { -+ return _zend_mm_alloc_canary_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ } -+ mm_block = ZEND_MM_HEADER_OF(p); -+ true_size = ZEND_MM_TRUE_SIZE(size); -+ orig_size = ZEND_MM_BLOCK_SIZE(mm_block); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_CHECK_CANARIES(mm_block, "erealloc()"); -+#endif -+ ZEND_MM_CHECK_PROTECTION(mm_block); -+ -+ if (UNEXPECTED(true_size < size)) { -+ goto out_of_memory; -+ } -+ -+ if (true_size <= orig_size) { -+ size_t remaining_size = orig_size - true_size; -+ -+ if (remaining_size >= ZEND_MM_ALIGNED_MIN_HEADER_SIZE) { -+ zend_mm_free_block_canary *new_free_block; -+ -+ HANDLE_BLOCK_INTERRUPTIONS(); -+ next_block = ZEND_MM_BLOCK_AT(mm_block, orig_size); -+ if (ZEND_MM_IS_FREE_BLOCK(next_block)) { -+ remaining_size += ZEND_MM_FREE_BLOCK_SIZE(next_block); -+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block_canary *) next_block); -+ } -+ -+ /* prepare new free block */ -+ ZEND_MM_BLOCK(mm_block, ZEND_MM_USED_BLOCK, true_size); -+ new_free_block = (zend_mm_free_block_canary *) ZEND_MM_BLOCK_AT(mm_block, true_size); -+ -+ ZEND_MM_BLOCK(new_free_block, ZEND_MM_FREE_BLOCK, remaining_size); -+ -+ /* add the new free block to the free list */ -+ zend_mm_add_to_free_list(heap, new_free_block); -+ heap->size += (true_size - orig_size); -+ HANDLE_UNBLOCK_INTERRUPTIONS(); -+ } -+ ZEND_MM_SET_DEBUG_INFO(mm_block, size, 0, 0); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(mm_block); -+ ((zend_mm_block_canary*)mm_block)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(mm_block); -+#endif -+ return p; -+ } -+ -+#if ZEND_MM_CACHE -+ if (ZEND_MM_SMALL_SIZE(true_size)) { -+ size_t index = ZEND_MM_BUCKET_INDEX(true_size); -+ -+ if (heap->cache[index] != NULL) { -+ zend_mm_free_block_canary *best_fit; -+ zend_mm_free_block_canary **cache; -+ -+#if ZEND_MM_CACHE_STAT -+ heap->cache_stat[index].count--; -+ heap->cache_stat[index].hit++; -+#endif -+ best_fit = SUHOSIN_MANGLE_PTR(heap->cache[index]); -+ heap->cache[index] = best_fit->prev_free_block; -+ ZEND_MM_CHECK_MAGIC(best_fit, MEM_BLOCK_CACHED); -+ ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 0); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(best_fit); -+ ((zend_mm_block_canary*)best_fit)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(best_fit); -+#endif -+ -+ ptr = ZEND_MM_DATA_OF(best_fit); -+ -+#if ZEND_DEBUG || ZEND_MM_HEAP_PROTECTION -+ memcpy(ptr, p, mm_block->debug.size); -+#else -+ memcpy(ptr, p, orig_size - ZEND_MM_ALIGNED_HEADER_SIZE - CANARY_SIZE); -+#endif -+ -+ heap->cached -= true_size - orig_size; -+ -+ index = ZEND_MM_BUCKET_INDEX(orig_size); -+ cache = &heap->cache[index]; -+ -+ ((zend_mm_free_block_canary*)mm_block)->prev_free_block = *cache; -+ *cache = (zend_mm_free_block_canary*)SUHOSIN_MANGLE_PTR(mm_block); -+ ZEND_MM_SET_MAGIC(mm_block, MEM_BLOCK_CACHED); -+#if ZEND_MM_CACHE_STAT -+ if (++heap->cache_stat[index].count > heap->cache_stat[index].max_count) { -+ heap->cache_stat[index].max_count = heap->cache_stat[index].count; -+ } -+#endif -+ return ptr; -+ } -+ } -+#endif -+ -+ next_block = ZEND_MM_BLOCK_AT(mm_block, orig_size); -+ -+ if (ZEND_MM_IS_FREE_BLOCK(next_block)) { -+ ZEND_MM_CHECK_COOKIE(next_block); -+ ZEND_MM_CHECK_BLOCK_LINKAGE(next_block); -+ if (orig_size + ZEND_MM_FREE_BLOCK_SIZE(next_block) >= true_size) { -+ size_t block_size = orig_size + ZEND_MM_FREE_BLOCK_SIZE(next_block); -+ size_t remaining_size = block_size - true_size; -+ -+ HANDLE_BLOCK_INTERRUPTIONS(); -+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block_canary *) next_block); -+ -+ if (remaining_size < ZEND_MM_ALIGNED_MIN_HEADER_SIZE) { -+ true_size = block_size; -+ ZEND_MM_BLOCK(mm_block, ZEND_MM_USED_BLOCK, true_size); -+ } else { -+ zend_mm_free_block_canary *new_free_block; -+ -+ /* prepare new free block */ -+ ZEND_MM_BLOCK(mm_block, ZEND_MM_USED_BLOCK, true_size); -+ new_free_block = (zend_mm_free_block_canary *) ZEND_MM_BLOCK_AT(mm_block, true_size); -+ ZEND_MM_BLOCK(new_free_block, ZEND_MM_FREE_BLOCK, remaining_size); -+ -+ /* add the new free block to the free list */ -+ if (ZEND_MM_IS_FIRST_BLOCK(mm_block) && -+ ZEND_MM_IS_GUARD_BLOCK(ZEND_MM_BLOCK_AT(new_free_block, remaining_size))) { -+ zend_mm_add_to_rest_list(heap, new_free_block); -+ } else { -+ zend_mm_add_to_free_list(heap, new_free_block); -+ } -+ } -+ ZEND_MM_SET_DEBUG_INFO(mm_block, size, 0, 0); -+ heap->size = heap->size + true_size - orig_size; -+ if (heap->peak < heap->size) { -+ heap->peak = heap->size; -+ } -+ HANDLE_UNBLOCK_INTERRUPTIONS(); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(mm_block); -+ ((zend_mm_block_canary*)mm_block)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(mm_block); -+#endif -+ return p; -+ } else if (ZEND_MM_IS_FIRST_BLOCK(mm_block) && -+ ZEND_MM_IS_GUARD_BLOCK(ZEND_MM_BLOCK_AT(next_block, ZEND_MM_FREE_BLOCK_SIZE(next_block)))) { -+ HANDLE_BLOCK_INTERRUPTIONS(); -+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block_canary *) next_block); -+ goto realloc_segment; -+ } -+ } else if (ZEND_MM_IS_FIRST_BLOCK(mm_block) && ZEND_MM_IS_GUARD_BLOCK(next_block)) { -+ zend_mm_segment *segment; -+ zend_mm_segment *segment_copy; -+ size_t segment_size; -+ size_t block_size; -+ size_t remaining_size; -+ -+ HANDLE_BLOCK_INTERRUPTIONS(); -+realloc_segment: -+ /* segment size, size of block and size of guard block */ -+ if (true_size > heap->block_size - (ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE)) { -+ segment_size = true_size+ZEND_MM_ALIGNED_SEGMENT_SIZE+ZEND_MM_ALIGNED_HEADER_SIZE; -+ segment_size = (segment_size + (heap->block_size-1)) & ~(heap->block_size-1); -+ } else { -+ segment_size = heap->block_size; -+ } -+ -+ segment_copy = (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE); -+ if (segment_size < true_size || -+ heap->real_size + segment_size - segment_copy->size > heap->limit) { -+ if (ZEND_MM_IS_FREE_BLOCK(next_block)) { -+ zend_mm_add_to_free_list(heap, (zend_mm_free_block_canary *) next_block); -+ } -+#if ZEND_MM_CACHE -+ zend_mm_free_cache(heap); -+#endif -+ HANDLE_UNBLOCK_INTERRUPTIONS(); -+#if ZEND_DEBUG -+ zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted at %s:%d (tried to allocate %ld bytes)", heap->limit, __zend_filename, __zend_lineno, size); -+#else -+ zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted (tried to allocate %ld bytes)", heap->limit, size); -+#endif -+ return NULL; -+ } -+ -+ segment = ZEND_MM_STORAGE_REALLOC(segment_copy, segment_size); -+ if (!segment) { -+#if ZEND_MM_CACHE -+ zend_mm_free_cache(heap); -+#endif -+ HANDLE_UNBLOCK_INTERRUPTIONS(); -+out_of_memory: -+#if ZEND_DEBUG -+ zend_mm_safe_error(heap, "Out of memory (allocated %ld) at %s:%d (tried to allocate %ld bytes)", heap->real_size, __zend_filename, __zend_lineno, size); -+#else -+ zend_mm_safe_error(heap, "Out of memory (allocated %ld) (tried to allocate %ld bytes)", heap->real_size, size); -+#endif -+ return NULL; -+ } -+ heap->real_size += segment_size - segment->size; -+ if (heap->real_size > heap->real_peak) { -+ heap->real_peak = heap->real_size; -+ } -+ -+ segment->size = segment_size; -+ -+ if (segment != segment_copy) { -+ zend_mm_segment **seg = &heap->segments_list; -+ while (*seg != segment_copy) { -+ seg = &(*seg)->next_segment; -+ } -+ *seg = segment; -+ mm_block = (zend_mm_block_canary *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); -+ ZEND_MM_MARK_FIRST_BLOCK(mm_block); -+ } -+ -+ block_size = segment_size - ZEND_MM_ALIGNED_SEGMENT_SIZE - ZEND_MM_ALIGNED_HEADER_SIZE; -+ remaining_size = block_size - true_size; -+ -+ /* setup guard block */ -+ ZEND_MM_LAST_BLOCK(ZEND_MM_BLOCK_AT(mm_block, block_size)); -+ -+ if (remaining_size < ZEND_MM_ALIGNED_MIN_HEADER_SIZE) { -+ true_size = block_size; -+ ZEND_MM_BLOCK(mm_block, ZEND_MM_USED_BLOCK, true_size); -+ } else { -+ zend_mm_free_block_canary *new_free_block; -+ -+ /* prepare new free block */ -+ ZEND_MM_BLOCK(mm_block, ZEND_MM_USED_BLOCK, true_size); -+ new_free_block = (zend_mm_free_block_canary *) ZEND_MM_BLOCK_AT(mm_block, true_size); -+ ZEND_MM_BLOCK(new_free_block, ZEND_MM_FREE_BLOCK, remaining_size); -+ -+ /* add the new free block to the free list */ -+ zend_mm_add_to_rest_list(heap, new_free_block); -+ } -+ -+ ZEND_MM_SET_DEBUG_INFO(mm_block, size, 1, 1); -+ -+ heap->size = heap->size + true_size - orig_size; -+ if (heap->peak < heap->size) { -+ heap->peak = heap->size; -+ } -+ -+ HANDLE_UNBLOCK_INTERRUPTIONS(); -+#if SUHOSIN_PATCH -+ SUHOSIN_MM_SET_CANARIES(mm_block); -+ ((zend_mm_block_canary*)mm_block)->info.size = size; -+ SUHOSIN_MM_SET_END_CANARY(mm_block); -+#endif -+ return ZEND_MM_DATA_OF(mm_block); -+ } -+ -+ ptr = _zend_mm_alloc_canary_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+#if ZEND_DEBUG || ZEND_MM_HEAP_PROTECTION -+ memcpy(ptr, p, mm_block->debug.size); -+#else -+ memcpy(ptr, p, orig_size - ZEND_MM_ALIGNED_HEADER_SIZE - CANARY_SIZE); -+#endif -+ _zend_mm_free_canary_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -+ return ptr; -+} -+ -+ZEND_API size_t _zend_mm_block_size_canary(zend_mm_heap_canary *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -+{ -+ zend_mm_block_canary *mm_block; -+ -+ if (!ZEND_MM_VALID_PTR(p)) { -+ return 0; -+ } -+ mm_block = ZEND_MM_HEADER_OF(p); -+ ZEND_MM_CHECK_PROTECTION(mm_block); -+#if ZEND_DEBUG || ZEND_MM_HEAP_PROTECTION -+ return mm_block->debug.size; -+#else -+ return ZEND_MM_BLOCK_SIZE(mm_block); -+#endif -+} -+ -+#if defined(__GNUC__) && defined(i386) -+ -+static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) -+{ -+ size_t res = nmemb; -+ unsigned long overflow = 0; -+ -+ __asm__ ("mull %3\n\taddl %4,%0\n\tadcl %1,%1" -+ : "=&a"(res), "=&d" (overflow) -+ : "%0"(res), -+ "rm"(size), -+ "rm"(offset)); -+ -+ if (UNEXPECTED(overflow)) { -+ zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset); -+ return 0; -+ } -+ return res; -+} -+ -+#elif defined(__GNUC__) && defined(__x86_64__) -+ -+static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) -+{ -+ size_t res = nmemb; -+ unsigned long overflow = 0; -+ -+ __asm__ ("mulq %3\n\taddq %4,%0\n\tadcq %1,%1" -+ : "=&a"(res), "=&d" (overflow) -+ : "%0"(res), -+ "rm"(size), -+ "rm"(offset)); -+ -+ if (UNEXPECTED(overflow)) { -+ zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset); -+ return 0; -+ } -+ return res; -+} -+ -+#elif SIZEOF_SIZE_T == 4 && defined(HAVE_ZEND_LONG64) -+ -+static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) -+{ -+ zend_ulong64 res = (zend_ulong64)nmemb * (zend_ulong64)size + (zend_ulong64)offset; -+ -+ if (UNEXPECTED(res > (zend_ulong64)0xFFFFFFFFL)) { -+ zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset); -+ return 0; -+ } -+ return (size_t) res; -+} -+ -+#else -+ -+static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) -+{ -+ size_t res = nmemb * size + offset; -+ double _d = (double)nmemb * (double)size + (double)offset; -+ double _delta = (double)res - _d; -+ -+ if (UNEXPECTED((_d + _delta ) != _d)) { -+ zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset); -+ return 0; -+ } -+ return res; -+} -+#endif -+ -+/* -+ * Local variables: -+ * tab-width: 4 -+ * c-basic-offset: 4 -+ * indent-tabs-mode: t -+ * End: -+ */ -+ ---- /dev/null -+++ b/Zend/zend_canary.c -@@ -0,0 +1,66 @@ -+/* -+ +----------------------------------------------------------------------+ -+ | Suhosin-Patch for PHP | -+ +----------------------------------------------------------------------+ -+ | Copyright (c) 2004-2009 Stefan Esser | -+ +----------------------------------------------------------------------+ -+ | This source file is subject to version 2.02 of the PHP license, | -+ | that is bundled with this package in the file LICENSE, and is | -+ | available at through the world-wide-web at | -+ | http://www.php.net/license/2_02.txt. | -+ | If you did not receive a copy of the PHP license and are unable to | -+ | obtain it through the world-wide-web, please send a note to | -+ | license@php.net so we can mail you a copy immediately. | -+ +----------------------------------------------------------------------+ -+ | Author: Stefan Esser | -+ +----------------------------------------------------------------------+ -+ */ -+/* $Id: zend_canary.c,v 1.1 2004/11/26 12:45:41 ionic Exp $ */ -+ -+#include "zend.h" -+ -+#include -+#include -+ -+ -+#if SUHOSIN_PATCH -+ -+static size_t last_canary = 0x73625123; -+ -+/* will be replaced later with more compatible method */ -+ZEND_API void zend_canary(void *buf, int len) -+{ -+ time_t t; -+ size_t canary; -+ int fd; -+ -+#ifndef PHP_WIN32 -+ fd = open("/dev/urandom", 0); -+ if (fd != -1) { -+ int r = read(fd, buf, len); -+ close(fd); -+ if (r == len) { -+ return; -+ } -+ } -+#endif -+ /* not good but we never want to do this */ -+ time(&t); -+ canary = *(unsigned int *)&t + getpid() << 16 + last_canary; -+ last_canary ^= (canary << 5) | (canary >> (32-5)); -+ /* When we ensure full win32 compatibility in next version -+ we will replace this with the random number code from zend_alloc.c */ -+ memcpy(buf, &canary, len); -+} -+ -+#endif -+ -+ -+/* -+ * Local variables: -+ * tab-width: 4 -+ * c-basic-offset: 4 -+ * End: -+ * vim600: sw=4 ts=4 fdm=marker -+ * vim<600: sw=4 ts=4 -+ */ ---- a/Zend/zend_compile.c -+++ b/Zend/zend_compile.c -@@ -141,6 +141,11 @@ static void zend_destroy_property_info_i - } - /* }}} */ - -+#if SUHOSIN_PATCH -+void *suhosin_zend_destroy_property_info_internal = zend_destroy_property_info_internal; -+void *suhosin_zend_destroy_property_info = zend_destroy_property_info; -+#endif -+ - static void build_runtime_defined_function_key(zval *result, const char *name, int name_length TSRMLS_DC) /* {{{ */ - { - char char_pos_buf[32]; ---- a/Zend/zend_compile.h -+++ b/Zend/zend_compile.h -@@ -685,6 +685,11 @@ ZEND_API zend_bool zend_is_auto_global(c - ZEND_API zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashval TSRMLS_DC); - ZEND_API size_t zend_dirname(char *path, size_t len); - -+#if SUHOSIN_PATCH -+extern void *suhosin_zend_destroy_property_info_internal; -+extern void *suhosin_zend_destroy_property_info; -+#endif -+ - int zendlex(znode *zendlval TSRMLS_DC); - - int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC); ---- a/Zend/zend_constants.c -+++ b/Zend/zend_constants.c -@@ -117,6 +117,76 @@ void zend_register_standard_constants(TS - - REGISTER_MAIN_LONG_CONSTANT("DEBUG_BACKTRACE_PROVIDE_OBJECT", DEBUG_BACKTRACE_PROVIDE_OBJECT, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("DEBUG_BACKTRACE_IGNORE_ARGS", DEBUG_BACKTRACE_IGNORE_ARGS, CONST_PERSISTENT | CONST_CS); -+#if SUHOSIN_PATCH -+ REGISTER_MAIN_LONG_CONSTANT("S_MEMORY", S_MEMORY, CONST_PERSISTENT | CONST_CS); -+ REGISTER_MAIN_LONG_CONSTANT("S_VARS", S_VARS, CONST_PERSISTENT | CONST_CS); -+ REGISTER_MAIN_LONG_CONSTANT("S_FILES", S_FILES, CONST_PERSISTENT | CONST_CS); -+ REGISTER_MAIN_LONG_CONSTANT("S_INCLUDE", S_INCLUDE, CONST_PERSISTENT | CONST_CS); -+ REGISTER_MAIN_LONG_CONSTANT("S_SQL", S_SQL, CONST_PERSISTENT | CONST_CS); -+ REGISTER_MAIN_LONG_CONSTANT("S_EXECUTOR", S_EXECUTOR, CONST_PERSISTENT | CONST_CS); -+ REGISTER_MAIN_LONG_CONSTANT("S_MAIL", S_MAIL, CONST_PERSISTENT | CONST_CS); -+ REGISTER_MAIN_LONG_CONSTANT("S_SESSION", S_SESSION, CONST_PERSISTENT | CONST_CS); -+ REGISTER_MAIN_LONG_CONSTANT("S_MISC", S_MISC, CONST_PERSISTENT | CONST_CS); -+ REGISTER_MAIN_LONG_CONSTANT("S_INTERNAL", S_INTERNAL, CONST_PERSISTENT | CONST_CS); -+ REGISTER_MAIN_LONG_CONSTANT("S_ALL", S_ALL, CONST_PERSISTENT | CONST_CS); -+ -+ /* error levels */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_EMERG", LOG_EMERG, CONST_CS | CONST_PERSISTENT); /* system unusable */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_ALERT", LOG_ALERT, CONST_CS | CONST_PERSISTENT); /* immediate action required */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_CRIT", LOG_CRIT, CONST_CS | CONST_PERSISTENT); /* critical conditions */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_ERR", LOG_ERR, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_WARNING", LOG_WARNING, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_NOTICE", LOG_NOTICE, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_INFO", LOG_INFO, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_DEBUG", LOG_DEBUG, CONST_CS | CONST_PERSISTENT); -+ /* facility: type of program logging the message */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_KERN", LOG_KERN, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_USER", LOG_USER, CONST_CS | CONST_PERSISTENT); /* generic user level */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_MAIL", LOG_MAIL, CONST_CS | CONST_PERSISTENT); /* log to email */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_DAEMON", LOG_DAEMON, CONST_CS | CONST_PERSISTENT); /* other system daemons */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_AUTH", LOG_AUTH, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_SYSLOG", LOG_SYSLOG, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_LPR", LOG_LPR, CONST_CS | CONST_PERSISTENT); -+#ifdef LOG_NEWS -+ /* No LOG_NEWS on HP-UX */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_NEWS", LOG_NEWS, CONST_CS | CONST_PERSISTENT); /* usenet new */ -+#endif -+#ifdef LOG_UUCP -+ /* No LOG_UUCP on HP-UX */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_UUCP", LOG_UUCP, CONST_CS | CONST_PERSISTENT); -+#endif -+#ifdef LOG_CRON -+ /* apparently some systems don't have this one */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_CRON", LOG_CRON, CONST_CS | CONST_PERSISTENT); -+#endif -+#ifdef LOG_AUTHPRIV -+ /* AIX doesn't have LOG_AUTHPRIV */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_AUTHPRIV", LOG_AUTHPRIV, CONST_CS | CONST_PERSISTENT); -+#endif -+#ifndef PHP_WIN32 -+ REGISTER_MAIN_LONG_CONSTANT("LOG_LOCAL0", LOG_LOCAL0, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_LOCAL1", LOG_LOCAL1, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_LOCAL2", LOG_LOCAL2, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_LOCAL3", LOG_LOCAL3, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_LOCAL4", LOG_LOCAL4, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_LOCAL5", LOG_LOCAL5, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_LOCAL6", LOG_LOCAL6, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_LOCAL7", LOG_LOCAL7, CONST_CS | CONST_PERSISTENT); -+#endif -+ /* options */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_PID", LOG_PID, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_CONS", LOG_CONS, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_ODELAY", LOG_ODELAY, CONST_CS | CONST_PERSISTENT); -+ REGISTER_MAIN_LONG_CONSTANT("LOG_NDELAY", LOG_NDELAY, CONST_CS | CONST_PERSISTENT); -+#ifdef LOG_NOWAIT -+ REGISTER_MAIN_LONG_CONSTANT("LOG_NOWAIT", LOG_NOWAIT, CONST_CS | CONST_PERSISTENT); -+#endif -+#ifdef LOG_PERROR -+ /* AIX doesn't have LOG_PERROR */ -+ REGISTER_MAIN_LONG_CONSTANT("LOG_PERROR", LOG_PERROR, CONST_CS | CONST_PERSISTENT); /*log to stderr*/ -+#endif -+#endif -+ - /* true/false constants */ - { - zend_constant c; ---- a/Zend/zend_errors.h -+++ b/Zend/zend_errors.h -@@ -41,6 +41,20 @@ - #define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED | E_STRICT) - #define E_CORE (E_CORE_ERROR | E_CORE_WARNING) - -+#if SUHOSIN_PATCH -+#define S_MEMORY (1<<0L) -+#define S_MISC (1<<1L) -+#define S_VARS (1<<2L) -+#define S_FILES (1<<3L) -+#define S_INCLUDE (1<<4L) -+#define S_SQL (1<<5L) -+#define S_EXECUTOR (1<<6L) -+#define S_MAIL (1<<7L) -+#define S_SESSION (1<<8L) -+#define S_INTERNAL (1<<29L) -+#define S_ALL (S_MEMORY | S_VARS | S_INCLUDE | S_FILES | S_MAIL | S_SESSION | S_MISC | S_SQL | S_EXECUTOR) -+#endif -+ - #endif /* ZEND_ERRORS_H */ - - /* ---- a/Zend/zend_hash.c -+++ b/Zend/zend_hash.c -@@ -21,6 +21,7 @@ - - #include "zend.h" - #include "zend_globals.h" -+#include "zend_compile.h" - - #define CONNECT_TO_BUCKET_DLLIST(element, list_head) \ - (element)->pNext = (list_head); \ -@@ -103,6 +104,199 @@ ZEND_API ulong zend_hash_func(const char - return zend_inline_hash_func(arKey, nKeyLength); - } - -+#if SUHOSIN_PATCH -+#ifdef ZTS -+static MUTEX_T zend_hash_dprot_mx_reader; -+static MUTEX_T zend_hash_dprot_mx_writer; -+static unsigned int zend_hash_dprot_reader; -+#endif -+static unsigned int zend_hash_dprot_counter; -+static unsigned int zend_hash_dprot_curmax; -+static dtor_func_t *zend_hash_dprot_table = NULL; -+ -+static void zend_hash_dprot_begin_read() -+{ -+#ifdef ZTS -+ tsrm_mutex_lock(zend_hash_dprot_mx_reader); -+ if ((++(zend_hash_dprot_reader)) == 1) { -+ tsrm_mutex_lock(zend_hash_dprot_mx_writer); -+ } -+ tsrm_mutex_unlock(zend_hash_dprot_mx_reader); -+#endif -+} -+ -+static void zend_hash_dprot_end_read() -+{ -+#ifdef ZTS -+ tsrm_mutex_lock(zend_hash_dprot_mx_reader); -+ if ((--(zend_hash_dprot_reader)) == 0) { -+ tsrm_mutex_unlock(zend_hash_dprot_mx_writer); -+ } -+ tsrm_mutex_unlock(zend_hash_dprot_mx_reader); -+#endif -+} -+ -+static void zend_hash_dprot_begin_write() -+{ -+#ifdef ZTS -+ tsrm_mutex_lock(zend_hash_dprot_mx_writer); -+#endif -+} -+ -+static void zend_hash_dprot_end_write() -+{ -+#ifdef ZTS -+ tsrm_mutex_unlock(zend_hash_dprot_mx_writer); -+#endif -+} -+ -+/*ZEND_API void zend_hash_dprot_dtor() -+{ -+#ifdef ZTS -+ tsrm_mutex_free(zend_hash_dprot_mx_reader); -+ tsrm_mutex_free(zend_hash_dprot_mx_writer); -+#endif -+ free(zend_hash_dprot_table); -+}*/ -+ -+static void zend_hash_add_destructor(dtor_func_t pDestructor) -+{ -+ int left, right, mid; -+ zend_bool found = 0; -+ unsigned long value; -+ -+ if (pDestructor == NULL || pDestructor == ZVAL_PTR_DTOR || pDestructor == ZVAL_INTERNAL_PTR_DTOR -+ || pDestructor == ZEND_FUNCTION_DTOR || pDestructor == ZEND_CLASS_DTOR) { -+ return; -+ } -+ -+ if (zend_hash_dprot_table == NULL) { -+#ifdef ZTS -+ zend_hash_dprot_mx_reader = tsrm_mutex_alloc(); -+ zend_hash_dprot_mx_writer = tsrm_mutex_alloc(); -+ zend_hash_dprot_reader = 0; -+#endif -+ zend_hash_dprot_counter = 0; -+ zend_hash_dprot_curmax = 256; -+ zend_hash_dprot_table = (dtor_func_t *) malloc(256 * sizeof(dtor_func_t)); -+ } -+ -+ zend_hash_dprot_begin_write(); -+ -+ if (zend_hash_dprot_counter == 0) { -+ zend_hash_dprot_counter++; -+ zend_hash_dprot_table[0] = pDestructor; -+ } else { -+ value = (unsigned long) pDestructor; -+ left = 0; -+ right = zend_hash_dprot_counter-1; -+ mid = 0; -+ -+ while (left < right) { -+ mid = (right - left) >> 1; -+ mid += left; -+ if ((unsigned long)zend_hash_dprot_table[mid] == value) { -+ found = 1; -+ break; -+ } -+ if (value < (unsigned long)zend_hash_dprot_table[mid]) { -+ right = mid-1; -+ } else { -+ left = mid+1; -+ } -+ } -+ if ((unsigned long)zend_hash_dprot_table[left] == value) { -+ found = 1; -+ } -+ -+ if (!found) { -+ -+ if (zend_hash_dprot_counter >= zend_hash_dprot_curmax) { -+ zend_hash_dprot_curmax += 256; -+ zend_hash_dprot_table = (dtor_func_t *) realloc(zend_hash_dprot_table, zend_hash_dprot_curmax * sizeof(dtor_func_t)); -+ } -+ -+ if ((unsigned long)zend_hash_dprot_table[left] < value) { -+ memmove(zend_hash_dprot_table+left+2, zend_hash_dprot_table+left+1, (zend_hash_dprot_counter-left-1)*sizeof(dtor_func_t)); -+ zend_hash_dprot_table[left+1] = pDestructor; -+ } else { -+ memmove(zend_hash_dprot_table+left+1, zend_hash_dprot_table+left, (zend_hash_dprot_counter-left)*sizeof(dtor_func_t)); -+ zend_hash_dprot_table[left] = pDestructor; -+ } -+ -+ zend_hash_dprot_counter++; -+ } -+ } -+ -+ zend_hash_dprot_end_write(); -+} -+ -+static void zend_hash_check_destructor(dtor_func_t pDestructor) -+{ -+ unsigned long value; -+ -+ if (pDestructor == NULL || pDestructor == ZVAL_PTR_DTOR || pDestructor == ZVAL_INTERNAL_PTR_DTOR -+#ifdef ZEND_ENGINE_2 -+ || pDestructor == suhosin_zend_destroy_property_info_internal || pDestructor == suhosin_zend_destroy_property_info -+#endif -+ || pDestructor == ZEND_FUNCTION_DTOR || pDestructor == ZEND_CLASS_DTOR) { -+ return; -+ } -+ -+ zend_hash_dprot_begin_read(); -+ -+ if (zend_hash_dprot_counter > 0) { -+ int left, right, mid; -+ zend_bool found = 0; -+ -+ value = (unsigned long) pDestructor; -+ left = 0; -+ right = zend_hash_dprot_counter-1; -+ -+ while (left < right) { -+ mid = (right - left) >> 1; -+ mid += left; -+ if ((unsigned long)zend_hash_dprot_table[mid] == value) { -+ found = 1; -+ break; -+ } -+ if (value < (unsigned long)zend_hash_dprot_table[mid]) { -+ right = mid-1; -+ } else { -+ left = mid+1; -+ } -+ } -+ if ((unsigned long)zend_hash_dprot_table[left] == value) { -+ found = 1; -+ } -+ -+ if (!found) { -+ zend_hash_dprot_end_read(); -+ -+ zend_suhosin_log(S_MEMORY, "possible memory corruption detected - unknown Hashtable destructor"); -+ if (SUHOSIN_CONFIG(SUHOSIN_HT_IGNORE_INVALID_DESTRUCTOR) == 0) { -+ _exit(1); -+ } -+ return; -+ } -+ -+ } else { -+ zend_hash_dprot_end_read(); -+ -+ zend_suhosin_log(S_MEMORY, "possible memory corruption detected - unknown Hashtable destructor"); -+ if (SUHOSIN_CONFIG(SUHOSIN_HT_IGNORE_INVALID_DESTRUCTOR) == 0) { -+ _exit(1); -+ } -+ return; -+ } -+ -+ zend_hash_dprot_end_read(); -+} -+ -+#else -+#define zend_hash_add_destructor(pDestructor) do {} while(0) -+#define zend_hash_check_destructor(pDestructor) do {} while(0) -+#endif - - #define UPDATE_DATA(ht, p, pData, nDataSize) \ - if (nDataSize == sizeof(void*)) { \ -@@ -163,6 +357,7 @@ ZEND_API int _zend_hash_init(HashTable * - - ht->nTableMask = 0; /* 0 means that ht->arBuckets is uninitialized */ - ht->pDestructor = pDestructor; -+ zend_hash_add_destructor(pDestructor); - ht->arBuckets = (Bucket**)&uninitialized_bucket; - ht->pListHead = NULL; - ht->pListTail = NULL; -@@ -230,6 +425,7 @@ ZEND_API int _zend_hash_add_or_update(Ha - return FAILURE; - } - #endif -+ zend_hash_check_destructor(ht->pDestructor); - if (ht->pDestructor) { - ht->pDestructor(p->pData); - } -@@ -307,6 +503,7 @@ ZEND_API int _zend_hash_quick_add_or_upd - return FAILURE; - } - #endif -+ zend_hash_check_destructor(ht->pDestructor); - if (ht->pDestructor) { - ht->pDestructor(p->pData); - } -@@ -394,6 +591,7 @@ ZEND_API int _zend_hash_index_update_or_ - return FAILURE; - } - #endif -+ zend_hash_check_destructor(ht->pDestructor); - if (ht->pDestructor) { - ht->pDestructor(p->pData); - } -@@ -527,6 +725,7 @@ ZEND_API int zend_hash_del_key_or_index( - if (ht->pInternalPointer == p) { - ht->pInternalPointer = p->pListNext; - } -+ zend_hash_check_destructor(ht->pDestructor); - if (ht->pDestructor) { - ht->pDestructor(p->pData); - } -@@ -553,6 +752,7 @@ ZEND_API void zend_hash_destroy(HashTabl - SET_INCONSISTENT(HT_IS_DESTROYING); - - p = ht->pListHead; -+ zend_hash_check_destructor(ht->pDestructor); - while (p != NULL) { - q = p; - p = p->pListNext; -@@ -646,6 +846,7 @@ static Bucket *zend_hash_apply_deleter(H - ht->nNumOfElements--; - HANDLE_UNBLOCK_INTERRUPTIONS(); - -+ zend_hash_check_destructor(ht->pDestructor); - if (ht->pDestructor) { - ht->pDestructor(p->pData); - } -@@ -666,6 +867,7 @@ ZEND_API void zend_hash_graceful_destroy - IS_CONSISTENT(ht); - - p = ht->pListHead; -+ zend_hash_check_destructor(ht->pDestructor); - while (p != NULL) { - p = zend_hash_apply_deleter(ht, p); - } ---- a/Zend/zend_llist.c -+++ b/Zend/zend_llist.c -@@ -23,6 +23,194 @@ - #include "zend_llist.h" - #include "zend_qsort.h" - -+#if SUHOSIN_PATCH -+#ifdef ZTS -+static MUTEX_T zend_llist_dprot_mx_reader; -+static MUTEX_T zend_llist_dprot_mx_writer; -+static unsigned int zend_llist_dprot_reader; -+#endif -+static unsigned int zend_llist_dprot_counter; -+static unsigned int zend_llist_dprot_curmax; -+static llist_dtor_func_t *zend_llist_dprot_table = NULL; -+ -+static void zend_llist_dprot_begin_read() -+{ -+#ifdef ZTS -+ tsrm_mutex_lock(zend_llist_dprot_mx_reader); -+ if ((++(zend_llist_dprot_reader)) == 1) { -+ tsrm_mutex_lock(zend_llist_dprot_mx_writer); -+ } -+ tsrm_mutex_unlock(zend_llist_dprot_mx_reader); -+#endif -+} -+ -+static void zend_llist_dprot_end_read() -+{ -+#ifdef ZTS -+ tsrm_mutex_lock(zend_llist_dprot_mx_reader); -+ if ((--(zend_llist_dprot_reader)) == 0) { -+ tsrm_mutex_unlock(zend_llist_dprot_mx_writer); -+ } -+ tsrm_mutex_unlock(zend_llist_dprot_mx_reader); -+#endif -+} -+ -+static void zend_llist_dprot_begin_write() -+{ -+#ifdef ZTS -+ tsrm_mutex_lock(zend_llist_dprot_mx_writer); -+#endif -+} -+ -+static void zend_llist_dprot_end_write() -+{ -+#ifdef ZTS -+ tsrm_mutex_unlock(zend_llist_dprot_mx_writer); -+#endif -+} -+ -+/*ZEND_API void zend_llist_dprot_dtor() -+{ -+#ifdef ZTS -+ tsrm_mutex_free(zend_llist_dprot_mx_reader); -+ tsrm_mutex_free(zend_llist_dprot_mx_writer); -+#endif -+ free(zend_llist_dprot_table); -+}*/ -+ -+static void zend_llist_add_destructor(llist_dtor_func_t pDestructor) -+{ -+ int left, right, mid; -+ zend_bool found = 0; -+ unsigned long value; -+ -+ if (pDestructor == NULL || pDestructor == ZVAL_PTR_DTOR) { -+ return; -+ } -+ -+ if (zend_llist_dprot_table == NULL) { -+#ifdef ZTS -+ zend_llist_dprot_mx_reader = tsrm_mutex_alloc(); -+ zend_llist_dprot_mx_writer = tsrm_mutex_alloc(); -+ zend_llist_dprot_reader = 0; -+#endif -+ zend_llist_dprot_counter = 0; -+ zend_llist_dprot_curmax = 256; -+ zend_llist_dprot_table = (llist_dtor_func_t *) malloc(256 * sizeof(llist_dtor_func_t)); -+ } -+ -+ zend_llist_dprot_begin_write(); -+ -+ if (zend_llist_dprot_counter == 0) { -+ zend_llist_dprot_counter++; -+ zend_llist_dprot_table[0] = pDestructor; -+ } else { -+ value = (unsigned long) pDestructor; -+ left = 0; -+ right = zend_llist_dprot_counter-1; -+ mid = 0; -+ -+ while (left < right) { -+ mid = (right - left) >> 1; -+ mid += left; -+ if ((unsigned long)zend_llist_dprot_table[mid] == value) { -+ found = 1; -+ break; -+ } -+ if (value < (unsigned long)zend_llist_dprot_table[mid]) { -+ right = mid-1; -+ } else { -+ left = mid+1; -+ } -+ } -+ if ((unsigned long)zend_llist_dprot_table[left] == value) { -+ found = 1; -+ } -+ -+ if (!found) { -+ -+ if (zend_llist_dprot_counter >= zend_llist_dprot_curmax) { -+ zend_llist_dprot_curmax += 256; -+ zend_llist_dprot_table = (llist_dtor_func_t *) realloc(zend_llist_dprot_table, zend_llist_dprot_curmax * sizeof(llist_dtor_func_t)); -+ } -+ -+ if ((unsigned long)zend_llist_dprot_table[left] < value) { -+ memmove(zend_llist_dprot_table+left+2, zend_llist_dprot_table+left+1, (zend_llist_dprot_counter-left-1)*sizeof(llist_dtor_func_t)); -+ zend_llist_dprot_table[left+1] = pDestructor; -+ } else { -+ memmove(zend_llist_dprot_table+left+1, zend_llist_dprot_table+left, (zend_llist_dprot_counter-left)*sizeof(llist_dtor_func_t)); -+ zend_llist_dprot_table[left] = pDestructor; -+ } -+ -+ zend_llist_dprot_counter++; -+ } -+ } -+ -+ zend_llist_dprot_end_write(); -+} -+ -+static void zend_llist_check_destructor(llist_dtor_func_t pDestructor) -+{ -+ unsigned long value; -+ -+ if (pDestructor == NULL || pDestructor == ZVAL_PTR_DTOR) { -+ return; -+ } -+ -+ zend_llist_dprot_begin_read(); -+ -+ if (zend_llist_dprot_counter > 0) { -+ int left, right, mid; -+ zend_bool found = 0; -+ -+ value = (unsigned long) pDestructor; -+ left = 0; -+ right = zend_llist_dprot_counter-1; -+ -+ while (left < right) { -+ mid = (right - left) >> 1; -+ mid += left; -+ if ((unsigned long)zend_llist_dprot_table[mid] == value) { -+ found = 1; -+ break; -+ } -+ if (value < (unsigned long)zend_llist_dprot_table[mid]) { -+ right = mid-1; -+ } else { -+ left = mid+1; -+ } -+ } -+ if ((unsigned long)zend_llist_dprot_table[left] == value) { -+ found = 1; -+ } -+ -+ if (!found) { -+ zend_llist_dprot_end_read(); -+ -+ zend_suhosin_log(S_MEMORY, "possible memory corruption detected - unknown llist destructor"); -+ if (SUHOSIN_CONFIG(SUHOSIN_LL_IGNORE_INVALID_DESTRUCTOR) == 0) { -+ _exit(1); -+ } -+ return; -+ } -+ -+ } else { -+ zend_llist_dprot_end_read(); -+ -+ zend_suhosin_log(S_MEMORY, "possible memory corruption detected - unknown llist destructor"); -+ if (SUHOSIN_CONFIG(SUHOSIN_LL_IGNORE_INVALID_DESTRUCTOR) == 0) { -+ _exit(1); -+ } -+ return; -+ } -+ -+ zend_llist_dprot_end_read(); -+} -+#else -+#define zend_llist_add_destructor(pDestructor) do {} while(0) -+#define zend_llist_check_destructor(pDestructor) do {} while(0) -+#endif -+ - ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent) - { - l->head = NULL; -@@ -30,6 +218,7 @@ ZEND_API void zend_llist_init(zend_llist - l->count = 0; - l->size = size; - l->dtor = dtor; -+ zend_llist_add_destructor(dtor); - l->persistent = persistent; - } - -@@ -81,6 +270,7 @@ ZEND_API void zend_llist_prepend_element - } else {\ - (l)->tail = (current)->prev;\ - }\ -+ zend_llist_check_destructor((l)->dtor); \ - if ((l)->dtor) {\ - (l)->dtor((current)->data);\ - }\ -@@ -108,6 +298,7 @@ ZEND_API void zend_llist_destroy(zend_ll - { - zend_llist_element *current=l->head, *next; - -+ zend_llist_check_destructor(l->dtor); - while (current) { - next = current->next; - if (l->dtor) { -@@ -133,6 +324,7 @@ ZEND_API void *zend_llist_remove_tail(ze - zend_llist_element *old_tail; - void *data; - -+ zend_llist_check_destructor((l)->dtor); - if ((old_tail = l->tail)) { - if (old_tail->prev) { - old_tail->prev->next = NULL; ---- a/Zend/zend_operators.c -+++ b/Zend/zend_operators.c -@@ -150,9 +150,14 @@ ZEND_API void convert_scalar_to_number(z - case IS_STRING: - { - char *strval; -+ int strl; - - strval = Z_STRVAL_P(op); -- if ((Z_TYPE_P(op)=is_numeric_string(strval, Z_STRLEN_P(op), &Z_LVAL_P(op), &Z_DVAL_P(op), 1)) == 0) { -+ strl = Z_STRLEN_P(op); -+#if SUHOSIN_PATCH -+ Z_STRLEN_P(op) = 0; -+#endif -+ if ((Z_TYPE_P(op)=is_numeric_string(strval, strl, &Z_LVAL_P(op), &Z_DVAL_P(op), 1)) == 0) { - ZVAL_LONG(op, 0); - } - STR_FREE(strval); -@@ -184,7 +189,8 @@ ZEND_API void convert_scalar_to_number(z - } else { \ - switch (Z_TYPE_P(op)) { \ - case IS_STRING: \ -- { \ -+ { \ -+ Z_STRLEN(holder) = 0; \ - if ((Z_TYPE(holder)=is_numeric_string(Z_STRVAL_P(op), Z_STRLEN_P(op), &Z_LVAL(holder), &Z_DVAL(holder), 1)) == 0) { \ - ZVAL_LONG(&(holder), 0); \ - } \ -@@ -226,6 +232,7 @@ ZEND_API void convert_scalar_to_number(z - Z_LVAL(holder) = zend_dval_to_lval(Z_DVAL_P(op)); \ - break; \ - case IS_STRING: \ -+ Z_STRLEN(holder) = 0; \ - Z_LVAL(holder) = strtol(Z_STRVAL_P(op), NULL, 10); \ - break; \ - case IS_ARRAY: \ -@@ -268,6 +275,7 @@ ZEND_API void convert_scalar_to_number(z - Z_LVAL(holder) = (Z_DVAL_P(op) ? 1 : 0); \ - break; \ - case IS_STRING: \ -+ Z_STRLEN(holder) = 0; \ - if (Z_STRLEN_P(op) == 0 \ - || (Z_STRLEN_P(op)==1 && Z_STRVAL_P(op)[0]=='0')) { \ - Z_LVAL(holder) = 0; \ -@@ -353,6 +361,9 @@ ZEND_API void convert_to_long_base(zval - { - char *strval = Z_STRVAL_P(op); - -+#if SUHOSIN_PATCH -+ Z_STRLEN_P(op) = 0; -+#endif - Z_LVAL_P(op) = strtol(strval, NULL, base); - STR_FREE(strval); - } -@@ -413,6 +424,9 @@ ZEND_API void convert_to_double(zval *op - { - char *strval = Z_STRVAL_P(op); - -+#if SUHOSIN_PATCH -+ Z_STRLEN_P(op) = 0; -+#endif - Z_DVAL_P(op) = zend_strtod(strval, NULL); - STR_FREE(strval); - } -@@ -499,8 +513,14 @@ ZEND_API void convert_to_boolean(zval *o - - if (Z_STRLEN_P(op) == 0 - || (Z_STRLEN_P(op)==1 && Z_STRVAL_P(op)[0]=='0')) { -+#if SUHOSIN_PATCH -+ Z_STRLEN_P(op) = 0; -+#endif - Z_LVAL_P(op) = 0; - } else { -+#if SUHOSIN_PATCH -+ Z_STRLEN_P(op) = 0; -+#endif - Z_LVAL_P(op) = 1; - } - STR_FREE(strval); -@@ -614,6 +634,9 @@ static void convert_scalar_to_array(zval - *entry = *op; - INIT_PZVAL(entry); - -+#if SUHOSIN_PATCH -+ Z_STRLEN_P(op) = 0; -+#endif - switch (type) { - case IS_ARRAY: - ALLOC_HASHTABLE(Z_ARRVAL_P(op)); ---- a/Zend/zend_variables.c -+++ b/Zend/zend_variables.c -@@ -34,6 +34,9 @@ ZEND_API void _zval_dtor_func(zval *zval - case IS_CONSTANT: - CHECK_ZVAL_STRING_REL(zvalue); - STR_FREE_REL(zvalue->value.str.val); -+#if SUHOSIN_PATCH -+ zvalue->value.str.len = 0; -+#endif - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: { -@@ -78,6 +81,9 @@ ZEND_API void _zval_internal_dtor(zval * - case IS_CONSTANT: - CHECK_ZVAL_STRING_REL(zvalue); - str_free(zvalue->value.str.val); -+#if SUHOSIN_PATCH -+ zvalue->value.str.len = 0; -+#endif - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: ---- a/configure.in -+++ b/configure.in -@@ -359,6 +359,7 @@ case $host_alias in - ;; - esac - -+sinclude(main/suhosin_patch.m4) - - dnl Include Zend and TSRM configurations. - dnl ------------------------------------------------------------------------- -@@ -1440,7 +1441,7 @@ PHP_ADD_SOURCES(main, main.c snprintf.c - php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \ - strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \ - network.c php_open_temporary_file.c php_logos.c \ -- output.c getopt.c) -+ output.c getopt.c suhosin_patch.c ) - - PHP_ADD_SOURCES(main/streams, streams.c cast.c memory.c filter.c \ - plain_wrapper.c userspace.c transports.c xp_socket.c mmap.c \ -@@ -1468,7 +1469,7 @@ PHP_ADD_SOURCES(Zend, \ - zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \ - zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c zend_stream.c \ - zend_iterators.c zend_interfaces.c zend_exceptions.c zend_strtod.c zend_gc.c \ -- zend_closures.c zend_float.c zend_string.c zend_signal.c) -+ zend_closures.c zend_float.c zend_string.c zend_signal.c zend_canary.c zend_alloc_canary.c ) - - if test -r "$abs_srcdir/Zend/zend_objects.c"; then - PHP_ADD_SOURCES(Zend, zend_objects.c zend_object_handlers.c zend_objects_API.c zend_default_classes.c) ---- a/ext/standard/dl.c -+++ b/ext/standard/dl.c -@@ -246,6 +246,23 @@ PHPAPI int php_load_extension(char *file - return FAILURE; - } - } -+ -+#if SUHOSIN_PATCH -+ if (strncmp("suhosin", module_entry->name, sizeof("suhosin")-1) == 0) { -+ void *log_func; -+ /* sucessfully loaded suhosin extension, now check for logging function replacement */ -+ log_func = (void *) DL_FETCH_SYMBOL(handle, "suhosin_log"); -+ if (log_func == NULL) { -+ log_func = (void *) DL_FETCH_SYMBOL(handle, "_suhosin_log"); -+ } -+ if (log_func != NULL) { -+ zend_suhosin_log = log_func; -+ } else { -+ zend_suhosin_log(S_MISC, "could not replace logging function"); -+ } -+ } -+#endif -+ - return SUCCESS; - } - /* }}} */ ---- a/ext/standard/info.c -+++ b/ext/standard/info.c -@@ -785,6 +785,33 @@ PHPAPI void php_print_info(int flag TSRM - - php_info_print_table_end(); - -+ /* Suhosin Patch */ -+ php_info_print_box_start(0); -+ if (expose_php && !sapi_module.phpinfo_as_text) { -+ PUTS("\"Suhosin\n"); -+ } -+ PUTS("This server is protected with the Suhosin Patch "); -+ if (sapi_module.phpinfo_as_text) { -+ PUTS(SUHOSIN_PATCH_VERSION); -+ } else { -+ zend_html_puts(SUHOSIN_PATCH_VERSION, strlen(SUHOSIN_PATCH_VERSION) TSRMLS_CC); -+ } -+ PUTS(!sapi_module.phpinfo_as_text?"
":"\n"); -+ if (sapi_module.phpinfo_as_text) { -+ PUTS("Copyright (c) 2006-2007 Hardened-PHP Project\n"); -+ PUTS("Copyright (c) 2007-2009 SektionEins GmbH\n"); -+ } else { -+ PUTS("Copyright (c) 2006-2007 Hardened-PHP Project\n"); -+ PUTS("Copyright (c) 2007-2009 SektionEins GmbH\n"); -+ } -+ php_info_print_box_end(); -+ - /* Zend Engine */ - php_info_print_box_start(0); - if (expose_php && !sapi_module.phpinfo_as_text) { ---- a/ext/standard/syslog.c -+++ b/ext/standard/syslog.c -@@ -40,6 +40,7 @@ - */ - PHP_MINIT_FUNCTION(syslog) - { -+#if !SUHOSIN_PATCH - /* error levels */ - REGISTER_LONG_CONSTANT("LOG_EMERG", LOG_EMERG, CONST_CS | CONST_PERSISTENT); /* system unusable */ - REGISTER_LONG_CONSTANT("LOG_ALERT", LOG_ALERT, CONST_CS | CONST_PERSISTENT); /* immediate action required */ -@@ -95,6 +96,7 @@ PHP_MINIT_FUNCTION(syslog) - /* AIX doesn't have LOG_PERROR */ - REGISTER_LONG_CONSTANT("LOG_PERROR", LOG_PERROR, CONST_CS | CONST_PERSISTENT); /*log to stderr*/ - #endif -+#endif - BG(syslog_device)=NULL; - - return SUCCESS; ---- a/main/fopen_wrappers.c -+++ b/main/fopen_wrappers.c -@@ -84,13 +84,8 @@ or a tightening during activation/runtim - PHPAPI ZEND_INI_MH(OnUpdateBaseDir) - { - char **p, *pathbuf, *ptr, *end; --#ifndef ZTS -- char *base = (char *) mh_arg2; --#else -- char *base = (char *) ts_resource(*((int *) mh_arg2)); --#endif - -- p = (char **) (base + (size_t) mh_arg1); -+ p = &PG(open_basedir); - - if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN || stage == PHP_INI_STAGE_ACTIVATE || stage == PHP_INI_STAGE_DEACTIVATE) { - /* We're in a PHP_INI_SYSTEM context, no restrictions */ ---- a/main/main.c -+++ b/main/main.c -@@ -92,6 +92,9 @@ - - #include "SAPI.h" - #include "rfc1867.h" -+#if SUHOSIN_PATCH -+#include "suhosin_globals.h" -+#endif - - #if HAVE_MMAP - # if HAVE_UNISTD_H -@@ -473,7 +476,7 @@ PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("extension_dir", PHP_EXTENSION_DIR, PHP_INI_SYSTEM, OnUpdateStringUnempty, extension_dir, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("include_path", PHP_INCLUDE_PATH, PHP_INI_ALL, OnUpdateStringUnempty, include_path, php_core_globals, core_globals) - PHP_INI_ENTRY("max_execution_time", "30", PHP_INI_ALL, OnUpdateTimeout) -- STD_PHP_INI_ENTRY("open_basedir", NULL, PHP_INI_ALL, OnUpdateBaseDir, open_basedir, php_core_globals, core_globals) -+ PHP_INI_ENTRY("open_basedir", NULL, PHP_INI_ALL, OnUpdateBaseDir) - - STD_PHP_INI_BOOLEAN("file_uploads", "1", PHP_INI_SYSTEM, OnUpdateBool, file_uploads, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("upload_max_filesize", "2M", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLong, upload_max_filesize, php_core_globals, core_globals) -@@ -1884,6 +1887,10 @@ void dummy_invalid_parameter_handler( - } - #endif - -+#if SUHOSIN_PATCH -+PHPAPI void suhosin_startup(); -+#endif -+ - /* {{{ php_module_startup - */ - int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_modules, uint num_additional_modules) -@@ -1927,6 +1934,10 @@ int php_module_startup(sapi_module_struc - php_win32_init_rng_lock(); - #endif - -+#if SUHOSIN_PATCH -+ suhosin_startup(); -+#endif -+ - module_shutdown = 0; - module_startup = 1; - sapi_initialize_empty_request(TSRMLS_C); -@@ -2051,7 +2062,11 @@ int php_module_startup(sapi_module_struc - REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_SHLIB_SUFFIX", PHP_SHLIB_SUFFIX, sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_EOL", PHP_EOL, sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS); -- REGISTER_MAIN_LONG_CONSTANT("PHP_MAXPATHLEN", MAXPATHLEN, CONST_PERSISTENT | CONST_CS); -+#if SUHOSIN_PATCH -+ REGISTER_MAIN_LONG_CONSTANT("SUHOSIN_PATCH", 1, CONST_PERSISTENT | CONST_CS); -+ REGISTER_MAIN_STRINGL_CONSTANT("SUHOSIN_PATCH_VERSION", SUHOSIN_PATCH_VERSION, sizeof(SUHOSIN_PATCH_VERSION)-1, CONST_PERSISTENT | CONST_CS); -+#endif -+ REGISTER_MAIN_LONG_CONSTANT("PHP_MAXPATHLEN", MAXPATHLEN, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("PHP_INT_MAX", LONG_MAX, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("PHP_INT_SIZE", sizeof(long), CONST_PERSISTENT | CONST_CS); - ---- a/main/php.h -+++ b/main/php.h -@@ -453,6 +453,10 @@ END_EXTERN_C() - #endif - #endif /* !XtOffsetOf */ - -+#if SUHOSIN_PATCH -+#include "suhosin_patch.h" -+#endif -+ - #endif - - /* ---- a/main/php_logos.c -+++ b/main/php_logos.c -@@ -50,6 +50,10 @@ PHPAPI int php_unregister_info_logo(char - return zend_hash_del(&phpinfo_logo_hash, logo_string, strlen(logo_string)); - } - -+#if SUHOSIN_PATCH -+#include "suhosin_logo.h" -+#endif -+ - int php_init_info_logos(void) - { - if(zend_hash_init(&phpinfo_logo_hash, 0, NULL, NULL, 1)==FAILURE) -@@ -58,7 +62,9 @@ int php_init_info_logos(void) - php_register_info_logo(PHP_LOGO_GUID , "image/gif", php_logo , sizeof(php_logo)); - php_register_info_logo(PHP_EGG_LOGO_GUID, "image/gif", php_egg_logo, sizeof(php_egg_logo)); - php_register_info_logo(ZEND_LOGO_GUID , "image/gif", zend_logo , sizeof(zend_logo)); -- -+#if SUHOSIN_PATCH -+ php_register_info_logo(SUHOSIN_LOGO_GUID, "image/jpeg", suhosin_logo , sizeof(suhosin_logo)); -+#endif - return SUCCESS; - } - ---- a/main/snprintf.c -+++ b/main/snprintf.c -@@ -782,6 +782,10 @@ static int format_converter(register buf - */ - switch (*fmt) { - case 'Z': -+#if SUHOSIN_PATCH -+ zend_suhosin_log(S_MISC, "'Z' specifier within format string"); -+ goto skip_output; -+#else - zvp = (zval*) va_arg(ap, zval*); - zend_make_printable_zval(zvp, &zcopy, &free_zcopy); - if (free_zcopy) { -@@ -792,6 +796,7 @@ static int format_converter(register buf - if (adjust_precision && precision < s_len) { - s_len = precision; - } -+#endif - break; - case 'u': - switch(modifier) { -@@ -1093,7 +1098,11 @@ static int format_converter(register buf - - - case 'n': -+#if SUHOSIN_PATCH -+ zend_suhosin_log(S_MISC, "'n' specifier within format string"); -+#else - *(va_arg(ap, int *)) = cc; -+#endif - goto skip_output; - - /* ---- a/main/spprintf.c -+++ b/main/spprintf.c -@@ -390,6 +390,10 @@ static void xbuf_format_converter(smart_ - */ - switch (*fmt) { - case 'Z': -+#if SUHOSIN_PATCH -+ zend_suhosin_log(S_MISC, "'Z' specifier within format string"); -+ goto skip_output; -+#else - zvp = (zval*) va_arg(ap, zval*); - zend_make_printable_zval(zvp, &zcopy, &free_zcopy); - if (free_zcopy) { -@@ -400,6 +404,7 @@ static void xbuf_format_converter(smart_ - if (adjust_precision && precision < s_len) { - s_len = precision; - } -+#endif - break; - case 'u': - switch(modifier) { -@@ -700,7 +705,11 @@ static void xbuf_format_converter(smart_ - - - case 'n': -+#if SUHOSIN_PATCH -+ zend_suhosin_log(S_MISC, "'n' specifier within format string"); -+#else - *(va_arg(ap, int *)) = xbuf->len; -+#endif - goto skip_output; - - /* ---- /dev/null -+++ b/main/suhosin_globals.h -@@ -0,0 +1,61 @@ -+/* -+ +----------------------------------------------------------------------+ -+ | Suhosin-Patch for PHP | -+ +----------------------------------------------------------------------+ -+ | Copyright (c) 2004-2009 Stefan Esser | -+ +----------------------------------------------------------------------+ -+ | This source file is subject to version 2.02 of the PHP license, | -+ | that is bundled with this package in the file LICENSE, and is | -+ | available at through the world-wide-web at | -+ | http://www.php.net/license/2_02.txt. | -+ | If you did not receive a copy of the PHP license and are unable to | -+ | obtain it through the world-wide-web, please send a note to | -+ | license@php.net so we can mail you a copy immediately. | -+ +----------------------------------------------------------------------+ -+ | Author: Stefan Esser | -+ +----------------------------------------------------------------------+ -+ */ -+ -+#ifndef SUHOSIN_GLOBALS_H -+#define SUHOSIN_GLOBALS_H -+ -+typedef struct _suhosin_patch_globals suhosin_patch_globals_struct; -+ -+#ifdef ZTS -+# define SPG(v) TSRMG(suhosin_patch_globals_id, suhosin_patch_globals_struct *, v) -+extern int suhosin_patch_globals_id; -+#else -+# define SPG(v) (suhosin_patch_globals.v) -+extern struct _suhosin_patch_globals suhosin_patch_globals; -+#endif -+ -+ -+struct _suhosin_patch_globals { -+ /* logging */ -+ int log_syslog; -+ int log_syslog_facility; -+ int log_syslog_priority; -+ int log_sapi; -+ int log_script; -+ int log_phpscript; -+ char *log_scriptname; -+ char *log_phpscriptname; -+ zend_bool log_phpscript_is_safe; -+ zend_bool log_use_x_forwarded_for; -+ -+ /* memory manager canary protection */ -+ unsigned int canary_1; -+ unsigned int canary_2; -+ unsigned int canary_3; -+ unsigned int dummy; -+}; -+ -+ -+#endif /* SUHOSIN_GLOBALS_H */ -+ -+/* -+ * Local variables: -+ * tab-width: 4 -+ * c-basic-offset: 4 -+ * End: -+ */ ---- /dev/null -+++ b/main/suhosin_logo.h -@@ -0,0 +1,178 @@ -+static unsigned char suhosin_logo[] = -+ "\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x01\x00\x48" -+ "\x00\x48\x00\x00\xff\xe1\x00\x16\x45\x78\x69\x66\x00\x00\x4d\x4d" -+ "\x00\x2a\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\xff\xdb\x00\x43" -+ "\x00\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" -+ "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" -+ "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" -+ "\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01" -+ "\x01\xff\xc0\x00\x0b\x08\x00\x27\x00\x71\x01\x01\x22\x00\xff\xc4" -+ "\x00\x1e\x00\x00\x02\x02\x02\x03\x01\x01\x00\x00\x00\x00\x00\x00" -+ "\x00\x00\x00\x00\x09\x06\x08\x05\x07\x02\x03\x0a\x01\x04\xff\xc4" -+ "\x00\x32\x10\x00\x01\x04\x03\x00\x02\x00\x05\x01\x05\x09\x01\x00" -+ "\x00\x00\x00\x05\x02\x03\x04\x06\x01\x07\x08\x00\x09\x11\x12\x13" -+ "\x14\x21\x15\x0a\x16\x31\x56\x96\x17\x18\x19\x23\x32\x41\x58\x98" -+ "\xd4\xd6\xff\xda\x00\x08\x01\x01\x00\x00\x3f\x00\xf4\xc1\xe1\xe5" -+ "\x69\xe9\x3e\xb9\xd1\x7c\x8a\x2e\x9d\x66\xe8\x3b\x29\x4d\x7f\x46" -+ "\xba\x58\x55\x54\x8d\xb1\x5f\xaa\xd9\x8d\x51\x2b\xb6\x27\x5a\x69" -+ "\xd1\x43\xaf\x16\x1a\xf0\xb2\xb1\xe9\x6d\x9f\xc2\xa4\x36\x18\xb5" -+ "\x85\x10\x41\xbe\xfc\x09\xac\x49\x29\x11\xd4\x32\x97\xec\x08\x13" -+ "\xc1\x2d\x20\xc3\x59\xeb\x26\x05\xd8\x6b\x76\x31\x43\x8f\x57\xcf" -+ "\x84\x9f\x14\xa8\x53\x81\x0b\xc3\x64\x80\xa3\x02\x0a\x41\x75\xf8" -+ "\x44\x85\x93\x81\x22\x3c\xd8\x13\xe1\xbe\xf4\x59\x91\x1f\x6a\x44" -+ "\x77\x5c\x69\xc4\x2f\x39\x5f\x0f\x2a\x8d\xeb\xba\xf8\xc3\x56\x6c" -+ "\x3b\x36\xa7\xda\xbd\x4d\xa1\xb5\x4e\xc6\xa7\xa4\x3a\xec\x15\x2d" -+ "\xa5\xb3\xea\x5a\xdc\xac\x46\xac\x01\x60\xd8\x43\xc8\x8e\x8b\xb1" -+ "\x40\x4c\x95\x8b\x34\x41\x28\x52\x91\x28\x43\xd3\xa3\xb6\xa7\x55" -+ "\x15\xe7\x5a\x96\xcb\xf1\xda\xe5\x55\xee\xfe\x1e\xbd\xd9\x41\xd3" -+ "\x28\xfd\x97\xca\x57\x2b\x85\x9c\xa4\x30\x95\xaa\xa5\x57\xa2\x35" -+ "\x15\x86\xcb\x61\x34\x41\xe4\xc7\x80\x20\x18\x21\x17\x09\x85\x0b" -+ "\x14\x9d\x21\x68\x62\x1c\x08\x11\x64\x4b\x92\xf2\xd2\xd3\x2d\x2d" -+ "\x6a\xc2\x73\x6b\x3c\x3c\x8b\x9e\xbc\x52\xaa\xa4\xab\x81\x6c\xf6" -+ "\xfa\xbd\x70\xc5\xc6\x7b\xc2\xaa\x22\x4f\x58\x04\x87\x25\x6a\x27" -+ "\x1d\xa4\x3d\x20\x75\x72\x01\x09\x71\xe5\x1c\x9e\xc3\x2e\x36\xf3" -+ "\xd0\xc6\x35\x2a\x43\x4d\x2d\x0e\x2d\xb4\xa1\x49\xce\x65\x1e\x52" -+ "\x9e\xa1\xf6\x09\xcc\xdc\x63\x66\xa8\x01\xe9\x3b\x0d\xd7\x5a\x85" -+ "\xbb\xc5\x65\xc0\x7b\x2e\x46\xa9\xd9\x56\x1d\x4c\x92\x72\x26\x4e" -+ "\x86\xd5\x68\xae\xc4\xaa\x55\xce\xd7\x83\x59\xb3\x81\xee\xce\x74" -+ "\x39\x39\x31\x9f\x8a\x25\xe8\xa5\xa5\xe5\x81\xf2\x11\x23\xcb\xa1" -+ "\x1e\x43\x12\xe3\xb1\x2a\x2b\xcd\xc8\x8d\x25\x96\xa4\x47\x7d\x95" -+ "\xa5\xc6\x9f\x61\xe4\x25\xc6\x5e\x69\xc4\xe7\x29\x5b\x6e\xb6\xa4" -+ "\xad\x0b\x4e\x72\x95\x25\x58\x56\x33\x9c\x67\xce\xef\x0f\x17\xbf" -+ "\x4c\x7b\x2d\xe6\xfe\x76\x35\x27\x5a\x07\x97\x67\xe8\xae\x8d\x71" -+ "\x0f\xb2\x13\x99\xb9\xbc\x14\xad\xb3\xb7\xe6\x11\x6f\xe0\xda\x58" -+ "\xb1\x08\xac\xa6\x6c\x2d\x7f\x05\xb7\x56\xd2\xe6\xcf\xbb\x4d\x0c" -+ "\xe3\x50\xb2\xec\x91\xf0\x4a\xb8\xd6\x22\xb8\xa7\xf6\x67\xaf\xcf" -+ "\x63\x7e\xd7\xe7\x42\xd8\xbd\xc3\x71\xa1\xf2\x7e\x9b\xa8\x97\x83" -+ "\x6e\xd1\xdc\x4b\x06\x11\x2d\xae\x26\x61\x98\x72\x10\xf4\x42\x5d" -+ "\x20\x4a\xa3\x73\xd7\xf2\xcd\x3c\x48\x32\xe4\x03\x9f\x80\x37\x08" -+ "\x36\x11\xd0\xcb\x97\x6c\x08\xed\x6d\x33\x24\xa2\x1b\xb4\x77\xdf" -+ "\x61\x5d\x5f\xc1\x43\xc2\x82\xeb\x0f\x5d\x84\x08\x68\xaa\xa4\x01" -+ "\xe1\x19\xdf\xbc\x31\x65\xfe\xd1\xf5\x7d\x7a\xb2\x2a\x33\x50\x21" -+ "\x2a\x56\x9d\xb1\x81\xab\xdb\x35\x78\x30\x83\xd9\x89\x1d\x31\xac" -+ "\x96\x14\x07\x61\xbc\x20\x68\x42\x85\x33\x19\xac\xbe\xdb\x34\x56" -+ "\xf1\xd5\xfd\x29\xa9\x28\xdb\xcb\x4c\x5a\x23\xdc\xf5\x96\xc5\x10" -+ "\xa3\x35\x5b\x14\x68\xd3\x61\x62\x64\x76\x26\xcb\x17\x3e\x34\x98" -+ "\x04\xa3\xc4\x20\x38\x90\x92\xe3\xc8\x07\x2c\x36\x74\x66\x26\x0e" -+ "\x29\x02\x64\x29\x2d\x21\xe6\x16\x9c\x6b\xce\xa3\x89\xd9\x4f\xd3" -+ "\xc4\xbd\xc5\x87\x79\x9c\x65\xf6\x39\x45\x60\xe8\xce\x9e\xab\x6d" -+ "\x13\x15\x22\xe1\x5e\x4b\x38\x42\xc4\x1e\xd5\x76\xe0\xc5\xeb\x85" -+ "\x07\x2d\x0f\xb8\xb6\xa6\xd6\x6d\x71\x0d\xa2\x43\x4c\x25\xea\xfa" -+ "\xa1\xae\x4c\xe4\x7d\xbd\x76\xa9\xfb\x06\xc2\x83\x42\xeb\xad\xe7" -+ "\xe9\x5f\x68\x6f\xba\xfb\x2f\x07\xce\xb8\x13\xc1\x9b\xeb\xb0\x76" -+ "\x45\x57\x28\x7b\xea\xbe\x0f\xf4\x30\x7b\xa0\xed\xe4\x22\x93\x21" -+ "\xfc\xbc\xe0\xb9\x75\xc1\x4f\xfc\xef\xb6\xfa\xa1\xfc\x64\xa1\x4a" -+ "\x82\xc7\x33\xad\x75\xed\x82\xbd\x3d\xdb\xf7\xa8\xbe\x5e\xbb\x36" -+ "\x62\x04\x9a\x2e\xc5\xd9\x9e\x9c\x3a\x0b\x98\x0b\x57\xac\xf1\x24" -+ "\x62\x58\x83\x15\x5b\xa6\xf2\xda\x34\x70\x03\xce\x0f\x93\x1b\x12" -+ "\xc7\xce\x54\x87\x33\x15\xd6\x53\x25\x1f\x2a\x90\x87\x12\xe3\x78" -+ "\xef\x55\x77\x4d\x4a\xd8\x7e\xef\xd2\xfd\xd1\xaf\x3a\xaf\x55\xdb" -+ "\x6a\x2d\x3d\x42\xac\x51\x79\xee\x91\xab\xe1\x05\x2d\x3c\x80\xa2" -+ "\x43\xad\x22\x2e\xd5\x33\x13\xa4\x9e\x00\xe0\x04\x10\x84\xc8\xf2" -+ "\x19\x30\x92\x1f\xaa\xc3\x28\xc9\x76\x30\x3f\xe9\x10\x61\x5e\x79" -+ "\xd5\xf7\xdf\xd0\x54\xdb\xae\xb6\xae\xfa\xe8\xa3\x57\xe0\x6c\x2d" -+ "\xf7\xbd\x49\xd6\x6e\x76\x79\xcc\x54\x0c\x5f\xff\x00\xbb\x06\x98" -+ "\xa6\x9e\x89\x61\xb4\x6f\xc3\xe3\x6a\xc2\x4f\x59\x03\xc9\x80\x2c" -+ "\x59\x24\x44\x70\x38\xd5\x96\x6a\x9e\x8b\x81\x64\xe5\xbc\xa0\x3c" -+ "\x33\xaf\x17\x9d\xff\x00\x71\x1a\xd1\x3a\x80\x66\xb3\xd9\x31\x77" -+ "\x0d\x12\xbd\xae\x29\xb5\x6a\xd6\xcf\x8d\x68\x87\x75\xcd\xe8\x65" -+ "\x5a\xbe\x3c\x04\x7b\x34\xdb\x54\x19\xa4\x63\x9c\x2a\x5d\x23\xbe" -+ "\xf4\xb1\x1c\x4d\x90\xec\x92\x2f\x49\x71\xf7\x14\xf2\x97\x9f\x15" -+ "\x57\xed\x13\x21\x2a\xf5\x33\xd1\x2a\x52\x52\xac\xb7\x62\xd1\xcb" -+ "\x46\x73\x8c\x67\x28\x56\x77\x86\xbf\x6f\x2a\x4e\x73\xfe\x95\x65" -+ "\x0b\x5a\x3e\x38\xfc\xfc\xaa\x56\x3f\x86\x73\xe3\xb9\x4a\x52\x84" -+ "\xa5\x08\x4e\x12\x94\x27\x09\x4a\x53\x8c\x61\x29\x4a\x71\xf0\x4a" -+ "\x53\x8c\x7e\x31\x8c\x63\x18\xc6\x31\x8f\xc6\x31\xf8\xc7\x9f\x7c" -+ "\xd5\xbb\xae\x5e\xe2\x1f\xab\x6e\x24\x34\x00\x8a\x25\x83\x70\x40" -+ "\x1c\xcc\xda\x45\x7f\x66\x4e\x30\x2e\x94\x7e\x74\x49\xf0\xe4\x4e" -+ "\x06\x5c\xa8\x2f\x89\x21\x2e\x98\x0e\xd9\x21\xc2\x0b\x21\x0f\xc4" -+ "\x16\x6e\x48\xd9\xe4\xe3\x4a\x19\x1e\x64\x67\x54\xff\x00\x3a\x6d" -+ "\x4f\x62\xb5\x00\x4a\xaa\x51\xfd\x2d\xe8\x0e\x6c\xaf\xc6\x7d\x6d" -+ "\xc8\x88\xc7\x67\xea\x8a\x58\x02\x73\xe3\x65\x4d\xc9\x24\xc0\x3d" -+ "\x57\xa3\x2e\x53\x16\x99\x4f\xe5\xe7\x19\x97\x3e\x3b\xcf\xc9\x4b" -+ "\x99\x7f\x33\x25\xa5\xdf\xba\x77\x2b\xd3\x3e\xc2\x7b\x8b\x94\x07" -+ "\xe9\x52\x5b\x43\x87\x34\x14\x86\x37\xcf\x41\x6b\x8e\x6a\xa5\x22" -+ "\xab\xdb\x96\xa2\xcf\x46\xd8\x9b\x45\x93\xef\xd6\xdf\x3e\x99\x9c" -+ "\x7e\x29\x10\x6b\x6c\xa2\xb8\x43\x05\x09\x44\x70\x8c\xb8\xaa\x54" -+ "\x7c\x30\x36\x5e\x1c\x5e\x5b\x9f\x6c\x0d\x81\xee\xa0\x93\x8d\x67" -+ "\x55\xf3\x87\xaf\xaa\x6b\x58\xf9\xbe\xb2\x36\x07\x42\x6e\xbd\x96" -+ "\xe3\x9f\x1f\x8f\xc9\xf4\x9d\xae\x6a\x7d\x4c\x96\xbe\x5f\xc7\xcd" -+ "\xf3\xb2\xf7\xcd\xf0\xcf\xc3\xe4\xf8\xfe\x37\x4f\x1c\x4d\xf6\x40" -+ "\xf1\x6b\x7c\x4e\xe0\xa6\x71\xad\x56\xa7\x1c\x5c\x15\x6b\xfc\xf3" -+ "\x01\x5d\xac\xf1\x75\x9a\x72\x6b\xaa\x28\xc5\x88\x6d\xfb\x33\x85" -+ "\xe0\x4e\x61\xab\xeb\x31\x2c\x71\x08\x73\x11\x3b\xfc\xb5\xc0\x96" -+ "\xcc\x87\x24\x44\xb5\x9b\x9e\xb3\x71\xba\xe9\xed\xb1\x4e\xd7\x76" -+ "\x6c\xd2\xb6\x05\xb7\x5a\xde\xeb\x34\x5b\x96\x16\xfb\x59\xa9\x5c" -+ "\x4f\x55\xca\x8a\xac\x59\xb0\xe4\x54\x39\x25\xbc\x81\x37\x2a\x09" -+ "\x5f\x9e\x3b\x6b\x7d\x1f\x69\xf3\x34\x85\x39\x84\xa7\x28\x0b\xd3" -+ "\xfd\xfb\x4b\x7a\xea\xe7\xd2\x3c\xd3\xda\x15\x68\xbc\x73\xd3\x22" -+ "\x6f\xd7\x72\x5b\x2b\x66\xee\xa8\x0d\x54\xe8\x5b\xf9\x92\x96\x92" -+ "\x93\xea\x97\x4a\xc7\x43\x10\x46\x35\xc5\xc0\x60\x8a\xe4\xc1\xb5" -+ "\x36\xc6\xae\xed\xf7\x70\xa5\x86\x99\x3d\x91\xf8\xfd\x4e\x53\xeb" -+ "\xbb\xbd\x6d\xec\x8f\xd7\x89\x3d\x31\x7f\xd7\x78\xba\x50\xbb\x74" -+ "\x9d\xf6\xac\x4e\xb9\x03\x9c\x79\xd5\xe1\xbd\x17\x68\xd9\x13\x0b" -+ "\x45\x75\x88\x00\x1d\x1f\xae\x73\x6a\x1d\x5c\x6e\x44\x9f\xa6\xfa" -+ "\x4e\xd8\x25\x8b\xc0\xbc\xb2\x99\xe3\x17\x24\xb3\x23\xe2\x48\x8b" -+ "\xfa\x22\xe7\x7e\x8f\xe6\x3f\x5f\x55\x0d\x75\xd3\x51\x0b\xd7\xed" -+ "\xd3\x6f\x97\x3b\x85\x42\x80\x7e\x5f\xdc\x1b\xd6\xba\xee\xc4\x80" -+ "\xce\x06\xa9\x15\x8c\x97\x5f\x40\x69\xb2\x4d\xc5\xb2\x5c\x1e\x01" -+ "\x87\x7e\xe0\x36\x6d\x78\x80\x4e\x3c\x02\xec\x90\x1d\x11\x81\x74" -+ "\xa5\x8b\xa4\xa0\x56\x06\xd5\x79\x72\x85\x57\x3b\xb2\x2e\xae\x90" -+ "\x18\x8d\x91\xb2\x0e\x44\x19\xaa\xb4\xcc\x08\xed\x46\xfa\xd7\x2b" -+ "\x78\x58\x72\x5d\xbb\x5e\x49\xe7\xee\xf3\x8a\x9d\x22\xa4\x19\xc8" -+ "\xe7\x08\xc3\x90\x9b\x35\x9a\xa4\x25\x8c\x4b\x9b\xa7\xf8\xbf\x81" -+ "\xf5\xdf\x22\x66\xf1\x7e\x9f\x66\x3d\xbb\xfa\x73\x73\x4d\xfd\x67" -+ "\x7b\xf4\xce\xc3\x62\x2e\x6f\xbb\x0c\xa2\xdc\x69\xfc\x8a\x17\x0e" -+ "\x3a\x9e\x83\x46\xd7\xe3\x5e\x65\x86\xc0\x51\x00\xbb\x91\xe3\xe1" -+ "\xc1\x16\xc4\xe9\x65\x5c\x14\x3e\x44\x6a\x6b\xd1\x1e\xb0\x36\xdd" -+ "\x0b\x7d\x8a\xeb\xaf\x58\x5b\x64\x3f\x38\xed\x52\x76\xe8\x46\xf7" -+ "\x86\x84\xb3\x93\xb1\x0b\xe5\xfd\xfd\x0d\xe9\x6d\xe4\xf1\x1b\x1d" -+ "\x56\xb4\x34\xe4\x6a\xf5\xa4\x9c\x2c\xc9\x64\x94\xc1\xf5\x79\x6d" -+ "\x12\x96\xf3\x47\xc5\x48\xa8\xdb\xd8\x95\x64\x29\xcf\xf6\x88\xf1" -+ "\x95\x7a\x98\xe8\xbc\x27\x19\xce\x73\x61\xd1\xb8\xc6\x31\x8c\xe7" -+ "\x39\xce\x77\x9e\xbc\xc6\x31\x8c\x63\xf3\x9c\xe7\x39\xc6\x31\x8f" -+ "\xf7\xce\x7e\x1e\x3b\x7f\x0f\x0f\x0f\x13\x57\xb9\x0a\xe1\x0b\x64" -+ "\x5f\x58\x40\xc6\xc7\x7a\x4b\xf2\x3d\xbc\x71\xf4\xa7\xd2\xca\x14" -+ "\xe2\x98\x1a\x30\x1e\xe0\x26\x5a\x6a\xf0\x9c\x67\x38\x66\x00\xb8" -+ "\x72\xe6\xbe\xac\xfe\x12\xd3\x0b\x56\x73\x8c\x63\xc7\x2b\xe1\xe2" -+ "\xe8\xdd\x7b\xff\x00\xd8\xe5\x23\x6c\xce\xa8\x69\xcf\x5e\x3a\xef" -+ "\x77\xea\xe5\xab\x0e\x82\xdb\xd9\xed\x7a\x9e\xb8\x6d\x51\x32\xdb" -+ "\x79\xc3\x36\x9a\x2d\xa3\x50\x39\x65\x0a\x63\x0e\xe5\xd4\x39\x12" -+ "\xbf\x8b\x98\xa4\xa1\x2d\xad\xb3\xcf\x65\x6a\x43\x78\xb3\x3b\x07" -+ "\xd8\xd5\xea\xae\x76\xad\x6f\xf5\xff\x00\xca\x93\xab\x96\xb0\x64" -+ "\xeb\xd6\x4a\xd5\x87\xba\xec\x24\x60\x97\x06\x76\x03\xe3\x4c\x07" -+ "\x29\x11\x8e\x34\x25\x02\x64\x29\xf0\x25\x48\x85\x3a\x33\x8b\x7a" -+ "\x3c\x86\x1e\x75\xa5\x61\xc6\x97\x9f\x8d\x25\xf5\xc9\xcd\xde\xc9" -+ "\x7d\x77\xf2\xc8\x7e\x70\xaf\x73\x5f\x2d\xec\xa2\x51\x2d\x96\xfb" -+ "\x89\xad\x80\x57\xb2\x36\x1d\x7d\x83\x45\xac\xf3\xdb\xcc\x6c\x31" -+ "\x4f\xcf\x30\x58\xd0\x12\x28\x90\x50\x42\x86\xfb\x48\x16\x3c\xc5" -+ "\x9c\xf8\xe7\xcc\x29\x88\xb3\x4a\x4b\x4e\x6c\xbc\xdb\xc7\xbb\xe9" -+ "\xb6\xa0\x8b\x11\xa1\x7d\x73\xd7\xe9\xbf\x7e\xc2\x6c\x10\x8d\xee" -+ "\x9d\xef\x63\x3a\xe0\xf5\xbe\x8c\x3e\xa1\xc7\xc5\xd1\x00\x44\x1e" -+ "\xf3\x51\xf2\xe2\xb0\xe3\xb5\x13\x7f\x32\xf1\x8c\xa6\x22\xfe\x1f" -+ "\x49\x4d\xbb\xcf\x3a\x5d\xed\x4c\xd2\xfc\x85\xed\x23\xd6\xc7\x50" -+ "\xb6\x5b\x3a\x16\x83\xb8\x6f\xfd\x32\x3f\xaa\x36\x34\xbb\xf5\x96" -+ "\xa9\xab\xcf\x9f\x8f\xac\xc3\xca\xd5\x8b\xd8\x48\x9e\x79\xaa\x30" -+ "\x87\xca\x58\x4d\x59\x96\xb9\x4f\xc5\x1b\x1c\xd2\xda\x5b\xe6\x57" -+ "\x29\xa1\x28\x7a\x2b\x5b\xff\x00\x12\x2f\x5e\x3f\xf3\xbb\x8e\x7f" -+ "\xec\xc6\x98\xff\x00\xed\x3c\xa6\xdd\xa9\xdc\x7e\xa0\xf7\xd6\x99" -+ "\x31\xa2\xf7\xaf\x6b\xe9\x82\x74\x4b\x3d\x8f\x5e\x58\x0b\x33\xab" -+ "\xef\xc3\xaf\x84\x64\xb9\xae\xb6\x25\x5f\x62\x8f\x1c\xe3\xf4\x51" -+ "\xb7\x96\xe3\x0e\x30\x42\xa9\x18\x39\xbf\x9e\x2a\x1f\x74\x19\x02" -+ "\x2d\x43\x93\x06\x63\xb1\xa7\x47\x6a\xfa\x9b\x6c\xeb\xbd\xe9\xae" -+ "\x6a\x7b\x6f\x53\x5a\x60\x5d\xb5\xcd\xe8\x67\xeb\x35\x3b\x48\xc6" -+ "\xa6\xb3\x04\xc8\xdf\xb8\x7e\x26\x64\xb0\xc9\x18\xb0\xa7\x33\xf2" -+ "\x4a\x8b\x22\x3b\x8d\x4b\x89\x1d\xf6\x9d\x65\xc4\x38\xd2\x54\x9c" -+ "\xe3\xcd\x89\xe1\xe1\xe6\x3e\x70\x81\x45\x1d\x18\xf9\x31\x83\xc8" -+ "\xbe\x14\x82\x4b\x87\x7a\x74\x28\xd2\xdd\x12\x55\x30\xe6\x0e\x49" -+ "\x31\x8e\x48\x69\xc5\xc0\x20\x91\xe4\x48\x41\x4c\xd8\xb9\x6a\x4e" -+ "\x21\xce\x99\x1b\x0e\xfd\x09\x4f\xa1\x79\x0f\x0f\x0f\x0f\x0f\x0f" -+ "\x0f\x3f\x3c\xb8\x71\x27\xc7\x72\x24\xe8\xb1\xa6\xc5\x7b\x18\xc3" -+ "\xb1\xa5\xb0\xd4\x98\xee\xe3\x19\xc6\x71\x87\x19\x79\x2b\x6d\x78" -+ "\xc6\x71\x8c\xe3\x0a\x4e\x71\x8c\xe3\x19\xfe\x38\xf2\x3b\xfb\x8b" -+ "\x48\xfe\x4e\xaa\xff\x00\x4f\x08\xff\x00\xc7\xe1\xfb\x8b\x48\xfe" -+ "\x4e\xaa\xff\x00\x4f\x08\xff\x00\xc7\xe4\x95\x86\x18\x8a\xcb\x31" -+ "\xa3\x32\xd4\x78\xf1\xdb\x43\x2c\x47\x61\xb4\x32\xcb\x2c\xb4\x9c" -+ "\x21\xb6\x99\x69\xbc\x25\xb6\xdb\x6d\x18\xc2\x10\xda\x12\x94\xa1" -+ "\x38\xc2\x53\x8c\x63\x18\xc7\x9d\xbe\x7f\xff\xd9" -+ ; ---- /dev/null -+++ b/main/suhosin_patch.c -@@ -0,0 +1,470 @@ -+/* -+ +----------------------------------------------------------------------+ -+ | Suhosin Patch for PHP | -+ +----------------------------------------------------------------------+ -+ | Copyright (c) 2004-2010 Stefan Esser | -+ +----------------------------------------------------------------------+ -+ | This source file is subject to version 2.02 of the PHP license, | -+ | that is bundled with this package in the file LICENSE, and is | -+ | available at through the world-wide-web at | -+ | http://www.php.net/license/2_02.txt. | -+ | If you did not receive a copy of the PHP license and are unable to | -+ | obtain it through the world-wide-web, please send a note to | -+ | license@php.net so we can mail you a copy immediately. | -+ +----------------------------------------------------------------------+ -+ | Author: Stefan Esser | -+ +----------------------------------------------------------------------+ -+ */ -+/* $Id: suhosin_patch.c,v 1.2 2004/11/21 09:38:52 ionic Exp $ */ -+ -+#include "php.h" -+ -+#include -+#include -+#include -+ -+#if HAVE_UNISTD_H -+#include -+#endif -+#include "SAPI.h" -+#include "php_globals.h" -+ -+#if SUHOSIN_PATCH -+ -+#ifdef HAVE_SYS_SOCKET_H -+#include -+#endif -+ -+#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) -+#undef AF_UNIX -+#endif -+ -+#if defined(AF_UNIX) -+#include -+#endif -+ -+#define SYSLOG_PATH "/dev/log" -+ -+#ifdef PHP_WIN32 -+static HANDLE log_source = 0; -+#endif -+ -+#include "snprintf.h" -+ -+#include "suhosin_patch.h" -+ -+#ifdef ZTS -+#include "suhosin_globals.h" -+int suhosin_patch_globals_id; -+#else -+struct _suhosin_patch_globals suhosin_patch_globals; -+#endif -+ -+static char *suhosin_config = NULL; -+ -+static zend_intptr_t SUHOSIN_POINTER_GUARD = 0; -+ -+static void php_security_log(int loglevel, char *fmt, ...); -+ -+static void suhosin_patch_globals_ctor(suhosin_patch_globals_struct *suhosin_patch_globals TSRMLS_DC) -+{ -+ memset(suhosin_patch_globals, 0, sizeof(*suhosin_patch_globals)); -+} -+ -+ZEND_API char suhosin_get_config(int element) -+{ -+ return ((char *)SUHOSIN_MANGLE_PTR(suhosin_config))[element]; -+} -+ -+static void suhosin_set_config(int element, char value) -+{ -+ ((char *)SUHOSIN_MANGLE_PTR(suhosin_config))[element] = value; -+} -+ -+static void suhosin_read_configuration_from_environment() -+{ -+ char *tmp; -+ -+ /* check if canary protection should be activated or not */ -+ tmp = getenv("SUHOSIN_MM_USE_CANARY_PROTECTION"); -+ /* default to activated */ -+ suhosin_set_config(SUHOSIN_MM_USE_CANARY_PROTECTION, 1); -+ if (tmp) { -+ int flag = zend_atoi(tmp, 0); -+ suhosin_set_config(SUHOSIN_MM_USE_CANARY_PROTECTION, flag); -+ } -+ -+ /* check if free memory should be overwritten with 0xFF or not */ -+ tmp = getenv("SUHOSIN_MM_DESTROY_FREE_MEMORY"); -+ /* default to deactivated */ -+ suhosin_set_config(SUHOSIN_MM_DESTROY_FREE_MEMORY, 0); -+ if (tmp) { -+ int flag = zend_atoi(tmp, 0); -+ suhosin_set_config(SUHOSIN_MM_DESTROY_FREE_MEMORY, flag); -+ } -+ -+ /* check if canary violations should be ignored */ -+ tmp = getenv("SUHOSIN_MM_IGNORE_CANARY_VIOLATION"); -+ /* default to NOT ignore */ -+ suhosin_set_config(SUHOSIN_MM_IGNORE_CANARY_VIOLATION, 0); -+ if (tmp) { -+ int flag = zend_atoi(tmp, 0); -+ suhosin_set_config(SUHOSIN_MM_IGNORE_CANARY_VIOLATION, flag); -+ } -+ -+ /* check if invalid hashtable destructors should be ignored */ -+ tmp = getenv("SUHOSIN_HT_IGNORE_INVALID_DESTRUCTOR"); -+ /* default to NOT ignore */ -+ suhosin_set_config(SUHOSIN_HT_IGNORE_INVALID_DESTRUCTOR, 0); -+ if (tmp) { -+ int flag = zend_atoi(tmp, 0); -+ suhosin_set_config(SUHOSIN_HT_IGNORE_INVALID_DESTRUCTOR, flag); -+ } -+ -+ /* check if invalid linkedlist destructors should be ignored */ -+ tmp = getenv("SUHOSIN_LL_IGNORE_INVALID_DESTRUCTOR"); -+ /* default to NOT ignore */ -+ suhosin_set_config(SUHOSIN_LL_IGNORE_INVALID_DESTRUCTOR, 0); -+ if (tmp) { -+ int flag = zend_atoi(tmp, 0); -+ suhosin_set_config(SUHOSIN_LL_IGNORE_INVALID_DESTRUCTOR, flag); -+ } -+ -+ suhosin_set_config(SUHOSIN_CONFIG_SET, 1); -+} -+ -+static void suhosin_write_protect_configuration() -+{ -+ /* check return value of mprotect() to ensure memory is read only now */ -+ if (mprotect(SUHOSIN_MANGLE_PTR(suhosin_config), sysconf(_SC_PAGESIZE), PROT_READ) != 0) { -+ perror("suhosin"); -+ _exit(1); -+ } -+} -+ -+PHPAPI void suhosin_startup() -+{ -+#ifdef ZTS -+ ts_allocate_id(&suhosin_patch_globals_id, sizeof(suhosin_patch_globals_struct), (ts_allocate_ctor) suhosin_patch_globals_ctor, NULL); -+#else -+ suhosin_patch_globals_ctor(&suhosin_patch_globals TSRMLS_CC); -+#endif -+ zend_suhosin_log = php_security_log; -+ -+ /* get the pointer guardian and ensure low 3 bits are 1 */ -+ if (SUHOSIN_POINTER_GUARD == 0) { -+ zend_canary(&SUHOSIN_POINTER_GUARD, sizeof(SUHOSIN_POINTER_GUARD)); -+ SUHOSIN_POINTER_GUARD |= 7; -+ } -+ -+ if (!suhosin_config) { -+#ifndef MAP_ANONYMOUS -+#define MAP_ANONYMOUS MAP_ANON -+#endif -+ suhosin_config = mmap(NULL, sysconf(_SC_PAGESIZE), PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); -+ if (suhosin_config == MAP_FAILED) { -+ perror("suhosin"); -+ _exit(1); -+ } -+ suhosin_config = SUHOSIN_MANGLE_PTR(suhosin_config); -+ } -+ if (!SUHOSIN_CONFIG(SUHOSIN_CONFIG_SET)) { -+ suhosin_read_configuration_from_environment(); -+ suhosin_write_protect_configuration(); -+ } -+} -+ -+static char *loglevel2string(int loglevel) -+{ -+ switch (loglevel) { -+ case S_FILES: -+ return "FILES"; -+ case S_INCLUDE: -+ return "INCLUDE"; -+ case S_MEMORY: -+ return "MEMORY"; -+ case S_MISC: -+ return "MISC"; -+ case S_SESSION: -+ return "SESSION"; -+ case S_SQL: -+ return "SQL"; -+ case S_EXECUTOR: -+ return "EXECUTOR"; -+ case S_VARS: -+ return "VARS"; -+ default: -+ return "UNKNOWN"; -+ } -+} -+ -+static void php_security_log(int loglevel, char *fmt, ...) -+{ -+ int s, r, i=0; -+#if defined(AF_UNIX) -+ struct sockaddr_un saun; -+#endif -+#ifdef PHP_WIN32 -+ LPTSTR strs[2]; -+ unsigned short etype; -+ DWORD evid; -+#endif -+ char buf[4096+64]; -+ char error[4096+100]; -+ char *ip_address; -+ char *fname; -+ char *alertstring; -+ int lineno; -+ va_list ap; -+ TSRMLS_FETCH(); -+ -+ /*SDEBUG("(suhosin_log) loglevel: %d log_syslog: %u - log_sapi: %u - log_script: %u", loglevel, SPG(log_syslog), SPG(log_sapi), SPG(log_script));*/ -+ -+ if (SPG(log_use_x_forwarded_for)) { -+ ip_address = sapi_getenv("HTTP_X_FORWARDED_FOR", 20 TSRMLS_CC); -+ if (ip_address == NULL) { -+ ip_address = "X-FORWARDED-FOR not set"; -+ } -+ } else { -+ ip_address = sapi_getenv("REMOTE_ADDR", 11 TSRMLS_CC); -+ if (ip_address == NULL) { -+ ip_address = "REMOTE_ADDR not set"; -+ } -+ } -+ -+ -+ va_start(ap, fmt); -+ ap_php_vsnprintf(error, sizeof(error), fmt, ap); -+ va_end(ap); -+ while (error[i]) { -+ if (error[i] < 32) error[i] = '.'; -+ i++; -+ } -+ -+/* if (SPG(simulation)) { -+ alertstring = "ALERT-SIMULATION"; -+ } else { */ -+ alertstring = "ALERT"; -+/* }*/ -+ -+ if (zend_is_executing(TSRMLS_C)) { -+ if (EG(current_execute_data)) { -+ lineno = EG(current_execute_data)->opline->lineno; -+ fname = EG(current_execute_data)->op_array->filename; -+ } else { -+ lineno = zend_get_executed_lineno(TSRMLS_C); -+ fname = zend_get_executed_filename(TSRMLS_C); -+ } -+ ap_php_snprintf(buf, sizeof(buf), "%s - %s (attacker '%s', file '%s', line %u)", alertstring, error, ip_address, fname, lineno); -+ } else { -+ fname = sapi_getenv("SCRIPT_FILENAME", 15 TSRMLS_CC); -+ if (fname==NULL) { -+ fname = "unknown"; -+ } -+ ap_php_snprintf(buf, sizeof(buf), "%s - %s (attacker '%s', file '%s')", alertstring, error, ip_address, fname); -+ } -+ -+ /* Syslog-Logging disabled? */ -+ if (((SPG(log_syslog)|S_INTERNAL) & loglevel)==0) { -+ goto log_sapi; -+ } -+ -+#if defined(AF_UNIX) -+ ap_php_snprintf(error, sizeof(error), "<%u>suhosin[%u]: %s\n", (unsigned int)(SPG(log_syslog_facility)|SPG(log_syslog_priority)),getpid(),buf); -+ -+ s = socket(AF_UNIX, SOCK_DGRAM, 0); -+ if (s == -1) { -+ goto log_sapi; -+ } -+ -+ memset(&saun, 0, sizeof(saun)); -+ saun.sun_family = AF_UNIX; -+ strcpy(saun.sun_path, SYSLOG_PATH); -+ /*saun.sun_len = sizeof(saun);*/ -+ -+ r = connect(s, (struct sockaddr *)&saun, sizeof(saun)); -+ if (r) { -+ close(s); -+ s = socket(AF_UNIX, SOCK_STREAM, 0); -+ if (s == -1) { -+ goto log_sapi; -+ } -+ -+ memset(&saun, 0, sizeof(saun)); -+ saun.sun_family = AF_UNIX; -+ strcpy(saun.sun_path, SYSLOG_PATH); -+ /*saun.sun_len = sizeof(saun);*/ -+ -+ r = connect(s, (struct sockaddr *)&saun, sizeof(saun)); -+ if (r) { -+ close(s); -+ goto log_sapi; -+ } -+ } -+ send(s, error, strlen(error), 0); -+ -+ close(s); -+#endif -+#ifdef PHP_WIN32 -+ ap_php_snprintf(error, sizeof(error), "suhosin[%u]: %s", getpid(),buf); -+ -+ switch (SPG(log_syslog_priority)) { /* translate UNIX type into NT type */ -+ case 1: /*LOG_ALERT:*/ -+ etype = EVENTLOG_ERROR_TYPE; -+ break; -+ case 6: /*LOG_INFO:*/ -+ etype = EVENTLOG_INFORMATION_TYPE; -+ break; -+ default: -+ etype = EVENTLOG_WARNING_TYPE; -+ } -+ evid = loglevel; -+ strs[0] = error; -+ /* report the event */ -+ if (log_source == NULL) { -+ log_source = RegisterEventSource(NULL, "Suhosin-Patch-" SUHOSIN_PATCH_VERSION); -+ } -+ ReportEvent(log_source, etype, (unsigned short) SPG(log_syslog_priority), evid, NULL, 1, 0, strs, NULL); -+ -+#endif -+log_sapi: -+ /* SAPI Logging activated? */ -+ /*SDEBUG("(suhosin_log) log_syslog: %u - log_sapi: %u - log_script: %u - log_phpscript: %u", SPG(log_syslog), SPG(log_sapi), SPG(log_script), SPG(log_phpscript));*/ -+ if (((SPG(log_sapi)|S_INTERNAL) & loglevel)!=0) { -+ sapi_module.log_message(buf); -+ } -+ -+/*log_script:*/ -+ /* script logging activaed? */ -+ if (((SPG(log_script) & loglevel)!=0) && SPG(log_scriptname)!=NULL) { -+ char cmd[8192], *cmdpos, *bufpos; -+ FILE *in; -+ int space; -+ -+ ap_php_snprintf(cmd, sizeof(cmd), "%s %s \'", SPG(log_scriptname), loglevel2string(loglevel)); -+ space = sizeof(cmd) - strlen(cmd); -+ cmdpos = cmd + strlen(cmd); -+ bufpos = buf; -+ if (space <= 1) return; -+ while (space > 2 && *bufpos) { -+ if (*bufpos == '\'') { -+ if (space<=5) break; -+ *cmdpos++ = '\''; -+ *cmdpos++ = '\\'; -+ *cmdpos++ = '\''; -+ *cmdpos++ = '\''; -+ bufpos++; -+ space-=4; -+ } else { -+ *cmdpos++ = *bufpos++; -+ space--; -+ } -+ } -+ *cmdpos++ = '\''; -+ *cmdpos = 0; -+ -+ if ((in=VCWD_POPEN(cmd, "r"))==NULL) { -+ php_security_log(S_INTERNAL, "Unable to execute logging shell script: %s", SPG(log_scriptname)); -+ return; -+ } -+ /* read and forget the result */ -+ while (1) { -+ int readbytes = fread(cmd, 1, sizeof(cmd), in); -+ if (readbytes<=0) { -+ break; -+ } -+ } -+ pclose(in); -+ } -+/*log_phpscript:*/ -+ if ((SPG(log_phpscript) & loglevel)!=0 && EG(in_execution) && SPG(log_phpscriptname) && SPG(log_phpscriptname)[0]) { -+ zend_file_handle file_handle; -+ zend_op_array *new_op_array; -+ zval *result = NULL; -+ -+ /*long orig_execution_depth = SPG(execution_depth);*/ -+ /*zend_bool orig_safe_mode = PG(safe_mode);*/ -+ char *orig_basedir = PG(open_basedir); -+ -+ char *phpscript = SPG(log_phpscriptname); -+/*SDEBUG("scriptname %s", SPG(log_phpscriptname));`*/ -+#ifdef ZEND_ENGINE_2 -+ if (zend_stream_open(phpscript, &file_handle TSRMLS_CC) == SUCCESS) { -+#else -+ if (zend_open(phpscript, &file_handle) == SUCCESS && ZEND_IS_VALID_FILE_HANDLE(&file_handle)) { -+ file_handle.filename = phpscript; -+ file_handle.free_filename = 0; -+#endif -+ if (!file_handle.opened_path) { -+ file_handle.opened_path = estrndup(phpscript, strlen(phpscript)); -+ } -+ new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE TSRMLS_CC); -+ zend_destroy_file_handle(&file_handle TSRMLS_CC); -+ if (new_op_array) { -+ HashTable *active_symbol_table = EG(active_symbol_table); -+ zval *zerror, *zerror_class; -+ -+ if (active_symbol_table == NULL) { -+ active_symbol_table = &EG(symbol_table); -+ } -+ EG(return_value_ptr_ptr) = &result; -+ EG(active_op_array) = new_op_array; -+ -+ MAKE_STD_ZVAL(zerror); -+ MAKE_STD_ZVAL(zerror_class); -+ ZVAL_STRING(zerror, buf, 1); -+ ZVAL_LONG(zerror_class, loglevel); -+ -+ zend_hash_update(active_symbol_table, "SUHOSIN_ERROR", sizeof("SUHOSIN_ERROR"), (void **)&zerror, sizeof(zval *), NULL); -+ zend_hash_update(active_symbol_table, "SUHOSIN_ERRORCLASS", sizeof("SUHOSIN_ERRORCLASS"), (void **)&zerror_class, sizeof(zval *), NULL); -+ -+ /*SPG(execution_depth) = 0;*/ -+ if (SPG(log_phpscript_is_safe)) { -+ /*PG(safe_mode) = 0;*/ -+ PG(open_basedir) = NULL; -+ } -+ -+ zend_execute(new_op_array TSRMLS_CC); -+ -+ /*SPG(execution_depth) = orig_execution_depth;*/ -+ /*PG(safe_mode) = orig_safe_mode;*/ -+ PG(open_basedir) = orig_basedir; -+ -+#ifdef ZEND_ENGINE_2 -+ destroy_op_array(new_op_array TSRMLS_CC); -+#else -+ destroy_op_array(new_op_array); -+#endif -+ efree(new_op_array); -+#ifdef ZEND_ENGINE_2 -+ if (!EG(exception)) -+#endif -+ { -+ if (EG(return_value_ptr_ptr)) { -+ zval_ptr_dtor(EG(return_value_ptr_ptr)); -+ EG(return_value_ptr_ptr) = NULL; -+ } -+ } -+ } else { -+ php_security_log(S_INTERNAL, "Unable to execute logging PHP script: %s", SPG(log_phpscriptname)); -+ return; -+ } -+ } else { -+ php_security_log(S_INTERNAL, "Unable to execute logging PHP script: %s", SPG(log_phpscriptname)); -+ return; -+ } -+ } -+ -+} -+ -+ -+#endif -+ -+/* -+ * Local variables: -+ * tab-width: 4 -+ * c-basic-offset: 4 -+ * End: -+ * vim600: sw=4 ts=4 fdm=marker -+ * vim<600: sw=4 ts=4 -+ */ ---- /dev/null -+++ b/main/suhosin_patch.h -@@ -0,0 +1,59 @@ -+/* -+ +----------------------------------------------------------------------+ -+ | Suhosin Patch for PHP | -+ +----------------------------------------------------------------------+ -+ | Copyright (c) 2004-2010 Stefan Esser | -+ +----------------------------------------------------------------------+ -+ | This source file is subject to version 2.02 of the PHP license, | -+ | that is bundled with this package in the file LICENSE, and is | -+ | available at through the world-wide-web at | -+ | http://www.php.net/license/2_02.txt. | -+ | If you did not receive a copy of the PHP license and are unable to | -+ | obtain it through the world-wide-web, please send a note to | -+ | license@php.net so we can mail you a copy immediately. | -+ +----------------------------------------------------------------------+ -+ | Author: Stefan Esser | -+ +----------------------------------------------------------------------+ -+ */ -+ -+#ifndef SUHOSIN_PATCH_H -+#define SUHOSIN_PATCH_H -+ -+#if SUHOSIN_PATCH -+ -+#include "zend.h" -+ -+#define SUHOSIN_PATCH_VERSION "0.9.10" -+ -+#define SUHOSIN_LOGO_GUID "SUHO8567F54-D428-14d2-A769-00DA302A5F18" -+ -+#define SUHOSIN_CONFIG(idx) (suhosin_get_config(idx)) -+ -+#define SUHOSIN_MM_USE_CANARY_PROTECTION 0 -+#define SUHOSIN_MM_DESTROY_FREE_MEMORY 1 -+#define SUHOSIN_MM_IGNORE_CANARY_VIOLATION 2 -+#define SUHOSIN_HT_IGNORE_INVALID_DESTRUCTOR 3 -+#define SUHOSIN_LL_IGNORE_INVALID_DESTRUCTOR 4 -+ -+#define SUHOSIN_CONFIG_SET 100 -+ -+#include -+#include -+#include -+ -+#if defined(DARWIN) -+#include -+#endif -+ -+#define SUHOSIN_MANGLE_PTR(ptr) (ptr==NULL?NULL:((void *)((zend_intptr_t)(ptr)^SUHOSIN_POINTER_GUARD))) -+ -+#endif -+ -+#endif /* SUHOSIN_PATCH_H */ -+ -+/* -+ * Local variables: -+ * tab-width: 4 -+ * c-basic-offset: 4 -+ * End: -+ */ ---- /dev/null -+++ b/main/suhosin_patch.m4 -@@ -0,0 +1,8 @@ -+dnl -+dnl $Id: suhosin_patch.m4,v 1.1 2004/11/14 13:24:24 ionic Exp $ -+dnl -+dnl This file contains Suhosin Patch for PHP specific autoconf functions. -+dnl -+ -+AC_DEFINE(SUHOSIN_PATCH, 1, [Suhosin Patch]) -+ ---- a/sapi/apache/mod_php5.c -+++ b/sapi/apache/mod_php5.c -@@ -965,7 +965,11 @@ static void php_init_handler(server_rec - { - TSRMLS_FETCH(); - if (PG(expose_php)) { -+#if SUHOSIN_PATCH -+ ap_add_version_component("PHP/" PHP_VERSION " with Suhosin-Patch"); -+#else - ap_add_version_component("PHP/" PHP_VERSION); -+#endif - } - } - #endif ---- a/sapi/apache2filter/sapi_apache2.c -+++ b/sapi/apache2filter/sapi_apache2.c -@@ -581,7 +581,11 @@ static void php_apache_add_version(apr_p - { - TSRMLS_FETCH(); - if (PG(expose_php)) { -+#if SUHOSIN_PATCH -+ ap_add_version_component(p, "PHP/" PHP_VERSION " with Suhosin-Patch"); -+#else - ap_add_version_component(p, "PHP/" PHP_VERSION); -+#endif - } - } - ---- a/sapi/apache2handler/sapi_apache2.c -+++ b/sapi/apache2handler/sapi_apache2.c -@@ -406,7 +406,11 @@ static void php_apache_add_version(apr_p - { - TSRMLS_FETCH(); - if (PG(expose_php)) { -+#if SUHOSIN_PATCH -+ ap_add_version_component(p, "PHP/" PHP_VERSION " with Suhosin-Patch"); -+#else - ap_add_version_component(p, "PHP/" PHP_VERSION); -+#endif - } - } - ---- a/sapi/apache_hooks/mod_php5.c -+++ b/sapi/apache_hooks/mod_php5.c -@@ -1251,7 +1251,11 @@ static void php_init_handler(server_rec - { - TSRMLS_FETCH(); - if (PG(expose_php)) { -+#if SUHOSIN_PATCH -+ ap_add_version_component("PHP/" PHP_VERSION " with Suhosin-Patch"); -+#else - ap_add_version_component("PHP/" PHP_VERSION); -+#endif - } - } - #endif ---- a/sapi/cgi/cgi_main.c -+++ b/sapi/cgi/cgi_main.c -@@ -2188,10 +2188,18 @@ consult the installation file that came - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - } -+#if SUHOSIN_PATCH - #if ZEND_DEBUG -- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2011 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+ php_printf("PHP %s with Suhosin-Patch (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2011 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); - #else -- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2011 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+ php_printf("PHP %s with Suhosin-Patch (%s) (built: %s %s)\nCopyright (c) 1997-2011 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+#endif -+#else -+ #if ZEND_DEBUG -+ php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2011 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+ #else -+ php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2011 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+ #endif - #endif - php_request_shutdown((void *) 0); - fcgi_shutdown(); ---- a/sapi/cli/php_cli.c -+++ b/sapi/cli/php_cli.c -@@ -687,7 +687,11 @@ static int do_cli(int argc, char **argv - goto out; - - case 'v': /* show php version & quit */ -+#if SUHOSIN_PATCH -+ php_printf("PHP %s with Suhosin-Patch (%s) (built: %s %s) %s\nCopyright (c) 1997-2011 The PHP Group\n%s", -+#else - php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2011 The PHP Group\n%s", -+#endif - PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__, - #if ZEND_DEBUG && defined(HAVE_GCOV) - "(DEBUG GCOV)", ---- a/sapi/litespeed/lsapi_main.c -+++ b/sapi/litespeed/lsapi_main.c -@@ -546,11 +546,19 @@ static int cli_main( int argc, char * ar - break; - case 'v': - if (php_request_startup(TSRMLS_C) != FAILURE) { -+#if SUHOSIN_PATCH -+#if ZEND_DEBUG -+ php_printf("PHP %s with Suhosin-Patch (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+#else -+ php_printf("PHP %s with Suhosin-Patch (%s) (built: %s %s)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+#endif -+#else - #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); - #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); - #endif -+#endif - #ifdef PHP_OUTPUT_NEWAPI - php_output_end_all(TSRMLS_C); - #else ---- a/sapi/milter/php_milter.c -+++ b/sapi/milter/php_milter.c -@@ -1109,7 +1109,11 @@ int main(int argc, char *argv[]) - } - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; -+#if SUHOSIN_PATCH -+ php_printf("PHP with Suhosin-Patch %s (%s) (built: %s %s)\nCopyright (c) 1997-2011 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+#else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2011 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -+#endif - php_output_teardown(); - exit(1); - break; ---- a/win32/build/config.w32 -+++ b/win32/build/config.w32 -@@ -333,7 +333,7 @@ ADD_SOURCES("Zend", "zend_language_parse - zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \ - zend_object_handlers.c zend_objects_API.c \ - zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c zend_closures.c \ -- zend_float.c zend_string.c"); -+ zend_float.c zend_string.c zend_canary.c zend_alloc_canary.c"); - - if (VCVERS == 1200) { - AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1); -@@ -385,6 +385,7 @@ ADD_FLAG("CFLAGS", "/D FD_SETSIZE=" + pa - - AC_DEFINE('HAVE_USLEEP', 1); - AC_DEFINE('HAVE_STRCOLL', 1); -+AC_DEFINE('SUHOSIN_PATCH', 1); - - /* For snapshot builders, where can we find the additional - * files that make up the snapshot template? */ ---- a/win32/build/config.w32.h.in -+++ b/win32/build/config.w32.h.in -@@ -150,6 +150,9 @@ - /* Win32 supports strcoll */ - #define HAVE_STRCOLL 1 - -+/* Suhosin Patch support */ -+#define SUHOSIN_PATCH 1 -+ - /* Win32 supports socketpair by the emulation in win32/sockets.c */ - #define HAVE_SOCKETPAIR 1 - #define HAVE_SOCKLEN_T 1 diff -Nru php5-5.4.4/debian/patches/temporary-path-fixes-for-multiarch.patch php5-5.4.9/debian/patches/temporary-path-fixes-for-multiarch.patch --- php5-5.4.4/debian/patches/temporary-path-fixes-for-multiarch.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/temporary-path-fixes-for-multiarch.patch 2012-11-28 21:33:33.000000000 +0000 @@ -104,29 +104,27 @@ --- a/ext/mysql/config.m4 +++ b/ext/mysql/config.m4 -@@ -2,16 +2,6 @@ dnl - dnl $Id$ - dnl - --AC_DEFUN([MYSQL_LIB_CHK], [ -- str="$MYSQL_DIR/$1/lib$MYSQL_LIBNAME.*" -- for j in `echo $str`; do -- if test -r $j; then -- MYSQL_LIB_DIR=$MYSQL_DIR/$1 -- break 2 -- fi -- done --]) -- - AC_DEFUN([PHP_MYSQL_SOCKET_SEARCH], [ - for i in \ - /var/run/mysqld/mysqld.sock \ -@@ -93,7 +83,7 @@ Note that the MySQL client library is no +@@ -93,17 +93,15 @@ Note that the MySQL client library is no fi for i in $PHP_LIBDIR $PHP_LIBDIR/mysql; do - MYSQL_LIB_CHK($i) -+ test -f "$MYSQL_DIR/$i/lib$MYSQL_LIBNAME.$SHLIB_SUFFIX_NAME" || test -f "$MYSQL_DIR/$i/$DEB_HOST_MULTIARCH/lib$MYSQL_LIBNAME.$SHLIB_SUFFIX_NAME" || test -r "$MYSQL_DIR/$i/lib$MYSQL_LIBNAME.a" && MYSQL_LIB_DIR=$MYSQL_DIR/$i ++ MYSQL_LIB_CHK($i/$DEB_HOST_MULTIARCH) ++ if test -z "$MYSQL_LIB_DIR"; then ++ MYSQL_LIB_CHK($i) ++ else ++ MYSQL_LIB_DIR=$MYSQL_DIR/$i ++ fi done if test -z "$MYSQL_LIB_DIR"; then +- MYSQL_LIB_CHK(lib/x86_64-linux-gnu) +- fi +- if test -z "$MYSQL_LIB_DIR"; then +- MYSQL_LIB_CHK(lib/i386-linux-gnu) +- fi +- +- if test -z "$MYSQL_LIB_DIR"; then + AC_MSG_ERROR([Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR. + Note that the MySQL client library is not bundled anymore!]) + fi diff -Nru php5-5.4.4/debian/patches/use_embedded_timezonedb.patch php5-5.4.9/debian/patches/use_embedded_timezonedb.patch --- php5-5.4.4/debian/patches/use_embedded_timezonedb.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/use_embedded_timezonedb.patch 2012-11-28 20:21:06.000000000 +0000 @@ -473,6 +473,7 @@ + char **map, size_t *maplen, + const timelib_tzdb *tzdb) +{ ++#ifdef HAVE_SYSTEM_TZDATA + if (tzdb == timezonedb_system) { + char *orig; + @@ -486,9 +487,8 @@ + + return 1; + } -+ else { -+ return inmem_seek_to_tz_position(tzf, timezone, tzdb); -+ } ++#endif ++ return inmem_seek_to_tz_position(tzf, timezone, tzdb); +} + const timelib_tzdb *timelib_builtin_db(void) @@ -614,3 +614,29 @@ + fi +fi + +--- a/ext/date/php_date.c ++++ b/ext/date/php_date.c +@@ -863,6 +863,23 @@ static char* guess_timezone(const timeli + } else if (*DATEG(default_timezone) && timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) { + return DATEG(default_timezone); + } ++ /* Try to guess timezone from system information */ ++ { ++ struct tm *ta, tmbuf; ++ time_t the_time; ++ char *tzid = NULL; ++ ++ the_time = time(NULL); ++ ta = php_localtime_r(&the_time, &tmbuf); ++ if (ta) { ++ tzid = timelib_timezone_id_from_abbr(ta->tm_zone, ta->tm_gmtoff, ta->tm_isdst); ++ } ++ if (! tzid) { ++ tzid = "UTC"; ++ } ++ ++ return tzid; ++ } + /* Fallback to UTC */ + php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone."); + return "UTC"; diff -Nru php5-5.4.4/debian/patches/use_system_crypt_fixes.patch php5-5.4.9/debian/patches/use_system_crypt_fixes.patch --- php5-5.4.4/debian/patches/use_system_crypt_fixes.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/use_system_crypt_fixes.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ ---- a/ext/standard/tests/strings/bug51059.phpt -+++ b/ext/standard/tests/strings/bug51059.phpt -@@ -3,7 +3,7 @@ Bug #51059 crypt() segfaults on certain - --FILE-- - diff -Nru php5-5.4.4/debian/patches/zend_int_overflow.patch php5-5.4.9/debian/patches/zend_int_overflow.patch --- php5-5.4.4/debian/patches/zend_int_overflow.patch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/patches/zend_int_overflow.patch 2012-11-28 20:21:06.000000000 +0000 @@ -32,7 +32,7 @@ - if (idx-1 > LONG_MAX) { /* overflow */ \ - break; \ - } \ -- idx = (ulong)(-(long)idx); \ +- idx = 0 - idx; \ - } else if (idx > LONG_MAX) { /* overflow */ \ + int digit = (*tmp - '0'); \ + if ( (!negative) && idx <= (LONG_MAX-digit)/10 ) { \ diff -Nru php5-5.4.4/debian/php5-cgi.NEWS php5-5.4.9/debian/php5-cgi.NEWS --- php5-5.4.4/debian/php5-cgi.NEWS 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/debian/php5-cgi.NEWS 2012-11-28 21:33:33.000000000 +0000 @@ -0,0 +1,36 @@ +php5 (5.4.4-5) unstable; urgency=low + + Please be aware that the mime-support package has dropped non-standard + definitions for PHP, which might affect any systems using PHP 5 + running as CGI or FastCGI. The following definitions were dropped: + + application/x-httpd-php phtml pht php + application/x-httpd-php-source phps + application/x-httpd-php3 php3 + application/x-httpd-php3-preprocessed php3p + application/x-httpd-php4 php4 + application/x-httpd-php5 php5 + + The php5-cgi package mitigates any known issues by creating a (dummy) + apache2 module php5_cgi with a configuration containing handlers for + all previously defined extensions. Even though we believe that this + configuration should keep your PHP scripts working, it might be a + good idea to check your apache2 site-wide configuration as well as + any specific PHP configuration for websites running on your system. + + The new (dummy) php5_cgi configuration uses the SetHandler directive, + which might interfere with existing custom configurations such as + FastCGI (mod_fcgid or mod_fastcgi). If so, you can reenable the + existing functionality of your custom configuration by disabling the + php5_cgi module (a2dismod php5_cgi), but you are also advised to + check whether your custom configuration is vulnerable to foo.php.jpeg + attacks. The php5_cgi configuration snippet can be used as a base - + it's important to use the FilesMatch or Files directive to limit the + handling to the last extension. + + As far as we know definitions from the mime-support packages are not + used in any other webserver included in Debian, but it might affect + any application which relies on system MIME types to interpret PHP + files. + + -- Ondřej Surý Wed, 15 Aug 2012 10:31:31 +0200 diff -Nru php5-5.4.4/debian/php5-cgi.dirs php5-5.4.9/debian/php5-cgi.dirs --- php5-5.4.4/debian/php5-cgi.dirs 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/php5-cgi.dirs 2012-11-28 20:21:06.000000000 +0000 @@ -1,3 +1,4 @@ +/etc/apache2/mods-available /etc/php5/cgi /usr/lib/cgi-bin /usr/bin diff -Nru php5-5.4.4/debian/php5-cgi.postinst php5-5.4.9/debian/php5-cgi.postinst --- php5-5.4.4/debian/php5-cgi.postinst 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/php5-cgi.postinst 2012-11-28 20:21:06.000000000 +0000 @@ -4,6 +4,15 @@ #DEBHELPER# +reload_apache() +{ + if apache2ctl configtest 2>/dev/null; then + invoke-rc.d apache2 $1 || true + else + echo "Your apache2 configuration is broken, so we're not restarting it for you." + fi +} + if [ "$1" != "configure" ]; then exit 0 fi @@ -13,6 +22,15 @@ ucf /usr/share/php5/php.ini-production $phpini ucfr php5-cgi $phpini +# Enable php5_cgi if upgrading from older versions of php5-cgi +if [ -n "$2" ] && dpkg --compare-versions "$2" lt 5.4.4-5; then + # Only enable php5_cgi if apache2 is installed + if [ -x "/usr/sbin/a2enmod" ]; then + a2enmod php5_cgi >/dev/null || true + reload_apache force-reload + fi +fi + update-alternatives \ --install /usr/bin/php-cgi php-cgi /usr/bin/php5-cgi 50 \ --slave /usr/share/man/man1/php-cgi.1.gz php-cgi.1.gz /usr/share/man/man1/php5-cgi.1.gz diff -Nru php5-5.4.4/debian/php5-cgi.prerm php5-5.4.9/debian/php5-cgi.prerm --- php5-5.4.4/debian/php5-cgi.prerm 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/php5-cgi.prerm 2012-11-28 20:21:06.000000000 +0000 @@ -4,11 +4,14 @@ #DEBHELPER# -if [ "$1" != "remove" -a "$1" != "purge" ]; then - exit 0 -fi - -update-alternatives --remove php-cgi /usr/bin/php5-cgi -update-alternatives --remove php-cgi-bin /usr/lib/cgi-bin/php5 +case "$1" in + remove) + if [ -x /usr/sbin/a2dismod ]; then + a2dismod php5_cgi || true + fi + update-alternatives --remove php-cgi /usr/bin/php5-cgi + update-alternatives --remove php-cgi-bin /usr/lib/cgi-bin/php5 + ;; +esac exit 0 diff -Nru php5-5.4.4/debian/php5-common.README.Debian php5-5.4.9/debian/php5-common.README.Debian --- php5-5.4.4/debian/php5-common.README.Debian 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/php5-common.README.Debian 2012-11-28 21:33:33.000000000 +0000 @@ -1,22 +1,23 @@ Table of Contents: ---------------------------------------------------------------------- -* Using PHP 5 with threaded webservers (eg. apache2-mpm-worker) +* Using PHP 5 with threaded webservers (e.g. apache2-mpm-worker) * Problems starting Apache HTTP Server with PHP 5 * Session storage * Other caveats +* PHP 5 and Apache 2 Multiviews (HTTP Content Negotiation) * PHP 5 CGI and Apache HTTP Server * Configuration layout * Timezone data from system timezone database * Further documentation, errata, etc -Using PHP 5 with threaded webservers (eg. apache2-mpm-worker) +Using PHP 5 with threaded webservers (e.g. apache2-mpm-worker) ---------------------------------------------------------------------- After much back-and-forth with upstream (and even building our packages thread-safe for a while), we're currently admitting defeat - on that front, and are NOT building any thread-safe versions of PHP 5 - for any webservers. Our recommendation is that, if you need to use a - threaded webserver, you should use php5-fpm and interface your + on that front, and are NOT building any thread-safe versions of PHP + 5 for any webservers. Our recommendation is that, if you need to use + a threaded webserver, you should use php5-fpm and interface to your webserver with FastCGI. Problems starting Apache HTTP Server with PHP 5 @@ -28,7 +29,7 @@ and it's possible there are still bugs in the released packages. If Apache fails to start after you install PHP 5, check your list of enabled extensions at the bottom of /etc/php5/apache2/php.ini (and - in the per-sapi configuration directory), and try commenting out or + in the per-SAPI configuration directory), and try commenting out or reordering the extensions until you find a combination that works. For example, in the past the mhash extension was incompatible with @@ -38,17 +39,17 @@ If you find an extension-related bug in the Debian packages, and you are willing to help debug the problem, please send us a bug report that lists all enabled PHP 5 extensions (extension=), in the order - in which they appear in php.ini, as well as all enabled Apache modules - (LoadModule), with version numbers where possible. + in which they appear in php.ini, as well as all enabled Apache + modules (LoadModule), with version numbers where possible. Session storage ---------------------------------------------------------------------- Session files are stored in /var/lib/php5. For security purposes, - this directory is unreadable by non-root users. This means that PHP + this directory is unreadable to non-root users. This means that PHP 5 running from Apache HTTP Server, for example, will not be able to clean up stale session files. Instead, we have a cron job run every - 30 mins that cleans up stale session files; /etc/cron.d/php5. You + 30 minutes that cleans up stale session files; /etc/cron.d/php5. You may need to modify how often this runs, if you've modified session.gc_maxlifetime in your php.ini; otherwise, it may be too lax or overly aggressive in cleaning out stale session files. @@ -57,20 +58,80 @@ ---------------------------------------------------------------------- Configuration directives extension_dir and include_path should be - commented out, unless you need special settings for them so php will + commented out, unless you need special settings for them so PHP will look in compiled-in paths. If you set them, you should also add - appropriate php install directories there. + appropriate PHP install directories there. + +PHP 5 and Apache 2 Multiviews (HTTP Content Negotiation) +---------------------------------------------------------------------- + + Apache 2’s mod_negotiation needs files to have a MIME-Type (amongst + others) associated with them in order to be considered for HTTP + content negotiation. + + Per default, the Debian PHP packages use Apache 2 handlers + (SetHandler directive) to enable PHP interpretation, while no + MIME-Type is being associated with the common PHP file extensions. + + Thus, by default, the HTTP content negotiation is disabled for PHP + file extensions. + + Possible use cases: + + 1) You intend to use HTTP content negotiation in order to tidy up URLs: + + For example, you wanted the file “http://example.org/foo.php” + being accessible as “http://example.org/foo”, too. In that case + you really shouldn’t abuse mod_negotiation but use mod_rewrite. + + An example of rewrite-rules, which allow any file ending in “.php” + to be accessed without this extension is: + + RewriteCond "%{REQUEST_FILENAME}" !-f + RewriteCond "%{REQUEST_FILENAME}" !-d + RewriteRule "^(.*)$" "$1.php" [last] + + Depending on your setup you may need to set other flags, too, + especially “passthrough” or “qsappend”. + + 2) You really wanted to use HTTP content negotiation on PHP files + (be they interpreted or not). + + An example for this might be, when you have the files + + http://example.org/foo.php + http://example.org/foo.js + + which both do the same job, but the former is executed as PHP on + the server-side, while the later is executed as JavaScript on the + client-side. + + If you really want it, just add MIME type definitions for file + extensions you need to your Apache 2 configuration. For example + to recognize php and phps extensions you would add: + + AddType application/x-php php + AddType application/x-php-source phps + + This scenario is really very rarely used (if at all)! PHP 5 CGI and Apache HTTP Server ---------------------------------------------------------------------- - In 99% of cases, what you probably want isn't php5-cgi package at - all, but rather the libapache2-mod-php5 package, which will - configure itself on installation and Just Work(tm). If, however, you + In simple cases, what you probably want isn't the php5-cgi package + at all, but rather the libapache2-mod-php5 package, which will + configure itself on installation and Just Work(tm). However, if you have a need to use the CGI version of PHP 5 with Apache HTTP Server, the following should help get you going, though there are dozens of different ways to do this. + The current recommended approach is to install the php5-fpm package + and use FastCGI to interface to your webserver. However, you will + have to use the libapache2-mod-fastcgi package (from non-free) or a + different FastCGI-capable webserver (such as nginx or lighttpd), + since the libapache2-mod-fcgid available from the main archive has + no way of interacting with external FastCGI servers. + Please note that this process will never be made automatic, as php5-cgi is meant to be a webserver-agnostic package that can be used with any httpd, and we don't want it to conflict with the @@ -78,25 +139,26 @@ installed side-by-side and both were automatically enabled, the results would be a bit confusing, obviously. - To use php5-cgi with Apache HTTP Server: - 1) activate CGI (it's on by default in default debian setups) - a) If using the prefork MPM, use 'a2enmod cgi' - b) If using a threaded MPM, use 'a2enmod cgid' - 2) activate mod_actions (a2enmod actions) - 3) Add the following to a config snippet in /etc/apache2/conf.d - - ScriptAlias /cgi-bin/php5-cgi /usr/lib/cgi-bin/php5 - Action php5-cgi /cgi-bin/php5-cgi - AddHandler php5-cgi .php - + You should also be aware that a server deployed in CGI mode is open + to several possible vulnerabilities. See the upstream CGI security + page to learn how to defend yourself from such attacks: + http://www.php.net/manual/en/security.cgi-bin.php - Note: more modern way of doing this is to install php5-fpm package - and use FastCGI interface of your webserver. + To use php5-cgi with Apache HTTP Server: + 1) activate php5_cgi module: run 'a2enmod php5_cgi' + 2) this will also activate the mod_actions module as a dependency + 3) comment out the last block of configuration in the + /etc/apache2/mods-enabled/php5_cgi.conf file to enable + server-wide PHP 5 CGI or add the mentioned configuration block to + one or more virtual hosts or directories. + 4) It's advised to not mix-and-match multiple SAPIs (such as + php5-cgi along with libapache2-mod-php5) in the same apache2 + configuration as it is likely to create unpredictable results. Configuration Layout ---------------------------------------------------------------------- - Each SAPI (apache2/apache2filter/cgi/cli/fpm) have a different + Each SAPI (apache2/apache2filter/cgi/cli/fpm) has a different central configuration file /etc/php5/$SAPI/php.ini. Additionally, each SAPI is configured with the compile-time option @@ -105,9 +167,9 @@ which for all SAPIs is actually a symlink pointing to a central directory /etc/php5/conf.d. Any file found in this directory ending - in .ini will be treated as a configuration file by the php SAPI. + in .ini will be treated as a configuration file by the PHP SAPI. - The rationale with this method is that each SAPI can thus be + The rationale behind this method is that each SAPI can thus be identically configured with a minimal amount of conffile handling, but at the same time if you want to have SAPI-specific configuration, you can just remove the symlink. @@ -119,9 +181,9 @@ Timezone data from system timezone database ---------------------------------------------------------------------- - Debian PHP has been patched to use of the system wide timezone - database from the tzdata package, making sure any updates there are - automatically used by PHP aswell. + Debian PHP has been patched to use the system wide timezone database + from the tzdata package, making sure any updates there are + automatically used by PHP as well. Note that this requires that the PHP process has access to /etc/localtime and /usr/share/zoneinfo. For any regular installation @@ -140,4 +202,4 @@ If after reading the documentation in this file you still have unanswered questions, that's a good next place to go. - -- Ondřej Surý , Sun, 8 Apr 2012 22:00:59 +0200 + -- Ondřej Surý , Thu, 30 Aug 2012 09:56:01 +0200 diff -Nru php5-5.4.4/debian/php5-common.dirs php5-5.4.9/debian/php5-common.dirs --- php5-5.4.4/debian/php5-common.dirs 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/php5-common.dirs 2012-11-28 20:21:06.000000000 +0000 @@ -1,6 +1,6 @@ /usr/lib/php5/libexec /usr/share/lintian/overrides -/usr/share/doc/php5-common/examples +/usr/share/doc/php5-common /usr/share/php5 /var/lib/php5 /usr/lib/php5 diff -Nru php5-5.4.4/debian/php5-common.php5.cron.d php5-5.4.9/debian/php5-common.php5.cron.d --- php5-5.4.4/debian/php5-common.php5.cron.d 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/php5-common.php5.cron.d 2012-12-04 21:51:47.000000000 +0000 @@ -4,4 +4,4 @@ # files, or 24 minutes if not defined. See /usr/lib/php5/maxlifetime # Look for and purge old sessions every 30 minutes -09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -ignore_readdir_race -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete +09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean ] && [ -d /var/lib/php5 ] && /usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime) diff -Nru php5-5.4.4/debian/php5-fpm.logrotate php5-5.4.9/debian/php5-fpm.logrotate --- php5-5.4.4/debian/php5-fpm.logrotate 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/php5-fpm.logrotate 2012-11-28 21:33:33.000000000 +0000 @@ -1,16 +1,11 @@ -# cat /etc/logrotate.d/php5-fpm /var/log/php5-fpm.log { + rotate 12 weekly missingok - rotate 7 + notifempty compress delaycompress - notifempty postrotate - if [ -x /usr/sbin/invoke-rc.d ]; then \ - invoke-rc.d php5-fpm reopen-logs > /dev/null 2>&1; \ - else \ - /etc/init.d/php5-fpm reopen-logs > /dev/null 2>&1; \ - fi; \ + invoke-rc.d php5-fpm reopen-logs > /dev/null endscript } diff -Nru php5-5.4.4/debian/php5-sapi.lintian-overrides php5-5.4.9/debian/php5-sapi.lintian-overrides --- php5-5.4.4/debian/php5-sapi.lintian-overrides 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/php5-sapi.lintian-overrides 2012-11-28 21:33:33.000000000 +0000 @@ -11,6 +11,8 @@ php5-cli: embedded-library usr/bin/php5: file php5-fpm: embedded-library usr/sbin/php5-fpm: file libphp5-embed: embedded-library usr/lib/libphp5.so: file +libphp5-embed: embedded-library usr/lib/php5/libphp5-*.so: file +libphp5-embed: missing-dependency-on-phpapi libapache2-mod-php5: embedded-library ./usr/lib/apache2/modules/libphp5.so: file libapache2-mod-php5filter: embedded-library ./usr/lib/apache2/modules/libphp5filter.so: file php5-cgi: embedded-library ./usr/bin/php5-cgi: file diff -Nru php5-5.4.4/debian/php5_cgi.conf php5-5.4.9/debian/php5_cgi.conf --- php5-5.4.4/debian/php5_cgi.conf 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/debian/php5_cgi.conf 2012-11-28 20:21:06.000000000 +0000 @@ -0,0 +1,37 @@ +# This file replaces old system MIME types and sets them only in the +# Apache webserver + +# application/x-httpd-php phtml pht php +# application/x-httpd-php3 php3 +# application/x-httpd-php4 php4 +# application/x-httpd-php5 php + + SetHandler application/x-httpd-php + +# application/x-httpd-php-source phps + + SetHandler application/x-httpd-php-source + # Deny access to raw php sources by default + # To re-enable it's recommended to enable access to the files + # only in specific virtual host or directory + Order Deny,Allow + Deny from all + +# Deny access to files without filename (e.g. '.php') + + Order Deny,Allow + Deny from all + + +# To enable PHP CGI site-wide, just uncomment following lines, however +# as a security measure, it's recommended to enable PHP just in the +# specific virtual servers or just specific directories + +#ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ +# +# AllowOverride None +# Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch +# Order allow,deny +# Allow from all +# +#Action application/x-httpd-php /cgi-bin/php5 diff -Nru php5-5.4.4/debian/php5_cgi.load php5-5.4.9/debian/php5_cgi.load --- php5-5.4.4/debian/php5_cgi.load 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/debian/php5_cgi.load 2012-11-28 20:21:06.000000000 +0000 @@ -0,0 +1,2 @@ +# Depends: actions +# This is just dummy load file to enable actions module diff -Nru php5-5.4.4/debian/php5enmod php5-5.4.9/debian/php5enmod --- php5-5.4.4/debian/php5enmod 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/php5enmod 2012-11-28 21:33:33.000000000 +0000 @@ -97,15 +97,23 @@ local FOUND=0 for live_link in $(ls -1 /etc/php5/conf.d/*.ini); do # assert $modname is in /etc/php5/conf.d - [ -e "${live_link}" ] || continue [ -h "${live_link}" ] || continue # assert $modname is a symlink to /etc/php5/mods-available [ "$(readlink "${live_link}")" != "${live_link_content}" ] && continue + [ -e "${live_link}" ] || echo "removing dangling symlink ${live_link}" # remove the symlink rm -f "${live_link}" FOUND=1 done - [ "${FOUND}" -gt 0 ] && DISABLED=$(($DISABLED+1)) + if [ "${FOUND}" -gt 0 ]; then + DISABLED=$(($DISABLED+1)) + else + if [ -e /etc/php5/mods-available/${modname}.ini ]; then + echo "$modname module already disabled" + else + echo "$modname module does not exist!" + fi + fi } # parse args diff -Nru php5-5.4.4/debian/rules php5-5.4.9/debian/rules --- php5-5.4.4/debian/rules 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/rules 2012-12-04 21:51:47.000000000 +0000 @@ -16,9 +16,6 @@ # compatibility to upstream PHP5_COMPAT=no -# Set this flag to 'yes' if you want to compile PHP5 with suhosin patch -PHP5_SUHOSIN=no - DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) @@ -160,18 +157,9 @@ foreach($$e as $$i) { $$s .= " $$i"; } \ echo("php:Extensions=" . wordwrap($$s . ".\n", 75, "\$${Newline}")); -# include the patch/unpatch rules from quilt -include /usr/share/quilt/quilt.make - prepared: prepared-stamp -prepared-stamp: $(QUILT_STAMPFN) +prepared-stamp: dh_testdir -ifeq (yes,$(PHP5_SUHOSIN)) - QUILT_PATCHES=$(QUILT_PATCH_DIR) \ - quilt --quiltrc /dev/null import debian/patches/suhosin.patch - QUILT_PATCHES=$(QUILT_PATCH_DIR) \ - quilt --quiltrc /dev/null push -a || test $$? = 2 -endif sed -i -e 's/EXTRA_VERSION=""/EXTRA_VERSION="-$(PHP5_DEBIAN_REVISION)"/' configure.in ./buildconf --force touch prepared-stamp @@ -449,16 +437,10 @@ Zend/ touch configure-fpm-stamp -clean: unprepared unpatch +clean: unprepared dh_testdir dh_testroot -ifeq (yes,$(PHP5_SUHOSIN)) - QUILT_PATCHES=$(QUILT_PATCH_DIR) \ - quilt --quiltrc /dev/null delete debian/patches/suhosin.patch \ - || return 0 -endif - rm -f configure-apache2-stamp build-apache2-stamp rm -f configure-apache2filter-stamp build-apache2filter-stamp rm -f configure-cgi-stamp build-cgi-stamp @@ -504,7 +486,11 @@ chmod 01733 debian/php5-common/var/lib/php5 - # Add here commands to install the package into debian/php5. + cp debian/php5_cgi.conf \ + debian/php5-cgi/etc/apache2/mods-available/php5_cgi.conf + cp debian/php5_cgi.load \ + debian/php5-cgi/etc/apache2/mods-available/php5_cgi.load + # install apache2 DSO module cp apache2-build/.libs/libphp5.so \ debian/libapache2-mod-php5/`apxs2 -q LIBEXECDIR`/ @@ -527,7 +513,6 @@ # memory_limit: 16M for cgi/apache; 32M for cli cat php.ini-production | tr "\t" " " | sed -e'/memory_limit =/ s/128M/-1/g;/short_open_tag =/ s/Off/On/g;/session.gc_probability =/ s/1/0/g' > debian/php5-common/usr/share/php5/php.ini-production.cli cat php.ini-production | tr "\t" " " | sed -e'/memory_limit =/ s/128M/32M/g' > debian/php5-common/usr/share/php5/php.ini-production-dist - cat php.ini-development | tr "\t" " " > debian/php5-common/usr/share/doc/php5-common/examples/php.ini-development cat php.ini-development | tr "\t" " " | sed -e'/short_open_tag =/ s/Off/On/g;/session.gc_probability =/ s/1/0/g;/disable_functions =/ s/$$/ $(PCNTL_FUNCTIONS)/g;' > debian/php5-common/usr/share/php5/php.ini-development cp test-results.txt debian/php5-common/usr/share/doc/php5-common/ @@ -645,9 +630,13 @@ # install common files install -m755 debian/maxlifetime debian/php5-common/usr/lib/php5 + install -m755 debian/sessionclean debian/php5-common/usr/lib/php5 install -m755 debian/php5enmod debian/php5-common/usr/sbin/php5enmod ln -s php5enmod debian/php5-common/usr/sbin/php5dismod + # remove libtool files + rm $(CURDIR)/debian/libphp5-embed/usr/lib/php5/libphp5.la + # install lintian overrides cp debian/php5.lintian-overrides $(CURDIR)/debian/php5-common/usr/share/lintian/overrides/php5-common cp debian/php5-dev.lintian-overrides $(CURDIR)/debian/php5-dev/usr/share/lintian/overrides/php5-dev diff -Nru php5-5.4.4/debian/sessionclean php5-5.4.9/debian/sessionclean --- php5-5.4.4/debian/sessionclean 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/debian/sessionclean 2012-12-04 21:51:47.000000000 +0000 @@ -0,0 +1,7 @@ +#!/bin/sh + +# first find all used files and touch them (hope it's not massive amount of files) +lsof -w -l +d "${1}" | awk -- '{ if (NR > 1) { print $9; } }' | xargs -i touch -c {} + +# find all files older then maxlifetime +find "${1}" -depth -mindepth 1 -maxdepth 1 -type f -ignore_readdir_race -cmin +${2} -delete diff -Nru php5-5.4.4/debian/source/format php5-5.4.9/debian/source/format --- php5-5.4.4/debian/source/format 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/source/format 2012-12-13 17:00:21.429737325 +0000 @@ -1 +1 @@ -1.0 +3.0 (quilt) diff -Nru php5-5.4.4/debian/suhosin_patch.watch php5-5.4.9/debian/suhosin_patch.watch --- php5-5.4.4/debian/suhosin_patch.watch 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/debian/suhosin_patch.watch 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -# Check for new versions with: -# uscan --watchfile debian/suhosin_patch.watch --package suhosin-patch -# don't forget to update the version in this file when updating the patch! -version=3 - -opts=uversionmangle=s/RC/~RC/ \ -http://www.hardened-php.net/suhosin/download.html \ - http://download.suhosin.org/suhosin-patch-(.*)\.patch\.gz 5.3.1-0.9.8 diff -Nru php5-5.4.4/ext/curl/interface.c php5-5.4.9/ext/curl/interface.c --- php5-5.4.4/ext/curl/interface.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/curl/interface.c 2012-11-21 05:12:20.000000000 +0000 @@ -713,6 +713,14 @@ #if LIBCURL_VERSION_NUM >= 0x071202 REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_URL); #endif +#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */ + REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_IP); +#endif +#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */ + REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_PORT); + REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_IP); + REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_PORT); +#endif /* cURL protocol constants (curl_version) */ @@ -1606,9 +1614,9 @@ dupch->uses = 0; ch->uses++; if (ch->handlers->write->stream) { - Z_ADDREF_P(dupch->handlers->write->stream); - dupch->handlers->write->stream = ch->handlers->write->stream; + Z_ADDREF_P(ch->handlers->write->stream); } + dupch->handlers->write->stream = ch->handlers->write->stream; dupch->handlers->write->method = ch->handlers->write->method; dupch->handlers->write->type = ch->handlers->write->type; if (ch->handlers->read->stream) { @@ -1675,6 +1683,11 @@ CURLcode error=CURLE_OK; switch (option) { + /* Long options */ + case CURLOPT_SSL_VERIFYHOST: + if(Z_TYPE_PP(zvalue)==IS_BOOL && Z_BVAL_PP(zvalue)) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "CURLOPT_SSL_VERIFYHOST set to true which disables common name validation (setting CURLOPT_SSL_VERIFYHOST to 2 enables common name validation)"); + } case CURLOPT_INFILESIZE: case CURLOPT_VERBOSE: case CURLOPT_HEADER: @@ -1713,7 +1726,6 @@ #if LIBCURL_VERSION_NUM > 0x071002 case CURLOPT_CONNECTTIMEOUT_MS: #endif - case CURLOPT_SSL_VERIFYHOST: case CURLOPT_SSL_VERIFYPEER: case CURLOPT_DNS_USE_GLOBAL_CACHE: case CURLOPT_NOSIGNAL: @@ -2177,7 +2189,7 @@ convert_to_string_ex(zvalue); - if (!Z_STRLEN_PP(zvalue) || php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) { + if (Z_STRLEN_PP(zvalue) && php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) { RETVAL_FALSE; return 1; } @@ -2447,6 +2459,8 @@ create_certinfo(ci, listcode TSRMLS_CC); CAAZ("certinfo", listcode); } +#endif +#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */ if (curl_easy_getinfo(ch->cp, CURLINFO_PRIMARY_IP, &s_code) == CURLE_OK) { CAAS("primary_ip", s_code); } @@ -2473,10 +2487,10 @@ } else { switch (option) { /* string variable types */ -#if LIBCURL_VERSION_NUM >= 0x071500 +#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */ case CURLINFO_PRIMARY_IP: #endif -#if LIBCURL_VERSION_NUM >= 0x071500 +#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */ case CURLINFO_LOCAL_IP: #endif case CURLINFO_PRIVATE: @@ -2496,7 +2510,7 @@ break; } /* Long variable types */ -#if LIBCURL_VERSION_NUM >= 0x071500 +#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */ case CURLINFO_PRIMARY_PORT: case CURLINFO_LOCAL_PORT: #endif diff -Nru php5-5.4.4/ext/curl/multi.c php5-5.4.9/ext/curl/multi.c --- php5-5.4.4/ext/curl/multi.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/curl/multi.c 2012-11-21 05:12:20.000000000 +0000 @@ -191,6 +191,9 @@ FD_ZERO(&exceptfds); curl_multi_fdset(mh->multi, &readfds, &writefds, &exceptfds, &maxfd); + if (maxfd == -1) { + RETURN_LONG(-1); + } RETURN_LONG(select(maxfd + 1, &readfds, &writefds, &exceptfds, &to)); } /* }}} */ diff -Nru php5-5.4.4/ext/curl/streams.c php5-5.4.9/ext/curl/streams.c --- php5-5.4.4/ext/curl/streams.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/curl/streams.c 2012-11-21 05:12:20.000000000 +0000 @@ -162,6 +162,10 @@ } do { + FD_ZERO(&curlstream->readfds); + FD_ZERO(&curlstream->writefds); + FD_ZERO(&curlstream->excfds); + /* get the descriptors from curl */ curl_multi_fdset(curlstream->multi, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &curlstream->maxfd); diff -Nru php5-5.4.4/ext/curl/tests/bug61948-win32.phpt php5-5.4.9/ext/curl/tests/bug61948-win32.phpt --- php5-5.4.4/ext/curl/tests/bug61948-win32.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/curl/tests/bug61948-win32.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,25 @@ +--TEST-- +Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction) +--SKIPIF-- + +--INI-- +open_basedir="c:/tmp" +--FILE-- + +--EXPECTF-- +%a + +Warning: curl_setopt(): open_basedir restriction in effect. File(c:/tmp/foo) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d +bool(false) + +Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d +bool(false) diff -Nru php5-5.4.4/ext/curl/tests/bug61948.phpt php5-5.4.9/ext/curl/tests/bug61948.phpt --- php5-5.4.4/ext/curl/tests/bug61948.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/curl/tests/bug61948.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,7 +1,10 @@ --TEST-- Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction) --SKIPIF-- - + --INI-- open_basedir="/tmp" --FILE-- @@ -13,7 +16,7 @@ curl_close($ch); ?> --EXPECTF-- -bool(false) +bool(true) bool(true) Warning: curl_setopt(): open_basedir restriction in effect. File(/xxx/bar) is not within the allowed path(s): (/tmp) in %sbug61948.php on line %d diff -Nru php5-5.4.4/ext/curl/tests/bug62839.phpt php5-5.4.9/ext/curl/tests/bug62839.phpt --- php5-5.4.4/ext/curl/tests/bug62839.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/curl/tests/bug62839.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,18 @@ +--TEST-- +Bug #62839 (curl_copy_handle segfault with CURLOPT_FILE) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +DONE! diff -Nru php5-5.4.4/ext/curl/tests/bug63363.phpt php5-5.4.9/ext/curl/tests/bug63363.phpt --- php5-5.4.4/ext/curl/tests/bug63363.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/curl/tests/bug63363.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,29 @@ +--TEST-- +Bug #63363 (CURL silently accepts boolean value for SSL_VERIFYHOST) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +bool(true) + +Notice: curl_setopt(): CURLOPT_SSL_VERIFYHOST set to true which disables common name validation (setting CURLOPT_SSL_VERIFYHOST to 2 enables common name validation) in %s on line %d +bool(true) +bool(true) +bool(true) +bool(true) diff -Nru php5-5.4.4/ext/date/lib/astro.c php5-5.4.9/ext/date/lib/astro.c --- php5-5.4.4/ext/date/lib/astro.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/astro.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/date/lib/dow.c php5-5.4.9/ext/date/lib/dow.c --- php5-5.4.4/ext/date/lib/dow.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/dow.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/date/lib/interval.c php5-5.4.9/ext/date/lib/interval.c --- php5-5.4.4/ext/date/lib/interval.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/interval.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/date/lib/parse_date.c php5-5.4.9/ext/date/lib/parse_date.c --- php5-5.4.4/ext/date/lib/parse_date.c 2012-06-13 06:08:08.000000000 +0000 +++ php5-5.4.9/ext/date/lib/parse_date.c 2012-11-21 05:53:10.000000000 +0000 @@ -1,9 +1,9 @@ -/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:27 2011 */ +/* Generated by re2c 0.13.5 on Sun Sep 30 20:14:42 2012 */ /* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -21296,6 +21296,7 @@ s->time->is_localtime = 1; s->time->zone_type = TIMELIB_ZONETYPE_OFFSET; s->time->z = 0; + s->time->dst = 0; TIMELIB_DEINIT; return TIMELIB_RELATIVE; @@ -24972,6 +24973,7 @@ s->time->is_localtime = 1; s->time->zone_type = TIMELIB_ZONETYPE_OFFSET; s->time->z = 0; + s->time->dst = 0; break; case 'e': /* timezone */ diff -Nru php5-5.4.4/ext/date/lib/parse_date.re php5-5.4.9/ext/date/lib/parse_date.re --- php5-5.4.4/ext/date/lib/parse_date.re 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/parse_date.re 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -1073,6 +1073,7 @@ s->time->is_localtime = 1; s->time->zone_type = TIMELIB_ZONETYPE_OFFSET; s->time->z = 0; + s->time->dst = 0; TIMELIB_DEINIT; return TIMELIB_RELATIVE; @@ -2077,6 +2078,7 @@ s->time->is_localtime = 1; s->time->zone_type = TIMELIB_ZONETYPE_OFFSET; s->time->z = 0; + s->time->dst = 0; break; case 'e': /* timezone */ diff -Nru php5-5.4.4/ext/date/lib/parse_iso_intervals.c php5-5.4.9/ext/date/lib/parse_iso_intervals.c --- php5-5.4.4/ext/date/lib/parse_iso_intervals.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/parse_iso_intervals.c 2012-11-21 05:12:20.000000000 +0000 @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/date/lib/parse_iso_intervals.re php5-5.4.9/ext/date/lib/parse_iso_intervals.re --- php5-5.4.4/ext/date/lib/parse_iso_intervals.re 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/parse_iso_intervals.re 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/date/lib/parse_tz.c php5-5.4.9/ext/date/lib/parse_tz.c --- php5-5.4.4/ext/date/lib/parse_tz.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/parse_tz.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/date/lib/timelib.c php5-5.4.9/ext/date/lib/timelib.c --- php5-5.4.4/ext/date/lib/timelib.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/timelib.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/date/lib/timelib.h php5-5.4.9/ext/date/lib/timelib.h --- php5-5.4.4/ext/date/lib/timelib.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/timelib.h 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/date/lib/timelib_structs.h php5-5.4.9/ext/date/lib/timelib_structs.h --- php5-5.4.4/ext/date/lib/timelib_structs.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/timelib_structs.h 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/date/lib/timezonedb.h php5-5.4.9/ext/date/lib/timezonedb.h --- php5-5.4.4/ext/date/lib/timezonedb.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/timezonedb.h 2012-11-21 05:12:20.000000000 +0000 @@ -14,224 +14,224 @@ { "Africa/Bujumbura" , 0x000571 }, { "Africa/Cairo" , 0x0005B5 }, { "Africa/Casablanca" , 0x000878 }, - { "Africa/Ceuta" , 0x000A6C }, - { "Africa/Conakry" , 0x000D73 }, - { "Africa/Dakar" , 0x000DDE }, - { "Africa/Dar_es_Salaam" , 0x000E44 }, - { "Africa/Djibouti" , 0x000EB1 }, - { "Africa/Douala" , 0x000F06 }, - { "Africa/El_Aaiun" , 0x000F5B }, - { "Africa/Freetown" , 0x000FC1 }, - { "Africa/Gaborone" , 0x0010D0 }, - { "Africa/Harare" , 0x00112B }, - { "Africa/Johannesburg" , 0x001180 }, - { "Africa/Juba" , 0x0011EE }, - { "Africa/Kampala" , 0x001301 }, - { "Africa/Khartoum" , 0x001380 }, - { "Africa/Kigali" , 0x001493 }, - { "Africa/Kinshasa" , 0x0014E8 }, - { "Africa/Lagos" , 0x001543 }, - { "Africa/Libreville" , 0x001598 }, - { "Africa/Lome" , 0x0015ED }, - { "Africa/Luanda" , 0x001631 }, - { "Africa/Lubumbashi" , 0x001686 }, - { "Africa/Lusaka" , 0x0016E1 }, - { "Africa/Malabo" , 0x001736 }, - { "Africa/Maputo" , 0x00179C }, - { "Africa/Maseru" , 0x0017F1 }, - { "Africa/Mbabane" , 0x001859 }, - { "Africa/Mogadishu" , 0x0018AF }, - { "Africa/Monrovia" , 0x00190A }, - { "Africa/Nairobi" , 0x001970 }, - { "Africa/Ndjamena" , 0x0019EF }, - { "Africa/Niamey" , 0x001A5B }, - { "Africa/Nouakchott" , 0x001ACE }, - { "Africa/Ouagadougou" , 0x001B39 }, - { "Africa/Porto-Novo" , 0x001B8E }, - { "Africa/Sao_Tome" , 0x001BF4 }, - { "Africa/Timbuktu" , 0x001C49 }, - { "Africa/Tripoli" , 0x001CB4 }, - { "Africa/Tunis" , 0x001DAE }, - { "Africa/Windhoek" , 0x001EC0 }, - { "America/Adak" , 0x002107 }, - { "America/Anchorage" , 0x00247D }, - { "America/Anguilla" , 0x0027F1 }, - { "America/Antigua" , 0x002846 }, - { "America/Araguaina" , 0x0028AC }, - { "America/Argentina/Buenos_Aires" , 0x002A07 }, - { "America/Argentina/Catamarca" , 0x002BB5 }, - { "America/Argentina/ComodRivadavia" , 0x002D76 }, - { "America/Argentina/Cordoba" , 0x002F1C }, - { "America/Argentina/Jujuy" , 0x0030F1 }, - { "America/Argentina/La_Rioja" , 0x0032A5 }, - { "America/Argentina/Mendoza" , 0x00345D }, - { "America/Argentina/Rio_Gallegos" , 0x00361D }, - { "America/Argentina/Salta" , 0x0037D2 }, - { "America/Argentina/San_Juan" , 0x00397E }, - { "America/Argentina/San_Luis" , 0x003B36 }, - { "America/Argentina/Tucuman" , 0x003CFC }, - { "America/Argentina/Ushuaia" , 0x003EB8 }, - { "America/Aruba" , 0x004073 }, - { "America/Asuncion" , 0x0040D9 }, - { "America/Atikokan" , 0x0043BE }, - { "America/Atka" , 0x004494 }, - { "America/Bahia" , 0x0047FA }, - { "America/Bahia_Banderas" , 0x004A8C }, - { "America/Barbados" , 0x004D05 }, - { "America/Belem" , 0x004D9F }, - { "America/Belize" , 0x004E9A }, - { "America/Blanc-Sablon" , 0x005016 }, - { "America/Boa_Vista" , 0x0050CA }, - { "America/Bogota" , 0x0051D3 }, - { "America/Boise" , 0x00523F }, - { "America/Buenos_Aires" , 0x0055D6 }, - { "America/Cambridge_Bay" , 0x00576F }, - { "America/Campo_Grande" , 0x005A97 }, - { "America/Cancun" , 0x005D86 }, - { "America/Caracas" , 0x005FC8 }, - { "America/Catamarca" , 0x00602F }, - { "America/Cayenne" , 0x0061D5 }, - { "America/Cayman" , 0x006237 }, - { "America/Chicago" , 0x00628C }, - { "America/Chihuahua" , 0x0067A3 }, - { "America/Coral_Harbour" , 0x006A0E }, - { "America/Cordoba" , 0x006AA0 }, - { "America/Costa_Rica" , 0x006C46 }, - { "America/Creston" , 0x006CD0 }, - { "America/Cuiaba" , 0x006D5C }, - { "America/Curacao" , 0x00703A }, - { "America/Danmarkshavn" , 0x0070A0 }, - { "America/Dawson" , 0x0071E4 }, - { "America/Dawson_Creek" , 0x007501 }, - { "America/Denver" , 0x0076DB }, - { "America/Detroit" , 0x007A61 }, - { "America/Dominica" , 0x007DC0 }, - { "America/Edmonton" , 0x007E15 }, - { "America/Eirunepe" , 0x0081CD }, - { "America/El_Salvador" , 0x0082E0 }, - { "America/Ensenada" , 0x008355 }, - { "America/Fort_Wayne" , 0x0087FC }, - { "America/Fortaleza" , 0x0086BE }, - { "America/Glace_Bay" , 0x008A66 }, - { "America/Godthab" , 0x008DDD }, - { "America/Goose_Bay" , 0x0090A1 }, - { "America/Grand_Turk" , 0x00955E }, - { "America/Grenada" , 0x00980D }, - { "America/Guadeloupe" , 0x009862 }, - { "America/Guatemala" , 0x0098B7 }, - { "America/Guayaquil" , 0x009940 }, - { "America/Guyana" , 0x00999D }, - { "America/Halifax" , 0x009A1E }, - { "America/Havana" , 0x009F34 }, - { "America/Hermosillo" , 0x00A2A7 }, - { "America/Indiana/Indianapolis" , 0x00A385 }, - { "America/Indiana/Knox" , 0x00A616 }, - { "America/Indiana/Marengo" , 0x00A9AD }, - { "America/Indiana/Petersburg" , 0x00AC53 }, - { "America/Indiana/Tell_City" , 0x00B1A0 }, - { "America/Indiana/Vevay" , 0x00B439 }, - { "America/Indiana/Vincennes" , 0x00B674 }, - { "America/Indiana/Winamac" , 0x00B928 }, - { "America/Indianapolis" , 0x00AF36 }, - { "America/Inuvik" , 0x00BBE1 }, - { "America/Iqaluit" , 0x00BED8 }, - { "America/Jamaica" , 0x00C1FA }, - { "America/Jujuy" , 0x00C2BF }, - { "America/Juneau" , 0x00C469 }, - { "America/Kentucky/Louisville" , 0x00C7E7 }, - { "America/Kentucky/Monticello" , 0x00CC05 }, - { "America/Knox_IN" , 0x00CF8A }, - { "America/Kralendijk" , 0x00D2FB }, - { "America/La_Paz" , 0x00D361 }, - { "America/Lima" , 0x00D3C8 }, - { "America/Los_Angeles" , 0x00D470 }, - { "America/Louisville" , 0x00D881 }, - { "America/Lower_Princes" , 0x00DC76 }, - { "America/Maceio" , 0x00DCDC }, - { "America/Managua" , 0x00DE16 }, - { "America/Manaus" , 0x00DEC9 }, - { "America/Marigot" , 0x00DFCB }, - { "America/Martinique" , 0x00E020 }, - { "America/Matamoros" , 0x00E08C }, - { "America/Mazatlan" , 0x00E2E5 }, - { "America/Mendoza" , 0x00E552 }, - { "America/Menominee" , 0x00E706 }, - { "America/Merida" , 0x00EA87 }, - { "America/Metlakatla" , 0x00ECC2 }, - { "America/Mexico_City" , 0x00EDFC }, - { "America/Miquelon" , 0x00F077 }, - { "America/Moncton" , 0x00F2E9 }, - { "America/Monterrey" , 0x00F780 }, - { "America/Montevideo" , 0x00F9E3 }, - { "America/Montreal" , 0x00FCF5 }, - { "America/Montserrat" , 0x01020B }, - { "America/Nassau" , 0x010260 }, - { "America/New_York" , 0x0105A5 }, - { "America/Nipigon" , 0x010AB0 }, - { "America/Nome" , 0x010E01 }, - { "America/Noronha" , 0x01117F }, - { "America/North_Dakota/Beulah" , 0x0112AF }, - { "America/North_Dakota/Center" , 0x011643 }, - { "America/North_Dakota/New_Salem" , 0x0119D7 }, - { "America/Ojinaga" , 0x011D80 }, - { "America/Panama" , 0x011FE1 }, - { "America/Pangnirtung" , 0x012036 }, - { "America/Paramaribo" , 0x01236C }, - { "America/Phoenix" , 0x0123FE }, - { "America/Port-au-Prince" , 0x0124AC }, - { "America/Port_of_Spain" , 0x0126D1 }, - { "America/Porto_Acre" , 0x0125D2 }, - { "America/Porto_Velho" , 0x012726 }, - { "America/Puerto_Rico" , 0x01281C }, - { "America/Rainy_River" , 0x012887 }, - { "America/Rankin_Inlet" , 0x012BBF }, - { "America/Recife" , 0x012EA5 }, - { "America/Regina" , 0x012FCF }, - { "America/Resolute" , 0x01318D }, - { "America/Rio_Branco" , 0x01347E }, - { "America/Rosario" , 0x013581 }, - { "America/Santa_Isabel" , 0x013727 }, - { "America/Santarem" , 0x013ACA }, - { "America/Santiago" , 0x013BCF }, - { "America/Santo_Domingo" , 0x013F78 }, - { "America/Sao_Paulo" , 0x01403E }, - { "America/Scoresbysund" , 0x01434D }, - { "America/Shiprock" , 0x01463B }, - { "America/Sitka" , 0x0149CA }, - { "America/St_Barthelemy" , 0x014D52 }, - { "America/St_Johns" , 0x014DA7 }, - { "America/St_Kitts" , 0x0152FA }, - { "America/St_Lucia" , 0x01534F }, - { "America/St_Thomas" , 0x0153A4 }, - { "America/St_Vincent" , 0x0153F9 }, - { "America/Swift_Current" , 0x01544E }, - { "America/Tegucigalpa" , 0x01556F }, - { "America/Thule" , 0x0155EE }, - { "America/Thunder_Bay" , 0x015835 }, - { "America/Tijuana" , 0x015B7E }, - { "America/Toronto" , 0x015F17 }, - { "America/Tortola" , 0x01642E }, - { "America/Vancouver" , 0x016483 }, - { "America/Virgin" , 0x0168C0 }, - { "America/Whitehorse" , 0x016915 }, - { "America/Winnipeg" , 0x016C32 }, - { "America/Yakutat" , 0x017072 }, - { "America/Yellowknife" , 0x0173DD }, - { "Antarctica/Casey" , 0x0176ED }, - { "Antarctica/Davis" , 0x01778A }, - { "Antarctica/DumontDUrville" , 0x01782B }, - { "Antarctica/Macquarie" , 0x0178BD }, - { "Antarctica/Mawson" , 0x017B37 }, - { "Antarctica/McMurdo" , 0x017BB3 }, - { "Antarctica/Palmer" , 0x017EB5 }, - { "Antarctica/Rothera" , 0x0181D1 }, - { "Antarctica/South_Pole" , 0x018247 }, - { "Antarctica/Syowa" , 0x01854F }, - { "Antarctica/Vostok" , 0x0185BD }, - { "Arctic/Longyearbyen" , 0x01862E }, - { "Asia/Aden" , 0x018960 }, - { "Asia/Almaty" , 0x0189B5 }, - { "Asia/Amman" , 0x018B34 }, + { "Africa/Ceuta" , 0x000A76 }, + { "Africa/Conakry" , 0x000D7D }, + { "Africa/Dakar" , 0x000DE8 }, + { "Africa/Dar_es_Salaam" , 0x000E4E }, + { "Africa/Djibouti" , 0x000EBB }, + { "Africa/Douala" , 0x000F10 }, + { "Africa/El_Aaiun" , 0x000F65 }, + { "Africa/Freetown" , 0x000FCB }, + { "Africa/Gaborone" , 0x0010DA }, + { "Africa/Harare" , 0x001135 }, + { "Africa/Johannesburg" , 0x00118A }, + { "Africa/Juba" , 0x0011F8 }, + { "Africa/Kampala" , 0x00130B }, + { "Africa/Khartoum" , 0x00138A }, + { "Africa/Kigali" , 0x00149D }, + { "Africa/Kinshasa" , 0x0014F2 }, + { "Africa/Lagos" , 0x00154D }, + { "Africa/Libreville" , 0x0015A2 }, + { "Africa/Lome" , 0x0015F7 }, + { "Africa/Luanda" , 0x00163B }, + { "Africa/Lubumbashi" , 0x001690 }, + { "Africa/Lusaka" , 0x0016EB }, + { "Africa/Malabo" , 0x001740 }, + { "Africa/Maputo" , 0x0017A6 }, + { "Africa/Maseru" , 0x0017FB }, + { "Africa/Mbabane" , 0x001863 }, + { "Africa/Mogadishu" , 0x0018B9 }, + { "Africa/Monrovia" , 0x001914 }, + { "Africa/Nairobi" , 0x00197A }, + { "Africa/Ndjamena" , 0x0019F9 }, + { "Africa/Niamey" , 0x001A65 }, + { "Africa/Nouakchott" , 0x001AD8 }, + { "Africa/Ouagadougou" , 0x001B43 }, + { "Africa/Porto-Novo" , 0x001B98 }, + { "Africa/Sao_Tome" , 0x001BFE }, + { "Africa/Timbuktu" , 0x001C53 }, + { "Africa/Tripoli" , 0x001CBE }, + { "Africa/Tunis" , 0x001DB8 }, + { "Africa/Windhoek" , 0x001ECA }, + { "America/Adak" , 0x002111 }, + { "America/Anchorage" , 0x002487 }, + { "America/Anguilla" , 0x0027FB }, + { "America/Antigua" , 0x002850 }, + { "America/Araguaina" , 0x0028B6 }, + { "America/Argentina/Buenos_Aires" , 0x002B10 }, + { "America/Argentina/Catamarca" , 0x002CBE }, + { "America/Argentina/ComodRivadavia" , 0x002E7F }, + { "America/Argentina/Cordoba" , 0x003025 }, + { "America/Argentina/Jujuy" , 0x0031FA }, + { "America/Argentina/La_Rioja" , 0x0033AE }, + { "America/Argentina/Mendoza" , 0x003566 }, + { "America/Argentina/Rio_Gallegos" , 0x003726 }, + { "America/Argentina/Salta" , 0x0038DB }, + { "America/Argentina/San_Juan" , 0x003A87 }, + { "America/Argentina/San_Luis" , 0x003C3F }, + { "America/Argentina/Tucuman" , 0x003E05 }, + { "America/Argentina/Ushuaia" , 0x003FC1 }, + { "America/Aruba" , 0x00417C }, + { "America/Asuncion" , 0x0041E2 }, + { "America/Atikokan" , 0x0044C7 }, + { "America/Atka" , 0x00459D }, + { "America/Bahia" , 0x004903 }, + { "America/Bahia_Banderas" , 0x004A96 }, + { "America/Barbados" , 0x004D0F }, + { "America/Belem" , 0x004DA9 }, + { "America/Belize" , 0x004EA4 }, + { "America/Blanc-Sablon" , 0x005020 }, + { "America/Boa_Vista" , 0x0050D4 }, + { "America/Bogota" , 0x0051DD }, + { "America/Boise" , 0x005249 }, + { "America/Buenos_Aires" , 0x0055E0 }, + { "America/Cambridge_Bay" , 0x005779 }, + { "America/Campo_Grande" , 0x005AA1 }, + { "America/Cancun" , 0x005D90 }, + { "America/Caracas" , 0x005FD2 }, + { "America/Catamarca" , 0x006039 }, + { "America/Cayenne" , 0x0061DF }, + { "America/Cayman" , 0x006241 }, + { "America/Chicago" , 0x006296 }, + { "America/Chihuahua" , 0x0067AD }, + { "America/Coral_Harbour" , 0x006A18 }, + { "America/Cordoba" , 0x006AAA }, + { "America/Costa_Rica" , 0x006C50 }, + { "America/Creston" , 0x006CDA }, + { "America/Cuiaba" , 0x006D66 }, + { "America/Curacao" , 0x007044 }, + { "America/Danmarkshavn" , 0x0070AA }, + { "America/Dawson" , 0x0071EE }, + { "America/Dawson_Creek" , 0x00750B }, + { "America/Denver" , 0x0076E5 }, + { "America/Detroit" , 0x007A6B }, + { "America/Dominica" , 0x007DCA }, + { "America/Edmonton" , 0x007E1F }, + { "America/Eirunepe" , 0x0081D7 }, + { "America/El_Salvador" , 0x0082EA }, + { "America/Ensenada" , 0x00835F }, + { "America/Fort_Wayne" , 0x008806 }, + { "America/Fortaleza" , 0x0086C8 }, + { "America/Glace_Bay" , 0x008A70 }, + { "America/Godthab" , 0x008DE7 }, + { "America/Goose_Bay" , 0x0090AB }, + { "America/Grand_Turk" , 0x009568 }, + { "America/Grenada" , 0x009817 }, + { "America/Guadeloupe" , 0x00986C }, + { "America/Guatemala" , 0x0098C1 }, + { "America/Guayaquil" , 0x00994A }, + { "America/Guyana" , 0x0099A7 }, + { "America/Halifax" , 0x009A28 }, + { "America/Havana" , 0x009F3E }, + { "America/Hermosillo" , 0x00A2B1 }, + { "America/Indiana/Indianapolis" , 0x00A38F }, + { "America/Indiana/Knox" , 0x00A620 }, + { "America/Indiana/Marengo" , 0x00A9B7 }, + { "America/Indiana/Petersburg" , 0x00AC5D }, + { "America/Indiana/Tell_City" , 0x00B1AA }, + { "America/Indiana/Vevay" , 0x00B443 }, + { "America/Indiana/Vincennes" , 0x00B67E }, + { "America/Indiana/Winamac" , 0x00B932 }, + { "America/Indianapolis" , 0x00AF40 }, + { "America/Inuvik" , 0x00BBEB }, + { "America/Iqaluit" , 0x00BEE2 }, + { "America/Jamaica" , 0x00C204 }, + { "America/Jujuy" , 0x00C2C9 }, + { "America/Juneau" , 0x00C473 }, + { "America/Kentucky/Louisville" , 0x00C7F1 }, + { "America/Kentucky/Monticello" , 0x00CC0F }, + { "America/Knox_IN" , 0x00CF94 }, + { "America/Kralendijk" , 0x00D305 }, + { "America/La_Paz" , 0x00D36B }, + { "America/Lima" , 0x00D3D2 }, + { "America/Los_Angeles" , 0x00D47A }, + { "America/Louisville" , 0x00D88B }, + { "America/Lower_Princes" , 0x00DC80 }, + { "America/Maceio" , 0x00DCE6 }, + { "America/Managua" , 0x00DE20 }, + { "America/Manaus" , 0x00DED3 }, + { "America/Marigot" , 0x00DFD5 }, + { "America/Martinique" , 0x00E02A }, + { "America/Matamoros" , 0x00E096 }, + { "America/Mazatlan" , 0x00E2EF }, + { "America/Mendoza" , 0x00E55C }, + { "America/Menominee" , 0x00E710 }, + { "America/Merida" , 0x00EA91 }, + { "America/Metlakatla" , 0x00ECCC }, + { "America/Mexico_City" , 0x00EE06 }, + { "America/Miquelon" , 0x00F081 }, + { "America/Moncton" , 0x00F2F3 }, + { "America/Monterrey" , 0x00F78A }, + { "America/Montevideo" , 0x00F9ED }, + { "America/Montreal" , 0x00FCFF }, + { "America/Montserrat" , 0x010215 }, + { "America/Nassau" , 0x01026A }, + { "America/New_York" , 0x0105AF }, + { "America/Nipigon" , 0x010ABA }, + { "America/Nome" , 0x010E0B }, + { "America/Noronha" , 0x011189 }, + { "America/North_Dakota/Beulah" , 0x0112B9 }, + { "America/North_Dakota/Center" , 0x01164D }, + { "America/North_Dakota/New_Salem" , 0x0119E1 }, + { "America/Ojinaga" , 0x011D8A }, + { "America/Panama" , 0x011FEB }, + { "America/Pangnirtung" , 0x012040 }, + { "America/Paramaribo" , 0x012376 }, + { "America/Phoenix" , 0x012408 }, + { "America/Port-au-Prince" , 0x0124B6 }, + { "America/Port_of_Spain" , 0x0126DB }, + { "America/Porto_Acre" , 0x0125DC }, + { "America/Porto_Velho" , 0x012730 }, + { "America/Puerto_Rico" , 0x012826 }, + { "America/Rainy_River" , 0x012891 }, + { "America/Rankin_Inlet" , 0x012BC9 }, + { "America/Recife" , 0x012EAF }, + { "America/Regina" , 0x012FD9 }, + { "America/Resolute" , 0x013197 }, + { "America/Rio_Branco" , 0x013488 }, + { "America/Rosario" , 0x01358B }, + { "America/Santa_Isabel" , 0x013731 }, + { "America/Santarem" , 0x013AD4 }, + { "America/Santiago" , 0x013BD9 }, + { "America/Santo_Domingo" , 0x013F82 }, + { "America/Sao_Paulo" , 0x014048 }, + { "America/Scoresbysund" , 0x014357 }, + { "America/Shiprock" , 0x014645 }, + { "America/Sitka" , 0x0149D4 }, + { "America/St_Barthelemy" , 0x014D5C }, + { "America/St_Johns" , 0x014DB1 }, + { "America/St_Kitts" , 0x015304 }, + { "America/St_Lucia" , 0x015359 }, + { "America/St_Thomas" , 0x0153AE }, + { "America/St_Vincent" , 0x015403 }, + { "America/Swift_Current" , 0x015458 }, + { "America/Tegucigalpa" , 0x015579 }, + { "America/Thule" , 0x0155F8 }, + { "America/Thunder_Bay" , 0x01583F }, + { "America/Tijuana" , 0x015B88 }, + { "America/Toronto" , 0x015F21 }, + { "America/Tortola" , 0x016438 }, + { "America/Vancouver" , 0x01648D }, + { "America/Virgin" , 0x0168CA }, + { "America/Whitehorse" , 0x01691F }, + { "America/Winnipeg" , 0x016C3C }, + { "America/Yakutat" , 0x01707C }, + { "America/Yellowknife" , 0x0173E7 }, + { "Antarctica/Casey" , 0x0176F7 }, + { "Antarctica/Davis" , 0x017794 }, + { "Antarctica/DumontDUrville" , 0x017835 }, + { "Antarctica/Macquarie" , 0x0178C7 }, + { "Antarctica/Mawson" , 0x017B41 }, + { "Antarctica/McMurdo" , 0x017BBD }, + { "Antarctica/Palmer" , 0x017EBF }, + { "Antarctica/Rothera" , 0x0181DB }, + { "Antarctica/South_Pole" , 0x018251 }, + { "Antarctica/Syowa" , 0x018559 }, + { "Antarctica/Vostok" , 0x0185C7 }, + { "Arctic/Longyearbyen" , 0x018638 }, + { "Asia/Aden" , 0x01896A }, + { "Asia/Almaty" , 0x0189BF }, + { "Asia/Amman" , 0x018B3E }, { "Asia/Anadyr" , 0x018DF4 }, { "Asia/Aqtau" , 0x018FD9 }, { "Asia/Aqtobe" , 0x0191D8 }, @@ -507,77 +507,77 @@ { "NZ" , 0x038F10 }, { "NZ-CHAT" , 0x03928E }, { "Pacific/Apia" , 0x039576 }, - { "Pacific/Auckland" , 0x039613 }, - { "Pacific/Chatham" , 0x03999F }, - { "Pacific/Chuuk" , 0x039C96 }, - { "Pacific/Easter" , 0x039CEF }, - { "Pacific/Efate" , 0x03A04D }, - { "Pacific/Enderbury" , 0x03A113 }, - { "Pacific/Fakaofo" , 0x03A181 }, - { "Pacific/Fiji" , 0x03A1D2 }, - { "Pacific/Funafuti" , 0x03A266 }, - { "Pacific/Galapagos" , 0x03A2AA }, - { "Pacific/Gambier" , 0x03A322 }, - { "Pacific/Guadalcanal" , 0x03A387 }, - { "Pacific/Guam" , 0x03A3DC }, - { "Pacific/Honolulu" , 0x03A432 }, - { "Pacific/Johnston" , 0x03A4A9 }, - { "Pacific/Kiritimati" , 0x03A4FB }, - { "Pacific/Kosrae" , 0x03A566 }, - { "Pacific/Kwajalein" , 0x03A5C3 }, - { "Pacific/Majuro" , 0x03A62F }, - { "Pacific/Marquesas" , 0x03A68E }, - { "Pacific/Midway" , 0x03A6F5 }, - { "Pacific/Nauru" , 0x03A77F }, - { "Pacific/Niue" , 0x03A7F7 }, - { "Pacific/Norfolk" , 0x03A855 }, - { "Pacific/Noumea" , 0x03A8AA }, - { "Pacific/Pago_Pago" , 0x03A93A }, - { "Pacific/Palau" , 0x03A9C3 }, - { "Pacific/Pitcairn" , 0x03AA07 }, - { "Pacific/Pohnpei" , 0x03AA5C }, - { "Pacific/Ponape" , 0x03AAB1 }, - { "Pacific/Port_Moresby" , 0x03AAF6 }, - { "Pacific/Rarotonga" , 0x03AB3A }, - { "Pacific/Saipan" , 0x03AC16 }, - { "Pacific/Samoa" , 0x03AC79 }, - { "Pacific/Tahiti" , 0x03AD02 }, - { "Pacific/Tarawa" , 0x03AD67 }, - { "Pacific/Tongatapu" , 0x03ADBB }, - { "Pacific/Truk" , 0x03AE47 }, - { "Pacific/Wake" , 0x03AE8C }, - { "Pacific/Wallis" , 0x03AEDC }, - { "Pacific/Yap" , 0x03AF20 }, - { "Poland" , 0x03AF65 }, - { "Portugal" , 0x03B346 }, - { "PRC" , 0x03B842 }, - { "PST8PDT" , 0x03B8F3 }, - { "ROC" , 0x03BC44 }, - { "ROK" , 0x03BD5C }, - { "Singapore" , 0x03BE00 }, - { "Turkey" , 0x03BEB7 }, - { "UCT" , 0x03C2A4 }, - { "Universal" , 0x03C2E8 }, - { "US/Alaska" , 0x03C32C }, - { "US/Aleutian" , 0x03C695 }, - { "US/Arizona" , 0x03C9FB }, - { "US/Central" , 0x03CA89 }, - { "US/East-Indiana" , 0x03D493 }, - { "US/Eastern" , 0x03CF94 }, - { "US/Hawaii" , 0x03D6FD }, - { "US/Indiana-Starke" , 0x03D76E }, - { "US/Michigan" , 0x03DADF }, - { "US/Mountain" , 0x03DE16 }, - { "US/Pacific" , 0x03E18F }, - { "US/Pacific-New" , 0x03E594 }, - { "US/Samoa" , 0x03E999 }, - { "UTC" , 0x03EA22 }, - { "W-SU" , 0x03ED19 }, - { "WET" , 0x03EA66 }, - { "Zulu" , 0x03EF53 }, + { "Pacific/Auckland" , 0x039712 }, + { "Pacific/Chatham" , 0x039A9E }, + { "Pacific/Chuuk" , 0x039D95 }, + { "Pacific/Easter" , 0x039DEE }, + { "Pacific/Efate" , 0x03A14C }, + { "Pacific/Enderbury" , 0x03A212 }, + { "Pacific/Fakaofo" , 0x03A280 }, + { "Pacific/Fiji" , 0x03A2D1 }, + { "Pacific/Funafuti" , 0x03A464 }, + { "Pacific/Galapagos" , 0x03A4A8 }, + { "Pacific/Gambier" , 0x03A520 }, + { "Pacific/Guadalcanal" , 0x03A585 }, + { "Pacific/Guam" , 0x03A5DA }, + { "Pacific/Honolulu" , 0x03A630 }, + { "Pacific/Johnston" , 0x03A6A7 }, + { "Pacific/Kiritimati" , 0x03A6F9 }, + { "Pacific/Kosrae" , 0x03A764 }, + { "Pacific/Kwajalein" , 0x03A7C1 }, + { "Pacific/Majuro" , 0x03A82D }, + { "Pacific/Marquesas" , 0x03A88C }, + { "Pacific/Midway" , 0x03A8F3 }, + { "Pacific/Nauru" , 0x03A97D }, + { "Pacific/Niue" , 0x03A9F5 }, + { "Pacific/Norfolk" , 0x03AA53 }, + { "Pacific/Noumea" , 0x03AAA8 }, + { "Pacific/Pago_Pago" , 0x03AB38 }, + { "Pacific/Palau" , 0x03ABC1 }, + { "Pacific/Pitcairn" , 0x03AC05 }, + { "Pacific/Pohnpei" , 0x03AC5A }, + { "Pacific/Ponape" , 0x03ACAF }, + { "Pacific/Port_Moresby" , 0x03ACF4 }, + { "Pacific/Rarotonga" , 0x03AD38 }, + { "Pacific/Saipan" , 0x03AE14 }, + { "Pacific/Samoa" , 0x03AE77 }, + { "Pacific/Tahiti" , 0x03AF00 }, + { "Pacific/Tarawa" , 0x03AF65 }, + { "Pacific/Tongatapu" , 0x03AFB9 }, + { "Pacific/Truk" , 0x03B045 }, + { "Pacific/Wake" , 0x03B08A }, + { "Pacific/Wallis" , 0x03B0DA }, + { "Pacific/Yap" , 0x03B11E }, + { "Poland" , 0x03B163 }, + { "Portugal" , 0x03B544 }, + { "PRC" , 0x03BA40 }, + { "PST8PDT" , 0x03BAF1 }, + { "ROC" , 0x03BE42 }, + { "ROK" , 0x03BF5A }, + { "Singapore" , 0x03BFFE }, + { "Turkey" , 0x03C0B5 }, + { "UCT" , 0x03C4A2 }, + { "Universal" , 0x03C4E6 }, + { "US/Alaska" , 0x03C52A }, + { "US/Aleutian" , 0x03C893 }, + { "US/Arizona" , 0x03CBF9 }, + { "US/Central" , 0x03CC87 }, + { "US/East-Indiana" , 0x03D691 }, + { "US/Eastern" , 0x03D192 }, + { "US/Hawaii" , 0x03D8FB }, + { "US/Indiana-Starke" , 0x03D96C }, + { "US/Michigan" , 0x03DCDD }, + { "US/Mountain" , 0x03E014 }, + { "US/Pacific" , 0x03E38D }, + { "US/Pacific-New" , 0x03E792 }, + { "US/Samoa" , 0x03EB97 }, + { "UTC" , 0x03EC20 }, + { "W-SU" , 0x03EF17 }, + { "WET" , 0x03EC64 }, + { "Zulu" , 0x03F151 }, }; /* This is a generated file, do not modify */ -const unsigned char timelib_timezone_db_data_builtin[257943] = { +const unsigned char timelib_timezone_db_data_builtin[258453] = { /* Africa/Abidjan */ @@ -755,36 +755,36 @@ /* Africa/Casablanca */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0x51, 0xF9, 0x9C, +0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0x51, 0xF9, 0x9C, 0xC6, 0xFF, 0x14, 0x80, 0xC7, 0x58, 0xAC, 0x70, 0xC7, 0xD9, 0xED, 0x80, 0xD2, 0xA1, 0x32, 0xF0, 0xDB, 0x35, 0xA4, 0x00, 0xDB, 0xEE, 0x27, 0xF0, 0xFB, 0x25, 0x72, 0x40, 0xFB, 0xC2, 0xEF, 0x70, 0x08, 0x6B, 0x84, 0x80, 0x08, 0xC6, 0x6D, 0xF0, 0x0B, 0xE8, 0x0C, 0x00, 0x0C, 0x61, 0x47, 0xF0, 0x0D, 0xC9, 0x3F, 0x80, 0x0E, 0x8E, 0xF2, 0x70, 0x0F, 0xD3, 0x51, 0x80, 0x10, 0x27, 0xA3, 0x70, 0x1A, 0xB7, 0xA6, 0x00, 0x1E, 0x18, 0x6F, 0xF0, 0x48, 0x41, 0xE6, 0x80, 0x48, 0xBB, 0x22, 0x70, 0x4A, 0x23, 0x1A, 0x00, 0x4A, 0x8D, 0xD5, 0x70, 0x4B, 0xDC, 0xC0, 0x80, 0x4C, 0x5D, 0xE5, 0x70, -0x4D, 0x97, 0xB8, 0x80, 0x4E, 0x34, 0x8C, 0xF0, 0x4F, 0x9C, 0xA0, 0xA0, 0x50, 0x67, 0xA7, 0xA0, -0x51, 0x7C, 0x82, 0xA0, 0x52, 0x47, 0x89, 0xA0, 0x53, 0x5C, 0x64, 0xA0, 0x54, 0x27, 0x6B, 0xA0, -0x55, 0x3C, 0x46, 0xA0, 0x56, 0x07, 0x4D, 0xA0, 0x57, 0x1C, 0x28, 0xA0, 0x57, 0xE7, 0x2F, 0xA0, -0x59, 0x05, 0x45, 0x20, 0x59, 0xC7, 0x11, 0xA0, 0x5A, 0xE5, 0x27, 0x20, 0x5B, 0xB0, 0x2E, 0x20, -0x5C, 0xC5, 0x09, 0x20, 0x5D, 0x90, 0x10, 0x20, 0x5E, 0xA4, 0xEB, 0x20, 0x5F, 0x6F, 0xF2, 0x20, -0x60, 0x84, 0xCD, 0x20, 0x61, 0x4F, 0xD4, 0x20, 0x62, 0x64, 0xAF, 0x20, 0x63, 0x2F, 0xB6, 0x20, -0x64, 0x4D, 0xCB, 0xA0, 0x65, 0x0F, 0x98, 0x20, 0x66, 0x2D, 0xAD, 0xA0, 0x66, 0xF8, 0xB4, 0xA0, -0x68, 0x0D, 0x8F, 0xA0, 0x68, 0xD8, 0x96, 0xA0, 0x69, 0xED, 0x71, 0xA0, 0x6A, 0xB8, 0x78, 0xA0, -0x6B, 0xCD, 0x53, 0xA0, 0x6C, 0x98, 0x5A, 0xA0, 0x6D, 0xB6, 0x70, 0x20, 0x6E, 0x78, 0x3C, 0xA0, -0x6F, 0x96, 0x52, 0x20, 0x70, 0x61, 0x59, 0x20, 0x71, 0x76, 0x34, 0x20, 0x72, 0x41, 0x3B, 0x20, -0x73, 0x56, 0x16, 0x20, 0x74, 0x21, 0x1D, 0x20, 0x75, 0x35, 0xF8, 0x20, 0x76, 0x00, 0xFF, 0x20, -0x77, 0x15, 0xDA, 0x20, 0x77, 0xE0, 0xE1, 0x20, 0x78, 0xFE, 0xF6, 0xA0, 0x79, 0xC0, 0xC3, 0x20, -0x7A, 0xDE, 0xD8, 0xA0, 0x7B, 0xA9, 0xDF, 0xA0, 0x7C, 0xBE, 0xBA, 0xA0, 0x7D, 0x89, 0xC1, 0xA0, -0x7E, 0x9E, 0x9C, 0xA0, 0x7F, 0x69, 0xA3, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x4D, 0x97, 0xB8, 0x80, 0x4E, 0x34, 0x8C, 0xF0, 0x4F, 0x9C, 0xA0, 0xA0, 0x50, 0x08, 0xBB, 0xA0, +0x50, 0x31, 0x9A, 0x20, 0x50, 0x67, 0xA7, 0xA0, 0x51, 0x7C, 0x82, 0xA0, 0x52, 0x47, 0x89, 0xA0, +0x53, 0x5C, 0x64, 0xA0, 0x54, 0x27, 0x6B, 0xA0, 0x55, 0x3C, 0x46, 0xA0, 0x56, 0x07, 0x4D, 0xA0, +0x57, 0x1C, 0x28, 0xA0, 0x57, 0xE7, 0x2F, 0xA0, 0x59, 0x05, 0x45, 0x20, 0x59, 0xC7, 0x11, 0xA0, +0x5A, 0xE5, 0x27, 0x20, 0x5B, 0xB0, 0x2E, 0x20, 0x5C, 0xC5, 0x09, 0x20, 0x5D, 0x90, 0x10, 0x20, +0x5E, 0xA4, 0xEB, 0x20, 0x5F, 0x6F, 0xF2, 0x20, 0x60, 0x84, 0xCD, 0x20, 0x61, 0x4F, 0xD4, 0x20, +0x62, 0x64, 0xAF, 0x20, 0x63, 0x2F, 0xB6, 0x20, 0x64, 0x4D, 0xCB, 0xA0, 0x65, 0x0F, 0x98, 0x20, +0x66, 0x2D, 0xAD, 0xA0, 0x66, 0xF8, 0xB4, 0xA0, 0x68, 0x0D, 0x8F, 0xA0, 0x68, 0xD8, 0x96, 0xA0, +0x69, 0xED, 0x71, 0xA0, 0x6A, 0xB8, 0x78, 0xA0, 0x6B, 0xCD, 0x53, 0xA0, 0x6C, 0x98, 0x5A, 0xA0, +0x6D, 0xB6, 0x70, 0x20, 0x6E, 0x78, 0x3C, 0xA0, 0x6F, 0x96, 0x52, 0x20, 0x70, 0x61, 0x59, 0x20, +0x71, 0x76, 0x34, 0x20, 0x72, 0x41, 0x3B, 0x20, 0x73, 0x56, 0x16, 0x20, 0x74, 0x21, 0x1D, 0x20, +0x75, 0x35, 0xF8, 0x20, 0x76, 0x00, 0xFF, 0x20, 0x77, 0x15, 0xDA, 0x20, 0x77, 0xE0, 0xE1, 0x20, +0x78, 0xFE, 0xF6, 0xA0, 0x79, 0xC0, 0xC3, 0x20, 0x7A, 0xDE, 0xD8, 0xA0, 0x7B, 0xA9, 0xDF, 0xA0, +0x7C, 0xBE, 0xBA, 0xA0, 0x7D, 0x89, 0xC1, 0xA0, 0x7E, 0x9E, 0x9C, 0xA0, 0x7F, 0x69, 0xA3, 0xA0, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x03, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xF8, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x0E, -0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x4C, -0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBC, 0xAC, 0xC8, 0x01, 0x07, 0x16, 0x42, -0x00, 0x00, 0x00, 0x00, +0x02, 0xFF, 0xFF, 0xF8, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, +0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, +0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xBC, 0xAC, 0xC8, 0x01, 0x07, 0x16, 0x42, 0x00, 0x00, 0x00, 0x00, /* Africa/Ceuta */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1382,7 +1382,7 @@ /* America/Araguaina */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x30, +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x30, 0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, 0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, @@ -1395,13 +1395,29 @@ 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, 0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, +0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x52, 0x63, 0x47, 0x30, 0x53, 0x00, 0x1B, 0xA0, +0x54, 0x43, 0x29, 0x30, 0x54, 0xE9, 0x38, 0x20, 0x56, 0x23, 0x0B, 0x30, 0x56, 0xC9, 0x1A, 0x20, +0x58, 0x02, 0xED, 0x30, 0x58, 0xA8, 0xFC, 0x20, 0x59, 0xE2, 0xCF, 0x30, 0x5A, 0x88, 0xDE, 0x20, +0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x68, 0xC0, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, 0x5E, 0x48, 0xA2, 0x20, +0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x31, 0xBE, 0xA0, 0x61, 0x6B, 0x91, 0xB0, 0x62, 0x11, 0xA0, 0xA0, +0x63, 0x4B, 0x73, 0xB0, 0x63, 0xFA, 0xBD, 0x20, 0x65, 0x2B, 0x55, 0xB0, 0x65, 0xD1, 0x64, 0xA0, +0x67, 0x14, 0x72, 0x30, 0x67, 0xB1, 0x46, 0xA0, 0x68, 0xF4, 0x54, 0x30, 0x69, 0x9A, 0x63, 0x20, +0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x7A, 0x45, 0x20, 0x6C, 0xB4, 0x18, 0x30, 0x6D, 0x5A, 0x27, 0x20, +0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x3A, 0x09, 0x20, 0x70, 0x7D, 0x16, 0xB0, 0x71, 0x19, 0xEB, 0x20, +0x72, 0x5C, 0xF8, 0xB0, 0x72, 0xF9, 0xCD, 0x20, 0x74, 0x3C, 0xDA, 0xB0, 0x74, 0xD9, 0xAF, 0x20, +0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xC2, 0xCB, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, 0x78, 0xAB, 0xE8, 0x20, +0x79, 0xDC, 0x80, 0xB0, 0x7A, 0x82, 0x8F, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, 0x7C, 0x62, 0x71, 0xA0, +0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x4B, 0x8E, 0x20, 0x7F, 0x85, 0x61, 0x30, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0xFF, 0xFF, 0xD2, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, -0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x57, 0xC0, 0x00, 0xC9, 0x1C, 0x60, 0x00, 0x00, -0x00, 0x09, 0x54, 0x6F, 0x63, 0x61, 0x6E, 0x74, 0x69, 0x6E, 0x73, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0xFF, 0xFF, 0xD2, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, +0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x57, 0xC0, 0x00, 0xC9, 0x1C, 0x60, 0x00, 0x00, 0x00, +0x09, 0x54, 0x6F, 0x63, 0x61, 0x6E, 0x74, 0x69, 0x6E, 0x73, /* America/Argentina/Buenos_Aires */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1929,7 +1945,7 @@ /* America/Bahia */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x6B, 0x1C, +0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x6B, 0x1C, 0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, 0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, @@ -1945,30 +1961,14 @@ 0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, 0x4F, 0x49, 0x92, 0x20, -0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x52, 0x63, 0x47, 0x30, 0x53, 0x00, 0x1B, 0xA0, -0x54, 0x43, 0x29, 0x30, 0x54, 0xE9, 0x38, 0x20, 0x56, 0x23, 0x0B, 0x30, 0x56, 0xC9, 0x1A, 0x20, -0x58, 0x02, 0xED, 0x30, 0x58, 0xA8, 0xFC, 0x20, 0x59, 0xE2, 0xCF, 0x30, 0x5A, 0x88, 0xDE, 0x20, -0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x68, 0xC0, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, 0x5E, 0x48, 0xA2, 0x20, -0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x31, 0xBE, 0xA0, 0x61, 0x6B, 0x91, 0xB0, 0x62, 0x11, 0xA0, 0xA0, -0x63, 0x4B, 0x73, 0xB0, 0x63, 0xFA, 0xBD, 0x20, 0x65, 0x2B, 0x55, 0xB0, 0x65, 0xD1, 0x64, 0xA0, -0x67, 0x14, 0x72, 0x30, 0x67, 0xB1, 0x46, 0xA0, 0x68, 0xF4, 0x54, 0x30, 0x69, 0x9A, 0x63, 0x20, -0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x7A, 0x45, 0x20, 0x6C, 0xB4, 0x18, 0x30, 0x6D, 0x5A, 0x27, 0x20, -0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x3A, 0x09, 0x20, 0x70, 0x7D, 0x16, 0xB0, 0x71, 0x19, 0xEB, 0x20, -0x72, 0x5C, 0xF8, 0xB0, 0x72, 0xF9, 0xCD, 0x20, 0x74, 0x3C, 0xDA, 0xB0, 0x74, 0xD9, 0xAF, 0x20, -0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xC2, 0xCB, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, 0x78, 0xAB, 0xE8, 0x20, -0x79, 0xDC, 0x80, 0xB0, 0x7A, 0x82, 0x8F, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, 0x7C, 0x62, 0x71, 0xA0, -0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x4B, 0x8E, 0x20, 0x7F, 0x85, 0x61, 0x30, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xDB, 0xE4, -0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, -0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x75, 0x84, 0xA2, 0x00, 0xD7, 0xE2, 0xED, 0x00, 0x00, 0x00, 0x05, 0x42, 0x61, 0x68, -0x69, 0x61, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xDB, +0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, +0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x75, 0x84, 0xA2, 0x00, 0xD7, 0xE2, 0xED, 0x00, 0x00, 0x00, 0x05, 0x42, 0x61, +0x68, 0x69, 0x61, /* America/Bahia_Banderas */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -7498,7 +7498,7 @@ /* Asia/Amman */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA3, 0xD6, 0xD0, +0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA3, 0xD6, 0xD0, 0x06, 0x72, 0x79, 0xE0, 0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0, 0x0A, 0x05, 0x6A, 0xE0, 0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xDA, 0x75, 0xD0, 0x0D, 0xC9, 0x23, 0x60, 0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0, @@ -7515,32 +7515,31 @@ 0x42, 0x4C, 0x72, 0xE0, 0x43, 0x3C, 0x63, 0xE0, 0x44, 0x2C, 0x54, 0xE0, 0x45, 0x41, 0x2F, 0xE0, 0x46, 0x0C, 0x36, 0xE0, 0x47, 0x21, 0x11, 0xE0, 0x47, 0xEC, 0x18, 0xE0, 0x49, 0x0A, 0x2E, 0x60, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xEA, 0x10, 0x60, 0x4B, 0xAB, 0xDC, 0xE0, 0x4C, 0xC9, 0xF2, 0x60, -0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x89, 0xB6, 0x60, -0x51, 0x54, 0xBD, 0x60, 0x52, 0x69, 0x98, 0x60, 0x53, 0x34, 0x9F, 0x60, 0x54, 0x52, 0xB4, 0xE0, -0x55, 0x14, 0x81, 0x60, 0x56, 0x32, 0x96, 0xE0, 0x56, 0xFD, 0x9D, 0xE0, 0x58, 0x12, 0x78, 0xE0, -0x58, 0xDD, 0x7F, 0xE0, 0x59, 0xF2, 0x5A, 0xE0, 0x5A, 0xBD, 0x61, 0xE0, 0x5B, 0xD2, 0x3C, 0xE0, -0x5C, 0x9D, 0x43, 0xE0, 0x5D, 0xB2, 0x1E, 0xE0, 0x5E, 0x7D, 0x25, 0xE0, 0x5F, 0x9B, 0x3B, 0x60, -0x60, 0x5D, 0x07, 0xE0, 0x61, 0x7B, 0x1D, 0x60, 0x62, 0x46, 0x24, 0x60, 0x63, 0x5A, 0xFF, 0x60, -0x64, 0x26, 0x06, 0x60, 0x65, 0x3A, 0xE1, 0x60, 0x66, 0x05, 0xE8, 0x60, 0x67, 0x1A, 0xC3, 0x60, -0x67, 0xE5, 0xCA, 0x60, 0x69, 0x03, 0xDF, 0xE0, 0x69, 0xC5, 0xAC, 0x60, 0x6A, 0xE3, 0xC1, 0xE0, -0x6B, 0xA5, 0x8E, 0x60, 0x6C, 0xC3, 0xA3, 0xE0, 0x6D, 0x8E, 0xAA, 0xE0, 0x6E, 0xA3, 0x85, 0xE0, -0x6F, 0x6E, 0x8C, 0xE0, 0x70, 0x83, 0x67, 0xE0, 0x71, 0x4E, 0x6E, 0xE0, 0x72, 0x63, 0x49, 0xE0, -0x73, 0x2E, 0x50, 0xE0, 0x74, 0x4C, 0x66, 0x60, 0x75, 0x0E, 0x32, 0xE0, 0x76, 0x2C, 0x48, 0x60, -0x76, 0xF7, 0x4F, 0x60, 0x78, 0x0C, 0x2A, 0x60, 0x78, 0xD7, 0x31, 0x60, 0x79, 0xEC, 0x0C, 0x60, -0x7A, 0xB7, 0x13, 0x60, 0x7B, 0xCB, 0xEE, 0x60, 0x7C, 0x96, 0xF5, 0x60, 0x7D, 0xB5, 0x0A, 0xE0, -0x7E, 0x76, 0xD7, 0x60, 0x7F, 0x94, 0xEC, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x52, 0x69, 0x98, 0x60, +0x53, 0x34, 0x9F, 0x60, 0x54, 0x52, 0xB4, 0xE0, 0x55, 0x14, 0x81, 0x60, 0x56, 0x32, 0x96, 0xE0, +0x56, 0xFD, 0x9D, 0xE0, 0x58, 0x12, 0x78, 0xE0, 0x58, 0xDD, 0x7F, 0xE0, 0x59, 0xF2, 0x5A, 0xE0, +0x5A, 0xBD, 0x61, 0xE0, 0x5B, 0xD2, 0x3C, 0xE0, 0x5C, 0x9D, 0x43, 0xE0, 0x5D, 0xB2, 0x1E, 0xE0, +0x5E, 0x7D, 0x25, 0xE0, 0x5F, 0x9B, 0x3B, 0x60, 0x60, 0x5D, 0x07, 0xE0, 0x61, 0x7B, 0x1D, 0x60, +0x62, 0x46, 0x24, 0x60, 0x63, 0x5A, 0xFF, 0x60, 0x64, 0x26, 0x06, 0x60, 0x65, 0x3A, 0xE1, 0x60, +0x66, 0x05, 0xE8, 0x60, 0x67, 0x1A, 0xC3, 0x60, 0x67, 0xE5, 0xCA, 0x60, 0x69, 0x03, 0xDF, 0xE0, +0x69, 0xC5, 0xAC, 0x60, 0x6A, 0xE3, 0xC1, 0xE0, 0x6B, 0xA5, 0x8E, 0x60, 0x6C, 0xC3, 0xA3, 0xE0, +0x6D, 0x8E, 0xAA, 0xE0, 0x6E, 0xA3, 0x85, 0xE0, 0x6F, 0x6E, 0x8C, 0xE0, 0x70, 0x83, 0x67, 0xE0, +0x71, 0x4E, 0x6E, 0xE0, 0x72, 0x63, 0x49, 0xE0, 0x73, 0x2E, 0x50, 0xE0, 0x74, 0x4C, 0x66, 0x60, +0x75, 0x0E, 0x32, 0xE0, 0x76, 0x2C, 0x48, 0x60, 0x76, 0xF7, 0x4F, 0x60, 0x78, 0x0C, 0x2A, 0x60, +0x78, 0xD7, 0x31, 0x60, 0x79, 0xEC, 0x0C, 0x60, 0x7A, 0xB7, 0x13, 0x60, 0x7B, 0xCB, 0xEE, 0x60, +0x7C, 0x96, 0xF5, 0x60, 0x7D, 0xB5, 0x0A, 0xE0, 0x7E, 0x76, 0xD7, 0x60, 0x7F, 0x94, 0xEC, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x00, -0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49, 0x7C, 0xF5, 0x00, 0x00, 0x00, 0x00, - +0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, +0x03, 0x01, 0x03, 0x01, 0x03, 0x00, 0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, +0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, +0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49, +0x7C, 0xF5, 0x00, 0x00, 0x00, 0x00, /* Asia/Anadyr */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -8085,7 +8084,7 @@ 0x45, 0x12, 0xFD, 0x50, 0x46, 0x0E, 0xD9, 0xE0, 0x46, 0xE8, 0x6F, 0x70, 0x47, 0xF1, 0x5E, 0xE0, 0x48, 0xB7, 0x11, 0xD0, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xA0, 0x4A, 0x70, 0x4B, 0xAD, 0x2E, 0x9C, 0x4C, 0x61, 0xBD, 0xD0, 0x4D, 0x96, 0xF3, 0xDC, 0x4E, 0x35, 0xC2, 0x50, 0x4F, 0x74, 0xDB, 0x60, -0x50, 0x64, 0xBE, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, +0x50, 0x5B, 0x91, 0xE0, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, @@ -8142,7 +8141,7 @@ 0x45, 0x12, 0xFD, 0x50, 0x46, 0x0E, 0xD9, 0xE0, 0x46, 0xE8, 0x6F, 0x70, 0x47, 0xF1, 0x5E, 0xE0, 0x48, 0xBB, 0x06, 0x50, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xA0, 0x4A, 0x70, 0x4B, 0xAD, 0x2E, 0x9C, 0x4C, 0x61, 0xBD, 0xD0, 0x4D, 0x95, 0xA2, 0x5C, 0x4E, 0x35, 0xC2, 0x50, 0x4E, 0x5C, 0x0B, 0xE0, -0x4E, 0x85, 0x06, 0x80, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x64, 0xE8, 0x80, 0x00, 0x01, 0x00, 0x01, +0x4E, 0x85, 0x06, 0x80, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x5B, 0x91, 0xE0, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, @@ -8373,19 +8372,19 @@ 0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, 0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00, -0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80, -0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00, -0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, +0x52, 0x50, 0x99, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x30, 0x7B, 0xF0, 0x55, 0x14, 0x9D, 0x80, +0x56, 0x10, 0x5D, 0xF0, 0x56, 0xF4, 0x7F, 0x80, 0x57, 0xF0, 0x3F, 0xF0, 0x58, 0xD4, 0x61, 0x80, +0x59, 0xD9, 0x5C, 0x70, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xB9, 0x3E, 0x70, 0x5C, 0x9D, 0x60, 0x00, +0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x79, 0x02, 0x70, 0x60, 0x5D, 0x24, 0x00, +0x61, 0x58, 0xE4, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x1C, 0xE8, 0x00, +0x65, 0x21, 0xE2, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, +0x68, 0xE1, 0xA6, 0xF0, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xC1, 0x88, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, +0x6C, 0xA2, 0xBC, 0x70, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0x8A, 0x87, 0x70, 0x6F, 0x65, 0x6E, 0x80, +0x70, 0x6A, 0x69, 0x70, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, +0x74, 0x2A, 0x2D, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x0A, 0x0F, 0x70, 0x76, 0xEE, 0x31, 0x00, +0x77, 0xE9, 0xF1, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xD3, 0x0D, 0xF0, 0x7A, 0xAD, 0xF5, 0x00, +0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x92, 0xD1, 0xF0, 0x7E, 0x76, 0xF3, 0x80, +0x7F, 0x72, 0xB3, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, @@ -9205,19 +9204,19 @@ 0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, 0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00, -0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80, -0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00, -0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, +0x52, 0x50, 0x99, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x30, 0x7B, 0xF0, 0x55, 0x14, 0x9D, 0x80, +0x56, 0x10, 0x5D, 0xF0, 0x56, 0xF4, 0x7F, 0x80, 0x57, 0xF0, 0x3F, 0xF0, 0x58, 0xD4, 0x61, 0x80, +0x59, 0xD9, 0x5C, 0x70, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xB9, 0x3E, 0x70, 0x5C, 0x9D, 0x60, 0x00, +0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x79, 0x02, 0x70, 0x60, 0x5D, 0x24, 0x00, +0x61, 0x58, 0xE4, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x1C, 0xE8, 0x00, +0x65, 0x21, 0xE2, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, +0x68, 0xE1, 0xA6, 0xF0, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xC1, 0x88, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, +0x6C, 0xA2, 0xBC, 0x70, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0x8A, 0x87, 0x70, 0x6F, 0x65, 0x6E, 0x80, +0x70, 0x6A, 0x69, 0x70, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, +0x74, 0x2A, 0x2D, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x0A, 0x0F, 0x70, 0x76, 0xEE, 0x31, 0x00, +0x77, 0xE9, 0xF1, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xD3, 0x0D, 0xF0, 0x7A, 0xAD, 0xF5, 0x00, +0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x92, 0xD1, 0xF0, 0x7E, 0x76, 0xF3, 0x80, +0x7F, 0x72, 0xB3, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, @@ -16062,19 +16061,19 @@ 0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, 0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00, -0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80, -0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00, -0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, +0x52, 0x50, 0x99, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x30, 0x7B, 0xF0, 0x55, 0x14, 0x9D, 0x80, +0x56, 0x10, 0x5D, 0xF0, 0x56, 0xF4, 0x7F, 0x80, 0x57, 0xF0, 0x3F, 0xF0, 0x58, 0xD4, 0x61, 0x80, +0x59, 0xD9, 0x5C, 0x70, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xB9, 0x3E, 0x70, 0x5C, 0x9D, 0x60, 0x00, +0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x79, 0x02, 0x70, 0x60, 0x5D, 0x24, 0x00, +0x61, 0x58, 0xE4, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x1C, 0xE8, 0x00, +0x65, 0x21, 0xE2, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, +0x68, 0xE1, 0xA6, 0xF0, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xC1, 0x88, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, +0x6C, 0xA2, 0xBC, 0x70, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0x8A, 0x87, 0x70, 0x6F, 0x65, 0x6E, 0x80, +0x70, 0x6A, 0x69, 0x70, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, +0x74, 0x2A, 0x2D, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x0A, 0x0F, 0x70, 0x76, 0xEE, 0x31, 0x00, +0x77, 0xE9, 0xF1, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xD3, 0x0D, 0xF0, 0x7A, 0xAD, 0xF5, 0x00, +0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x92, 0xD1, 0xF0, 0x7E, 0x76, 0xF3, 0x80, +0x7F, 0x72, 0xB3, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, @@ -16559,14 +16558,30 @@ /* Pacific/Apia */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x57, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x91, 0x05, 0xFC, 0x00, +0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x91, 0x05, 0xFC, 0x00, 0xDA, 0x62, 0x04, 0x38, 0x4C, 0x9F, 0x27, 0xB0, 0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, -0x4E, 0xFD, 0x8B, 0xA0, 0x4F, 0x77, 0x0D, 0xE0, 0x01, 0x02, 0x03, 0x02, 0x03, 0x04, 0x05, 0xFF, -0xFF, 0x5F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, 0x00, -0x09, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x0D, 0x00, 0x00, 0xC4, 0xE0, 0x01, 0x0D, 0x00, 0x00, 0xB6, -0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x57, 0x53, 0x54, 0x00, -0x57, 0x53, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x74, 0x38, 0x9A, 0x00, 0x0C, 0x9D, 0x2A, 0x00, 0x00, 0x00, 0x00, +0x4E, 0xFD, 0x8B, 0xA0, 0x4F, 0x77, 0x0D, 0xE0, 0x50, 0x66, 0xFE, 0xE0, 0x51, 0x60, 0x2A, 0x60, +0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, 0x54, 0x26, 0xC2, 0xE0, 0x55, 0x1F, 0xEE, 0x60, +0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, 0x57, 0xE6, 0x86, 0xE0, 0x58, 0xDF, 0xB2, 0x60, +0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, 0x5B, 0xAF, 0x85, 0x60, 0x5C, 0xA8, 0xB0, 0xE0, +0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, 0x5F, 0x6F, 0x49, 0x60, 0x60, 0x68, 0x74, 0xE0, +0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, 0x63, 0x2F, 0x0D, 0x60, 0x64, 0x28, 0x38, 0xE0, +0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, 0x66, 0xF8, 0x0B, 0xE0, 0x67, 0xF1, 0x37, 0x60, +0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, 0x6A, 0xB7, 0xCF, 0xE0, 0x6B, 0xB0, 0xFB, 0x60, +0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, 0x6E, 0x77, 0x93, 0xE0, 0x6F, 0x70, 0xBF, 0x60, +0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, 0x72, 0x40, 0x92, 0x60, 0x73, 0x39, 0xBD, 0xE0, +0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, 0x76, 0x00, 0x56, 0x60, 0x76, 0xF9, 0x81, 0xE0, +0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, 0x79, 0xC0, 0x1A, 0x60, 0x7A, 0xB9, 0x45, 0xE0, +0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, 0x7D, 0x89, 0x18, 0xE0, 0x7E, 0x82, 0x44, 0x60, +0x7F, 0x68, 0xFA, 0xE0, 0x01, 0x02, 0x03, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, +0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, +0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, +0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, +0x5F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x09, +0xFF, 0xFF, 0x73, 0x60, 0x01, 0x0D, 0x00, 0x00, 0xC4, 0xE0, 0x01, 0x0D, 0x00, 0x00, 0xB6, 0xD0, +0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x57, 0x53, 0x54, 0x00, 0x57, +0x53, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x74, 0x38, 0x9A, 0x00, 0x0C, 0x9D, 0x2A, 0x00, 0x00, 0x00, 0x00, /* Pacific/Auckland */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -16768,22 +16783,38 @@ /* Pacific/Fakaofo */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x4E, 0xFD, 0x8B, 0xA0, -0x01, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xE0, 0x00, 0x00, 0x54, 0x4B, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x4E, 0xFD, 0x99, 0xB0, +0x01, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x00, 0x54, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7B, 0x09, 0x65, 0x00, 0x0D, 0x60, 0x7A, 0x00, 0x00, 0x00, 0x00, /* Pacific/Fiji */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x46, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x9A, 0x13, 0xB2, 0x3C, +0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x9A, 0x13, 0xB2, 0x3C, 0x36, 0x3B, 0x17, 0xE0, 0x36, 0xD7, 0xFA, 0x60, 0x38, 0x24, 0x34, 0x60, 0x38, 0xB7, 0xDC, 0x60, 0x4B, 0x11, 0x2C, 0xE0, 0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xC2, 0xEA, 0x60, 0x4D, 0x72, 0x41, 0xE0, -0x4E, 0xA2, 0xCC, 0x60, 0x4F, 0x1A, 0xC4, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x00, 0x00, 0xA7, 0x44, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, -0x00, 0xA8, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4A, 0x53, 0x54, 0x00, 0x46, 0x4A, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6D, 0xA8, 0xEA, 0x02, 0x22, 0xE6, 0x82, -0x00, 0x00, 0x00, 0x00, +0x4E, 0xA2, 0xCC, 0x60, 0x4F, 0x1A, 0xC4, 0xE0, 0x50, 0x82, 0xAE, 0x60, 0x50, 0xFA, 0xA6, 0xE0, +0x52, 0x62, 0x90, 0x60, 0x52, 0xDA, 0x88, 0xE0, 0x54, 0x42, 0x72, 0x60, 0x54, 0xBA, 0x6A, 0xE0, +0x56, 0x22, 0x54, 0x60, 0x56, 0xA3, 0x87, 0x60, 0x58, 0x0B, 0x70, 0xE0, 0x58, 0x83, 0x69, 0x60, +0x59, 0xEB, 0x52, 0xE0, 0x5A, 0x63, 0x4B, 0x60, 0x5B, 0xCB, 0x34, 0xE0, 0x5C, 0x43, 0x2D, 0x60, +0x5D, 0xAB, 0x16, 0xE0, 0x5E, 0x23, 0x0F, 0x60, 0x5F, 0x8A, 0xF8, 0xE0, 0x60, 0x0C, 0x2B, 0xE0, +0x61, 0x74, 0x15, 0x60, 0x61, 0xEC, 0x0D, 0xE0, 0x63, 0x53, 0xF7, 0x60, 0x63, 0xCB, 0xEF, 0xE0, +0x65, 0x33, 0xD9, 0x60, 0x65, 0xAB, 0xD1, 0xE0, 0x67, 0x13, 0xBB, 0x60, 0x67, 0x8B, 0xB3, 0xE0, +0x68, 0xF3, 0x9D, 0x60, 0x69, 0x6B, 0x95, 0xE0, 0x6A, 0xD3, 0x7F, 0x60, 0x6B, 0x54, 0xB2, 0x60, +0x6C, 0xBC, 0x9B, 0xE0, 0x6D, 0x34, 0x94, 0x60, 0x6E, 0x9C, 0x7D, 0xE0, 0x6F, 0x14, 0x76, 0x60, +0x70, 0x7C, 0x5F, 0xE0, 0x70, 0xF4, 0x58, 0x60, 0x72, 0x5C, 0x41, 0xE0, 0x72, 0xD4, 0x3A, 0x60, +0x74, 0x3C, 0x23, 0xE0, 0x74, 0xB4, 0x1C, 0x60, 0x76, 0x25, 0x40, 0x60, 0x76, 0x9D, 0x38, 0xE0, +0x78, 0x05, 0x22, 0x60, 0x78, 0x7D, 0x1A, 0xE0, 0x79, 0xE5, 0x04, 0x60, 0x7A, 0x5C, 0xFC, 0xE0, +0x7B, 0xC4, 0xE6, 0x60, 0x7C, 0x3C, 0xDE, 0xE0, 0x7D, 0xA4, 0xC8, 0x60, 0x7E, 0x1C, 0xC0, 0xE0, +0x7F, 0x84, 0xAA, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x00, 0x00, 0xA7, 0x44, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, 0x00, +0xA8, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4A, 0x53, 0x54, 0x00, 0x46, 0x4A, 0x54, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6D, 0xA8, 0xEA, 0x02, 0x22, 0xE6, 0x82, 0x00, +0x00, 0x00, 0x00, /* Pacific/Funafuti */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -18175,4 +18206,4 @@ 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, }; -const timelib_tzdb timezonedb_builtin = { "2012.3", 576, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2012.8", 576, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff -Nru php5-5.4.4/ext/date/lib/tm2unixtime.c php5-5.4.9/ext/date/lib/tm2unixtime.c --- php5-5.4.4/ext/date/lib/tm2unixtime.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/tm2unixtime.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/date/lib/unixtime2tm.c php5-5.4.9/ext/date/lib/unixtime2tm.c --- php5-5.4.4/ext/date/lib/unixtime2tm.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/lib/unixtime2tm.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/date/php_date.c php5-5.4.9/ext/date/php_date.c --- php5-5.4.4/ext/date/php_date.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/date/php_date.c 2012-11-21 05:12:20.000000000 +0000 @@ -3430,10 +3430,19 @@ zval_copy_ctor(&tmp_member); convert_to_string(&tmp_member); member = &tmp_member; + key = NULL; } obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC); + if (!obj->initialized) { + retval = (zend_get_std_object_handlers())->read_property(object, member, type, key TSRMLS_CC); + if (member == &tmp_member) { + zval_dtor(member); + } + return retval; + } + #define GET_VALUE_FROM_STRUCT(n,m) \ if (strcmp(Z_STRVAL_P(member), m) == 0) { \ value = obj->diff->n; \ @@ -3482,9 +3491,19 @@ zval_copy_ctor(&tmp_member); convert_to_string(&tmp_member); member = &tmp_member; + key = NULL; } + obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC); + if (!obj->initialized) { + (zend_get_std_object_handlers())->write_property(object, member, value, key TSRMLS_CC); + if (member == &tmp_member) { + zval_dtor(member); + } + return; + } + #define SET_VALUE_FROM_STRUCT(n,m) \ if (strcmp(Z_STRVAL_P(member), m) == 0) { \ if (value->type != IS_LONG) { \ diff -Nru php5-5.4.4/ext/date/tests/bug62500.phpt php5-5.4.9/ext/date/tests/bug62500.phpt --- php5-5.4.4/ext/date/tests/bug62500.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/date/tests/bug62500.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,28 @@ +--TEST-- +Bug #62500 (Segfault in DateInterval class when extended) +--INI-- +date.timezone=GMT +--FILE-- +foo); + $this->foo = 3; + var_dump($this->foo); + var_dump($this->{2}); + parent::__construct($time_spec); + } +} +try { + $c = new Crasher('blah'); +} catch (Exception $e) { + var_dump($e->getMessage()); +} +--EXPECTF-- +NULL +int(3) + +Notice: Undefined property: Crasher::$2 in %sbug62500.php on line %d +NULL +string(%s) "DateInterval::__construct(): Unknown or bad format (blah)" diff -Nru php5-5.4.4/ext/date/tests/bug62561.phpt php5-5.4.9/ext/date/tests/bug62561.phpt --- php5-5.4.4/ext/date/tests/bug62561.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/date/tests/bug62561.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,16 @@ +--TEST-- +Bug #62561 Unixtimestamp may take on local times DST flag (this test will only be valid during EDT) +--FILE-- +add($int); + +echo 'ts: '.$ts->format('Y-m-d H:i:s')."\n"; +echo 'day from ts: '.$dayFromTs->format('Y-m-d H:i:s')."\n"; +?> +--EXPECT-- +ts: 2012-07-01 04:00:00 +day from ts: 2012-07-02 04:00:00 diff -Nru php5-5.4.4/ext/date/tests/bug62852.phpt php5-5.4.9/ext/date/tests/bug62852.phpt --- php5-5.4.4/ext/date/tests/bug62852.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/date/tests/bug62852.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,36 @@ +--TEST-- +Bug #62852 (Unserialize invalid DateTime causes crash) +--INI-- +date.timezone=GMT +--XFAIL-- +bug is not fixed yet +--FILE-- + +--EXPECTF-- +okey diff -Nru php5-5.4.4/ext/date/tests/bug62896.phpt php5-5.4.9/ext/date/tests/bug62896.phpt --- php5-5.4.4/ext/date/tests/bug62896.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/date/tests/bug62896.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,42 @@ +--TEST-- +Bug #62896 Unixtimestamp may take on local times DST flag (this test will only be valid during CEST) +--INI-- +date.timezone=Europe/Berlin +--FILE-- +format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n"; + + $date->modify('+0 days'); + echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n"; + + echo "FROM TIMESTAMP, WITH TZ:\n"; + + $date = new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST')); + $date->setTimezone($tz); + echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n"; + + $date->modify('+0 days'); + echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n"; + + echo "FROM STRING:\n"; + + $date = new DateTime('2012-08-22 00:00:00 CEST', $tz); + echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n"; + + $date->modify('+0 days'); + echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n"; +--EXPECT-- +FROM TIMESTAMP, NO TZ: +2012-08-21 22:00:00 GMT+0000 (offset 0) +2012-08-21 22:00:00 GMT+0000 (offset 0) +FROM TIMESTAMP, WITH TZ: +2012-08-22 00:00:00 CEST (offset 7200) +2012-08-22 00:00:00 CEST (offset 7200) +FROM STRING: +2012-08-22 00:00:00 CEST (offset 7200) +2012-08-22 00:00:00 CEST (offset 7200) diff -Nru php5-5.4.4/ext/dba/libcdb/cdb.c php5-5.4.9/ext/dba/libcdb/cdb.c --- php5-5.4.4/ext/dba/libcdb/cdb.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dba/libcdb/cdb.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: 5c26b4fd9f2aff928342c9a5988b4cbcdfcb3253 $ */ +/* $Id: cfce91e080e6f41c71bfe48a319824cef2522018 $ */ /* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ @@ -189,6 +189,6 @@ /* {{{ cdb_version */ char *cdb_version() { - return "0.75, $Id: 5c26b4fd9f2aff928342c9a5988b4cbcdfcb3253 $"; + return "0.75, $Id: cfce91e080e6f41c71bfe48a319824cef2522018 $"; } /* }}} */ diff -Nru php5-5.4.4/ext/dba/libcdb/cdb.h php5-5.4.9/ext/dba/libcdb/cdb.h --- php5-5.4.4/ext/dba/libcdb/cdb.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dba/libcdb/cdb.h 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/dba/libcdb/cdb_make.c php5-5.4.9/ext/dba/libcdb/cdb_make.c --- php5-5.4.4/ext/dba/libcdb/cdb_make.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dba/libcdb/cdb_make.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: 600b8dd0f9187fe83c489340acb60259c1b16700 $ */ +/* $Id: 014db032ebde7d4fe5c63911b8fc0b3dda298f2a $ */ /* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ @@ -240,5 +240,5 @@ /* {{{ cdb_make_version */ char *cdb_make_version() { - return "0.75, $Id: 600b8dd0f9187fe83c489340acb60259c1b16700 $"; + return "0.75, $Id: 014db032ebde7d4fe5c63911b8fc0b3dda298f2a $"; } diff -Nru php5-5.4.4/ext/dba/libcdb/cdb_make.h php5-5.4.9/ext/dba/libcdb/cdb_make.h --- php5-5.4.4/ext/dba/libcdb/cdb_make.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dba/libcdb/cdb_make.h 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/dba/libcdb/uint32.c php5-5.4.9/ext/dba/libcdb/uint32.c --- php5-5.4.4/ext/dba/libcdb/uint32.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dba/libcdb/uint32.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/dba/libcdb/uint32.h php5-5.4.9/ext/dba/libcdb/uint32.h --- php5-5.4.4/ext/dba/libcdb/uint32.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dba/libcdb/uint32.h 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/dba/libflatfile/flatfile.c php5-5.4.9/ext/dba/libflatfile/flatfile.c --- php5-5.4.4/ext/dba/libflatfile/flatfile.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dba/libflatfile/flatfile.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: bf851847d598cf488f89ac273f73e5ee8a42eeab $ */ +/* $Id: c17a295438f21791be8bf1f046c769fdd03f51ee $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -306,7 +306,7 @@ /* {{{ flatfile_version */ char *flatfile_version() { - return "1.0, $Id: bf851847d598cf488f89ac273f73e5ee8a42eeab $"; + return "1.0, $Id: c17a295438f21791be8bf1f046c769fdd03f51ee $"; } /* }}} */ diff -Nru php5-5.4.4/ext/dba/libflatfile/flatfile.h php5-5.4.9/ext/dba/libflatfile/flatfile.h --- php5-5.4.4/ext/dba/libflatfile/flatfile.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dba/libflatfile/flatfile.h 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/dba/libinifile/inifile.c php5-5.4.9/ext/dba/libinifile/inifile.c --- php5-5.4.4/ext/dba/libinifile/inifile.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dba/libinifile/inifile.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: 35930d10283d140c69e0bd485fa7c50938e37f8b $ */ +/* $Id: cd53f4adf0f7fcb974154ce418a71b2ce1589268 $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -42,7 +42,7 @@ /* {{{ inifile_version */ char *inifile_version() { - return "1.0, $Id: 35930d10283d140c69e0bd485fa7c50938e37f8b $"; + return "1.0, $Id: cd53f4adf0f7fcb974154ce418a71b2ce1589268 $"; } /* }}} */ diff -Nru php5-5.4.4/ext/dba/libinifile/inifile.h php5-5.4.9/ext/dba/libinifile/inifile.h --- php5-5.4.4/ext/dba/libinifile/inifile.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dba/libinifile/inifile.h 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/dom/documenttype.c php5-5.4.9/ext/dom/documenttype.c --- php5-5.4.4/ext/dom/documenttype.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dom/documenttype.c 2012-11-21 05:12:20.000000000 +0000 @@ -205,7 +205,11 @@ if (buff != NULL) { xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL); xmlOutputBufferFlush(buff); +#ifdef LIBXML2_NEW_BUFFER + ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1); +#else ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1); +#endif (void)xmlOutputBufferClose(buff); return SUCCESS; } diff -Nru php5-5.4.4/ext/dom/domerrorhandler.c php5-5.4.9/ext/dom/domerrorhandler.c --- php5-5.4.4/ext/dom/domerrorhandler.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dom/domerrorhandler.c 2012-11-21 05:12:20.000000000 +0000 @@ -29,7 +29,7 @@ /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_domerrorhandler_handle_error, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, error, DOMError, 0) + ZEND_ARG_OBJ_INFO(0, error, DOMDomError, 0) ZEND_END_ARG_INFO(); /* }}} */ diff -Nru php5-5.4.4/ext/dom/element.c php5-5.4.9/ext/dom/element.c --- php5-5.4.4/ext/dom/element.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dom/element.c 2012-11-21 05:12:20.000000000 +0000 @@ -832,7 +832,7 @@ } if (errorcode == 0 && is_xmlns == 0) { - attr = xmlSetNsProp(elemp, nsptr, (xmlChar *)localname, (xmlChar *)value); + xmlSetNsProp(elemp, nsptr, (xmlChar *)localname, (xmlChar *)value); } } else { name_valid = xmlValidateName((xmlChar *) localname, 0); @@ -844,7 +844,7 @@ if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) { node_list_unlink(attr->children TSRMLS_CC); } - attr = xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value); + xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value); } } } diff -Nru php5-5.4.4/ext/dom/node.c php5-5.4.9/ext/dom/node.c --- php5-5.4.4/ext/dom/node.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dom/node.c 2012-11-21 05:12:20.000000000 +0000 @@ -1895,9 +1895,17 @@ RETVAL_FALSE; } else { if (mode == 0) { +#ifdef LIBXML2_NEW_BUFFER + ret = xmlOutputBufferGetSize(buf); +#else ret = buf->buffer->use; +#endif if (ret > 0) { +#ifdef LIBXML2_NEW_BUFFER + RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1); +#else RETVAL_STRINGL((char *) buf->buffer->content, ret, 1); +#endif } else { RETVAL_EMPTY_STRING(); } diff -Nru php5-5.4.4/ext/dom/xpath.c php5-5.4.9/ext/dom/xpath.c --- php5-5.4.4/ext/dom/xpath.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/dom/xpath.c 2012-11-21 05:12:20.000000000 +0000 @@ -216,7 +216,7 @@ if (Z_TYPE(handler) == IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(&handler)); } - /* retval is == NULL, when an exception occured, don't report anything, because PHP itself will handle that */ + /* retval is == NULL, when an exception occurred, don't report anything, because PHP itself will handle that */ } else if (retval == NULL) { } else { if (retval->type == IS_OBJECT && instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) { @@ -321,6 +321,7 @@ xmlDoc *docp = NULL; xmlXPathContextPtr ctx; int ret; + zval *tmp; ctx = (xmlXPathContextPtr) obj->ptr; @@ -329,10 +330,16 @@ } ALLOC_ZVAL(*retval); + tmp = *retval; + if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, *retval, obj TSRMLS_CC))) { + FREE_ZVAL(tmp); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); return FAILURE; } + if (tmp != *retval) { + FREE_ZVAL(tmp); + } return SUCCESS; } /* }}} */ diff -Nru php5-5.4.4/ext/enchant/enchant.c php5-5.4.9/ext/enchant/enchant.c --- php5-5.4.4/ext/enchant/enchant.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/enchant/enchant.c 2012-11-21 05:12:20.000000000 +0000 @@ -16,7 +16,7 @@ | Ilia Alshanetsky | +----------------------------------------------------------------------+ - $Id: 2d784ebbefd2f4c5ac8131210c16599418deb934 $ + $Id: 357f3cb0340d8cd484a81ee16ff3b26fb38a64b6 $ */ #ifdef HAVE_CONFIG_H @@ -326,7 +326,7 @@ #elif defined(HAVE_ENCHANT_BROKER_SET_PARAM) php_info_print_table_row(2, "Libenchant Version", "1.5.0 or later"); #endif - php_info_print_table_row(2, "Revision", "$Id: 2d784ebbefd2f4c5ac8131210c16599418deb934 $"); + php_info_print_table_row(2, "Revision", "$Id: 357f3cb0340d8cd484a81ee16ff3b26fb38a64b6 $"); php_info_print_table_end(); php_info_print_table_start(); @@ -730,6 +730,7 @@ if (sugg) { zval_dtor(sugg); + array_init(sugg); } PHP_ENCHANT_GET_DICT; @@ -743,8 +744,6 @@ RETURN_FALSE; } - array_init(sugg); - suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg_st); memcpy(&n_sugg, &n_sugg_st, sizeof(n_sugg)); if (suggs && n_sugg) { diff -Nru php5-5.4.4/ext/exif/exif.c php5-5.4.9/ext/exif/exif.c --- php5-5.4.4/ext/exif/exif.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/exif/exif.c 2012-11-21 05:12:20.000000000 +0000 @@ -3254,7 +3254,7 @@ if ((l1 = php_strnlen(buffer+2, length-2)) > 0) { exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC); if (length > 2+l1+1) { - l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1); + l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1); exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC); } } @@ -3404,6 +3404,10 @@ case M_SOF13: case M_SOF14: case M_SOF15: + if ((itemlen - 2) < 6) { + return FALSE; + } + exif_process_SOFn(Data, marker, &sof_info); ImageInfo->Width = sof_info.width; ImageInfo->Height = sof_info.height; diff -Nru php5-5.4.4/ext/exif/tests/bug60150.phpt php5-5.4.9/ext/exif/tests/bug60150.phpt --- php5-5.4.4/ext/exif/tests/bug60150.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/exif/tests/bug60150.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -12,7 +12,7 @@ ?> ===DONE=== --EXPECTF-- -Warning: exif_read_data(bug60150.jpg): Process tag(x9003=DateTimeOri): Illegal pointer offset(x%x + x%x = x%x > x%x) in %s on line %d +Warning: exif_read_data(bug60150.jpg): Process tag(x9003=DateTimeOri): Illegal pointer offset(%s) in %s on line %d Warning: exif_read_data(bug60150.jpg): Error reading from file: got=x%x(=%d) != itemlen-%d=x%x(=%d) in %s on line %d diff -Nru php5-5.4.4/ext/fileinfo/config.w32 php5-5.4.9/ext/fileinfo/config.w32 --- php5-5.4.4/ext/fileinfo/config.w32 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/fileinfo/config.w32 2012-11-21 05:12:20.000000000 +0000 @@ -4,22 +4,16 @@ ARG_ENABLE("fileinfo", "fileinfo support", "no"); if (PHP_FILEINFO != 'no') { - if (CHECK_HEADER_ADD_INCLUDE("dirent.h", "CFLAGS_FILEINFO") && - CHECK_LIB("dirent_a.lib", "fileinfo", PHP_FILEINFO)) { - LIBMAGIC_SOURCES=" apprentice.c apptype.c ascmagic.c \ - cdf.c cdf_time.c compress.c \ - encoding.c fsmagic.c funcs.c \ - is_tar.c magic.c print.c \ - readcdf.c readelf.c softmagic.c"; + LIBMAGIC_SOURCES=" apprentice.c apptype.c ascmagic.c \ + cdf.c cdf_time.c compress.c \ + encoding.c fsmagic.c funcs.c \ + is_tar.c magic.c print.c \ + readcdf.c readelf.c softmagic.c"; - if (VCVERS < 1500) { - ADD_FLAG('CFLAGS', '/Zm1000'); - } + if (VCVERS < 1500) { + ADD_FLAG('CFLAGS', '/Zm1000'); + } - EXTENSION('fileinfo', 'fileinfo.c', true, "/I" + configure_module_dirname + "/libmagic /I" + configure_module_dirname); - ADD_SOURCES(configure_module_dirname + '\\libmagic', LIBMAGIC_SOURCES, "fileinfo"); - } else { - WARNING("fileinfo not enabled; libraries and headers not found"); - PHP_FILEINFO = "no"; - } + EXTENSION('fileinfo', 'fileinfo.c', true, "/I" + configure_module_dirname + "/libmagic /I" + configure_module_dirname); + ADD_SOURCES(configure_module_dirname + '\\libmagic', LIBMAGIC_SOURCES, "fileinfo"); } diff -Nru php5-5.4.4/ext/fileinfo/fileinfo.c php5-5.4.9/ext/fileinfo/fileinfo.c --- php5-5.4.4/ext/fileinfo/fileinfo.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/fileinfo/fileinfo.c 2012-11-21 05:12:20.000000000 +0000 @@ -270,7 +270,7 @@ PHP_MINFO_FUNCTION(fileinfo) { php_info_print_table_start(); - php_info_print_table_header(2, "fileinfo support", "enabled"); + php_info_print_table_row(2, "fileinfo support", "enabled"); php_info_print_table_row(2, "version", PHP_FILEINFO_VERSION); php_info_print_table_end(); } diff -Nru php5-5.4.4/ext/fileinfo/libmagic/apprentice.c php5-5.4.9/ext/fileinfo/libmagic/apprentice.c --- php5-5.4.4/ext/fileinfo/libmagic/apprentice.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/fileinfo/libmagic/apprentice.c 2012-11-21 05:12:20.000000000 +0000 @@ -63,9 +63,6 @@ #include #include #include -#ifndef PHP_WIN32 -#include -#endif #define EATAB {while (isascii((unsigned char) *l) && \ isspace((unsigned char) *l)) ++l;} @@ -753,14 +750,16 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, const char *fn, int action) { - int errs = 0; + int errs = 0; struct magic_entry *marray; uint32_t marraycount, i, mentrycount = 0, starttest; size_t files = 0, maxfiles = 0; - char **filearr = NULL, mfn[MAXPATHLEN]; + char **filearr = NULL; struct stat st; - DIR *dir; - struct dirent *d; + php_stream *dir; + php_stream_dirent d; + + TSRMLS_FETCH(); ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */ @@ -776,17 +775,20 @@ /* FIXME: Read file names and sort them to prevent non-determinism. See Debian bug #488562. */ if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) { - dir = opendir(fn); + int mflen; + char mfn[MAXPATHLEN]; + + dir = php_stream_opendir(fn, REPORT_ERRORS, NULL); if (!dir) { errs++; goto out; } - while ((d = readdir(dir)) != NULL) { - if (snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name) < 0) { + while (php_stream_readdir(dir, &d)) { + if ((mflen = snprintf(mfn, sizeof(mfn), "%s/%s", fn, d.d_name)) < 0) { file_oomem(ms, - strlen(fn) + strlen(d->d_name) + 2); + strlen(fn) + strlen(d.d_name) + 2); errs++; - closedir(dir); + php_stream_closedir(dir); goto out; } if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) { @@ -799,19 +801,19 @@ if ((filearr = CAST(char **, realloc(filearr, mlen))) == NULL) { file_oomem(ms, mlen); - closedir(dir); + php_stream_closedir(dir); errs++; goto out; } } - filearr[files++] = mfn; + filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen); } - closedir(dir); + php_stream_closedir(dir); qsort(filearr, files, sizeof(*filearr), cmpstrp); for (i = 0; i < files; i++) { load_1(ms, action, filearr[i], &errs, &marray, &marraycount); - free(filearr[i]); + efree(filearr[i]); } free(filearr); } else @@ -886,9 +888,14 @@ mentrycount += marray[i].cont_count; } out: - for (i = 0; i < marraycount; i++) - efree(marray[i].mp); - efree(marray); + for (i = 0; i < marraycount; i++) { + if (marray[i].mp) { + efree(marray[i].mp); + } + } + if (marray) { + efree(marray); + } if (errs) { *magicp = NULL; *nmagicp = 0; @@ -1165,6 +1172,9 @@ return -1; } me = &(*mentryp)[*nmentryp - 1]; + if (me->mp == NULL) { + return -1; + } if (me->cont_count == me->max_count) { struct magic *nm; size_t cnt = me->max_count + ALLOC_CHUNK; @@ -1329,6 +1339,10 @@ if (m->type == FILE_INVALID) { if (ms->flags & MAGIC_CHECK) file_magwarn(ms, "type `%s' invalid", l); + if (me->mp) { + efree(me->mp); + me->mp = NULL; + } return -1; } @@ -2192,6 +2206,16 @@ goto internal_loaded; } +#ifdef PHP_WIN32 + /* Don't bother on windows with php_stream_open_wrapper, + return to give apprentice_load() a chance. */ + if (php_stream_stat_path_ex(fn, 0, &st, NULL) == SUCCESS) { + if (st.sb.st_mode & S_IFDIR) { + goto error2; + } + } +#endif + dbname = mkdbname(ms, fn, 0); if (dbname == NULL) goto error2; @@ -2219,6 +2243,7 @@ mm = emalloc((size_t)st.sb.st_size); if (php_stream_read(stream, mm, (size_t)st.sb.st_size) != (size_t)st.sb.st_size) { file_badread(ms); + ret = 1; goto error1; } ret = 1; diff -Nru php5-5.4.4/ext/fileinfo/libmagic/softmagic.c php5-5.4.9/ext/fileinfo/libmagic/softmagic.c --- php5-5.4.4/ext/fileinfo/libmagic/softmagic.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/fileinfo/libmagic/softmagic.c 2012-11-21 05:12:20.000000000 +0000 @@ -1654,29 +1654,6 @@ for (i=0; i -#endif -+#ifndef PHP_WIN32 - #include -+#endif +-#include #define EATAB {while (isascii((unsigned char) *l) && \ isspace((unsigned char) *l)) ++l;} -@@ -112,12 +130,10 @@ +@@ -112,12 +127,10 @@ private int parse_strength(struct magic_set *, struct magic_entry *, const char *); private int parse_apple(struct magic_set *, struct magic_entry *, const char *); @@ -62,7 +60,7 @@ private struct { const char *name; size_t len; -@@ -131,38 +147,7 @@ +@@ -131,38 +144,7 @@ { NULL, 0, NULL } }; @@ -102,7 +100,7 @@ static const struct type_tbl_s { const char name[16]; -@@ -218,6 +203,10 @@ +@@ -218,6 +200,10 @@ # undef XX_NULL }; @@ -113,7 +111,7 @@ private int get_type(const char *l, const char **t) { -@@ -275,15 +264,17 @@ +@@ -275,15 +261,17 @@ if (rv != 0) return -1; rv = apprentice_compile(ms, &magic, &nmagic, fn); @@ -136,7 +134,7 @@ if (rv != 0) return -1; } -@@ -295,11 +286,7 @@ +@@ -295,11 +283,7 @@ return -1; } @@ -149,7 +147,7 @@ ml->magic = magic; ml->nmagic = nmagic; -@@ -318,7 +305,6 @@ +@@ -318,7 +302,6 @@ } return 0; @@ -157,7 +155,7 @@ } protected void -@@ -327,22 +313,18 @@ +@@ -327,22 +310,18 @@ if (p == NULL) return; switch (type) { @@ -186,7 +184,7 @@ default: abort(); } -@@ -355,23 +337,27 @@ +@@ -355,23 +334,27 @@ char *p, *mfn; int file_err, errs = -1; struct mlist *mlist; @@ -223,7 +221,7 @@ mlist->next = mlist->prev = mlist; while (fn) { -@@ -385,13 +371,13 @@ +@@ -385,13 +368,13 @@ fn = p; } if (errs == -1) { @@ -240,7 +238,7 @@ return mlist; } -@@ -524,6 +510,7 @@ +@@ -524,6 +507,7 @@ abort(); } @@ -248,7 +246,7 @@ /* * Magic entries with no description get a bonus because they depend * on subsequent magic entries to print something. -@@ -539,8 +526,8 @@ +@@ -539,8 +523,8 @@ private int apprentice_sort(const void *a, const void *b) { @@ -259,7 +257,7 @@ size_t sa = apprentice_magic_strength(ma->mp); size_t sb = apprentice_magic_strength(mb->mp); if (sa == sb) -@@ -671,12 +658,22 @@ +@@ -671,12 +655,22 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs, struct magic_entry **marray, uint32_t *marraycount) { @@ -271,7 +269,9 @@ + size_t lineno = 0; + + php_stream *stream; -+ + +- FILE *f = fopen(ms->file = fn, "r"); +- if (f == NULL) { + TSRMLS_FETCH(); + +#if PHP_API_VERSION < 20100412 @@ -279,14 +279,12 @@ +#else + stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL); +#endif - -- FILE *f = fopen(ms->file = fn, "r"); -- if (f == NULL) { ++ + if (stream == NULL) { if (errno != ENOENT) file_error(ms, errno, "cannot read magic file `%s'", fn); -@@ -684,9 +681,12 @@ +@@ -684,9 +678,12 @@ return; } @@ -302,7 +300,7 @@ if (len == 0) /* null line, garbage, etc */ continue; if (line[len - 1] == '\n') { -@@ -736,8 +736,7 @@ +@@ -736,8 +733,7 @@ break; } } @@ -312,17 +310,25 @@ } /* -@@ -757,20 +756,16 @@ - int errs = 0; +@@ -754,23 +750,21 @@ + apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, + const char *fn, int action) + { +- int errs = 0; ++ int errs = 0; struct magic_entry *marray; uint32_t marraycount, i, mentrycount = 0, starttest; - size_t slen, files = 0, maxfiles = 0; - char **filearr = NULL, *mfn; + size_t files = 0, maxfiles = 0; -+ char **filearr = NULL, mfn[MAXPATHLEN]; ++ char **filearr = NULL; struct stat st; - DIR *dir; - struct dirent *d; +- DIR *dir; +- struct dirent *d; ++ php_stream *dir; ++ php_stream_dirent d; ++ ++ TSRMLS_FETCH(); ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */ @@ -337,26 +343,33 @@ marraycount = 0; /* print silly verbose header for USG compat. */ -@@ -778,14 +773,16 @@ +@@ -778,22 +772,26 @@ (void)fprintf(stderr, "%s\n", usg_hdr); /* load directory or file */ - if (stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) { +- dir = opendir(fn); + /* FIXME: Read file names and sort them to prevent + non-determinism. See Debian bug #488562. */ + if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) { - dir = opendir(fn); ++ int mflen; ++ char mfn[MAXPATHLEN]; ++ ++ dir = php_stream_opendir(fn, REPORT_ERRORS, NULL); if (!dir) { errs++; goto out; } - while ((d = readdir(dir)) != NULL) { +- while ((d = readdir(dir)) != NULL) { - if (asprintf(&mfn, "%s/%s", fn, d->d_name) < 0) { -+ if (snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name) < 0) { ++ while (php_stream_readdir(dir, &d)) { ++ if ((mflen = snprintf(mfn, sizeof(mfn), "%s/%s", fn, d.d_name)) < 0) { file_oomem(ms, - strlen(fn) + strlen(d->d_name) + 2); +- strlen(fn) + strlen(d->d_name) + 2); ++ strlen(fn) + strlen(d.d_name) + 2); errs++; -@@ -793,7 +790,6 @@ +- closedir(dir); ++ php_stream_closedir(dir); goto out; } if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) { @@ -364,15 +377,32 @@ continue; } if (files >= maxfiles) { -@@ -803,7 +799,6 @@ +@@ -803,20 +801,19 @@ if ((filearr = CAST(char **, realloc(filearr, mlen))) == NULL) { file_oomem(ms, mlen); - free(mfn); - closedir(dir); +- closedir(dir); ++ php_stream_closedir(dir); errs++; goto out; -@@ -882,12 +877,7 @@ + } + } +- filearr[files++] = mfn; ++ filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen); + } +- closedir(dir); ++ php_stream_closedir(dir); + qsort(filearr, files, sizeof(*filearr), cmpstrp); + for (i = 0; i < files; i++) { + load_1(ms, action, filearr[i], &errs, &marray, + &marraycount); +- free(filearr[i]); ++ efree(filearr[i]); + } + free(filearr); + } else +@@ -882,12 +879,7 @@ for (i = 0; i < marraycount; i++) mentrycount += marray[i].cont_count; @@ -386,18 +416,31 @@ mentrycount = 0; for (i = 0; i < marraycount; i++) { -@@ -897,8 +887,8 @@ +@@ -896,9 +888,14 @@ + mentrycount += marray[i].cont_count; } out: - for (i = 0; i < marraycount; i++) +- for (i = 0; i < marraycount; i++) - free(marray[i].mp); - free(marray); -+ efree(marray[i].mp); -+ efree(marray); ++ for (i = 0; i < marraycount; i++) { ++ if (marray[i].mp) { ++ efree(marray[i].mp); ++ } ++ } ++ if (marray) { ++ efree(marray); ++ } if (errs) { *magicp = NULL; *nmagicp = 0; -@@ -1178,11 +1168,7 @@ +@@ -1175,14 +1172,13 @@ + return -1; + } + me = &(*mentryp)[*nmentryp - 1]; ++ if (me->mp == NULL) { ++ return -1; ++ } if (me->cont_count == me->max_count) { struct magic *nm; size_t cnt = me->max_count + ALLOC_CHUNK; @@ -410,7 +453,7 @@ me->mp = m = nm; me->max_count = CAST(uint32_t, cnt); } -@@ -1194,23 +1180,13 @@ +@@ -1194,23 +1190,13 @@ struct magic_entry *mp; maxmagic += ALLOC_INCR; @@ -437,7 +480,18 @@ me->mp = m; me->max_count = ALLOC_CHUNK; } else -@@ -1361,7 +1337,7 @@ +@@ -1353,6 +1339,10 @@ + if (m->type == FILE_INVALID) { + if (ms->flags & MAGIC_CHECK) + file_magwarn(ms, "type `%s' invalid", l); ++ if (me->mp) { ++ efree(me->mp); ++ me->mp = NULL; ++ } + return -1; + } + +@@ -1361,7 +1351,7 @@ m->mask_op = 0; if (*l == '~') { @@ -446,7 +500,7 @@ m->mask_op |= FILE_OPINVERSE; else if (ms->flags & MAGIC_CHECK) file_magwarn(ms, "'~' invalid for string types"); -@@ -1370,7 +1346,7 @@ +@@ -1370,7 +1360,7 @@ m->str_range = 0; m->str_flags = m->type == FILE_PSTRING ? PSTRING_1_LE : 0; if ((op = get_op(*l)) != -1) { @@ -455,7 +509,7 @@ uint64_t val; ++l; m->mask_op |= op; -@@ -1558,11 +1534,6 @@ +@@ -1558,11 +1548,6 @@ if (check_format(ms, m) == -1) return -1; } @@ -467,7 +521,7 @@ m->mimetype[0] = '\0'; /* initialise MIME type to none */ if (m->cont_level == 0) ++(*nmentryp); /* make room for next */ -@@ -2195,56 +2166,68 @@ +@@ -2195,56 +2180,79 @@ /* * handle a compiled file. @@ -498,6 +552,16 @@ + ret = 3; + goto internal_loaded; + } ++ ++#ifdef PHP_WIN32 ++ /* Don't bother on windows with php_stream_open_wrapper, ++ return to give apprentice_load() a chance. */ ++ if (php_stream_stat_path_ex(fn, 0, &st, NULL) == SUCCESS) { ++ if (st.sb.st_mode & S_IFDIR) { ++ goto error2; ++ } ++ } ++#endif dbname = mkdbname(ms, fn, 0); if (dbname == NULL) @@ -542,6 +606,7 @@ + mm = emalloc((size_t)st.sb.st_size); + if (php_stream_read(stream, mm, (size_t)st.sb.st_size) != (size_t)st.sb.st_size) { file_badread(ms); ++ ret = 1; goto error1; } -#define RET 1 @@ -559,7 +624,7 @@ ptr = (uint32_t *)(void *)*magicp; if (*ptr != MAGICNO) { if (swap4(*ptr) != MAGICNO) { -@@ -2259,35 +2242,55 @@ +@@ -2259,35 +2267,55 @@ else version = ptr[1]; if (version != VERSIONNO) { @@ -631,7 +696,7 @@ return -1; } -@@ -2301,42 +2304,49 @@ +@@ -2301,42 +2329,49 @@ apprentice_compile(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, const char *fn) { @@ -639,10 +704,10 @@ char *dbname; int rv = -1; + php_stream *stream; ++ ++ TSRMLS_FETCH(); - dbname = mkdbname(ms, fn, 1); -+ TSRMLS_FETCH(); -+ + dbname = mkdbname(ms, fn, 0); if (dbname == NULL) @@ -692,7 +757,7 @@ return rv; } -@@ -2349,6 +2359,7 @@ +@@ -2349,6 +2384,7 @@ { const char *p, *q; char *buf; @@ -700,7 +765,7 @@ if (strip) { if ((p = strrchr(fn, '/')) != NULL) -@@ -2370,14 +2381,14 @@ +@@ -2370,14 +2406,14 @@ q++; /* Compatibility with old code that looked in .mime */ if (ms->flags & MAGIC_MIME) { @@ -719,7 +784,7 @@ /* Compatibility with old code that looked in .mime */ if (strstr(p, ".mime") != NULL) -@@ -2467,7 +2478,7 @@ +@@ -2467,7 +2503,7 @@ m->offset = swap4((uint32_t)m->offset); m->in_offset = swap4((uint32_t)m->in_offset); m->lineno = swap4((uint32_t)m->lineno); @@ -728,9 +793,9 @@ m->str_range = swap4(m->str_range); m->str_flags = swap4(m->str_flags); } -diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c ---- libmagic.orig/ascmagic.c 2012-04-22 19:30:43.182305355 +0800 -+++ libmagic/ascmagic.c 2012-04-22 19:28:57.330309533 +0800 +diff -u libmagic.origin/ascmagic.c libmagic/ascmagic.c +--- libmagic.origin/ascmagic.c Sat Dec 17 18:17:18 2011 ++++ libmagic/ascmagic.c Tue Apr 10 09:46:33 2012 @@ -139,10 +139,8 @@ /* malloc size is a conservative overestimate; could be improved, or at least realloced after conversion. */ @@ -754,9 +819,9 @@ return rv; } -diff -u libmagic.orig/cdf.c libmagic/cdf.c ---- libmagic.orig/cdf.c 2012-04-22 19:30:43.182305355 +0800 -+++ libmagic/cdf.c 2012-04-22 19:28:57.370309531 +0800 +diff -u libmagic.origin/cdf.c libmagic/cdf.c +--- libmagic.origin/cdf.c Mon Feb 20 23:35:29 2012 ++++ libmagic/cdf.c Tue Apr 10 09:46:33 2012 @@ -43,7 +43,17 @@ #include #endif @@ -818,9 +883,9 @@ cdf_print_elapsed_time(buf, sizeof(buf), tp); (void)fprintf(stderr, "timestamp %s\n", buf); } else { -diff -u libmagic.orig/cdf.h libmagic/cdf.h ---- libmagic.orig/cdf.h 2012-04-22 19:30:43.182305355 +0800 -+++ libmagic/cdf.h 2012-04-22 19:28:57.370309531 +0800 +diff -u libmagic.origin/cdf.h libmagic/cdf.h +--- libmagic.origin/cdf.h Fri Feb 17 06:28:31 2012 ++++ libmagic/cdf.h Tue Apr 10 09:46:34 2012 @@ -35,7 +35,7 @@ #ifndef _H_CDF_ #define _H_CDF_ @@ -856,9 +921,9 @@ int cdf_read_header(const cdf_info_t *, cdf_header_t *); void cdf_swap_header(cdf_header_t *); void cdf_unpack_header(cdf_header_t *, char *); -diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c ---- libmagic.orig/cdf_time.c 2012-04-22 19:30:43.182305355 +0800 -+++ libmagic/cdf_time.c 2012-04-22 19:28:57.326309537 +0800 +diff -u libmagic.origin/cdf_time.c libmagic/cdf_time.c +--- libmagic.origin/cdf_time.c Tue Dec 13 14:48:41 2011 ++++ libmagic/cdf_time.c Tue Apr 10 09:46:34 2012 @@ -96,7 +96,7 @@ } @@ -915,9 +980,9 @@ static const cdf_timestamp_t tst = 0x01A5E403C2D59C00ULL; static const char *ref = "Sat Apr 23 01:30:00 1977"; char *p, *q; -diff -u libmagic.orig/compress.c libmagic/compress.c ---- libmagic.orig/compress.c 2012-04-22 19:30:43.182305355 +0800 -+++ libmagic/compress.c 2012-04-22 19:28:57.314309548 +0800 +diff -u libmagic.origin/compress.c libmagic/compress.c +--- libmagic.origin/compress.c Sat Dec 17 18:17:18 2011 ++++ libmagic/compress.c Tue Apr 10 09:46:34 2012 @@ -32,6 +32,7 @@ * uncompress(method, old, n, newch) - uncompress old into new, * using method, return sizeof new @@ -1078,9 +1143,9 @@ } -#endif +#endif /* if PHP_FILEINFO_UNCOMPRESS */ -diff -u libmagic.orig/file.h libmagic/file.h ---- libmagic.orig/file.h 2012-04-22 19:30:43.186305188 +0800 -+++ libmagic/file.h 2012-04-22 19:49:58.922256776 +0800 +diff -u libmagic.origin/file.h libmagic/file.h +--- libmagic.origin/file.h Tue Sep 20 17:30:14 2011 ++++ libmagic/file.h Mon Apr 23 17:58:54 2012 @@ -33,11 +33,9 @@ #ifndef __file_h__ #define __file_h__ @@ -1238,22 +1303,24 @@ size_t strlcat(char *dst, const char *src, size_t siz); #endif #ifndef HAVE_GETLINE -@@ -500,4 +487,12 @@ - #define FILE_RCSID(id) +@@ -498,6 +485,14 @@ #endif - + #else + #define FILE_RCSID(id) ++#endif ++ +#ifdef PHP_WIN32 +#define FINFO_LSEEK_FUNC _lseek +#define FINFO_READ_FUNC _read +#else +#define FINFO_LSEEK_FUNC lseek +#define FINFO_READ_FUNC read -+#endif -+ + #endif + #endif /* __file_h__ */ -diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c ---- libmagic.orig/fsmagic.c 2012-04-22 19:30:43.186305188 +0800 -+++ libmagic/fsmagic.c 2012-04-22 19:28:57.298309521 +0800 +diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c +--- libmagic.origin/fsmagic.c Tue Aug 23 10:57:10 2011 ++++ libmagic/fsmagic.c Tue Apr 10 09:46:34 2012 @@ -59,27 +59,21 @@ # define minor(dev) ((dev) & 0xff) #endif @@ -1576,9 +1643,9 @@ } /* -diff -u libmagic.orig/funcs.c libmagic/funcs.c ---- libmagic.orig/funcs.c 2012-04-22 19:30:43.186305188 +0800 -+++ libmagic/funcs.c 2012-04-22 19:28:57.370309531 +0800 +diff -u libmagic.origin/funcs.c libmagic/funcs.c +--- libmagic.origin/funcs.c Sat Dec 17 18:17:18 2011 ++++ libmagic/funcs.c Mon Apr 23 17:58:54 2012 @@ -41,52 +41,42 @@ #if defined(HAVE_WCTYPE_H) #include @@ -1872,11 +1939,9 @@ + return rep_cnt; } + -Only in libmagic.orig: funcs.c.orig -Only in libmagic.orig: funcs.c.rej -diff -u libmagic.orig/magic.c libmagic/magic.c ---- libmagic.orig/magic.c 2012-04-22 19:30:43.186305188 +0800 -+++ libmagic/magic.c 2012-04-22 19:28:57.370309531 +0800 +diff -u libmagic.origin/magic.c libmagic/magic.c +--- libmagic.origin/magic.c Thu May 26 03:27:59 2011 ++++ libmagic/magic.c Tue Apr 10 09:46:34 2012 @@ -25,11 +25,6 @@ * SUCH DAMAGE. */ @@ -2252,9 +2317,9 @@ public const char * magic_error(struct magic_set *ms) -diff -u libmagic.orig/magic.h libmagic/magic.h ---- libmagic.orig/magic.h 2012-04-22 19:30:43.190305058 +0800 -+++ libmagic/magic.h 2012-04-22 19:28:57.326309537 +0800 +diff -u libmagic.origin/magic.h libmagic/magic.h +--- libmagic.origin/magic.h Sun Dec 18 15:54:43 2011 ++++ libmagic/magic.h Tue Apr 10 09:46:34 2012 @@ -85,6 +85,7 @@ const char *magic_getpath(const char *, int); @@ -2271,20 +2336,27 @@ int magic_list(magic_t, const char *); int magic_errno(magic_t); -diff -u libmagic.orig/print.c libmagic/print.c ---- libmagic.orig/print.c 2012-04-22 19:30:43.190305058 +0800 -+++ libmagic/print.c 2012-04-22 19:28:57.326309537 +0800 -@@ -29,6 +29,9 @@ +diff -u libmagic.origin/print.c libmagic/print.c +--- libmagic.origin/print.c Tue Sep 20 17:28:09 2011 ++++ libmagic/print.c Tue Oct 16 10:13:39 2012 +@@ -29,12 +29,16 @@ * print.c - debugging printout routines */ ++#define _GNU_SOURCE +#include "php.h" -+#include "main/snprintf.h" + #include "file.h" #ifndef lint -@@ -45,174 +48,21 @@ + FILE_RCSID("@(#)$File: print.c,v 1.71 2011/09/20 15:28:09 christos Exp $") + #endif /* lint */ + ++#include + #include + #include + #include +@@ -45,174 +49,21 @@ #define SZOF(a) (sizeof(a) / sizeof(a[0])) @@ -2466,9 +2538,9 @@ } protected const char * -diff -u libmagic.orig/readcdf.c libmagic/readcdf.c ---- libmagic.orig/readcdf.c 2012-04-22 19:30:43.190305058 +0800 -+++ libmagic/readcdf.c 2012-04-22 19:28:57.326309537 +0800 +diff -u libmagic.origin/readcdf.c libmagic/readcdf.c +--- libmagic.origin/readcdf.c Mon Feb 20 21:04:58 2012 ++++ libmagic/readcdf.c Tue Apr 10 09:46:34 2012 @@ -30,7 +30,11 @@ #endif @@ -2514,9 +2586,9 @@ c = cdf_ctime(&ts.tv_sec); if ((ec = strchr(c, '\n')) != NULL) *ec = '\0'; -diff -u libmagic.orig/readelf.c libmagic/readelf.c ---- libmagic.orig/readelf.c 2012-04-22 19:30:43.190305058 +0800 -+++ libmagic/readelf.c 2012-04-22 19:28:57.378309534 +0800 +diff -u libmagic.origin/readelf.c libmagic/readelf.c +--- libmagic.origin/readelf.c Tue Aug 23 10:57:10 2011 ++++ libmagic/readelf.c Tue Apr 10 09:46:34 2012 @@ -49,7 +49,7 @@ off_t, int *, int); private int doshn(struct magic_set *, int, int, int, off_t, int, size_t, @@ -2671,9 +2743,9 @@ fd = file_pipe2file(ms, fd, buf, nbytes); if (fstat(fd, &st) == -1) { -diff -u libmagic.orig/softmagic.c libmagic/softmagic.c ---- libmagic.orig/softmagic.c 2012-04-22 19:30:43.194304945 +0800 -+++ libmagic/softmagic.c 2012-04-22 19:28:57.286309597 +0800 +diff -u libmagic.origin/softmagic.c libmagic/softmagic.c +--- libmagic.origin/softmagic.c Sat Dec 17 18:17:18 2011 ++++ libmagic/softmagic.c Fri May 25 09:59:25 2012 @@ -41,6 +41,11 @@ #include #include @@ -2860,7 +2932,7 @@ } } -@@ -1669,6 +1642,65 @@ +@@ -1669,6 +1642,42 @@ return file_strncmp(a, b, len, flags); } @@ -2876,29 +2948,6 @@ + + for (i=0; isearch.s == NULL) - return 0; - -+ zval *pattern; -+ int options = 0; -+ pcre_cache_entry *pce; -+ TSRMLS_FETCH(); -+ -+ MAKE_STD_ZVAL(pattern); -+ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0); -+ -+ options |= PCRE_MULTILINE; -+ -+ if (m->str_flags & STRING_IGNORE_CASE) { -+ options |= PCRE_CASELESS; -+ } -+ -+ convert_libmagic_pattern(pattern, options); -+ - l = 0; +- l = 0; - rc = regcomp(&rx, m->value.s, - REG_EXTENDED|REG_NEWLINE| - ((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)); @@ -2970,6 +3003,23 @@ - size_t l = ms->search.s_len - 1; - char c = ms->search.s[l]; - ((char *)(intptr_t)ms->search.s)[l] = '\0'; ++ zval *pattern; ++ int options = 0; ++ pcre_cache_entry *pce; ++ TSRMLS_FETCH(); ++ ++ MAKE_STD_ZVAL(pattern); ++ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0); ++ ++ options |= PCRE_MULTILINE; ++ ++ if (m->str_flags & STRING_IGNORE_CASE) { ++ options |= PCRE_CASELESS; ++ } ++ ++ convert_libmagic_pattern(pattern, options); ++ ++ l = v = 0; +#if (PHP_MAJOR_VERSION < 6) + if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) { #else diff -Nru php5-5.4.4/ext/fileinfo/tests/bug61964.phpt php5-5.4.9/ext/fileinfo/tests/bug61964.phpt --- php5-5.4.4/ext/fileinfo/tests/bug61964.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/fileinfo/tests/bug61964.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,69 @@ +--TEST-- +Bug #61964 (finfo_open with directory cause invalid free) +--SKIPIF-- + +--FILE-- + Core\n> Me"); +file_put_contents($dir . "/test2.txt", "a\nb\n"); +@mkdir($dir . "/test-inner-folder"); + +finfo_open(FILEINFO_NONE, $dir); +echo "DONE: testing dir with files\n"; + +rmdir($dir . "/test-inner-folder"); +unlink($dir . "/test1.txt"); +unlink($dir . "/test2.txt"); + +unlink($magic_file_copy); +unlink($magic_file_copy2); +rmdir($dir); +?> +===DONE=== +--EXPECTF-- +bool(false) +resource(%d) of type (file_info) +resource(%d) of type (file_info) +bool(false) + +Notice: finfo_open(): Warning: offset `string' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: offset ` Core' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: type `Core' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: offset `a' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: type `a' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: offset `b' invalid in %sbug61964.php on line %d + +Notice: finfo_open(): Warning: type `b' invalid in %sbug61964.php on line %d + +Warning: finfo_open(): Failed to load magic database at '%stest-folder'. in %sbug61964.php on line %d +DONE: testing dir with files +===DONE=== diff -Nru php5-5.4.4/ext/fileinfo/tests/finfo_file_002.phpt php5-5.4.9/ext/fileinfo/tests/finfo_file_002.phpt --- php5-5.4.4/ext/fileinfo/tests/finfo_file_002.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/fileinfo/tests/finfo_file_002.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -18,9 +18,11 @@ var_dump($results); ?> --EXPECTF-- -array(6) { +array(7) { ["%s/resources/dir.zip"]=> string(15) "application/zip" + ["%s/resources/test.awk"]=> + string(10) "text/plain" ["%s/resources/test.bmp"]=> string(14) "image/x-ms-bmp" ["%s/resources/test.gif"]=> diff -Nru php5-5.4.4/ext/fileinfo/tests/finfo_file_regex-win32.phpt php5-5.4.9/ext/fileinfo/tests/finfo_file_regex-win32.phpt --- php5-5.4.4/ext/fileinfo/tests/finfo_file_regex-win32.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/fileinfo/tests/finfo_file_regex-win32.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,36 @@ +--TEST-- +Test finfo_file() function : regex rules +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing finfo_file() : regex rules *** +string(10) "text/plain" +string(22) "awk script, ASCII text" +===DONE=== diff -Nru php5-5.4.4/ext/fileinfo/tests/finfo_file_regex.phpt php5-5.4.9/ext/fileinfo/tests/finfo_file_regex.phpt --- php5-5.4.4/ext/fileinfo/tests/finfo_file_regex.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/fileinfo/tests/finfo_file_regex.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,32 @@ +--TEST-- +Test finfo_file() function : regex rules +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing finfo_file() : regex rules *** +string(28) "text/plain; charset=us-ascii" +string(22) "awk script, ASCII text" +===DONE=== diff -Nru php5-5.4.4/ext/fileinfo/tests/finfo_open_error-win32.phpt php5-5.4.9/ext/fileinfo/tests/finfo_open_error-win32.phpt --- php5-5.4.4/ext/fileinfo/tests/finfo_open_error-win32.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/fileinfo/tests/finfo_open_error-win32.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,53 @@ +--TEST-- +Test finfo_open() function : error functionality +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing finfo_open() : error functionality *** + +Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d + +Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d + +Warning: finfo_open(): Failed to load magic database at '%sfoobarfile'. in %sfinfo_open_error-win32.php on line %d +bool(false) + +Warning: finfo_open() expects parameter 1 to be long, array given in %sfinfo_open_error-win32.php on line %d +bool(false) + +Warning: finfo_open() expects at most 2 parameters, 3 given in %sfinfo_open_error-win32.php on line %d +bool(false) +resource(6) of type (file_info) + +Warning: finfo_open() expects parameter 1 to be long, string given in %sfinfo_open_error-win32.php on line %d +bool(false) + +Warning: finfo::finfo() expects parameter 1 to be long, string given in %sfinfo_open_error-win32.php on line %d +NULL +===DONE=== diff -Nru php5-5.4.4/ext/fileinfo/tests/finfo_open_error.phpt php5-5.4.9/ext/fileinfo/tests/finfo_open_error.phpt --- php5-5.4.4/ext/fileinfo/tests/finfo_open_error.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/fileinfo/tests/finfo_open_error.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,7 +1,10 @@ --TEST-- Test finfo_open() function : error functionality --SKIPIF-- - + --FILE-- 0) && (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\v' || *p == '\n')) { \ p++; \ len--; \ } \ - if (len < 1) { \ + if (len < 1 && return_if_empty) { \ RETURN_VALIDATION_FAILED \ } \ while (p[len-1] == ' ' || p[len-1] == '\t' || p[len-1] == '\r' || p[len-1] == '\v' || p[len-1] == '\n') { \ diff -Nru php5-5.4.4/ext/filter/logical_filters.c php5-5.4.9/ext/filter/logical_filters.c --- php5-5.4.4/ext/filter/logical_filters.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/filter/logical_filters.c 2012-11-21 05:12:20.000000000 +0000 @@ -235,12 +235,15 @@ int len = Z_STRLEN_P(value); int ret; - PHP_FILTER_TRIM_DEFAULT(str, len); + PHP_FILTER_TRIM_DEFAULT_EX(str, len, 0); /* returns true for "1", "true", "on" and "yes" * returns false for "0", "false", "off", "no", and "" * null otherwise. */ switch (len) { + case 0: + ret = 0; + break; case 1: if (*str == '1') { ret = 1; @@ -286,7 +289,7 @@ ret = -1; } - if (ret == -1) { + if (ret == -1) { RETURN_VALIDATION_FAILED } else { zval_dtor(value); diff -Nru php5-5.4.4/ext/filter/tests/bug49510.phpt php5-5.4.9/ext/filter/tests/bug49510.phpt --- php5-5.4.4/ext/filter/tests/bug49510.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/filter/tests/bug49510.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,36 @@ +--TEST-- +#49510 boolean validation fails with FILTER_NULL_ON_FAILURE +--FILE-- + +==DONE== +--EXPECT-- +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +NULL +==DONE== diff -Nru php5-5.4.4/ext/gd/config.w32 php5-5.4.9/ext/gd/config.w32 --- php5-5.4.4/ext/gd/config.w32 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/gd/config.w32 2012-11-21 05:12:20.000000000 +0000 @@ -15,7 +15,9 @@ (CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) && CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD) && (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD) )) || - (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "gd", PHP_GD)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) + (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "gd", PHP_GD)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) && + CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("xpm.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\X11") ) { if (PHP_T1LIB != "no") { if (CHECK_LIB("T1_StaticMD.lib", "gd", PHP_GD) && @@ -56,6 +58,7 @@ /D HAVE_GD_STRINGTTF=1 \ /D HAVE_GD_WBMP \ /D HAVE_GD_XBM \ +/D HAVE_GD_XPM \ /D HAVE_GD_WEBP \ /D HAVE_LIBFREETYPE=1 \ /D HAVE_LIBGD13=1 \ @@ -65,6 +68,7 @@ /D HAVE_LIBJPEG \ /D HAVE_LIBVPX \ /D HAVE_LIBPNG \ +/D HAVE_XPM \ /D HAVE_COLORCLOSESTHWB \ /D USE_GD_IMGSTRTTF \ /D USE_GD_IOCTX \ diff -Nru php5-5.4.4/ext/gd/gd.c php5-5.4.9/ext/gd/gd.c --- php5-5.4.4/ext/gd/gd.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/gd/gd.c 2012-11-21 05:12:20.000000000 +0000 @@ -1328,6 +1328,11 @@ #endif #if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) php_info_print_table_row(2, "XPM Support", "enabled"); + { + char tmp[12]; + snprintf(tmp, sizeof(tmp), "%d", XpmLibraryVersion()); + php_info_print_table_row(2, "libXpm Version", tmp); + } #endif #ifdef HAVE_GD_XBM php_info_print_table_row(2, "XBM Support", "enabled"); diff -Nru php5-5.4.4/ext/gd/libgd/gd_png.c php5-5.4.9/ext/gd/libgd/gd_png.c --- php5-5.4.4/ext/gd/libgd/gd_png.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/gd/libgd/gd_png.c 2012-11-21 05:12:20.000000000 +0000 @@ -127,8 +127,8 @@ png_color_16p trans_gray_rgb; png_color_16p trans_color_rgb; png_bytep trans; - png_bytep image_data = NULL; - png_bytepp row_pointers = NULL; + volatile png_bytep image_data = NULL; + volatile png_bytepp row_pointers = NULL; gdImagePtr im = NULL; int i, j, *open = NULL; volatile int transparent = -1; diff -Nru php5-5.4.4/ext/gd/libgd/xbm.c php5-5.4.9/ext/gd/libgd/xbm.c --- php5-5.4.4/ext/gd/libgd/xbm.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/gd/libgd/xbm.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/gd/tests/bug43073.phpt php5-5.4.9/ext/gd/tests/bug43073.phpt --- php5-5.4.4/ext/gd/tests/bug43073.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/gd/tests/bug43073.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,9 +1,12 @@ --TEST-- -Bug #43073 (TrueType bounding box is wrong for angle<>0) +Bug #43073 (TrueType bounding box is wrong for angle<>0) freetype < 2.4.10 --SKIPIF-- = 0) die('skip for freetype < 2.4.10'); ?> --FILE-- 0) freetype >= 2.4.10 +--SKIPIF-- += 2.4.10'); +?> +--FILE-- + +--CLEAN-- + +--EXPECTF-- +(500, 400), (610, 400), (610, 376), (500, 376) +(492, 363), (591, 322), (580, 295), (480, 336) +(470, 331), (548, 254), (527, 233), (449, 310) +(439, 309), (483, 202), (461, 193), (416, 299) +(400, 300), (400, 183), (380, 183), (380, 300) +(362, 307), (316, 195), (291, 205), (337, 318) +(330, 329), (246, 244), (224, 265), (308, 350) +(308, 360), (202, 316), (190, 344), (296, 388) +(300, 400), (187, 400), (187, 425), (300, 425) +(306, 437), (195, 483), (206, 510), (318, 464) +(328, 469), (240, 557), (260, 578), (349, 491) +(359, 491), (312, 607), (334, 616), (382, 501) +(400, 500), (400, 618), (419, 618), (419, 500) +(436, 493), (483, 607), (507, 597), (461, 482) +(468, 471), (555, 558), (577, 538), (490, 450) +(490, 440), (600, 485), (611, 457), (502, 412) diff -Nru php5-5.4.4/ext/gd/tests/bug48801.phpt php5-5.4.9/ext/gd/tests/bug48801.phpt --- php5-5.4.4/ext/gd/tests/bug48801.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/gd/tests/bug48801.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,9 +1,12 @@ --TEST-- -Bug #48801 (Problem with imagettfbbox) +Bug #48801 (Problem with imagettfbbox) freetype < 2.4.10 --SKIPIF-- = 0) die('skip for freetype < 2.4.10'); ?> --FILE-- = 2.4.10 +--SKIPIF-- += 2.4.10'); +?> +--FILE-- + +--EXPECTF-- +(-1, 15) +(156, 15) +(156, -48) +(-1, -48) diff -Nru php5-5.4.4/ext/gd/tests/func.inc php5-5.4.9/ext/gd/tests/func.inc --- php5-5.4.4/ext/gd/tests/func.inc 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/gd/tests/func.inc 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,61 @@ + (\d+\.\d+\.\d+),s', get_php_info(), $match)) { + $version = $match[1]; + } + + return $version; +} + +function get_libjpeg_version() +{ + $version = 0; + + if (preg_match(',libJPEG Version => ([a-z0-9]+),s', get_php_info(), $match)) { + $version = $match[1]; + } + + return $version; +} + +function get_libpng_version() +{ + $version = 0; + + if (preg_match(',libPNG Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) { + $version = $match[1]; + } + + return $version; +} + +function get_libxpm_version() +{ + $version = 0; + + if (preg_match(',libXpm Version => (\d+),s', get_php_info(), $match)) { + $version = $match[1]; + } + + return $version; +} + diff -Nru php5-5.4.4/ext/gmp/tests/022.phpt php5-5.4.9/ext/gmp/tests/022.phpt --- php5-5.4.4/ext/gmp/tests/022.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/gmp/tests/022.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,7 +1,8 @@ --TEST-- gmp_gcdext() basic tests --SKIPIF-- - + --FILE-- + --FILE-- > 8) & 0x0f), (_libiconv_version & 0x0f)); + ((_libiconv_version >> 8) & 0x0f), (_libiconv_version & 0x0f)); version = buf; } #elif HAVE_GLIBC_ICONV @@ -354,7 +354,7 @@ if (mimetype != NULL && !(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) { int len; - char *p = strstr(ICONVG(output_encoding), "//"); + char *p = strstr(ICONVG(output_encoding), "//"); if (p) { len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (int) strlen(mimetype), mimetype, (int)(p - ICONVG(output_encoding)), ICONVG(output_encoding)); @@ -375,7 +375,7 @@ return SUCCESS; } - + /* {{{ _php_iconv_appendl() */ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd) { @@ -400,7 +400,7 @@ if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) { #if ICONV_SUPPORTS_ERRNO - switch (errno) { + switch (errno) { case EINVAL: return PHP_ICONV_ERR_ILLEGAL_CHAR; @@ -415,7 +415,7 @@ } #else if (prev_in_left == in_left) { - return PHP_ICONV_ERR_UNKNOWN; + return PHP_ICONV_ERR_UNKNOWN; } #endif } @@ -446,7 +446,7 @@ #else if (out_left != 0) { return PHP_ICONV_ERR_UNKNOWN; - } + } #endif } (d)->len += (buf_growth - out_left); @@ -492,31 +492,35 @@ in_size = in_len; cd = iconv_open(out_charset, in_charset); - + if (cd == (iconv_t)(-1)) { return PHP_ICONV_ERR_UNKNOWN; } out_buffer = (char *) emalloc(out_size + 1); out_p = out_buffer; - + #ifdef NETWARE result = iconv(cd, (char **) &in_p, &in_size, (char **) #else result = iconv(cd, (const char **) &in_p, &in_size, (char **) #endif &out_p, &out_left); - + if (result == (size_t)(-1)) { efree(out_buffer); return PHP_ICONV_ERR_UNKNOWN; } if (out_left < 8) { - out_buffer = (char *) erealloc(out_buffer, out_size + 8); + size_t pos = out_p - out_buffer; + out_buffer = (char *) safe_erealloc(out_buffer, out_size, 1, 8); + out_p = out_buffer+pos; + out_size += 7; + out_left += 7; } - /* flush the shift-out sequences */ + /* flush the shift-out sequences */ result = iconv(cd, NULL, NULL, &out_p, &out_left); if (result == (size_t)(-1)) { @@ -555,10 +559,10 @@ } } in_left= in_len; - out_left = in_len + 32; /* Avoid realloc() most cases */ + out_left = in_len + 32; /* Avoid realloc() most cases */ out_size = 0; bsz = out_left; - out_buf = (char *) emalloc(bsz+1); + out_buf = (char *) emalloc(bsz+1); out_p = out_buf; while (in_left > 0) { @@ -573,14 +577,14 @@ out_p = out_buf = tmp_buf; out_p += out_size; out_left = bsz - out_size; - continue; + continue; } } break; } if (result != (size_t)(-1)) { - /* flush the shift-out sequences */ + /* flush the shift-out sequences */ for (;;) { result = iconv(cd, NULL, NULL, (char **) &out_p, &out_left); out_size = bsz - out_left; @@ -592,7 +596,7 @@ if (errno == E2BIG) { bsz += 16; tmp_buf = (char *) erealloc(out_buf, bsz); - + out_p = out_buf = tmp_buf; out_p += out_size; out_left = bsz - out_size; @@ -684,7 +688,7 @@ } if (out_left > 0) { - cnt -= out_left / GENERIC_SUPERSET_NBYTES; + cnt -= out_left / GENERIC_SUPERSET_NBYTES; } #if ICONV_SUPPORTS_ERRNO @@ -735,12 +739,12 @@ unsigned int cnt; int total_len; - + err = _php_iconv_strlen(&total_len, str, nbytes, enc); if (err != PHP_ICONV_ERR_SUCCESS) { return err; } - + if (len < 0) { if ((len += (total_len - offset)) < 0) { return PHP_ICONV_ERR_SUCCESS; @@ -772,7 +776,7 @@ smart_str_0(pretval); return PHP_ICONV_ERR_SUCCESS; } - + cd1 = iconv_open(GENERIC_SUPERSET_NAME, enc); if (cd1 == (iconv_t)(-1)) { @@ -857,7 +861,7 @@ if (cd2 != (iconv_t)NULL) { iconv_close(cd2); - } + } return err; } @@ -1042,7 +1046,7 @@ if (ndl_buf) { efree(ndl_buf); } - + iconv_close(cd); return err; @@ -1089,7 +1093,7 @@ if ((fname_nbytes + 2) >= max_line_len || (out_charset_len + 12) >= max_line_len) { /* field name is too long */ - err = PHP_ICONV_ERR_TOO_BIG; + err = PHP_ICONV_ERR_TOO_BIG; goto out; } @@ -1131,7 +1135,7 @@ char_cnt -= 2; in_p = fval; - in_left = fval_nbytes; + in_left = fval_nbytes; do { size_t prev_in_left; @@ -1142,8 +1146,8 @@ smart_str_appendl(pretval, lfchars, lfchars_len); smart_str_appendc(pretval, ' '); char_cnt = max_line_len - 1; - } - + } + smart_str_appendl(pretval, "=?", sizeof("=?") - 1); char_cnt -= 2; smart_str_appendl(pretval, out_charset, out_charset_len); @@ -1195,7 +1199,7 @@ goto out; } break; - + default: err = PHP_ICONV_ERR_UNKNOWN; goto out; @@ -1295,7 +1299,7 @@ goto out; } break; - + default: err = PHP_ICONV_ERR_UNKNOWN; goto out; @@ -1372,7 +1376,7 @@ } if (encoded != NULL) { efree(encoded); - } + } if (buf != NULL) { efree(buf); } @@ -1391,7 +1395,7 @@ size_t str_left; unsigned int scan_stat = 0; const char *csname = NULL; - size_t csname_len; + size_t csname_len; const char *encoded_text = NULL; size_t encoded_text_len = 0; const char *encoded_word = NULL; @@ -1430,7 +1434,7 @@ break; case '\n': - scan_stat = 8; + scan_stat = 8; break; case '=': /* first letter of an encoded chunk */ @@ -1455,7 +1459,7 @@ case 1: /* expecting a delimiter */ if (*p1 != '?') { - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); + err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { goto out; } @@ -1470,7 +1474,7 @@ csname = p1 + 1; scan_stat = 2; break; - + case 2: /* expecting a charset name */ switch (*p1) { case '?': /* normal delimiter: encoding scheme follows */ @@ -1480,7 +1484,7 @@ case '*': /* new style delimiter: locale id follows */ scan_stat = 10; break; - } + } if (scan_stat != 2) { char tmpbuf[80]; @@ -1493,7 +1497,7 @@ if (csname_len > sizeof(tmpbuf) - 1) { if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); + err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { goto out; } @@ -1549,7 +1553,7 @@ --str_left; } - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); + err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { goto out; } @@ -1608,12 +1612,12 @@ } } break; - + case 4: /* expecting a delimiter */ if (*p1 != '?') { if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { /* pass the entire chunk through the converter */ - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); + err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { goto out; } @@ -1669,7 +1673,7 @@ if (*p1 != '=') { if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { /* pass the entire chunk through the converter */ - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); + err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { goto out; } @@ -1696,17 +1700,17 @@ switch (*p1) { default: /* Handle non-RFC-compliant formats - * + * * RFC2047 requires the character that comes right * after an encoded word (chunk) to be a whitespace, * while there are lots of broken implementations that * generate such malformed headers that don't fulfill * that requirement. - */ - if (!eos) { + */ + if (!eos) { if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { /* pass the entire chunk through the converter */ - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); + err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { goto out; } @@ -1738,7 +1742,7 @@ if (decoded_text == NULL) { if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { /* pass the entire chunk through the converter */ - err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); + err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { goto out; } @@ -1761,7 +1765,7 @@ if (err != PHP_ICONV_ERR_SUCCESS) { if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { /* pass the entire chunk through the converter */ - err = _php_iconv_appendl(pretval, encoded_word, (size_t)(p1 - encoded_word), cd_pl); + err = _php_iconv_appendl(pretval, encoded_word, (size_t)(p1 - encoded_word), cd_pl); encoded_word = NULL; if (err != PHP_ICONV_ERR_SUCCESS) { break; @@ -1956,7 +1960,7 @@ char *charset = ICONVG(internal_encoding); int charset_len = 0; char *str; - int str_len; + int str_len; php_iconv_err_t err; @@ -1972,7 +1976,7 @@ RETURN_FALSE; } - err = _php_iconv_strlen(&retval, str, str_len, charset); + err = _php_iconv_strlen(&retval, str, str_len, charset); _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC); if (err == PHP_ICONV_ERR_SUCCESS) { RETVAL_LONG(retval); @@ -1989,7 +1993,7 @@ char *charset = ICONVG(internal_encoding); int charset_len = 0; char *str; - int str_len; + int str_len; long offset, length = 0; php_iconv_err_t err; @@ -2008,10 +2012,10 @@ } if (ZEND_NUM_ARGS() < 3) { - length = str_len; + length = str_len; } - err = _php_iconv_substr(&retval, str, str_len, offset, length, charset); + err = _php_iconv_substr(&retval, str, str_len, offset, length, charset); _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC); if (err == PHP_ICONV_ERR_SUCCESS && str != NULL && retval.c != NULL) { @@ -2029,7 +2033,7 @@ char *charset = ICONVG(internal_encoding); int charset_len = 0; char *haystk; - int haystk_len; + int haystk_len; char *ndl; int ndl_len; long offset = 0; @@ -2059,7 +2063,7 @@ } err = _php_iconv_strpos(&retval, haystk, haystk_len, ndl, ndl_len, - offset, charset); + offset, charset); _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC); if (err == PHP_ICONV_ERR_SUCCESS && retval != (unsigned int)-1) { @@ -2077,7 +2081,7 @@ char *charset = ICONVG(internal_encoding); int charset_len = 0; char *haystk; - int haystk_len; + int haystk_len; char *ndl; int ndl_len; @@ -2101,7 +2105,7 @@ } err = _php_iconv_strpos(&retval, haystk, haystk_len, ndl, ndl_len, - -1, charset); + -1, charset); _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC); if (err == PHP_ICONV_ERR_SUCCESS && retval != (unsigned int)-1) { @@ -2241,7 +2245,7 @@ char *charset = ICONVG(internal_encoding); int charset_len = 0; long mode = 0; - + smart_str retval = {0}; php_iconv_err_t err; @@ -2282,7 +2286,7 @@ char *charset = ICONVG(internal_encoding); int charset_len = 0; long mode = 0; - + php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", @@ -2350,14 +2354,14 @@ zend_hash_update(Z_ARRVAL_P(return_value), header_name, header_name_len, (void *)&new_elem, sizeof(new_elem), NULL); elem = &new_elem; - } + } add_next_index_stringl(*elem, header_value, header_value_len, 1); } else { add_assoc_stringl_ex(return_value, header_name, header_name_len, header_value, header_value_len, 1); } } encoded_str_len -= next_pos - encoded_str; - encoded_str = next_pos; + encoded_str = next_pos; smart_str_free(&decoded_header); } @@ -2378,7 +2382,7 @@ size_t out_len; int in_charset_len = 0, out_charset_len = 0, in_buffer_len; php_iconv_err_t err; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &in_charset, &in_charset_len, &out_charset, &out_charset_len, &in_buffer, &in_buffer_len) == FAILURE) return; @@ -2390,7 +2394,7 @@ err = php_iconv_string(in_buffer, (size_t)in_buffer_len, &out_buffer, &out_len, out_charset, in_charset); - _php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC); + _php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC); if (err == PHP_ICONV_ERR_SUCCESS && out_buffer != NULL) { RETVAL_STRINGL(out_buffer, out_len, 0); } else { @@ -2539,7 +2543,7 @@ icnt = buf_len; } - out_buf_size = ocnt = prev_ocnt = initial_out_buf_size; + out_buf_size = ocnt = prev_ocnt = initial_out_buf_size; if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) { return FAILURE; } diff -Nru php5-5.4.4/ext/imap/tests/imap_errors_basic.phpt php5-5.4.9/ext/imap/tests/imap_errors_basic.phpt --- php5-5.4.4/ext/imap/tests/imap_errors_basic.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/imap/tests/imap_errors_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -7,7 +7,7 @@ --FILE-- zo, ce TSRMLS_CC ); + object_properties_init(&intern->zo, ce); retval.handle = zend_objects_store_put( intern, diff -Nru php5-5.4.4/ext/intl/collator/collator_class.h php5-5.4.9/ext/intl/collator/collator_class.h --- php5-5.4.4/ext/intl/collator/collator_class.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/collator/collator_class.h 2012-11-21 05:12:20.000000000 +0000 @@ -20,8 +20,9 @@ #include -#include "intl_common.h" -#include "intl_error.h" +#include "../intl_common.h" +#include "../intl_error.h" +#include "../intl_data.h" #include @@ -54,9 +55,7 @@ Collator_object* co = NULL; \ intl_error_reset( NULL TSRMLS_CC ); \ -#define COLLATOR_METHOD_FETCH_OBJECT \ - co = (Collator_object *) zend_object_store_get_object( object TSRMLS_CC ); \ - intl_error_reset( COLLATOR_ERROR_P( co ) TSRMLS_CC ); \ +#define COLLATOR_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(Collator, co) // Macro to check return value of a ucol_* function call. #define COLLATOR_CHECK_STATUS( co, msg ) \ diff -Nru php5-5.4.4/ext/intl/collator/collator_create.c php5-5.4.9/ext/intl/collator/collator_create.c --- php5-5.4.4/ext/intl/collator/collator_create.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/collator/collator_create.c 2012-11-21 05:12:20.000000000 +0000 @@ -45,7 +45,7 @@ } INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value); - co = (Collator_object *) zend_object_store_get_object( object TSRMLS_CC ); + COLLATOR_METHOD_FETCH_OBJECT; if(locale_len == 0) { locale = INTL_G(default_locale); diff -Nru php5-5.4.4/ext/intl/collator/collator_sort.c php5-5.4.9/ext/intl/collator/collator_sort.c --- php5-5.4.4/ext/intl/collator/collator_sort.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/collator/collator_sort.c 2012-11-21 05:12:20.000000000 +0000 @@ -594,6 +594,8 @@ RETURN_FALSE; } + /* ucol_getSortKey is exception in that the key length includes the + * NUL terminator*/ key_len = ucol_getSortKey(co->ucoll, ustr, ustr_len, key, 0); if(!key_len) { efree( ustr ); @@ -605,7 +607,7 @@ if(!key_len) { RETURN_FALSE; } - RETURN_STRINGL((char *)key, key_len, 0); + RETURN_STRINGL((char *)key, key_len - 1, 0); } /* }}} */ diff -Nru php5-5.4.4/ext/intl/common/common_error.c php5-5.4.9/ext/intl/common/common_error.c --- php5-5.4.4/ext/intl/common/common_error.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/common/common_error.c 2012-11-21 05:12:20.000000000 +0000 @@ -24,7 +24,7 @@ #include "common_error.h" /* {{{ proto int intl_get_error_code() - * Get code of the last occured error. + * Get code of the last occurred error. */ PHP_FUNCTION( intl_get_error_code ) { @@ -33,7 +33,7 @@ /* }}} */ /* {{{ proto string intl_get_error_message() - * Get text description of the last occured error. + * Get text description of the last occurred error. */ PHP_FUNCTION( intl_get_error_message ) { @@ -240,7 +240,9 @@ INTL_EXPOSE_CONST( U_IDNA_ACE_PREFIX_ERROR ); INTL_EXPOSE_CONST( U_IDNA_VERIFICATION_ERROR ); INTL_EXPOSE_CONST( U_IDNA_LABEL_TOO_LONG_ERROR ); +#if U_ICU_VERSION_MAJOR_NUM > 3 || U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM >= 6 INTL_EXPOSE_CONST( U_IDNA_ZERO_LENGTH_LABEL_ERROR ); +#endif #if U_ICU_VERSION_MAJOR_NUM > 3 || U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM >= 8 INTL_EXPOSE_CONST( U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR ); #endif diff -Nru php5-5.4.4/ext/intl/dateformat/dateformat.c php5-5.4.9/ext/intl/dateformat/dateformat.c --- php5-5.4.4/ext/intl/dateformat/dateformat.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/dateformat/dateformat.c 2012-11-21 05:12:20.000000000 +0000 @@ -99,17 +99,46 @@ } INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value); - DATE_FORMAT_METHOD_FETCH_OBJECT; + + if (calendar != UCAL_TRADITIONAL && calendar != UCAL_GREGORIAN) { + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: " + "invalid value for calendar type; it must be one of " + "IntlDateFormatter::TRADITIONAL (locale's default calendar) " + "or IntlDateFormatter::GREGORIAN", 0 TSRMLS_CC); + goto error; + } + + DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; + + if (DATE_FORMAT_OBJECT(dfo) != NULL) { + intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR, + "datefmt_create: cannot call constructor twice", 0 TSRMLS_CC); + return; + } + /* Convert pattern (if specified) to UTF-16. */ if( pattern_str && pattern_str_len>0 ){ - intl_convert_utf8_to_utf16(&svalue, &slength, pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo)); - INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting pattern to UTF-16"); + intl_convert_utf8_to_utf16(&svalue, &slength, + pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo)); + if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) { + /* object construction -> only set global error */ + intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: " + "error converting pattern to UTF-16", 0 TSRMLS_CC); + goto error; + } } + + /* resources allocated from now on */ /* Convert pattern (if specified) to UTF-16. */ if( timezone_str && timezone_str_len >0 ){ - intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len, timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo)); - INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting timezone_str to UTF-16" ); + intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len, + timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo)); + if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) { + intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: " + "error converting timezone_str to UTF-16", 0 TSRMLS_CC); + goto error; + } } if(locale_len == 0) { @@ -122,25 +151,25 @@ DATE_FORMAT_OBJECT(dfo) = udat_open(time_type, date_type, locale, timezone_utf16, timezone_utf16_len, svalue, slength, &INTL_DATA_ERROR_CODE(dfo)); } - /* Set the calendar if passed */ - if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo)) && calendar) { - ucal_obj = ucal_open( timezone_utf16, timezone_utf16_len, locale, calendar, &INTL_DATA_ERROR_CODE(dfo) ); - if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) { - udat_setCalendar( DATE_FORMAT_OBJECT(dfo), ucal_obj ); + if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) { + if (calendar != UCAL_TRADITIONAL) { + ucal_obj = ucal_open(timezone_utf16, timezone_utf16_len, locale, + calendar, &INTL_DATA_ERROR_CODE(dfo)); + if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) { + udat_setCalendar(DATE_FORMAT_OBJECT(dfo), ucal_obj); + ucal_close(ucal_obj); + } else { + intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create" + ": error opening calendar", 0 TSRMLS_CC); + goto error; + } } - } - - if(svalue) - { - efree(svalue); - } - if(timezone_utf16) - { - efree(timezone_utf16); + } else { + intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: date " + "formatter creation failed", 0 TSRMLS_CC); + goto error; } - INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: date formatter creation failed"); - /* Set the class variables */ dfo->date_type = date_type; dfo->time_type = time_type; @@ -148,6 +177,19 @@ if( timezone_str && timezone_str_len > 0){ dfo->timezone_id = estrndup( timezone_str, timezone_str_len); } + +error: + if (svalue) { + efree(svalue); + } + if (timezone_utf16) { + efree(timezone_utf16); + } + if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) { + /* free_object handles partially constructed instances fine */ + zval_dtor(return_value); + RETVAL_NULL(); + } } /* }}} */ @@ -169,6 +211,8 @@ */ PHP_METHOD( IntlDateFormatter, __construct ) { + /* return_value param is being changed, therefore we will always return + * NULL here */ return_value = getThis(); datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU); } diff -Nru php5-5.4.4/ext/intl/dateformat/dateformat_attr.c php5-5.4.9/ext/intl/dateformat/dateformat_attr.c --- php5-5.4.4/ext/intl/dateformat/dateformat_attr.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/dateformat/dateformat_attr.c 2012-11-21 05:12:20.000000000 +0000 @@ -17,8 +17,9 @@ #include "config.h" #endif -#include "php_intl.h" -#include "intl_convert.h" +#include "../php_intl.h" +#include "dateformat_class.h" +#include "../intl_convert.h" #include "dateformat_class.h" #include "dateformat_attr.h" diff -Nru php5-5.4.4/ext/intl/dateformat/dateformat_class.c php5-5.4.9/ext/intl/dateformat/dateformat_class.c --- php5-5.4.4/ext/intl/dateformat/dateformat_class.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/dateformat/dateformat_class.c 2012-11-21 05:12:20.000000000 +0000 @@ -23,6 +23,8 @@ #include "dateformat.h" #include "dateformat_attr.h" +#include + zend_class_entry *IntlDateFormatter_ce_ptr = NULL; static zend_object_handlers IntlDateFormatter_handlers; @@ -63,6 +65,7 @@ intern = ecalloc( 1, sizeof(IntlDateFormatter_object) ); dateformat_data_init( &intern->datef_data TSRMLS_CC ); zend_object_std_init( &intern->zo, ce TSRMLS_CC ); + object_properties_init(&intern->zo, ce); intern->date_type = 0; intern->time_type = 0; intern->calendar = 1; /* Gregorian calendar */ @@ -87,18 +90,23 @@ zend_object_handle handle = Z_OBJ_HANDLE_P(object); IntlDateFormatter_object *dfo, *new_dfo; - DATE_FORMAT_METHOD_FETCH_OBJECT; - new_obj_val = IntlDateFormatter_ce_ptr->create_object(IntlDateFormatter_ce_ptr TSRMLS_CC); + DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; + + new_obj_val = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); new_dfo = (IntlDateFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC); /* clone standard parts */ zend_objects_clone_members(&new_dfo->zo, new_obj_val, &dfo->zo, handle TSRMLS_CC); /* clone formatter object */ - DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(new_dfo)); - if(U_FAILURE(INTL_DATA_ERROR_CODE(new_dfo))) { - /* set up error in case error handler is interested */ - intl_error_set( NULL, INTL_DATA_ERROR_CODE(new_dfo), "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC ); - IntlDateFormatter_object_dtor(new_dfo, new_obj_val.handle TSRMLS_CC); /* free new object */ - zend_error(E_ERROR, "Failed to clone IntlDateFormatter object"); + if (dfo->datef_data.udatf != NULL) { + DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(dfo)); + if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) { + /* set up error in case error handler is interested */ + intl_errors_set(INTL_DATA_ERROR_P(dfo), INTL_DATA_ERROR_CODE(dfo), + "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC ); + zend_throw_exception(NULL, "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC); + } + } else { + zend_throw_exception(NULL, "Cannot clone unconstructed IntlDateFormatter", 0 TSRMLS_CC); } return new_obj_val; } diff -Nru php5-5.4.4/ext/intl/dateformat/dateformat_class.h php5-5.4.9/ext/intl/dateformat/dateformat_class.h --- php5-5.4.4/ext/intl/dateformat/dateformat_class.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/dateformat/dateformat_class.h 2012-11-21 05:12:20.000000000 +0000 @@ -38,7 +38,15 @@ /* Auxiliary macros */ #define DATE_FORMAT_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(IntlDateFormatter, dfo) -#define DATE_FORMAT_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(IntlDateFormatter, dfo) +#define DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(IntlDateFormatter, dfo) +#define DATE_FORMAT_METHOD_FETCH_OBJECT \ + DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \ + if (dfo->datef_data.udatf == NULL) \ + { \ + intl_errors_set(&dfo->datef_data.error, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlDateFormatter", 0 TSRMLS_CC); \ + RETURN_FALSE; \ + } + #define DATE_FORMAT_OBJECT(dfo) (dfo)->datef_data.udatf #endif // #ifndef DATE_FORMAT_CLASS_H diff -Nru php5-5.4.4/ext/intl/doc/collator_api.php php5-5.4.9/ext/intl/doc/collator_api.php --- php5-5.4.4/ext/intl/doc/collator_api.php 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/doc/collator_api.php 2012-11-21 05:12:20.000000000 +0000 @@ -116,7 +116,7 @@ /** * Return error text for the last ICU operation. * - * @return string Description of an error occured in the last + * @return string Description of an error occurred in the last * Collator method call. */ public function getErrorMessage() {} @@ -236,7 +236,7 @@ * * @return string Real locale name from which the * collation data comes. If the collator - * was instantiated from rules or an error occured, + * was instantiated from rules or an error occurred, * returns false. */ public function getLocale( $type ) {} @@ -331,7 +331,7 @@ * * @return string Real locale name from which the * collation data comes. If the collator - * was instantiated from rules or an error occured, + * was instantiated from rules or an error occurred, * returns false. */ function collator_get_locale( $coll, $type ) {} @@ -391,7 +391,7 @@ * * @param Collator $coll Collator object. * - * @return string Description of an error occured in the last + * @return string Description of an error occurred in the last * Collator API function call. */ function collator_get_error_message( $coll ) {} diff -Nru php5-5.4.4/ext/intl/doc/common_api.php php5-5.4.9/ext/intl/doc/common_api.php --- php5-5.4.4/ext/intl/doc/common_api.php 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/doc/common_api.php 2012-11-21 05:12:20.000000000 +0000 @@ -1,7 +1,7 @@ + zend_class_entry *NumberFormatter_ce_ptr = NULL; static zend_object_handlers NumberFormatter_handlers; @@ -62,6 +64,7 @@ intern = ecalloc( 1, sizeof(NumberFormatter_object) ); formatter_data_init( &intern->nf_data TSRMLS_CC ); zend_object_std_init( &intern->zo, ce TSRMLS_CC ); + object_properties_init(&intern->zo, ce); retval.handle = zend_objects_store_put( intern, @@ -82,18 +85,23 @@ zend_object_handle handle = Z_OBJ_HANDLE_P(object); NumberFormatter_object *nfo, *new_nfo; - FORMATTER_METHOD_FETCH_OBJECT; - new_obj_val = NumberFormatter_ce_ptr->create_object(NumberFormatter_ce_ptr TSRMLS_CC); + FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK; + new_obj_val = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); new_nfo = (NumberFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC); /* clone standard parts */ zend_objects_clone_members(&new_nfo->zo, new_obj_val, &nfo->zo, handle TSRMLS_CC); - /* clone formatter object */ - FORMATTER_OBJECT(new_nfo) = unum_clone(FORMATTER_OBJECT(nfo), &INTL_DATA_ERROR_CODE(new_nfo)); - if(U_FAILURE(INTL_DATA_ERROR_CODE(new_nfo))) { - /* set up error in case error handler is interested */ - intl_error_set( NULL, INTL_DATA_ERROR_CODE(new_nfo), "Failed to clone NumberFormatter object", 0 TSRMLS_CC ); - NumberFormatter_object_dtor(new_nfo, new_obj_val.handle TSRMLS_CC); /* free new object */ - zend_error(E_ERROR, "Failed to clone NumberFormatter object"); + /* clone formatter object. It may fail, the destruction code must handle this case */ + if (FORMATTER_OBJECT(nfo) != NULL) { + FORMATTER_OBJECT(new_nfo) = unum_clone(FORMATTER_OBJECT(nfo), + &INTL_DATA_ERROR_CODE(nfo)); + if (U_FAILURE(INTL_DATA_ERROR_CODE(nfo))) { + /* set up error in case error handler is interested */ + intl_errors_set(INTL_DATA_ERROR_P(nfo), INTL_DATA_ERROR_CODE(nfo), + "Failed to clone NumberFormatter object", 0 TSRMLS_CC); + zend_throw_exception(NULL, "Failed to clone NumberFormatter object", 0 TSRMLS_CC); + } + } else { + zend_throw_exception(NULL, "Cannot clone unconstructed NumberFormatter", 0 TSRMLS_CC); } return new_obj_val; } diff -Nru php5-5.4.4/ext/intl/formatter/formatter_class.h php5-5.4.9/ext/intl/formatter/formatter_class.h --- php5-5.4.4/ext/intl/formatter/formatter_class.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/formatter/formatter_class.h 2012-11-21 05:12:20.000000000 +0000 @@ -34,8 +34,17 @@ /* Auxiliary macros */ -#define FORMATTER_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(NumberFormatter, nfo) -#define FORMATTER_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(NumberFormatter, nfo) -#define FORMATTER_OBJECT(nfo) (nfo)->nf_data.unum +#define FORMATTER_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(NumberFormatter, nfo) +#define FORMATTER_OBJECT(nfo) (nfo)->nf_data.unum +#define FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(NumberFormatter, nfo) +#define FORMATTER_METHOD_FETCH_OBJECT \ + FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK; \ + if (FORMATTER_OBJECT(nfo) == NULL) \ + { \ + intl_errors_set(&nfo->nf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \ + "Found unconstructed NumberFormatter", 0 TSRMLS_CC); \ + RETURN_FALSE; \ + } + #endif // #ifndef FORMATTER_CLASS_H diff -Nru php5-5.4.4/ext/intl/formatter/formatter_main.c php5-5.4.9/ext/intl/formatter/formatter_main.c --- php5-5.4.4/ext/intl/formatter/formatter_main.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/formatter/formatter_main.c 2012-11-21 05:12:20.000000000 +0000 @@ -47,7 +47,7 @@ INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value); object = return_value; - FORMATTER_METHOD_FETCH_OBJECT; + FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK; /* Convert pattern (if specified) to UTF-16. */ if(pattern && pattern_len) { diff -Nru php5-5.4.4/ext/intl/grapheme/grapheme_string.c php5-5.4.9/ext/intl/grapheme/grapheme_string.c --- php5-5.4.4/ext/intl/grapheme/grapheme_string.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/grapheme/grapheme_string.c 2012-11-21 05:12:20.000000000 +0000 @@ -822,6 +822,7 @@ } else { /* initialize next */ + zval_dtor(next); ZVAL_LONG(next, lstart); } } diff -Nru php5-5.4.4/ext/intl/intl_convert.c php5-5.4.9/ext/intl/intl_convert.c --- php5-5.4.4/ext/intl/intl_convert.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/intl_convert.c 2012-11-21 05:12:20.000000000 +0000 @@ -67,7 +67,7 @@ return; } - /* Bail out if an unexpected error occured. + /* Bail out if an unexpected error occurred. * (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough). * (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty). */ @@ -119,7 +119,7 @@ *status = U_ZERO_ERROR; u_strToUTF8( NULL, 0, &dst_len, src, src_len, status ); - /* Bail out if an unexpected error occured. + /* Bail out if an unexpected error occurred. * (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough). * (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty). */ diff -Nru php5-5.4.4/ext/intl/msgformat/msgformat.c php5-5.4.9/ext/intl/msgformat/msgformat.c --- php5-5.4.4/ext/intl/msgformat/msgformat.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/msgformat/msgformat.c 2012-11-21 05:12:20.000000000 +0000 @@ -49,7 +49,7 @@ } INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value); - MSG_FORMAT_METHOD_FETCH_OBJECT; + MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; /* Convert pattern (if specified) to UTF-16. */ if(pattern && pattern_len) { @@ -64,9 +64,11 @@ locale = INTL_G(default_locale); } +#ifdef MSG_FORMAT_QUOTE_APOS if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) { INTL_CTOR_CHECK_STATUS(mfo, "msgfmt_create: error converting pattern to quote-friendly format"); } +#endif if ((mfo)->mf_data.orig_format) { msgformat_data_free(&mfo->mf_data TSRMLS_CC); diff -Nru php5-5.4.4/ext/intl/msgformat/msgformat_attr.c php5-5.4.9/ext/intl/msgformat/msgformat_attr.c --- php5-5.4.4/ext/intl/msgformat/msgformat_attr.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/msgformat/msgformat_attr.c 2012-11-21 05:12:20.000000000 +0000 @@ -82,11 +82,13 @@ intl_convert_utf8_to_utf16(&spattern, &spattern_len, value, value_len, &INTL_DATA_ERROR_CODE(mfo)); INTL_METHOD_CHECK_STATUS(mfo, "Error converting pattern to UTF-16" ); +#ifdef MSG_FORMAT_QUOTE_APOS if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) { intl_error_set( NULL, U_INVALID_FORMAT_ERROR, "msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 TSRMLS_CC ); RETURN_FALSE; } +#endif /* TODO: add parse error information */ umsg_applyPattern(MSG_FORMAT_OBJECT(mfo), spattern, spattern_len, NULL, &INTL_DATA_ERROR_CODE(mfo)); diff -Nru php5-5.4.4/ext/intl/msgformat/msgformat_class.c php5-5.4.9/ext/intl/msgformat/msgformat_class.c --- php5-5.4.4/ext/intl/msgformat/msgformat_class.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/msgformat/msgformat_class.c 2012-11-21 05:12:20.000000000 +0000 @@ -24,6 +24,8 @@ #include "msgformat.h" #include "msgformat_attr.h" +#include + zend_class_entry *MessageFormatter_ce_ptr = NULL; static zend_object_handlers MessageFormatter_handlers; @@ -60,6 +62,7 @@ intern = ecalloc( 1, sizeof(MessageFormatter_object) ); msgformat_data_init( &intern->mf_data TSRMLS_CC ); zend_object_std_init( &intern->zo, ce TSRMLS_CC ); + object_properties_init(&intern->zo, ce); retval.handle = zend_objects_store_put( intern, @@ -80,18 +83,24 @@ zend_object_handle handle = Z_OBJ_HANDLE_P(object); MessageFormatter_object *mfo, *new_mfo; - MSG_FORMAT_METHOD_FETCH_OBJECT; - new_obj_val = MessageFormatter_ce_ptr->create_object(MessageFormatter_ce_ptr TSRMLS_CC); + MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; + new_obj_val = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); new_mfo = (MessageFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC); /* clone standard parts */ zend_objects_clone_members(&new_mfo->zo, new_obj_val, &mfo->zo, handle TSRMLS_CC); + /* clone formatter object */ - MSG_FORMAT_OBJECT(new_mfo) = umsg_clone(MSG_FORMAT_OBJECT(mfo), &INTL_DATA_ERROR_CODE(new_mfo)); - if(U_FAILURE(INTL_DATA_ERROR_CODE(new_mfo))) { - /* set up error in case error handler is interested */ - intl_error_set( NULL, INTL_DATA_ERROR_CODE(new_mfo), "Failed to clone MessageFormatter object", 0 TSRMLS_CC ); - MessageFormatter_object_dtor(new_mfo, new_obj_val.handle TSRMLS_CC); /* free new object */ - zend_error(E_ERROR, "Failed to clone MessageFormatter object"); + if (MSG_FORMAT_OBJECT(mfo) != NULL) { + MSG_FORMAT_OBJECT(new_mfo) = umsg_clone(MSG_FORMAT_OBJECT(mfo), + &INTL_DATA_ERROR_CODE(mfo)); + + if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) { + intl_errors_set(INTL_DATA_ERROR_P(mfo), INTL_DATA_ERROR_CODE(mfo), + "Failed to clone MessageFormatter object", 0 TSRMLS_CC); + zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed to clone MessageFormatter object"); + } + } else { + zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Cannot clone unconstructed MessageFormatter"); } return new_obj_val; } diff -Nru php5-5.4.4/ext/intl/msgformat/msgformat_class.h php5-5.4.9/ext/intl/msgformat/msgformat_class.h --- php5-5.4.4/ext/intl/msgformat/msgformat_class.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/msgformat/msgformat_class.h 2012-11-21 05:12:20.000000000 +0000 @@ -19,9 +19,11 @@ #include -#include "intl_common.h" -#include "intl_error.h" -#include "intl_data.h" +#include + +#include "../intl_common.h" +#include "../intl_error.h" +#include "../intl_data.h" #include "msgformat_data.h" typedef struct { @@ -35,7 +37,19 @@ /* Auxiliary macros */ #define MSG_FORMAT_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(MessageFormatter, mfo) -#define MSG_FORMAT_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo) +#define MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo) +#define MSG_FORMAT_METHOD_FETCH_OBJECT \ + MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \ + if (MSG_FORMAT_OBJECT(mfo) == NULL) { \ + intl_errors_set(&mfo->mf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \ + "Found unconstructed MessageFormatter", 0 TSRMLS_CC); \ + RETURN_FALSE; \ + } + #define MSG_FORMAT_OBJECT(mfo) (mfo)->mf_data.umsgf +#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48 +# define MSG_FORMAT_QUOTE_APOS 1 +#endif + #endif // #ifndef MSG_FORMAT_CLASS_H diff -Nru php5-5.4.4/ext/intl/msgformat/msgformat_data.c php5-5.4.9/ext/intl/msgformat/msgformat_data.c --- php5-5.4.4/ext/intl/msgformat/msgformat_data.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/msgformat/msgformat_data.c 2012-11-21 05:12:20.000000000 +0000 @@ -21,6 +21,8 @@ #include #include "msgformat_data.h" +#include "msgformat_class.h" + /* {{{ void msgformat_data_init( msgformat_data* mf_data ) * Initialize internals of msgformat_data. */ @@ -69,6 +71,7 @@ } /* }}} */ +#ifdef MSG_FORMAT_QUOTE_APOS int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec) { if(*spattern && *spattern_len && u_strchr(*spattern, (UChar)'\'')) { @@ -86,6 +89,7 @@ } return SUCCESS; } +#endif /* diff -Nru php5-5.4.4/ext/intl/msgformat/msgformat_data.h php5-5.4.9/ext/intl/msgformat/msgformat_data.h --- php5-5.4.4/ext/intl/msgformat/msgformat_data.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/msgformat/msgformat_data.h 2012-11-21 05:12:20.000000000 +0000 @@ -19,9 +19,9 @@ #include -#include +#include "../intl_error.h" -#include "intl_error.h" +#include typedef struct { // error hangling @@ -36,6 +36,9 @@ msgformat_data* msgformat_data_create( TSRMLS_D ); void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC ); void msgformat_data_free( msgformat_data* mf_data TSRMLS_DC ); + +#ifdef MSG_FORMAT_QUOTE_APOS int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec); +#endif #endif // MSG_FORMAT_DATA_H diff -Nru php5-5.4.4/ext/intl/msgformat/msgformat_format.c php5-5.4.9/ext/intl/msgformat/msgformat_format.c --- php5-5.4.4/ext/intl/msgformat/msgformat_format.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/msgformat/msgformat_format.c 2012-11-21 05:12:20.000000000 +0000 @@ -154,11 +154,13 @@ slocale = INTL_G(default_locale); } +#ifdef MSG_FORMAT_QUOTE_APOS if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) { intl_error_set( NULL, U_INVALID_FORMAT_ERROR, "msgfmt_format_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC ); RETURN_FALSE; } +#endif /* Create an ICU message formatter. */ MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo)); diff -Nru php5-5.4.4/ext/intl/msgformat/msgformat_parse.c php5-5.4.9/ext/intl/msgformat/msgformat_parse.c --- php5-5.4.4/ext/intl/msgformat/msgformat_parse.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/msgformat/msgformat_parse.c 2012-11-21 05:12:20.000000000 +0000 @@ -129,11 +129,13 @@ slocale = INTL_G(default_locale); } +#ifdef MSG_FORMAT_QUOTE_APOS if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) { intl_error_set( NULL, U_INVALID_FORMAT_ERROR, "msgfmt_parse_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC ); RETURN_FALSE; } +#endif /* Create an ICU message formatter. */ MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo)); diff -Nru php5-5.4.4/ext/intl/normalizer/normalizer_normalize.c php5-5.4.9/ext/intl/normalizer/normalizer_normalize.c --- php5-5.4.4/ext/intl/normalizer/normalizer_normalize.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/normalizer/normalizer_normalize.c 2012-11-21 05:12:20.000000000 +0000 @@ -110,7 +110,7 @@ /* normalize */ size_needed = unorm_normalize( uinput, uinput_len, form, (int32_t) 0 /* options */, uret_buf, uret_len, &status); - /* Bail out if an unexpected error occured. + /* Bail out if an unexpected error occurred. * (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough). * (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty). */ @@ -133,7 +133,7 @@ /* try normalize again */ size_needed = unorm_normalize( uinput, uinput_len, form, (int32_t) 0 /* options */, uret_buf, uret_len, &status); - /* Bail out if an unexpected error occured. */ + /* Bail out if an unexpected error occurred. */ if( U_FAILURE(status) ) { /* Set error messages. */ intl_error_set_custom_msg( NULL,"Error normalizing string", 0 TSRMLS_CC ); @@ -234,7 +234,7 @@ efree( uinput ); - /* Bail out if an unexpected error occured. */ + /* Bail out if an unexpected error occurred. */ if( U_FAILURE(status) ) { /* Set error messages. */ intl_error_set_custom_msg( NULL,"Error testing if string is the given normalization form.", 0 TSRMLS_CC ); diff -Nru php5-5.4.4/ext/intl/php_intl.c php5-5.4.9/ext/intl/php_intl.c --- php5-5.4.4/ext/intl/php_intl.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/php_intl.c 2012-11-21 05:12:20.000000000 +0000 @@ -70,7 +70,7 @@ #include "idn/idn.h" -#if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2 +#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002 # include "spoofchecker/spoofchecker_class.h" # include "spoofchecker/spoofchecker.h" # include "spoofchecker/spoofchecker_create.h" @@ -646,7 +646,7 @@ /* Expose IDN constants to PHP scripts. */ idn_register_constants(INIT_FUNC_ARGS_PASSTHRU); -#if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2 +#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002 /* Register 'Spoofchecker' PHP class */ spoofchecker_register_Spoofchecker_class( TSRMLS_C ); diff -Nru php5-5.4.4/ext/intl/resourcebundle/resourcebundle_class.c php5-5.4.9/ext/intl/resourcebundle/resourcebundle_class.c --- php5-5.4.4/ext/intl/resourcebundle/resourcebundle_class.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/resourcebundle/resourcebundle_class.c 2012-11-21 05:12:20.000000000 +0000 @@ -63,6 +63,7 @@ rb = ecalloc( 1, sizeof(ResourceBundle_object) ); zend_object_std_init( (zend_object *) rb, ce TSRMLS_CC ); + object_properties_init((zend_object *) rb, ce); intl_error_init( INTL_DATA_ERROR_P(rb) TSRMLS_CC ); rb->me = NULL; @@ -91,7 +92,7 @@ intl_error_reset( NULL TSRMLS_CC ); - if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", + if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s!s!|b", &locale, &locale_len, &bundlename, &bundlename_len, &fallback ) == FAILURE ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, @@ -101,6 +102,10 @@ } INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value); + + if (locale == NULL) { + locale = INTL_G(default_locale); + } if (fallback) { rb->me = ures_open(bundlename, locale, &INTL_DATA_ERROR_CODE(rb)); @@ -110,13 +115,17 @@ INTL_CTOR_CHECK_STATUS(rb, "resourcebundle_ctor: Cannot load libICU resource bundle"); - if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING || INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) { - intl_errors_set_code( NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC ); - spprintf( &pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource '%s' without fallback from %s to %s", - bundlename, locale, ures_getLocaleByType( rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb)) ); - intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC ); + if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING || + INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) { + intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC); + spprintf(&pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource " + "'%s' without fallback from %s to %s", + bundlename ? bundlename : "(default data)", locale, + ures_getLocaleByType( + rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb))); + intl_errors_set_custom_msg(INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC); efree(pbuf); - zval_dtor( return_value ); + zval_dtor(return_value); RETURN_NULL(); } } @@ -252,7 +261,14 @@ /* {{{ resourcebundle_array_count */ int resourcebundle_array_count(zval *object, long *count TSRMLS_DC) { - ResourceBundle_object *rb = (ResourceBundle_object *) zend_object_store_get_object( object TSRMLS_CC); + ResourceBundle_object *rb; + RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK; + + if (rb->me == NULL) { + intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, + "Found unconstructed ResourceBundle", 0 TSRMLS_CC); + return 0; + } *count = ures_getSize( rb->me ); @@ -427,6 +443,8 @@ ResourceBundle_object_handlers.clone_obj = NULL; /* ICU ResourceBundle has no clone implementation */ ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get; ResourceBundle_object_handlers.count_elements = resourcebundle_array_count; + + zend_class_implements(ResourceBundle_ce_ptr TSRMLS_CC, 1, zend_ce_traversable); } /* }}} */ diff -Nru php5-5.4.4/ext/intl/resourcebundle/resourcebundle_class.h php5-5.4.9/ext/intl/resourcebundle/resourcebundle_class.h --- php5-5.4.4/ext/intl/resourcebundle/resourcebundle_class.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/resourcebundle/resourcebundle_class.h 2012-11-21 05:12:20.000000000 +0000 @@ -33,7 +33,16 @@ } ResourceBundle_object; #define RESOURCEBUNDLE_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(ResourceBundle, rb) -#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb) +#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb) +#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT \ + INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb); \ + if (RESOURCEBUNDLE_OBJECT(rb) == NULL) { \ + intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, \ + "Found unconstructed ResourceBundle", 0 TSRMLS_CC); \ + RETURN_FALSE; \ + } + + #define RESOURCEBUNDLE_OBJECT(rb) (rb)->me void resourcebundle_register_class( TSRMLS_D ); diff -Nru php5-5.4.4/ext/intl/spoofchecker/spoofchecker_class.c php5-5.4.9/ext/intl/spoofchecker/spoofchecker_class.c --- php5-5.4.4/ext/intl/spoofchecker/spoofchecker_class.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/spoofchecker/spoofchecker_class.c 2012-11-21 05:12:20.000000000 +0000 @@ -61,6 +61,7 @@ intern = ecalloc(1, sizeof(Spoofchecker_object)); intl_error_init(SPOOFCHECKER_ERROR_P(intern) TSRMLS_CC); zend_object_std_init(&intern->zo, ce TSRMLS_CC); + object_properties_init(&intern->zo, ce); retval.handle = zend_objects_store_put( intern, @@ -126,7 +127,7 @@ sfo = (Spoofchecker_object *) zend_object_store_get_object(object TSRMLS_CC); intl_error_reset(SPOOFCHECKER_ERROR_P(sfo) TSRMLS_CC); - new_obj_val = Spoofchecker_ce_ptr->create_object(Spoofchecker_ce_ptr TSRMLS_CC); + new_obj_val = Spoofchecker_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC); new_sfo = (Spoofchecker_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC); /* clone standard parts */ zend_objects_clone_members(&new_sfo->zo, new_obj_val, &sfo->zo, handle TSRMLS_CC); diff -Nru php5-5.4.4/ext/intl/spoofchecker/spoofchecker_class.h php5-5.4.9/ext/intl/spoofchecker/spoofchecker_class.h --- php5-5.4.4/ext/intl/spoofchecker/spoofchecker_class.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/spoofchecker/spoofchecker_class.h 2012-11-21 05:12:20.000000000 +0000 @@ -22,6 +22,7 @@ #include "intl_common.h" #include "spoofchecker_create.h" #include "intl_error.h" +#include "intl_data.h" #include @@ -55,9 +56,14 @@ Spoofchecker_object* co = NULL; \ intl_error_reset(NULL TSRMLS_CC); \ -#define SPOOFCHECKER_METHOD_FETCH_OBJECT \ - co = (Spoofchecker_object *) zend_object_store_get_object(object TSRMLS_CC); \ - intl_error_reset(SPOOFCHECKER_ERROR_P(co) TSRMLS_CC); \ +#define SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(Spoofchecker, co) +#define SPOOFCHECKER_METHOD_FETCH_OBJECT \ + SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK; \ + if (co->uspoof == NULL) { \ + intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, \ + "Found unconstructed Spoofchecker", 0 TSRMLS_CC); \ + RETURN_FALSE; \ + } // Macro to check return value of a ucol_* function call. #define SPOOFCHECKER_CHECK_STATUS(co, msg) \ diff -Nru php5-5.4.4/ext/intl/spoofchecker/spoofchecker_create.c php5-5.4.9/ext/intl/spoofchecker/spoofchecker_create.c --- php5-5.4.4/ext/intl/spoofchecker/spoofchecker_create.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/spoofchecker/spoofchecker_create.c 2012-11-21 05:12:20.000000000 +0000 @@ -35,7 +35,7 @@ return; } - SPOOFCHECKER_METHOD_FETCH_OBJECT; + SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK; co->uspoof = uspoof_open(SPOOFCHECKER_ERROR_CODE_P(co)); INTL_CTOR_CHECK_STATUS(co, "spoofchecker: unable to open ICU Spoof Checker"); diff -Nru php5-5.4.4/ext/intl/tests/bug59597_64.phpt php5-5.4.9/ext/intl/tests/bug59597_64.phpt --- php5-5.4.4/ext/intl/tests/bug59597_64.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/bug59597_64.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -18,4 +18,3 @@ --EXPECT-- int(2147483647) int(2147483650) - diff -Nru php5-5.4.4/ext/intl/tests/bug62017.phpt php5-5.4.9/ext/intl/tests/bug62017.phpt --- php5-5.4.4/ext/intl/tests/bug62017.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/bug62017.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,22 @@ +--TEST-- +Bug #62017: datefmt_create with incorrectly encoded timezone leaks pattern +--SKIPIF-- += 49 only'); +--FILE-- +__construct(1,1,1,1,1)); +--EXPECTF-- +Warning: IntlDateFormatter::__construct(): datefmt_create: cannot call constructor twice in %s on line %d +NULL diff -Nru php5-5.4.4/ext/intl/tests/bug62083.phpt php5-5.4.9/ext/intl/tests/bug62083.phpt --- php5-5.4.4/ext/intl/tests/bug62083.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/bug62083.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,12 @@ +--TEST-- +Bug #62083: grapheme_extract() leaks memory +--SKIPIF-- +newInstanceArgs($subclass::$ARGS); + $clone = clone $obj; + var_dump(get_class($clone)); +} +--EXPECT-- +string(1) "A" +string(1) "B" +string(1) "C" +string(1) "D" diff -Nru php5-5.4.4/ext/intl/tests/collator_get_sort_key.phpt php5-5.4.9/ext/intl/tests/collator_get_sort_key.phpt --- php5-5.4.4/ext/intl/tests/collator_get_sort_key.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/collator_get_sort_key.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -2,8 +2,7 @@ collator_get_sort_key() --SKIPIF-- ---XFAIL-- -Sort keys are not fixed, comparing them to fixed strings doesn't work. += 4.8 only'; ?> --FILE-- --EXPECT-- source: abc -key: %29%2B-%01%07%01%07%00 +key: 27292b01070107 source: abd -key: %29%2B%2F%01%07%01%07%00 +key: 27292d01070107 source: aaa -key: %29%29%29%01%07%01%07%00 -source: %D0%B0%D0%B0 -key: _++%01%06%01%06%00 -source: %D0%B0 -key: _+%01%05%01%05%00 +key: 27272701070107 +source: аа +key: 5c0a0a01060106 +source: а +key: 5c0a01050105 source: z -key: %5B%01%05%01%05%00 -source: -key: %01%01%00 -source: -key: %01%01%00 +key: 5901050105 +source: +key: 0101 +source: +key: 0101 source: 3 -key: %26%80%01%05%01%05%00 +key: 1801050105 source: y -key: Y%01%05%01%05%00 +key: 5701050105 source: i -key: 9%01%05%01%05%00 +key: 3701050105 source: k -key: %3D%01%05%01%05%00 -source: %D0%B0%D0%B1%D0%B3 -key: _+%2C0%01%07%01%07%00 -source: %D0%B0%D0%B1%D0%B2 -key: _+%2C.%01%07%01%07%00 -source: %D0%B6%D0%B6%D0%B6 -key: _LLL%01%07%01%07%00 -source: %D1%8D%D1%8E%D1%8F -key: %60%05%09%0B%01%07%01%07%00 -source: %D0%B0%D0%B1%D0%B3 -key: _+%2C0%01%07%01%07%00 -source: %D0%B0%D0%B1%D0%B2 -key: _+%2C.%01%07%01%07%00 -source: %D0%B6%D0%B6%D0%B6 -key: _LLL%01%07%01%07%00 -source: %D1%8D%D1%8E%D1%8F -key: %60%05%09%0B%01%07%01%07%00 \ No newline at end of file +key: 3b01050105 +source: абг +key: 5c0a161a01070107 +source: абв +key: 5c0a161801070107 +source: жжж +key: 5c3a3a3a01070107 +source: эюя +key: 5d3b3f4501070107 +source: абг +key: 5c0a161a01070107 +source: абв +key: 5c0a161801070107 +source: жжж +key: 5c3a3a3a01070107 +source: эюя +key: 5d3b3f4501070107 \ No newline at end of file diff -Nru php5-5.4.4/ext/intl/tests/dateformat_calendars.phpt php5-5.4.9/ext/intl/tests/dateformat_calendars.phpt --- php5-5.4.4/ext/intl/tests/dateformat_calendars.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/dateformat_calendars.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,45 @@ +--TEST-- +IntlDateFormatter, calendars and time zone +--INI-- +date.timezone=Atlantic/Azores +--SKIPIF-- +format(strtotime('2012-01-01 00:00:00 +0000'))); +var_dump($fmt2->format(strtotime('2012-01-01 00:00:00 +0000'))); +var_dump($fmt3->format(strtotime('2012-01-01 00:00:00 +0000'))); + +new IntlDateFormatter('en_US@calendar=hebrew', + IntlDateFormatter::FULL, + IntlDateFormatter::FULL, + 'GMT+05:12', + -1); +?> +==DONE== +--EXPECTF-- +string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12" +string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12" +string(42) "Sunday, Tevet 6, 5772 5:12:00 AM GMT+05:12" + +Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN in %s on line %d +==DONE== diff -Nru php5-5.4.4/ext/intl/tests/dateformat_clone_bad_obj.phpt php5-5.4.9/ext/intl/tests/dateformat_clone_bad_obj.phpt --- php5-5.4.4/ext/intl/tests/dateformat_clone_bad_obj.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/dateformat_clone_bad_obj.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,20 @@ +--TEST-- +Cloning unconstructed IntlDateFormatter +--SKIPIF-- + +--FILE-- +getMessage()); +} + +--EXPECTF-- +string(%s) "Cannot clone unconstructed IntlDateFormatter" diff -Nru php5-5.4.4/ext/intl/tests/formatter_clone_bad_obj.phpt php5-5.4.9/ext/intl/tests/formatter_clone_bad_obj.phpt --- php5-5.4.4/ext/intl/tests/formatter_clone_bad_obj.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/formatter_clone_bad_obj.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,20 @@ +--TEST-- +Cloning unconstructed numfmt +--SKIPIF-- + +--FILE-- +getMessage()); +} + +--EXPECTF-- +string(42) "Cannot clone unconstructed NumberFormatter" diff -Nru php5-5.4.4/ext/intl/tests/formatter_get_error.phpt php5-5.4.9/ext/intl/tests/formatter_get_error.phpt --- php5-5.4.4/ext/intl/tests/formatter_get_error.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/formatter_get_error.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -19,7 +19,7 @@ if( $num === false ) return $fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n"; else - return "Ooops, an error should have occured."; + return "Ooops, an error should have occurred."; } include_once( 'ut_common.inc' ); diff -Nru php5-5.4.4/ext/intl/tests/formatter_get_set_attribute.phpt php5-5.4.9/ext/intl/tests/formatter_get_set_attribute.phpt --- php5-5.4.4/ext/intl/tests/formatter_get_set_attribute.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/formatter_get_set_attribute.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,8 +1,8 @@ --TEST-- -numfmt_get/set_attribute() icu < 4.2 +numfmt_get/set_attribute() --SKIPIF-- - + --FILE-- array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ), 'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ), 'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ), - 'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ), + 'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 2, 12345.123456 ), 'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ), 'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ), 'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ), @@ -159,7 +159,7 @@ New attribute value: 1 ; Format result: '0,012,345.12345' ; Parse result: 12345.12345 Attribute ROUNDING_INCREMENT -Old attribute value: 1.0E-5 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 +Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 Setting attribute: ok New attribute value: 2 ; Format result: '0,012,346.00000' ; Parse result: 12346 @@ -171,7 +171,7 @@ Attribute PADDING_POSITION Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 Setting attribute: ok -New attribute value: 21 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 +New attribute value: 2 ; Format result: '0,012,345.12346************' ; Parse result: 12345.12346 Attribute SECONDARY_GROUPING_SIZE Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 diff -Nru php5-5.4.4/ext/intl/tests/formatter_get_set_attribute2.phpt php5-5.4.9/ext/intl/tests/formatter_get_set_attribute2.phpt --- php5-5.4.4/ext/intl/tests/formatter_get_set_attribute2.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/formatter_get_set_attribute2.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,194 +0,0 @@ ---TEST-- -numfmt_get/set_attribute() icu >= 4.8 ---SKIPIF-- - - ---FILE-- - array( attr, value ) - $attributes = array( - 'PARSE_INT_ONLY' => array( NumberFormatter::PARSE_INT_ONLY, 1, 12345.123456 ), - 'GROUPING_USED' => array( NumberFormatter::GROUPING_USED, 0, 12345.123456 ), - 'DECIMAL_ALWAYS_SHOWN' => array( NumberFormatter::DECIMAL_ALWAYS_SHOWN, 1, 12345 ), - 'MAX_INTEGER_DIGITS' => array( NumberFormatter::MAX_INTEGER_DIGITS, 2, 12345.123456 ), - 'MIN_INTEGER_DIGITS' => array( NumberFormatter::MIN_INTEGER_DIGITS, 20, 12345.123456 ), - 'INTEGER_DIGITS' => array( NumberFormatter::INTEGER_DIGITS, 7, 12345.123456 ), - 'MAX_FRACTION_DIGITS' => array( NumberFormatter::MAX_FRACTION_DIGITS, 2, 12345.123456 ), - 'MIN_FRACTION_DIGITS' => array( NumberFormatter::MIN_FRACTION_DIGITS, 20, 12345.123456 ), - 'FRACTION_DIGITS' => array( NumberFormatter::FRACTION_DIGITS, 5, 12345.123456 ), - 'MULTIPLIER' => array( NumberFormatter::MULTIPLIER, 2, 12345.123456 ), - 'GROUPING_SIZE' => array( NumberFormatter::GROUPING_SIZE, 2, 12345.123456 ), - 'ROUNDING_MODE' => array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ), - 'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ), - 'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ), - 'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ), - 'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ), - 'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ), - 'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ), - 'MAX_SIGNIFICANT_DIGITS' => array( NumberFormatter::MAX_SIGNIFICANT_DIGITS, 4, 12345.123456 ), - // 'LENIENT_PARSE' => array( NumberFormatter::LENIENT_PARSE, 2, 12345.123456 ) - ); - - $res_str = ''; - - $fmt = ut_nfmt_create( "en_US", NumberFormatter::DECIMAL ); - - foreach( $attributes as $attr_name => $args ) - { - list( $attr, $new_val, $number ) = $args; - $res_str .= "\nAttribute $attr_name\n"; - - // Get original value of the attribute. - $orig_val = ut_nfmt_get_attribute( $fmt, $attr ); - - // Format the number using the original attribute value. - $rc = ut_nfmt_format( $fmt, $number ); - - $ps = ut_nfmt_parse( $fmt, $rc ); - - $res_str .= sprintf( "Old attribute value: %s ; Format result: %s ; Parse result: %s\n", - dump( $orig_val ), - dump( $rc ), - dump( $ps ) ); - - // Set new attribute value. - $rc = ut_nfmt_set_attribute( $fmt, $attr, $new_val ); - if( $rc ) - $res_str .= "Setting attribute: ok\n"; - else - $res_str .= sprintf( "Setting attribute failed: %s\n", ut_nfmt_get_error_message( $fmt ) ); - - // Format the number using the new value. - $rc = ut_nfmt_format( $fmt, $number ); - - // Get current value of the attribute and check if it equals $new_val. - $attr_val_check = ut_nfmt_get_attribute( $fmt, $attr ); - if( $attr_val_check !== $new_val ) - $res_str .= "ERROR: New $attr_name attribute value has not been set correctly.\n"; - - $ps = ut_nfmt_parse( $fmt, $rc ); - - $res_str .= sprintf( "New attribute value: %s ; Format result: %s ; Parse result: %s\n", - dump( $new_val ), - dump( $rc ), - dump( $ps ) ); - - - // Restore original attribute of the value - if( $attr != NumberFormatter::INTEGER_DIGITS && $attr != NumberFormatter::FRACTION_DIGITS - && $attr != NumberFormatter::FORMAT_WIDTH && $attr != NumberFormatter::SIGNIFICANT_DIGITS_USED ) - ut_nfmt_set_attribute( $fmt, $attr, $orig_val ); - } - - return $res_str; -} - -include_once( 'ut_common.inc' ); - -// Run the test -ut_run(); - -?> ---EXPECT-- -Attribute PARSE_INT_ONLY -Old attribute value: 0 ; Format result: '12,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345 - -Attribute GROUPING_USED -Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 0 ; Format result: '12345.123' ; Parse result: 12345.123 - -Attribute DECIMAL_ALWAYS_SHOWN -Old attribute value: 0 ; Format result: '12,345' ; Parse result: 12345 -Setting attribute: ok -New attribute value: 1 ; Format result: '12,345.' ; Parse result: 12345 - -Attribute MAX_INTEGER_DIGITS -Old attribute value: 309 ; Format result: '12,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 2 ; Format result: '45.123' ; Parse result: 45.123 - -Attribute MIN_INTEGER_DIGITS -Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 20 ; Format result: '00,000,000,000,000,012,345.123' ; Parse result: 12345.123 - -Attribute INTEGER_DIGITS -Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 7 ; Format result: '0,012,345.123' ; Parse result: 12345.123 - -Attribute MAX_FRACTION_DIGITS -Old attribute value: 3 ; Format result: '0,012,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 2 ; Format result: '0,012,345.12' ; Parse result: 12345.12 - -Attribute MIN_FRACTION_DIGITS -Old attribute value: 0 ; Format result: '0,012,345.123' ; Parse result: 12345.123 -Setting attribute: ok -New attribute value: 20 ; Format result: '0,012,345.12345600000000000000' ; Parse result: 12345.123456 - -Attribute FRACTION_DIGITS -Old attribute value: 0 ; Format result: '0,012,345.123456' ; Parse result: 12345.123456 -Setting attribute: ok -New attribute value: 5 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 - -Attribute MULTIPLIER -Old attribute value: 1 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 2 ; Format result: '0,024,690.24691' ; Parse result: 12345.123455 - -Attribute GROUPING_SIZE -Old attribute value: 3 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 2 ; Format result: '0,01,23,45.12346' ; Parse result: 12345.12346 - -Attribute ROUNDING_MODE -Old attribute value: 4 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 1 ; Format result: '0,012,345.12345' ; Parse result: 12345.12345 - -Attribute ROUNDING_INCREMENT -Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 2 ; Format result: '0,012,346.00000' ; Parse result: 12346 - -Attribute FORMAT_WIDTH -Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 27 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 - -Attribute PADDING_POSITION -Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 21 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346 - -Attribute SECONDARY_GROUPING_SIZE -Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 2 ; Format result: '************00,12,345.12346' ; Parse result: 12345.12346 - -Attribute SIGNIFICANT_DIGITS_USED -Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346 -Setting attribute: ok -New attribute value: 1 ; Format result: '*******************12,345.1' ; Parse result: 12345.1 - -Attribute MIN_SIGNIFICANT_DIGITS -Old attribute value: 1 ; Format result: '**************************1' ; Parse result: 1 -Setting attribute: ok -New attribute value: 3 ; Format result: '***********************1.00' ; Parse result: 1 - -Attribute MAX_SIGNIFICANT_DIGITS -Old attribute value: 6 ; Format result: '*******************12,345.1' ; Parse result: 12345.1 -Setting attribute: ok -New attribute value: 4 ; Format result: '*********************12,350' ; Parse result: 12350 diff -Nru php5-5.4.4/ext/intl/tests/locale_get_display_script2.phpt php5-5.4.9/ext/intl/tests/locale_get_display_script2.phpt --- php5-5.4.4/ext/intl/tests/locale_get_display_script2.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/locale_get_display_script2.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,8 +1,8 @@ --TEST-- -locale_get_display_script() icu >= 4.8 +locale_get_display_script() icu = 4.8 --SKIPIF-- - += 0) print 'skip'; ?> --FILE-- = 49 +--SKIPIF-- + + +--FILE-- + +--EXPECT-- +locale='uk-ua_CALIFORNIA@currency=;currency=GRN' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='root' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='uk@currency=EURO' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='Hindi' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='de' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='fr' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='ja' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='i-enochian' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='zh-Hant' +disp_locale=en : display_script=Traditional Han +disp_locale=fr : display_script=chinois traditionnel +disp_locale=de : display_script=Traditionelles Chinesisch +----------------- +locale='zh-Hans' +disp_locale=en : display_script=Simplified Han +disp_locale=fr : display_script=chinois simplifié +disp_locale=de : display_script=Vereinfachtes Chinesisch +----------------- +locale='sr-Cyrl' +disp_locale=en : display_script=Cyrillic +disp_locale=fr : display_script=cyrillique +disp_locale=de : display_script=Kyrillisch +----------------- +locale='sr-Latn' +disp_locale=en : display_script=Latin +disp_locale=fr : display_script=latin +disp_locale=de : display_script=Lateinisch +----------------- +locale='zh-Hans-CN' +disp_locale=en : display_script=Simplified Han +disp_locale=fr : display_script=chinois simplifié +disp_locale=de : display_script=Vereinfachtes Chinesisch +----------------- +locale='sr-Latn-CS' +disp_locale=en : display_script=Latin +disp_locale=fr : display_script=latin +disp_locale=de : display_script=Lateinisch +----------------- +locale='sl-rozaj' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='sl-nedis' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='de-CH-1901' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='sl-IT-nedis' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='sl-Latn-IT-nedis' +disp_locale=en : display_script=Latin +disp_locale=fr : display_script=latin +disp_locale=de : display_script=Lateinisch +----------------- +locale='de-DE' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='en-US' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='es-419' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='de-CH-x-phonebk' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='az-Arab-x-AZE-derbend' +disp_locale=en : display_script=Arabic +disp_locale=fr : display_script=arabe +disp_locale=de : display_script=Arabisch +----------------- +locale='zh-min' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='zh-min-nan-Hant-CN' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='x-whatever' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='qaa-Qaaa-QM-x-southern' +disp_locale=en : display_script=Qaaa +disp_locale=fr : display_script=Qaaa +disp_locale=de : display_script=Qaaa +----------------- +locale='sr-Latn-QM' +disp_locale=en : display_script=Latin +disp_locale=fr : display_script=latin +disp_locale=de : display_script=Lateinisch +----------------- +locale='sr-Qaaa-CS' +disp_locale=en : display_script=Qaaa +disp_locale=fr : display_script=Qaaa +disp_locale=de : display_script=Qaaa +----------------- +locale='en-US-u-islamCal' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='zh-CN-a-myExt-x-private' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='en-a-myExt-b-another' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='de-419-DE' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='a-DE' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- +locale='ar-a-aaa-b-bbb-a-ccc' +disp_locale=en : display_script= +disp_locale=fr : display_script= +disp_locale=de : display_script= +----------------- diff -Nru php5-5.4.4/ext/intl/tests/msgfmt_clone_bad_obj.phpt php5-5.4.9/ext/intl/tests/msgfmt_clone_bad_obj.phpt --- php5-5.4.4/ext/intl/tests/msgfmt_clone_bad_obj.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/msgfmt_clone_bad_obj.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,20 @@ +--TEST-- +Cloning unconstructed MessageFormatter +--SKIPIF-- + +--FILE-- +getMessage()); +} + +--EXPECTF-- +string(%d) "Cannot clone unconstructed MessageFormatter" diff -Nru php5-5.4.4/ext/intl/tests/resourcebundle_null_mandatory_args.phpt php5-5.4.9/ext/intl/tests/resourcebundle_null_mandatory_args.phpt --- php5-5.4.4/ext/intl/tests/resourcebundle_null_mandatory_args.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/resourcebundle_null_mandatory_args.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,28 @@ +--TEST-- +ResourceBundle constructor bundle accepts NULL for first two arguments +--INI-- +date.timezone=Atlantic/Azores +--SKIPIF-- += 4.8 only'); +--FILE-- +get('calendar')->get('gregorian')->get('DateTimePatterns')->get(0); +var_dump($c); + +ini_set('intl.default_locale', 'pt_PT'); +$r = new ResourceBundle(NULL, NULL); +$c = $r->get('calendar')->get('gregorian')->get('DateTimePatterns')->get(0); +var_dump($c); +?> +==DONE== +--EXPECT-- +string(14) "h:mm:ss a zzzz" +string(12) "H:mm:ss zzzz" +==DONE== diff -Nru php5-5.4.4/ext/intl/tests/resourcebundle_traversable.phpt php5-5.4.9/ext/intl/tests/resourcebundle_traversable.phpt --- php5-5.4.4/ext/intl/tests/resourcebundle_traversable.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/resourcebundle_traversable.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,23 @@ +--TEST-- +Bug #55610: ResourceBundle does not implement Traversable +--SKIPIF-- + +--FILE-- +get('testarray'))); +?> +--EXPECTF-- +bool(true) +array(3) { + [0]=> + string(8) "cadena 1" + [1]=> + string(8) "cadena 2" + [2]=> + string(8) "cadena 3" +} diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_double_intl1.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_double_intl1.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_double_intl1.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_double_intl1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #1 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(1) "1" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_double_intl2.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_double_intl2.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_double_intl2.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_double_intl2.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #2 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(3) "1.1" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_double_intl3.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_double_intl3.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_double_intl3.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_double_intl3.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #3 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(7) "SFD1.00" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_double_intl4.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_double_intl4.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_double_intl4.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_double_intl4.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #4 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(7) "SFD1.10" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl1.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl1.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl1.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,49 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #1 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(1) "1" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl2.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl2.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl2.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl2.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,33 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #2 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(1) "1" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl3.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl3.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl3.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl3.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,32 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #3 +--SKIPIF-- + +--FILE-- +format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range.";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt32Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(4) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(2147483648) + [2]=> + string(14) "-2,147,483,648" + [3]=> + string(83) "->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range." +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl4.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl4.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl4.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl4.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #4 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(7) "SFD1.00" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl5.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl5.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl5.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl5.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #5 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(7) "SFD1.00" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl6.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl6.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl6.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl6.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,32 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #6 +--SKIPIF-- + +--FILE-- +format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range.";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt32Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(4) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(2147483648) + [2]=> + string(21) "(SFD2,147,483,648.00)" + [3]=> + string(83) "->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range." +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl7.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl7.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int32_intl7.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int32_intl7.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,32 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #7 +--SKIPIF-- + +--FILE-- +format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range.";}'); + +var_dump($unit_test_args); + +// execute the code from #testFormatTypeInt32Intl +$unit_test_args[0]->format($unit_test_args[1], \NumberFormatter::TYPE_INT32); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(4) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(-2147483649) + [2]=> + string(19) "SFD2,147,483,647.00" + [3]=> + string(83) "->format() TYPE_INT32 formats inconsistently an integer if out of the 32 bit range." +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl1.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl1.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl1.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #1 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(1) "1" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl2.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl2.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl2.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl2.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #2 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(1) "1" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl3.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl3.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl3.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl3.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #3 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(2147483648) + [2]=> + string(13) "2,147,483,648" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl4.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl4.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl4.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl4.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #4 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(-2147483649) + [2]=> + string(14) "-2,147,483,649" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl5.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl5.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl5.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl5.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #5 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + int(1) + [2]=> + string(7) "SFD1.00" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl6.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl6.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl6.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl6.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #6 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(1.1) + [2]=> + string(7) "SFD1.00" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl7.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl7.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl7.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl7.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #7 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(2147483648) + [2]=> + string(19) "SFD2,147,483,648.00" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl8.phpt php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl8.phpt --- php5-5.4.4/ext/intl/tests/symfony_format_type_int64_intl8.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/intl/tests/symfony_format_type_int64_intl8.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Symfony StubNumberFormatterTest#testFormatTypeInt64Intl #8 +--SKIPIF-- + +--FILE-- +format($unit_test_args[1], \NumberFormatter::TYPE_INT64); + +echo "== didn't crash ==".PHP_EOL; + +?> +--EXPECT-- +array(3) { + [0]=> + object(NumberFormatter)#1 (0) { + } + [1]=> + float(-2147483649) + [2]=> + string(21) "(SFD2,147,483,649.00)" +} +== didn't crash == diff -Nru php5-5.4.4/ext/intl/transliterator/transliterator_class.c php5-5.4.9/ext/intl/transliterator/transliterator_class.c --- php5-5.4.4/ext/intl/transliterator/transliterator_class.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/intl/transliterator/transliterator_class.c 2012-11-21 05:12:20.000000000 +0000 @@ -162,7 +162,7 @@ to_orig = zend_object_store_get_object( object TSRMLS_CC ); intl_error_reset( INTL_DATA_ERROR_P( to_orig ) TSRMLS_CC ); - ret_val = Transliterator_ce_ptr->create_object( Transliterator_ce_ptr TSRMLS_CC ); + ret_val = Transliterator_ce_ptr->create_object( Z_OBJCE_P( object ) TSRMLS_CC ); to_new = zend_object_store_get_object_by_handle( ret_val.handle TSRMLS_CC ); zend_objects_clone_members( &to_new->zo, ret_val, diff -Nru php5-5.4.4/ext/json/json.c php5-5.4.9/ext/json/json.c --- php5-5.4.4/ext/json/json.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/json/json.c 2012-11-21 05:12:20.000000000 +0000 @@ -302,7 +302,7 @@ smart_str_appendc(buf, ':'); json_pretty_print_char(buf, options, ' ' TSRMLS_CC); - + php_json_encode(buf, *data, options TSRMLS_CC); } else { if (need_comma) { @@ -320,7 +320,7 @@ smart_str_appendc(buf, ':'); json_pretty_print_char(buf, options, ' ' TSRMLS_CC); - + php_json_encode(buf, *data, options TSRMLS_CC); } } @@ -331,7 +331,7 @@ } } } - + --JSON_G(encoder_depth); json_pretty_print_char(buf, options, '\n' TSRMLS_CC); json_pretty_print_indent(buf, options TSRMLS_CC); @@ -351,6 +351,7 @@ int pos = 0, ulen = 0; unsigned short us; unsigned short *utf16; + size_t newlen; if (len == 0) { smart_str_appendl(buf, "\"\"", 2); @@ -378,9 +379,9 @@ } return; } - + } - + utf16 = (options & PHP_JSON_UNESCAPED_UNICODE) ? NULL : (unsigned short *) safe_emalloc(len, sizeof(unsigned short), 0); ulen = utf8_to_utf16(utf16, s, len); if (ulen <= 0) { @@ -402,6 +403,8 @@ len = ulen; } + /* pre-allocate for string length plus 2 quotes */ + smart_str_alloc(buf, len+2, 0); smart_str_appendc(buf, '"'); while (pos < len) @@ -514,13 +517,13 @@ zend_class_entry *ce = Z_OBJCE_P(val); zval *retval = NULL, fname; HashTable* myht; - + if (Z_TYPE_P(val) == IS_ARRAY) { myht = HASH_OF(val); } else { myht = Z_OBJPROP_P(val); - } - + } + if (myht && myht->nApplyCount > 1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected"); smart_str_appendl(buf, "null", 4); @@ -533,7 +536,7 @@ zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed calling %s::jsonSerialize()", ce->name); smart_str_appendl(buf, "null", sizeof("null") - 1); return; - } + } if (EG(exception)) { /* Error already raised */ diff -Nru php5-5.4.4/ext/libxml/libxml.c php5-5.4.9/ext/libxml/libxml.c --- php5-5.4.4/ext/libxml/libxml.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/libxml/libxml.c 2012-11-21 05:12:20.000000000 +0000 @@ -677,9 +677,18 @@ static xmlParserInputPtr _php_libxml_pre_ext_ent_loader(const char *URL, const char *ID, xmlParserCtxtPtr context) { + TSRMLS_FETCH(); + /* Check whether we're running in a PHP context, since the entity loader - * we've defined is an application level (true global) setting */ - if (xmlGenericError == php_libxml_error_handler) { + * we've defined is an application level (true global) setting. + * If we are, we also want to check whether we've finished activating + * the modules (RINIT phase). Using our external entity loader during a + * RINIT should not be problem per se (though during MINIT it is, because + * we don't even have a resource list by then), but then whether one + * extension would be using the custom external entity loader or not + * could depend on extension loading order + * (if _php_libxml_per_request_initialization */ + if (xmlGenericError == php_libxml_error_handler && PG(modules_activated)) { return _php_libxml_external_entity_loader(URL, ID, context); } else { return _php_libxml_default_entity_loader(URL, ID, context); @@ -909,7 +918,7 @@ { zval *arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg) == FAILURE) { return; } if (LIBXML(stream_context)) { diff -Nru php5-5.4.4/ext/libxml/tests/004.phpt php5-5.4.9/ext/libxml/tests/004.phpt --- php5-5.4.4/ext/libxml/tests/004.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/libxml/tests/004.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -27,26 +27,26 @@ ?> --EXPECTF-- -Warning: stream_context_create(): options should have the form ["wrappername"]["optionname"] = $value in %s004.php on line 10 -NULL +Warning: stream_context_create(): options should have the form ["wrappername"]["optionname"] = $value in %s004.php on line %d -Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18 -bool(true) +Warning: libxml_set_streams_context() expects parameter 1 to be resource, null given in %s004.php on line %d NULL - -Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18 bool(true) -NULL -Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18 -bool(true) +Warning: libxml_set_streams_context() expects parameter 1 to be resource, string given in %s004.php on line %d NULL +bool(true) -Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18 +Warning: libxml_set_streams_context() expects parameter 1 to be resource, integer given in %s004.php on line %d +NULL bool(true) + +Warning: libxml_set_streams_context() expects parameter 1 to be resource, object given in %s004.php on line %d NULL +bool(true) -Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18 +Warning: libxml_set_streams_context() expects parameter 1 to be resource, array given in %s004.php on line %d +NULL bool(true) NULL bool(true) diff -Nru php5-5.4.4/ext/libxml/tests/bug61367-read.phpt php5-5.4.9/ext/libxml/tests/bug61367-read.phpt --- php5-5.4.4/ext/libxml/tests/bug61367-read.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/libxml/tests/bug61367-read.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -4,11 +4,12 @@ --INI-- open_basedir=. -; Suppress spurious "Trying to get property of non-object" notices error_reporting=E_ALL & ~E_NOTICE --FILE-- --INI-- open_basedir=. -; Suppress spurious "Trying to get property of non-object" notices -error_reporting=E_ALL & ~E_NOTICE --FILE-- +--FILE-- + +--EXPECTF-- +Warning: libxml_set_streams_context() expects parameter 1 to be resource, string given in %sbug63389.php on line %d +okey diff -Nru php5-5.4.4/ext/mbstring/mb_gpc.c php5-5.4.9/ext/mbstring/mb_gpc.c --- php5-5.4.4/ext/mbstring/mb_gpc.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mbstring/mb_gpc.c 2012-11-21 05:12:20.000000000 +0000 @@ -254,6 +254,12 @@ n++; var = php_strtok_r(NULL, info->separator, &strtok_buf); } + + if (n > (PG(max_input_vars) * 2)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars)); + goto out; + } + num = n; /* make sure to process initilized vars only */ /* initialize converter */ diff -Nru php5-5.4.4/ext/mbstring/mbstring.c php5-5.4.9/ext/mbstring/mbstring.c --- php5-5.4.4/ext/mbstring/mbstring.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mbstring/mbstring.c 2012-11-21 05:12:20.000000000 +0000 @@ -2715,9 +2715,10 @@ char *str, *encoding; long from, len; int mblen, str_len, encoding_len; + zval **z_len = NULL; mbfl_string string, result, *ret; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls", &str, &str_len, &from, &len, &encoding, &encoding_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|Zs", &str, &str_len, &from, &z_len, &encoding, &encoding_len) == FAILURE) { return; } @@ -2736,8 +2737,11 @@ string.val = (unsigned char *)str; string.len = str_len; - if (argc < 3) { + if (argc < 3 || Z_TYPE_PP(z_len) == IS_NULL) { len = str_len; + } else { + convert_to_long_ex(z_len); + len = Z_LVAL_PP(z_len); } /* measures length */ @@ -2788,13 +2792,14 @@ char *encoding; long from, len; int encoding_len; + zval **z_len = NULL; mbfl_string string, result, *ret; mbfl_string_init(&string); string.no_language = MBSTRG(language); string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls", (char **)&string.val, (int **)&string.len, &from, &len, &encoding, &encoding_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|Zs", (char **)&string.val, (int **)&string.len, &from, &z_len, &encoding, &encoding_len) == FAILURE) { return; } @@ -2806,8 +2811,11 @@ } } - if (argc < 3) { + if (argc < 3 || Z_TYPE_PP(z_len) == IS_NULL) { len = string.len; + } else { + convert_to_long_ex(z_len); + len = Z_LVAL_PP(z_len); } /* if "from" position is negative, count start position from the end diff -Nru php5-5.4.4/ext/mbstring/tests/bug63447_001.phpt php5-5.4.9/ext/mbstring/tests/bug63447_001.phpt --- php5-5.4.4/ext/mbstring/tests/bug63447_001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/mbstring/tests/bug63447_001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,20 @@ +--TEST-- +Bug #63447 (max_input_vars doesn't filter variables when mbstring.encoding_translation = On) +--SKIPIF-- + +--INI-- +max_input_nesting_level=10 +max_input_vars=5 +mbstring.encoding_translation=1 +--POST-- +a=1&b=2&c=3&d=4&e=5&f=6 +--FILE-- + +--EXPECT-- +Warning: Unknown: Input variables exceeded 5. To increase the limit change max_input_vars in php.ini. in Unknown on line 0 +array(0) { +} diff -Nru php5-5.4.4/ext/mbstring/tests/bug63447_002.phpt php5-5.4.9/ext/mbstring/tests/bug63447_002.phpt --- php5-5.4.4/ext/mbstring/tests/bug63447_002.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/mbstring/tests/bug63447_002.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,20 @@ +--TEST-- +Bug #63447 (max_input_vars doesn't filter variables when mbstring.encoding_translation = On) +--SKIPIF-- + +--INI-- +max_input_nesting_level=10 +max_input_vars=4 +mbstring.encoding_translation=1 +--POST-- +a=1&b=2&c=3&d=4&e=5 +--FILE-- + +--EXPECT-- +Warning: Unknown: Input variables exceeded 4. To increase the limit change max_input_vars in php.ini. in Unknown on line 0 +array(0) { +} diff -Nru php5-5.4.4/ext/mbstring/tests/bug63447_003.phpt php5-5.4.9/ext/mbstring/tests/bug63447_003.phpt --- php5-5.4.4/ext/mbstring/tests/bug63447_003.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/mbstring/tests/bug63447_003.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,34 @@ +--TEST-- +Bug #63447 (max_input_vars doesn't filter variables when mbstring.encoding_translation = On) +--SKIPIF-- + +--INI-- +max_input_nesting_level=5 +max_input_vars=100 +mbstring.encoding_translation=1 +--POST-- +a=1&b[][][]=2&c[][][][][][]=7 +--FILE-- + +--EXPECT-- +Array +( + [a] => 1 + [b] => Array + ( + [0] => Array + ( + [0] => Array + ( + [0] => 2 + ) + + ) + + ) + +) diff -Nru php5-5.4.4/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt php5-5.4.9/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt --- php5-5.4.4/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -28,5 +28,3 @@ baz foo ==DONE== ---XFAIL-- -mb functions fail to allow null instead of actual value diff -Nru php5-5.4.4/ext/mcrypt/tests/mcrypt_cbf.phpt php5-5.4.9/ext/mcrypt/tests/mcrypt_cbf.phpt --- php5-5.4.4/ext/mcrypt/tests/mcrypt_cbf.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mcrypt/tests/mcrypt_cbf.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ ---TEST-- -mcrypt_cbf ---SKIPIF-- - ---FILE-- - +--FILE-- + array( 'timestamp', - 'unsigned', - 'zerofill', 'binary', 'not_null'), ), ); +if ($version < 560) { + $tables['label1 TIMESTAMP']['label1'][] = 'zerofill'; + $tables['label1 TIMESTAMP']['label1'][] = 'unsigned'; +} + + foreach ($tables as $columns => $expected) { if (!mysql_query("DROP TABLE IF EXISTS test", $link)) { printf("[010/%s] [%d] %s\n", $columns, mysql_errno($link), mysql_error($link)); diff -Nru php5-5.4.4/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt php5-5.4.9/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt --- php5-5.4.4/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,6 @@ LOAD DATA INFILE - open_basedir --SKIPIF-- --EXPECTF-- Warning: mysql_stat(): %d is not a valid MySQL-Link resource in %s on line %d -done! \ No newline at end of file +done! diff -Nru php5-5.4.4/ext/mysqli/mysqli.c php5-5.4.9/ext/mysqli/mysqli.c --- php5-5.4.4/ext/mysqli/mysqli.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqli/mysqli.c 2012-11-21 05:12:20.000000000 +0000 @@ -162,7 +162,7 @@ { if (stmt->stmt) { if (mysqli_stmt_close(stmt->stmt, TRUE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occured while closing statement"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occurred while closing statement"); return; } } diff -Nru php5-5.4.4/ext/mysqli/mysqli_nonapi.c php5-5.4.9/ext/mysqli/mysqli_nonapi.c --- php5-5.4.4/ext/mysqli/mysqli_nonapi.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqli/mysqli_nonapi.c 2012-11-21 05:12:20.000000000 +0000 @@ -781,6 +781,11 @@ RETURN_FALSE; } + if (!r_array && !e_array) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stream arrays were passed"); + RETURN_FALSE; + } + if (r_array != NULL) { mysqlnd_zval_array_to_mysqlnd_array(r_array, &new_r_array TSRMLS_CC); } diff -Nru php5-5.4.4/ext/mysqli/tests/bug51647.phpt php5-5.4.9/ext/mysqli/tests/bug51647.phpt --- php5-5.4.4/ext/mysqli/tests/bug51647.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqli/tests/bug51647.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -24,12 +24,12 @@ die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error)); } } - + if (empty($row)) die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error)); -if ($row[1] == 'NO') +if (($row[1] == 'NO') || ($row[1] == 'DISABLED')) die(sprintf("skip MySQL has no SSL support, [%d] %s", $link->errno, $link->error)); $link->close(); diff -Nru php5-5.4.4/ext/mysqli/tests/bug55283.phpt php5-5.4.9/ext/mysqli/tests/bug55283.phpt --- php5-5.4.4/ext/mysqli/tests/bug55283.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqli/tests/bug55283.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -29,7 +29,7 @@ if (empty($row)) die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error)); -if ($row[1] == 'NO') +if (($row[1] == 'NO') || ($row[1] == 'DISABLED')) die(sprintf("skip MySQL has no SSL support, [%d] %s", $link->errno, $link->error)); $link->close(); @@ -41,7 +41,7 @@ $flags = MYSQLI_CLIENT_SSL; - + $link = mysqli_init(); mysqli_ssl_set($link, null, null, null, null, "RC4-MD5"); if (my_mysqli_real_connect($link, 'p:' . $host, $user, $passwd, $db, $port, null, $flags)) { diff -Nru php5-5.4.4/ext/mysqli/tests/bug55859.phpt php5-5.4.9/ext/mysqli/tests/bug55859.phpt --- php5-5.4.4/ext/mysqli/tests/bug55859.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqli/tests/bug55859.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -12,9 +12,9 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); } - var_dump(mysqli_stat($link) === $link->stat); + var_dump(soundex(mysqli_stat($link)) === soundex($link->stat)); echo "done!"; ?> --EXPECT-- bool(true) -done! \ No newline at end of file +done! diff -Nru php5-5.4.4/ext/mysqli/tests/bug62046.phpt php5-5.4.9/ext/mysqli/tests/bug62046.phpt --- php5-5.4.4/ext/mysqli/tests/bug62046.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/mysqli/tests/bug62046.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,40 @@ +--TEST-- +Bug #62046 mysqli@mysqlnd can't iterate over stored sets after call to mysqli_stmt_reset() +--SKIPIF-- + +--FILE-- +prepare('SELECT 42'))) { + printf("[002] Prepare failed, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + } + if (FALSE === $stmt->execute()) { + printf("[003] Execute failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + if (FALSE === $stmt->store_result()) { + printf("[004] store_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + $one = NULL; + if (FALSE === $stmt->bind_result($one)) { + printf("[005] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + if (FALSE === $stmt->reset()) { + printf("[006] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + while ($stmt->fetch()) { + var_dump($one); + } + $stmt->close(); + $link->close(); + echo "done!"; +?> +--EXPECT-- +int(42) +done! \ No newline at end of file diff -Nru php5-5.4.4/ext/mysqli/tests/bug62885.phpt php5-5.4.9/ext/mysqli/tests/bug62885.phpt --- php5-5.4.4/ext/mysqli/tests/bug62885.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/mysqli/tests/bug62885.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,26 @@ +--TEST-- +Bug #62885 (mysqli_poll - Segmentation fault) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d + +Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d +okey diff -Nru php5-5.4.4/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt php5-5.4.9/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt --- php5-5.4.4/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -211,7 +211,7 @@ $mysqli->sqlstate, gettype($mysqli->sqlstate), mysqli_sqlstate($link), gettype(mysqli_sqlstate($link))); - assert(mysqli_stat($link) === $mysqli->stat); + assert(soundex(mysqli_stat($link)) == soundex($mysqli->stat)); printf("mysqli->stat = '%s'/%s ('%s'/%s)\n", $mysqli->stat, gettype($mysqli->stat), mysqli_stat($link), gettype(mysqli_stat($link))); diff -Nru php5-5.4.4/ext/mysqli/tests/mysqli_fetch_field_flags.phpt php5-5.4.9/ext/mysqli/tests/mysqli_fetch_field_flags.phpt --- php5-5.4.4/ext/mysqli/tests/mysqli_fetch_field_flags.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqli/tests/mysqli_fetch_field_flags.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -84,6 +84,8 @@ 'VARCHAR(2) NOT NULL PRIMARY KEY' => 'NOT_NULL PRI_KEY NO_DEFAULT_VALUE PART_KEY' ); + + function checkFlags($reported_flags, $expected_flags, $flags) { $found_flags = $unexpected_flags = ''; foreach ($flags as $code => $name) { @@ -104,6 +106,10 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); + if (mysqli_get_server_version($link) > 50600) { + $columns['TIMESTAMP NOT NULL'] = 'ON_UPDATE_NOW TIMESTAMP BINARY NOT_NULL'; + } + foreach ($columns as $column_def => $expected_flags) { if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) { printf("[002] %s [%d] %s\n", $column_def, diff -Nru php5-5.4.4/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt php5-5.4.9/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt --- php5-5.4.4/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -63,7 +63,7 @@ // NOTE: the error message varies with the MySQL Server version, dump only the error code! printf("[009] [%d] (error message varies with the MySQL Server version, check the error code)\n", mysqli_stmt_errno($stmt)); - /* an error occured: affected rows should return -1 */ + /* an error occurred: affected rows should return -1 */ if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt))) printf("[010] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp); diff -Nru php5-5.4.4/ext/mysqlnd/mysqlnd.c php5-5.4.9/ext/mysqlnd/mysqlnd.c --- php5-5.4.4/ext/mysqlnd/mysqlnd.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqlnd/mysqlnd.c 2012-11-21 05:12:20.000000000 +0000 @@ -764,6 +764,13 @@ conn->server_version = mnd_pestrdup(greet_packet->server_version, conn->persistent); conn->greet_charset = mysqlnd_find_charset_nr(greet_packet->charset_no); + if (!conn->greet_charset) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "Server sent charset (%d) unknown to the client. Please, report to the developers", greet_packet->charset_no); + SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, + "Server sent charset unknown to the client. Please, report to the developers"); + goto err; + } /* we allow load data local infile by default */ mysql_flags |= MYSQLND_CAPABILITIES; @@ -2177,7 +2184,7 @@ } memcpy(conn->auth_plugin_data, plugin_data, plugin_data_len); - DBG_INF_FMT("salt=[%*s]", plugin_data_len - 1, plugin_data); + DBG_INF_FMT("salt=[%*.s]", plugin_data_len - 1, plugin_data); /* The data should be allocated with malloc() */ scrambled_data = diff -Nru php5-5.4.4/ext/mysqlnd/mysqlnd_charset.c php5-5.4.9/ext/mysqlnd/mysqlnd_charset.c --- php5-5.4.4/ext/mysqlnd/mysqlnd_charset.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqlnd/mysqlnd_charset.c 2012-11-21 05:12:20.000000000 +0000 @@ -450,20 +450,27 @@ { 6, "hp8", "hp8_english_ci", 1, 1, "", NULL, NULL}, { 7, "koi8r", "koi8r_general_ci", 1, 1, "", NULL, NULL}, { 8, "latin1", "latin1_swedish_ci", 1, 1, "", NULL, NULL}, + { 5, "latin1", "latin1_german_ci", 1, 1, "", NULL, NULL}, /* should be after 0x9 because swedish_ci is the default collation */ { 9, "latin2", "latin2_general_ci", 1, 1, "", NULL, NULL}, + { 2, "latin2", "latin2_czech_cs", 1, 1, "", NULL, NULL}, /* should be after 0x9 because general_ci is the default collation */ { 10, "swe7", "swe7_swedish_ci", 1, 1, "", NULL, NULL}, { 11, "ascii", "ascii_general_ci", 1, 1, "", NULL, NULL}, { 12, "ujis", "ujis_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_ujis, check_mb_ujis}, { 13, "sjis", "sjis_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_sjis, check_mb_sjis}, { 16, "hebrew", "hebrew_general_ci", 1, 1, "", NULL, NULL}, + { 17, "filename", "filename", 1, 5, "", NULL, NULL}, { 18, "tis620", "tis620_thai_ci", 1, 1, "", NULL, NULL}, { 19, "euckr", "euckr_korean_ci", 1, 2, "", mysqlnd_mbcharlen_euckr, check_mb_euckr}, + { 21, "latin2", "latin2_hungarian_ci", 1, 1, "", NULL, NULL}, + { 27, "latin2", "latin2_croatian_ci", 1, 1, "", NULL, NULL}, { 22, "koi8u", "koi8u_general_ci", 1, 1, "", NULL, NULL}, { 24, "gb2312", "gb2312_chinese_ci", 1, 2, "", mysqlnd_mbcharlen_gb2312, check_mb_gb2312}, { 25, "greek", "greek_general_ci", 1, 1, "", NULL, NULL}, { 26, "cp1250", "cp1250_general_ci", 1, 1, "", NULL, NULL}, { 28, "gbk", "gbk_chinese_ci", 1, 2, "", mysqlnd_mbcharlen_gbk, check_mb_gbk}, { 30, "latin5", "latin5_turkish_ci", 1, 1, "", NULL, NULL}, + { 31, "latin1", "latin1_german2_ci", 1, 1, "", NULL, NULL}, + { 15, "latin1", "latin1_danish_ci", 1, 1, "", NULL, NULL}, { 32, "armscii8", "armscii8_general_ci", 1, 1, "", NULL, NULL}, { 33, UTF8_MB3, UTF8_MB3"_general_ci", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 35, "ucs2", "ucs2_general_ci", 2, 2, "UCS-2 Unicode", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, @@ -473,22 +480,11 @@ { 39, "macroman", "macroman_general_ci", 1, 1, "", NULL, NULL}, { 40, "cp852", "cp852_general_ci", 1, 1, "", NULL, NULL}, { 41, "latin7", "latin7_general_ci", 1, 1, "", NULL, NULL}, - { 51, "cp1251", "cp1251_general_ci", 1, 1, "", NULL, NULL}, + { 20, "latin7", "latin7_estonian_cs", 1, 1, "", NULL, NULL}, { 57, "cp1256", "cp1256_general_ci", 1, 1, "", NULL, NULL}, { 59, "cp1257", "cp1257_general_ci", 1, 1, "", NULL, NULL}, { 63, "binary", "binary", 1, 1, "", NULL, NULL}, - { 92, "geostd8", "geostd8_general_ci", 1, 1, "", NULL, NULL}, - { 95, "cp932", "cp932_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932}, { 97, "eucjpms", "eucjpms_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms}, - { 2, "latin2", "latin2_czech_cs", 1, 1, "", NULL, NULL}, - { 5, "latin1", "latin1_german_ci", 1, 1, "", NULL, NULL}, - { 14, "cp1251", "cp1251_bulgarian_ci", 1, 1, "", NULL, NULL}, - { 15, "latin1", "latin1_danish_ci", 1, 1, "", NULL, NULL}, - { 17, "filename", "filename", 1, 5, "", NULL, NULL}, - { 20, "latin7", "latin7_estonian_cs", 1, 1, "", NULL, NULL}, - { 21, "latin2", "latin2_hungarian_ci", 1, 1, "", NULL, NULL}, - { 23, "cp1251", "cp1251_ukrainian_ci", 1, 1, "", NULL, NULL}, - { 27, "latin2", "latin2_croatian_ci", 1, 1, "", NULL, NULL}, { 29, "cp1257", "cp1257_lithunian_ci", 1, 1, "", NULL, NULL}, { 31, "latin1", "latin1_german2_ci", 1, 1, "", NULL, NULL}, { 34, "cp1250", "cp1250_czech_cs", 1, 1, "", NULL, NULL}, @@ -500,6 +496,9 @@ { 47, "latin1", "latin1_bin", 1, 1, "", NULL, NULL}, { 48, "latin1", "latin1_general_ci", 1, 1, "", NULL, NULL}, { 49, "latin1", "latin1_general_cs", 1, 1, "", NULL, NULL}, + { 51, "cp1251", "cp1251_general_ci", 1, 1, "", NULL, NULL}, + { 14, "cp1251", "cp1251_bulgarian_ci", 1, 1, "", NULL, NULL}, + { 23, "cp1251", "cp1251_ukrainian_ci", 1, 1, "", NULL, NULL}, { 50, "cp1251", "cp1251_bin", 1, 1, "", NULL, NULL}, { 52, "cp1251", "cp1251_general_cs", 1, 1, "", NULL, NULL}, { 53, "macroman", "macroman_bin", 1, 1, "", NULL, NULL}, @@ -509,8 +508,8 @@ #ifdef USED_TO_BE_SO_BEFORE_MYSQL_5_5 { 60, "armascii8", "armascii8_bin", 1, 1, "", NULL, NULL}, #endif - { 60, "utf32", "utf32_general_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, - { 61, "utf32", "utf32_bin", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*55*/{ 60, "utf32", "utf32_general_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*55*/{ 61, "utf32", "utf32_bin", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, { 65, "ascii", "ascii_bin", 1, 1, "", NULL, NULL}, { 66, "cp1250", "cp1250_bin", 1, 1, "", NULL, NULL}, { 67, "cp1256", "cp1256_bin", 1, 1, "", NULL, NULL}, @@ -528,7 +527,6 @@ { 80, "cp850", "cp850_bin", 1, 1, "", NULL, NULL}, { 81, "cp852", "cp852_bin", 1, 1, "", NULL, NULL}, { 82, "swe7", "swe7_bin", 1, 1, "", NULL, NULL}, - { 93, "geostd8", "geostd8_bin", 1, 1, "", NULL, NULL}, { 83, UTF8_MB3, UTF8_MB3"_bin", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 84, "big5", "big5_bin", 1, 2, "", mysqlnd_mbcharlen_big5, check_mb_big5}, { 85, "euckr", "euckr_bin", 1, 2, "", mysqlnd_mbcharlen_euckr, check_mb_euckr}, @@ -538,10 +536,14 @@ { 89, "tis620", "tis620_bin", 1, 1, "", NULL, NULL}, { 90, "ucs2", "ucs2_bin", 2, 2, "UCS-2 Unicode", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, { 91, "ujis", "ujis_bin", 1, 3, "", mysqlnd_mbcharlen_ujis, check_mb_ujis}, + { 92, "geostd8", "geostd8_general_ci", 1, 1, "", NULL, NULL}, + { 93, "geostd8", "geostd8_bin", 1, 1, "", NULL, NULL}, { 94, "latin1", "latin1_spanish_ci", 1, 1, "", NULL, NULL}, + { 95, "cp932", "cp932_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932}, { 96, "cp932", "cp932_bin", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932}, - { 99, "cp1250", "cp1250_polish_ci", 1, 1, "", NULL, NULL}, + { 97, "eucjpms", "eucjpms_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms}, { 98, "eucjpms", "eucjpms_bin", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms}, + { 99, "cp1250", "cp1250_polish_ci", 1, 1, "", NULL, NULL}, { 128, "ucs2", "ucs2_unicode_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, { 129, "ucs2", "ucs2_icelandic_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, { 130, "ucs2", "ucs2_latvian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, @@ -562,7 +564,35 @@ { 145, "ucs2", "ucs2_esperanto_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, { 146, "ucs2", "ucs2_hungarian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, { 147, "ucs2", "ucs2_sinhala_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, - { 149, "ucs2", "ucs2_croatian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, /* MDB */ + { 148, "ucs2", "ucs2_german2_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, + { 149, "ucs2", "ucs2_croatian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, + { 150, "ucs2", "ucs2_unicode_520_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, + { 151, "ucs2", "ucs2_vietnamese_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, + +/*56*/{160, "utf32", "utf32_unicode_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{161, "utf32", "utf32_icelandic_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{162, "utf32", "utf32_latvian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{163, "utf32", "utf32_romanian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{164, "utf32", "utf32_slovenian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{165, "utf32", "utf32_polish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{166, "utf32", "utf32_estonian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{167, "utf32", "utf32_spanish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{168, "utf32", "utf32_swedish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{169, "utf32", "utf32_turkish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{170, "utf32", "utf32_czech_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{171, "utf32", "utf32_danish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{172, "utf32", "utf32_lithuanian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{173, "utf32", "utf32_slovak_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{174, "utf32", "utf32_spanish2_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{175, "utf32", "utf32_roman_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{176, "utf32", "utf32_persian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{177, "utf32", "utf32_esperanto_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{178, "utf32", "utf32_hungarian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{179, "utf32", "utf32_sinhala_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{180, "utf32", "utf32_german2_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{181, "utf32", "utf32_croatian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{182, "utf32", "utf32_unicode_520_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, +/*56*/{183, "utf32", "utf32_vietnamese_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32}, { 192, UTF8_MB3, UTF8_MB3"_general_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 193, UTF8_MB3, UTF8_MB3"_icelandic_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, @@ -571,7 +601,7 @@ { 196, UTF8_MB3, UTF8_MB3"_slovenian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 197, UTF8_MB3, UTF8_MB3"_polish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 198, UTF8_MB3, UTF8_MB3"_estonian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, - { 119, UTF8_MB3, UTF8_MB3"_spanish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, + { 199, UTF8_MB3, UTF8_MB3"_spanish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 200, UTF8_MB3, UTF8_MB3"_swedish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 201, UTF8_MB3, UTF8_MB3"_turkish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 202, UTF8_MB3, UTF8_MB3"_czech_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, @@ -584,7 +614,10 @@ { 209, UTF8_MB3, UTF8_MB3"_esperanto_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 210, UTF8_MB3, UTF8_MB3"_hungarian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 211, UTF8_MB3, UTF8_MB3"_sinhala_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, - { 213, UTF8_MB3, UTF8_MB3"_croatian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, /*MDB*/ + { 211, UTF8_MB3, UTF8_MB3"_german2_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, + { 213, UTF8_MB3, UTF8_MB3"_croatian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, + { 214, UTF8_MB3, UTF8_MB3"_unicode_520_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, + { 215, UTF8_MB3, UTF8_MB3"_vietnamese_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, { 224, UTF8_MB4, UTF8_MB4"_unicode_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 225, UTF8_MB4, UTF8_MB4"_icelandic_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, @@ -606,6 +639,10 @@ { 241, UTF8_MB4, UTF8_MB4"_esperanto_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 242, UTF8_MB4, UTF8_MB4"_hungarian_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 243, UTF8_MB4, UTF8_MB4"_sinhala_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 244, UTF8_MB4, UTF8_MB4"_german2_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 245, UTF8_MB4, UTF8_MB4"_croatian_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 246, UTF8_MB4, UTF8_MB4"_unicode_520_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 247, UTF8_MB4, UTF8_MB4"_vietnamese_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 254, UTF8_MB3, UTF8_MB3"_general_cs", 1, 3, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 0, NULL, NULL, 0, 0, NULL, NULL, NULL} diff -Nru php5-5.4.4/ext/mysqlnd/mysqlnd_debug.c php5-5.4.9/ext/mysqlnd/mysqlnd_debug.c --- php5-5.4.4/ext/mysqlnd/mysqlnd_debug.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqlnd/mysqlnd_debug.c 2012-11-21 05:12:20.000000000 +0000 @@ -516,9 +516,11 @@ static void MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const mode) { - unsigned int mode_len = strlen(mode), i; + unsigned int mode_len, i; enum mysqlnd_debug_parser_state state = PARSER_WAIT_MODIFIER; + mode_len = mode? strlen(mode) : 0; + self->flags = 0; self->nest_level_limit = 0; if (self->file_name && self->file_name != mysqlnd_debug_default_trace_file) { diff -Nru php5-5.4.4/ext/mysqlnd/mysqlnd_loaddata.c php5-5.4.9/ext/mysqlnd/mysqlnd_loaddata.c --- php5-5.4.4/ext/mysqlnd/mysqlnd_loaddata.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqlnd/mysqlnd_loaddata.c 2012-11-21 05:12:20.000000000 +0000 @@ -188,7 +188,7 @@ char tmp_buf[sizeof(conn->error_info->error)]; int tmp_error_no; *is_warning = TRUE; - /* error occured */ + /* error occurred */ tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf) TSRMLS_CC); SET_CLIENT_ERROR(*conn->error_info, tmp_error_no, UNKNOWN_SQLSTATE, tmp_buf); /* write empty packet to server */ @@ -211,7 +211,7 @@ goto infile_error; } - /* error during read occured */ + /* error during read occurred */ if (bufsize < 0) { char tmp_buf[sizeof(conn->error_info->error)]; int tmp_error_no; diff -Nru php5-5.4.4/ext/mysqlnd/mysqlnd_ps.c php5-5.4.9/ext/mysqlnd/mysqlnd_ps.c --- php5-5.4.4/ext/mysqlnd/mysqlnd_ps.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqlnd/mysqlnd_ps.c 2012-11-21 05:12:20.000000000 +0000 @@ -636,6 +636,8 @@ have it again. */ stmt->result->m.free_result_buffers(stmt->result TSRMLS_CC); + + stmt->state = MYSQLND_STMT_PREPARED; } else if (stmt->state < MYSQLND_STMT_PREPARED) { /* Only initted - error */ SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, @@ -1221,8 +1223,6 @@ COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); } *stmt->upsert_status = *conn->upsert_status; - - stmt->state = MYSQLND_STMT_PREPARED; } DBG_INF(ret == PASS? "PASS":"FAIL"); DBG_RETURN(ret); @@ -1261,8 +1261,6 @@ stmt->result->m.skip_result(stmt->result TSRMLS_CC); } } while (mysqlnd_stmt_more_results(s) && mysqlnd_stmt_next_result(s) == PASS); - - stmt->state = MYSQLND_STMT_PREPARED; } DBG_INF(ret == PASS? "PASS":"FAIL"); DBG_RETURN(ret); diff -Nru php5-5.4.4/ext/mysqlnd/mysqlnd_wireprotocol.c php5-5.4.9/ext/mysqlnd/mysqlnd_wireprotocol.c --- php5-5.4.4/ext/mysqlnd/mysqlnd_wireprotocol.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/mysqlnd/mysqlnd_wireprotocol.c 2012-11-21 05:12:20.000000000 +0000 @@ -1201,7 +1201,7 @@ p += 2; BAIL_IF_NO_MORE_DATA; - meta->decimals = uint2korr(p); + meta->decimals = uint1korr(p); p += 1; BAIL_IF_NO_MORE_DATA; diff -Nru php5-5.4.4/ext/oci8/config.m4 php5-5.4.9/ext/oci8/config.m4 --- php5-5.4.4/ext/oci8/config.m4 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/config.m4 2012-11-21 05:12:20.000000000 +0000 @@ -8,6 +8,13 @@ PHP_OCI8_SED="$SED"; fi +PHP_OCI8_TAIL1=`echo a | tail -n1 2>/dev/null` +if test "$PHP_OCI8_TAIL1" = "a"; then + PHP_OCI8_TAIL1="tail -n1" +else + PHP_OCI8_TAIL1="tail -1" +fi + AC_DEFUN([PHP_OCI_IF_DEFINED],[ old_CPPFLAGS=$CPPFLAGS CPPFLAGS=$3 @@ -49,8 +56,8 @@ AC_DEFUN([AC_OCI8IC_VERSION],[ AC_MSG_CHECKING([Oracle Instant Client library version compatibility]) OCI8_LCS_BASE=$PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME - OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -1` # Oracle 10g, 11g etc - OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | tail -1` + OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | $PHP_OCI8_TAIL1` # Oracle 10g, 11g etc + OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | $PHP_OCI8_TAIL1` if test -f "$OCI8_NNZ" && test -f "$OCI8_LCS"; then if test ! -f "$OCI8_LCS_BASE"; then AC_MSG_ERROR([Link from $OCI8_LCS_BASE to $OCI8_LCS_BASE.*.1 not found]) @@ -65,7 +72,7 @@ AC_DEFUN([AC_OCI8_ORACLE_VERSION],[ AC_MSG_CHECKING([Oracle library version compatibility]) OCI8_LCS_BASE=$OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME - OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -1` # Oracle 10g, 11g etc + OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | $PHP_OCI8_TAIL1` # Oracle 10g, 11g etc if test -s "$OCI8_DIR/orainst/unix.rgs"; then OCI8_ORACLE_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4` test -z "$OCI8_ORACLE_VERSION" && OCI8_ORACLE_VERSION=7.3 @@ -278,7 +285,7 @@ dnl user must pass in the library directory. But on Linux we default dnl to the most recent version in /usr/lib which is where the Oracle dnl Instant Client RPM gets installed. - PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | tail -1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'` + PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | $PHP_OCI8_TAIL1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'` if test -z "$PHP_OCI8_INSTANT_CLIENT"; then AC_MSG_ERROR([Oracle Instant Client directory /usr/lib/oracle/.../client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib libraries not found. Try --with-oci8=instantclient,DIR]) fi diff -Nru php5-5.4.4/ext/oci8/oci8.c php5-5.4.9/ext/oci8/oci8.c --- php5-5.4.4/ext/oci8/oci8.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/oci8.c 2012-11-21 05:12:20.000000000 +0000 @@ -26,7 +26,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: bf2eaf558b050b6d2e6d098bed6345af7e842ea4 $ */ +/* $Id: e2241cffb72c940cb2ca267b7a6a0ce436de7e5e $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1341,7 +1341,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "OCI8 Support", "enabled"); php_info_print_table_row(2, "Version", PHP_OCI8_VERSION); - php_info_print_table_row(2, "Revision", "$Id: bf2eaf558b050b6d2e6d098bed6345af7e842ea4 $"); + php_info_print_table_row(2, "Revision", "$Id: e2241cffb72c940cb2ca267b7a6a0ce436de7e5e $"); snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent)); php_info_print_table_row(2, "Active Persistent Connections", buf); @@ -3197,7 +3197,7 @@ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)actual_spool->poolh, OCI_HTYPE_SPOOL, (dvoid *)&numopen, (ub4 *)0, OCI_ATTR_SPOOL_OPEN_COUNT, OCI_G(err))); PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)actual_spool->poolh, OCI_HTYPE_SPOOL, (dvoid *)&numbusy, (ub4 *)0, OCI_ATTR_SPOOL_BUSY_COUNT, OCI_G(err))); numfree = numopen - numbusy; /* number of free connections in the pool */ - php_printf ("OCI8 DEBUG L1: (numopen=%d)(numbusy=%d) at (%s:%d) \n", numopen, numbusy, __FILE__, __LINE__); + php_printf ("OCI8 DEBUG L1: (numopen=%d)(numbusy=%d)(numfree=%d) at (%s:%d) \n", numopen, numbusy, numfree, __FILE__, __LINE__); } /* }}} */ /* Ping loop: Ping and loop till we get a good connection. When a database instance goes diff -Nru php5-5.4.4/ext/oci8/package.xml php5-5.4.9/ext/oci8/package.xml --- php5-5.4.4/ext/oci8/package.xml 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/package.xml 2012-11-21 05:12:20.000000000 +0000 @@ -33,12 +33,12 @@ no - 2011-11-18 + 2012-10-21 - 1.4.7 - 1.4.7 + 1.4.9 + 1.4.9 stable @@ -46,11 +46,7 @@ PHP - Fixed bug #59985 (show normal warning text for OCI_NO_DATA) - Fixed OCI8 part of bug #55748 (CVE-2011-4153: multiple NULL pointer dereferences with zend_strndup) - Fixed OCI8 part of bug #55301 (multiple null pointer dereferences with calloc) - Increased maximum Oracle error message buffer length for new Oracle 11.2.0.3 size - Improve internal initalization failure error messages + Re-fixed bug #60901 (Improve "tail" syntax for AIX installation) @@ -416,6 +412,42 @@ + 1.4.8 + 1.4.8 + + + stable + stable + + PHP + + Fixed bug #63307 (Unused variable in oci8.c) + Fixed bug #63265 (Add ORA-00028 to the PHP_OCI_HANDLE_ERROR macro) + Fixed bug #60901 (Improve "tail" syntax for AIX installation) + + + + + + 1.4.7 + 1.4.7 + + + stable + stable + + PHP + + Fixed bug #59985 (show normal warning text for OCI_NO_DATA) + Fixed OCI8 part of bug #55748 (CVE-2011-4153: multiple NULL pointer dereferences with zend_strndup) + Fixed OCI8 part of bug #55301 (multiple null pointer dereferences with calloc) + Increased maximum Oracle error message buffer length for new Oracle 11.2.0.3 size + Improve internal initalization failure error messages + + + + + 1.4.6 1.4.6 diff -Nru php5-5.4.4/ext/oci8/php_oci8.h php5-5.4.9/ext/oci8/php_oci8.h --- php5-5.4.4/ext/oci8/php_oci8.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/php_oci8.h 2012-11-21 05:12:20.000000000 +0000 @@ -46,7 +46,7 @@ */ #undef PHP_OCI8_VERSION #endif -#define PHP_OCI8_VERSION "1.4.7" +#define PHP_OCI8_VERSION "1.4.9" extern zend_module_entry oci8_module_entry; #define phpext_oci8_ptr &oci8_module_entry diff -Nru php5-5.4.4/ext/oci8/php_oci8_int.h php5-5.4.9/ext/oci8/php_oci8_int.h --- php5-5.4.4/ext/oci8/php_oci8_int.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/php_oci8_int.h 2012-11-21 05:12:20.000000000 +0000 @@ -289,6 +289,7 @@ zend_bailout(); \ break; \ case 22: \ + case 28: \ case 378: \ case 602: \ case 603: \ diff -Nru php5-5.4.4/ext/oci8/tests/bind_char_2_11gR1.phpt php5-5.4.9/ext/oci8/tests/bind_char_2_11gR1.phpt --- php5-5.4.4/ext/oci8/tests/bind_char_2_11gR1.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/tests/bind_char_2_11gR1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -5,7 +5,7 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -if (preg_match('/Release 11\.1\./', $sv, $matches) !== 1) { +if (preg_match('/Release 11\.1\./', oci_server_version($c), $matches) !== 1) { if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); } diff -Nru php5-5.4.4/ext/oci8/tests/bind_char_3_11gR1.phpt php5-5.4.9/ext/oci8/tests/bind_char_3_11gR1.phpt --- php5-5.4.4/ext/oci8/tests/bind_char_3_11gR1.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/tests/bind_char_3_11gR1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -5,7 +5,7 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -if (preg_match('/Release 11\.1\./', $sv, $matches) !== 1) { +if (preg_match('/Release 11\.1\./', oci_server_version($c), $matches) !== 1) { if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); } diff -Nru php5-5.4.4/ext/oci8/tests/bind_char_4_11gR1.phpt php5-5.4.9/ext/oci8/tests/bind_char_4_11gR1.phpt --- php5-5.4.4/ext/oci8/tests/bind_char_4_11gR1.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/tests/bind_char_4_11gR1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -5,7 +5,7 @@ if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -if (preg_match('/Release 11\.1\./', $sv, $matches) !== 1) { +if (preg_match('/Release 11\.1\./', oci_server_version($c), $matches) !== 1) { if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); } diff -Nru php5-5.4.4/ext/oci8/tests/details.inc php5-5.4.9/ext/oci8/tests/details.inc --- php5-5.4.4/ext/oci8/tests/details.inc 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/tests/details.inc 2012-11-21 05:12:20.000000000 +0000 @@ -45,31 +45,34 @@ * Used for creating/dropping schema objects used by a test */ -function oci8_test_sql_execute($c, $stmtarray) -{ - foreach ($stmtarray as $stmt) { - $s = oci_parse($c, $stmt); - if (!$s) { - $m = oci_error($c); - echo $stmt . PHP_EOL . $m['message'] . PHP_EOL; - } - else { - $r = @oci_execute($s); - if (!$r) { - $m = oci_error($s); - if (!in_array($m['code'], array( // ignore expected errors - 942 // table or view does not exist - , 1918 // user does not exist - , 2024 // database link not found - , 2289 // sequence does not exist - , 4080 // trigger does not exist - , 38802 // edition does not exist - ))) { - echo $stmt . PHP_EOL . $m['message'] . PHP_EOL; - } - } - } - } +if (!function_exists('oci8_test_sql_execute')) { + function oci8_test_sql_execute($c, $stmtarray) + { + foreach ($stmtarray as $stmt) { + $s = oci_parse($c, $stmt); + if (!$s) { + $m = oci_error($c); + echo $stmt . PHP_EOL . $m['message'] . PHP_EOL; + } + else { + $r = @oci_execute($s); + if (!$r) { + $m = oci_error($s); + if (!in_array($m['code'], array( // ignore expected errors + 942 // table or view does not exist + , 1918 // user does not exist + , 2024 // database link not found + , 2289 // sequence does not exist + , 4080 // trigger does not exist + , 38802 // edition does not exist + ))) { + echo $stmt . PHP_EOL . $m['message'] . PHP_EOL; + } + } + } + } + } + } ?> diff -Nru php5-5.4.4/ext/oci8/tests/pecl_bug10194.phpt php5-5.4.9/ext/oci8/tests/pecl_bug10194.phpt --- php5-5.4.4/ext/oci8/tests/pecl_bug10194.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/tests/pecl_bug10194.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -5,6 +5,9 @@ $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); +if (getenv("USE_ZEND_ALLOC") === "0") { + die("skip Zend MM disabled"); +} ?> --INI-- memory_limit=10M diff -Nru php5-5.4.4/ext/oci8/tests/pecl_bug10194_blob.phpt php5-5.4.9/ext/oci8/tests/pecl_bug10194_blob.phpt --- php5-5.4.4/ext/oci8/tests/pecl_bug10194_blob.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/tests/pecl_bug10194_blob.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -6,6 +6,9 @@ require(dirname(__FILE__).'/skipif.inc'); if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only"); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); +if (getenv("USE_ZEND_ALLOC") === "0") { + die("skip Zend MM disabled"); +} ?> --INI-- memory_limit=3M diff -Nru php5-5.4.4/ext/oci8/tests/pecl_bug10194_blob_64.phpt php5-5.4.9/ext/oci8/tests/pecl_bug10194_blob_64.phpt --- php5-5.4.4/ext/oci8/tests/pecl_bug10194_blob_64.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/tests/pecl_bug10194_blob_64.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -6,6 +6,9 @@ require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); +if (getenv("USE_ZEND_ALLOC") === "0") { + die("skip Zend MM disabled"); +} ?> --INI-- memory_limit=6M diff -Nru php5-5.4.4/ext/oci8/tests/xmltype_01.phpt php5-5.4.9/ext/oci8/tests/xmltype_01.phpt --- php5-5.4.4/ext/oci8/tests/xmltype_01.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/oci8/tests/xmltype_01.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -5,6 +5,7 @@ if (!extension_loaded("simplexml")) die("skip no simplexml extension"); $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); +?> --FILE-- = 0x0090708fL +#define OPENSSL_ALGO_SHA224 6 +#define OPENSSL_ALGO_SHA256 7 +#define OPENSSL_ALGO_SHA384 8 +#define OPENSSL_ALGO_SHA512 9 +#define OPENSSL_ALGO_RMD160 10 +#endif #define DEBUG_SMIME 0 /* FIXME: Use the openssl constants instead of @@ -954,6 +960,23 @@ case OPENSSL_ALGO_DSS1: mdtype = (EVP_MD *) EVP_dss1(); break; +#if OPENSSL_VERSION_NUMBER >= 0x0090708fL + case OPENSSL_ALGO_SHA224: + mdtype = (EVP_MD *) EVP_sha224(); + break; + case OPENSSL_ALGO_SHA256: + mdtype = (EVP_MD *) EVP_sha256(); + break; + case OPENSSL_ALGO_SHA384: + mdtype = (EVP_MD *) EVP_sha384(); + break; + case OPENSSL_ALGO_SHA512: + mdtype = (EVP_MD *) EVP_sha512(); + break; + case OPENSSL_ALGO_RMD160: + mdtype = (EVP_MD *) EVP_ripemd160(); + break; +#endif default: return NULL; break; @@ -1048,6 +1071,13 @@ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT); #endif REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT); +#if OPENSSL_VERSION_NUMBER >= 0x0090708fL + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA256", OPENSSL_ALGO_SHA256, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA384", OPENSSL_ALGO_SHA384, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA512", OPENSSL_ALGO_SHA512, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OPENSSL_ALGO_RMD160", OPENSSL_ALGO_RMD160, CONST_CS|CONST_PERSISTENT); +#endif /* flags for S/MIME */ REGISTER_LONG_CONSTANT("PKCS7_DETACHED", PKCS7_DETACHED, CONST_CS|CONST_PERSISTENT); diff -Nru php5-5.4.4/ext/pcntl/pcntl.c php5-5.4.9/ext/pcntl/pcntl.c --- php5-5.4.4/ext/pcntl/pcntl.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcntl/pcntl.c 2012-11-21 05:12:20.000000000 +0000 @@ -816,7 +816,7 @@ if (execve(path, argv, envp) == -1) { PCNTL_G(last_error) = errno; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno)); } /* Cleanup */ @@ -826,7 +826,7 @@ if (execv(path, argv) == -1) { PCNTL_G(last_error) = errno; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno)); } } @@ -1127,7 +1127,7 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Invalid identifier flag", errno); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occured", errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno); break; } RETURN_FALSE; @@ -1167,7 +1167,7 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Only a super user may attempt to increase the process priority", errno); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occured", errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno); break; } RETURN_FALSE; diff -Nru php5-5.4.4/ext/pcntl/tests/pcntl_exec_3.phpt php5-5.4.9/ext/pcntl/tests/pcntl_exec_3.phpt --- php5-5.4.4/ext/pcntl/tests/pcntl_exec_3.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcntl/tests/pcntl_exec_3.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -13,5 +13,5 @@ Warning: pcntl_exec() expects at least 1 parameter, 0 given %s NULL -Warning: pcntl_exec(): Error has occured: (errno %d) %s +Warning: pcntl_exec(): Error has occurred: (errno %d) %s bool(false) diff -Nru php5-5.4.4/ext/pcre/config.w32 php5-5.4.9/ext/pcre/config.w32 --- php5-5.4.4/ext/pcre/config.w32 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/config.w32 2012-11-21 05:12:20.000000000 +0000 @@ -3,7 +3,7 @@ EXTENSION("pcre", "php_pcre.c", false /* never shared */, "-Iext/pcre/pcrelib"); -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_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_maketables.c pcre_newline.c pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.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'); diff -Nru php5-5.4.4/ext/pcre/config0.m4 php5-5.4.9/ext/pcre/config0.m4 --- php5-5.4.4/ext/pcre/config0.m4 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/config0.m4 2012-11-21 05:12:20.000000000 +0000 @@ -55,9 +55,9 @@ 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 \ + pcrelib/pcre_maketables.c pcrelib/pcre_newline.c \ pcrelib/pcre_ord2utf8.c pcrelib/pcre_refcount.c pcrelib/pcre_study.c \ - pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c \ + pcrelib/pcre_tables.c pcrelib/pcre_valid_utf8.c \ pcrelib/pcre_version.c pcrelib/pcre_xclass.c" PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,-I@ext_srcdir@/pcrelib) PHP_ADD_BUILD_DIR($ext_builddir/pcrelib) diff -Nru php5-5.4.4/ext/pcre/pcrelib/AUTHORS php5-5.4.9/ext/pcre/pcrelib/AUTHORS --- php5-5.4.4/ext/pcre/pcrelib/AUTHORS 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/AUTHORS 2012-11-21 05:12:20.000000000 +0000 @@ -8,16 +8,38 @@ University of Cambridge Computing Service, Cambridge, England. -Copyright (c) 1997-2010 University of Cambridge +Copyright (c) 1997-2012 University of Cambridge All rights reserved +PCRE JUST-IN-TIME COMPILATION SUPPORT +------------------------------------- + +Written by: Zoltan Herczeg +Email local part: hzmester +Emain domain: freemail.hu + +Copyright(c) 2010-2012 Zoltan Herczeg +All rights reserved. + + +STACK-LESS JUST-IN-TIME COMPILER +-------------------------------- + +Written by: Zoltan Herczeg +Email local part: hzmester +Emain domain: freemail.hu + +Copyright(c) 2009-2012 Zoltan Herczeg +All rights reserved. + + THE C++ WRAPPER LIBRARY ----------------------- Written by: Google Inc. -Copyright (c) 2007-2010 Google Inc +Copyright (c) 2007-2012 Google Inc All rights reserved #### diff -Nru php5-5.4.4/ext/pcre/pcrelib/ChangeLog php5-5.4.9/ext/pcre/pcrelib/ChangeLog --- php5-5.4.4/ext/pcre/pcrelib/ChangeLog 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/ChangeLog 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,699 @@ ChangeLog for PCRE ------------------ +Version 8.31 06-July-2012 +------------------------- + +1. Fixing a wrong JIT test case and some compiler warnings. + +2. Removed a bashism from the RunTest script. + +3. Add a cast to pcre_exec.c to fix the warning "unary minus operator applied + to unsigned type, result still unsigned" that was given by an MS compiler + on encountering the code "-sizeof(xxx)". + +4. Partial matching support is added to the JIT compiler. + +5. Fixed several bugs concerned with partial matching of items that consist + of more than one character: + + (a) /^(..)\1/ did not partially match "aba" because checking references was + done on an "all or nothing" basis. This also applied to repeated + references. + + (b) \R did not give a hard partial match if \r was found at the end of the + subject. + + (c) \X did not give a hard partial match after matching one or more + characters at the end of the subject. + + (d) When newline was set to CRLF, a pattern such as /a$/ did not recognize + a partial match for the string "\r". + + (e) When newline was set to CRLF, the metacharacter "." did not recognize + a partial match for a CR character at the end of the subject string. + +6. If JIT is requested using /S++ or -s++ (instead of just /S+ or -s+) when + running pcretest, the text "(JIT)" added to the output whenever JIT is + actually used to run the match. + +7. Individual JIT compile options can be set in pcretest by following -s+[+] + or /S+[+] with a digit between 1 and 7. + +8. OP_NOT now supports any UTF character not just single-byte ones. + +9. (*MARK) control verb is now supported by the JIT compiler. + +10. The command "./RunTest list" lists the available tests without actually + running any of them. (Because I keep forgetting what they all are.) + +11. Add PCRE_INFO_MAXLOOKBEHIND. + +12. Applied a (slightly modified) user-supplied patch that improves performance + when the heap is used for recursion (compiled with --disable-stack-for- + recursion). Instead of malloc and free for each heap frame each time a + logical recursion happens, frames are retained on a chain and re-used where + possible. This sometimes gives as much as 30% improvement. + +13. As documented, (*COMMIT) is now confined to within a recursive subpattern + call. + +14. As documented, (*COMMIT) is now confined to within a positive assertion. + +15. It is now possible to link pcretest with libedit as an alternative to + libreadline. + +16. (*COMMIT) control verb is now supported by the JIT compiler. + +17. The Unicode data tables have been updated to Unicode 6.1.0. + +18. Added --file-list option to pcregrep. + +19. Added binary file support to pcregrep, including the -a, --binary-files, + -I, and --text options. + +20. The madvise function is renamed for posix_madvise for QNX compatibility + reasons. Fixed by Giuseppe D'Angelo. + +21. Fixed a bug for backward assertions with REVERSE 0 in the JIT compiler. + +22. Changed the option for creating symbolic links for 16-bit man pages from + -s to -sf so that re-installing does not cause issues. + +23. Support PCRE_NO_START_OPTIMIZE in JIT as (*MARK) support requires it. + +24. Fixed a very old bug in pcretest that caused errors with restarted DFA + matches in certain environments (the workspace was not being correctly + retained). Also added to pcre_dfa_exec() a simple plausibility check on + some of the workspace data at the beginning of a restart. + +25. \s*\R was auto-possessifying the \s* when it should not, whereas \S*\R + was not doing so when it should - probably a typo introduced by SVN 528 + (change 8.10/14). + +26. When PCRE_UCP was not set, \w+\x{c4} was incorrectly auto-possessifying the + \w+ when the character tables indicated that \x{c4} was a word character. + There were several related cases, all because the tests for doing a table + lookup were testing for characters less than 127 instead of 255. + +27. If a pattern contains capturing parentheses that are not used in a match, + their slots in the ovector are set to -1. For those that are higher than + any matched groups, this happens at the end of processing. In the case when + there were back references that the ovector was too small to contain + (causing temporary malloc'd memory to be used during matching), and the + highest capturing number was not used, memory off the end of the ovector + was incorrectly being set to -1. (It was using the size of the temporary + memory instead of the true size.) + +28. To catch bugs like 27 using valgrind, when pcretest is asked to specify an + ovector size, it uses memory at the end of the block that it has got. + +29. Check for an overlong MARK name and give an error at compile time. The + limit is 255 for the 8-bit library and 65535 for the 16-bit library. + +30. JIT compiler update. + +31. JIT is now supported on jailbroken iOS devices. Thanks for Ruiger + Rill for the patch. + +32. Put spaces around SLJIT_PRINT_D in the JIT compiler. Required by CXX11. + +33. Variable renamings in the PCRE-JIT compiler. No functionality change. + +34. Fixed typos in pcregrep: in two places there was SUPPORT_LIBZ2 instead of + SUPPORT_LIBBZ2. This caused a build problem when bzip2 but not gzip (zlib) + was enabled. + +35. Improve JIT code generation for greedy plus quantifier. + +36. When /((?:a?)*)*c/ or /((?>a?)*)*c/ was matched against "aac", it set group + 1 to "aa" instead of to an empty string. The bug affected repeated groups + that could potentially match an empty string. + +37. Optimizing single character iterators in JIT. + +38. Wide characters specified with \uxxxx in JavaScript mode are now subject to + the same checks as \x{...} characters in non-JavaScript mode. Specifically, + codepoints that are too big for the mode are faulted, and in a UTF mode, + disallowed codepoints are also faulted. + +39. If PCRE was compiled with UTF support, in three places in the DFA + matcher there was code that should only have been obeyed in UTF mode, but + was being obeyed unconditionally. In 8-bit mode this could cause incorrect + processing when bytes with values greater than 127 were present. In 16-bit + mode the bug would be provoked by values in the range 0xfc00 to 0xdc00. In + both cases the values are those that cannot be the first data item in a UTF + character. The three items that might have provoked this were recursions, + possessively repeated groups, and atomic groups. + +40. Ensure that libpcre is explicitly listed in the link commands for pcretest + and pcregrep, because some OS require shared objects to be explicitly + passed to ld, causing the link step to fail if they are not. + +41. There were two incorrect #ifdefs in pcre_study.c, meaning that, in 16-bit + mode, patterns that started with \h* or \R* might be incorrectly matched. + + +Version 8.30 04-February-2012 +----------------------------- + +1. Renamed "isnumber" as "is_a_number" because in some Mac environments this + name is defined in ctype.h. + +2. Fixed a bug in fixed-length calculation for lookbehinds that would show up + only in quite long subpatterns. + +3. Removed the function pcre_info(), which has been obsolete and deprecated + since it was replaced by pcre_fullinfo() in February 2000. + +4. For a non-anchored pattern, if (*SKIP) was given with a name that did not + match a (*MARK), and the match failed at the start of the subject, a + reference to memory before the start of the subject could occur. This bug + was introduced by fix 17 of release 8.21. + +5. A reference to an unset group with zero minimum repetition was giving + totally wrong answers (in non-JavaScript-compatibility mode). For example, + /(another)?(\1?)test/ matched against "hello world test". This bug was + introduced in release 8.13. + +6. Add support for 16-bit character strings (a large amount of work involving + many changes and refactorings). + +7. RunGrepTest failed on msys because \r\n was replaced by whitespace when the + command "pattern=`printf 'xxx\r\njkl'`" was run. The pattern is now taken + from a file. + +8. Ovector size of 2 is also supported by JIT based pcre_exec (the ovector size + rounding is not applied in this particular case). + +9. The invalid Unicode surrogate codepoints U+D800 to U+DFFF are now rejected + if they appear, or are escaped, in patterns. + +10. Get rid of a number of -Wunused-but-set-variable warnings. + +11. The pattern /(?=(*:x))(q|)/ matches an empty string, and returns the mark + "x". The similar pattern /(?=(*:x))((*:y)q|)/ did not return a mark at all. + Oddly, Perl behaves the same way. PCRE has been fixed so that this pattern + also returns the mark "x". This bug applied to capturing parentheses, + non-capturing parentheses, and atomic parentheses. It also applied to some + assertions. + +12. Stephen Kelly's patch to CMakeLists.txt allows it to parse the version + information out of configure.ac instead of relying on pcre.h.generic, which + is not stored in the repository. + +13. Applied Dmitry V. Levin's patch for a more portable method for linking with + -lreadline. + +14. ZH added PCRE_CONFIG_JITTARGET; added its output to pcretest -C. + +15. Applied Graycode's patch to put the top-level frame on the stack rather + than the heap when not using the stack for recursion. This gives a + performance improvement in many cases when recursion is not deep. + +16. Experimental code added to "pcretest -C" to output the stack frame size. + + +Version 8.21 12-Dec-2011 +------------------------ + +1. Updating the JIT compiler. + +2. JIT compiler now supports OP_NCREF, OP_RREF and OP_NRREF. New test cases + are added as well. + +3. Fix cache-flush issue on PowerPC (It is still an experimental JIT port). + PCRE_EXTRA_TABLES is not suported by JIT, and should be checked before + calling _pcre_jit_exec. Some extra comments are added. + +4. (*MARK) settings inside atomic groups that do not contain any capturing + parentheses, for example, (?>a(*:m)), were not being passed out. This bug + was introduced by change 18 for 8.20. + +5. Supporting of \x, \U and \u in JavaScript compatibility mode based on the + ECMA-262 standard. + +6. Lookbehinds such as (?<=a{2}b) that contained a fixed repetition were + erroneously being rejected as "not fixed length" if PCRE_CASELESS was set. + This bug was probably introduced by change 9 of 8.13. + +7. While fixing 6 above, I noticed that a number of other items were being + incorrectly rejected as "not fixed length". This arose partly because newer + opcodes had not been added to the fixed-length checking code. I have (a) + corrected the bug and added tests for these items, and (b) arranged for an + error to occur if an unknown opcode is encountered while checking for fixed + length instead of just assuming "not fixed length". The items that were + rejected were: (*ACCEPT), (*COMMIT), (*FAIL), (*MARK), (*PRUNE), (*SKIP), + (*THEN), \h, \H, \v, \V, and single character negative classes with fixed + repetitions, e.g. [^a]{3}, with and without PCRE_CASELESS. + +8. A possessively repeated conditional subpattern such as (?(?=c)c|d)++ was + being incorrectly compiled and would have given unpredicatble results. + +9. A possessively repeated subpattern with minimum repeat count greater than + one behaved incorrectly. For example, (A){2,}+ behaved as if it was + (A)(A)++ which meant that, after a subsequent mismatch, backtracking into + the first (A) could occur when it should not. + +10. Add a cast and remove a redundant test from the code. + +11. JIT should use pcre_malloc/pcre_free for allocation. + +12. Updated pcre-config so that it no longer shows -L/usr/lib, which seems + best practice nowadays, and helps with cross-compiling. (If the exec_prefix + is anything other than /usr, -L is still shown). + +13. In non-UTF-8 mode, \C is now supported in lookbehinds and DFA matching. + +14. Perl does not support \N without a following name in a [] class; PCRE now + also gives an error. + +15. If a forward reference was repeated with an upper limit of around 2000, + it caused the error "internal error: overran compiling workspace". The + maximum number of forward references (including repeats) was limited by the + internal workspace, and dependent on the LINK_SIZE. The code has been + rewritten so that the workspace expands (via pcre_malloc) if necessary, and + the default depends on LINK_SIZE. There is a new upper limit (for safety) + of around 200,000 forward references. While doing this, I also speeded up + the filling in of repeated forward references. + +16. A repeated forward reference in a pattern such as (a)(?2){2}(.) was + incorrectly expecting the subject to contain another "a" after the start. + +17. When (*SKIP:name) is activated without a corresponding (*MARK:name) earlier + in the match, the SKIP should be ignored. This was not happening; instead + the SKIP was being treated as NOMATCH. For patterns such as + /A(*MARK:A)A+(*SKIP:B)Z|AAC/ this meant that the AAC branch was never + tested. + +18. The behaviour of (*MARK), (*PRUNE), and (*THEN) has been reworked and is + now much more compatible with Perl, in particular in cases where the result + is a non-match for a non-anchored pattern. For example, if + /b(*:m)f|a(*:n)w/ is matched against "abc", the non-match returns the name + "m", where previously it did not return a name. A side effect of this + change is that for partial matches, the last encountered mark name is + returned, as for non matches. A number of tests that were previously not + Perl-compatible have been moved into the Perl-compatible test files. The + refactoring has had the pleasing side effect of removing one argument from + the match() function, thus reducing its stack requirements. + +19. If the /S+ option was used in pcretest to study a pattern using JIT, + subsequent uses of /S (without +) incorrectly behaved like /S+. + +21. Retrieve executable code size support for the JIT compiler and fixing + some warnings. + +22. A caseless match of a UTF-8 character whose other case uses fewer bytes did + not work when the shorter character appeared right at the end of the + subject string. + +23. Added some (int) casts to non-JIT modules to reduce warnings on 64-bit + systems. + +24. Added PCRE_INFO_JITSIZE to pass on the value from (21) above, and also + output it when the /M option is used in pcretest. + +25. The CheckMan script was not being included in the distribution. Also, added + an explicit "perl" to run Perl scripts from the PrepareRelease script + because this is reportedly needed in Windows. + +26. If study data was being save in a file and studying had not found a set of + "starts with" bytes for the pattern, the data written to the file (though + never used) was taken from uninitialized memory and so caused valgrind to + complain. + +27. Updated RunTest.bat as provided by Sheri Pierce. + +28. Fixed a possible uninitialized memory bug in pcre_jit_compile.c. + +29. Computation of memory usage for the table of capturing group names was + giving an unnecessarily large value. + + +Version 8.20 21-Oct-2011 +------------------------ + +1. Change 37 of 8.13 broke patterns like [:a]...[b:] because it thought it had + a POSIX class. After further experiments with Perl, which convinced me that + Perl has bugs and confusions, a closing square bracket is no longer allowed + in a POSIX name. This bug also affected patterns with classes that started + with full stops. + +2. If a pattern such as /(a)b|ac/ is matched against "ac", there is no + captured substring, but while checking the failing first alternative, + substring 1 is temporarily captured. If the output vector supplied to + pcre_exec() was not big enough for this capture, the yield of the function + was still zero ("insufficient space for captured substrings"). This cannot + be totally fixed without adding another stack variable, which seems a lot + of expense for a edge case. However, I have improved the situation in cases + such as /(a)(b)x|abc/ matched against "abc", where the return code + indicates that fewer than the maximum number of slots in the ovector have + been set. + +3. Related to (2) above: when there are more back references in a pattern than + slots in the output vector, pcre_exec() uses temporary memory during + matching, and copies in the captures as far as possible afterwards. It was + using the entire output vector, but this conflicts with the specification + that only 2/3 is used for passing back captured substrings. Now it uses + only the first 2/3, for compatibility. This is, of course, another edge + case. + +4. Zoltan Herczeg's just-in-time compiler support has been integrated into the + main code base, and can be used by building with --enable-jit. When this is + done, pcregrep automatically uses it unless --disable-pcregrep-jit or the + runtime --no-jit option is given. + +5. When the number of matches in a pcre_dfa_exec() run exactly filled the + ovector, the return from the function was zero, implying that there were + other matches that did not fit. The correct "exactly full" value is now + returned. + +6. If a subpattern that was called recursively or as a subroutine contained + (*PRUNE) or any other control that caused it to give a non-standard return, + invalid errors such as "Error -26 (nested recursion at the same subject + position)" or even infinite loops could occur. + +7. If a pattern such as /a(*SKIP)c|b(*ACCEPT)|/ was studied, it stopped + computing the minimum length on reaching *ACCEPT, and so ended up with the + wrong value of 1 rather than 0. Further investigation indicates that + computing a minimum subject length in the presence of *ACCEPT is difficult + (think back references, subroutine calls), and so I have changed the code + so that no minimum is registered for a pattern that contains *ACCEPT. + +8. If (*THEN) was present in the first (true) branch of a conditional group, + it was not handled as intended. [But see 16 below.] + +9. Replaced RunTest.bat and CMakeLists.txt with improved versions provided by + Sheri Pierce. + +10. A pathological pattern such as /(*ACCEPT)a/ was miscompiled, thinking that + the first byte in a match must be "a". + +11. Change 17 for 8.13 increased the recursion depth for patterns like + /a(?:.)*?a/ drastically. I've improved things by remembering whether a + pattern contains any instances of (*THEN). If it does not, the old + optimizations are restored. It would be nice to do this on a per-group + basis, but at the moment that is not feasible. + +12. In some environments, the output of pcretest -C is CRLF terminated. This + broke RunTest's code that checks for the link size. A single white space + character after the value is now allowed for. + +13. RunTest now checks for the "fr" locale as well as for "fr_FR" and "french". + For "fr", it uses the Windows-specific input and output files. + +14. If (*THEN) appeared in a group that was called recursively or as a + subroutine, it did not work as intended. [But see next item.] + +15. Consider the pattern /A (B(*THEN)C) | D/ where A, B, C, and D are complex + pattern fragments (but not containing any | characters). If A and B are + matched, but there is a failure in C so that it backtracks to (*THEN), PCRE + was behaving differently to Perl. PCRE backtracked into A, but Perl goes to + D. In other words, Perl considers parentheses that do not contain any | + characters to be part of a surrounding alternative, whereas PCRE was + treading (B(*THEN)C) the same as (B(*THEN)C|(*FAIL)) -- which Perl handles + differently. PCRE now behaves in the same way as Perl, except in the case + of subroutine/recursion calls such as (?1) which have in any case always + been different (but PCRE had them first :-). + +16. Related to 15 above: Perl does not treat the | in a conditional group as + creating alternatives. Such a group is treated in the same way as an + ordinary group without any | characters when processing (*THEN). PCRE has + been changed to match Perl's behaviour. + +17. If a user had set PCREGREP_COLO(U)R to something other than 1:31, the + RunGrepTest script failed. + +18. Change 22 for version 13 caused atomic groups to use more stack. This is + inevitable for groups that contain captures, but it can lead to a lot of + stack use in large patterns. The old behaviour has been restored for atomic + groups that do not contain any capturing parentheses. + +19. If the PCRE_NO_START_OPTIMIZE option was set for pcre_compile(), it did not + suppress the check for a minimum subject length at run time. (If it was + given to pcre_exec() or pcre_dfa_exec() it did work.) + +20. Fixed an ASCII-dependent infelicity in pcretest that would have made it + fail to work when decoding hex characters in data strings in EBCDIC + environments. + +21. It appears that in at least one Mac OS environment, the isxdigit() function + is implemented as a macro that evaluates to its argument more than once, + contravening the C 90 Standard (I haven't checked a later standard). There + was an instance in pcretest which caused it to go wrong when processing + \x{...} escapes in subject strings. The has been rewritten to avoid using + things like p++ in the argument of isxdigit(). + + +Version 8.13 16-Aug-2011 +------------------------ + +1. The Unicode data tables have been updated to Unicode 6.0.0. + +2. Two minor typos in pcre_internal.h have been fixed. + +3. Added #include to pcre_scanner_unittest.cc, pcrecpp.cc, and + pcrecpp_unittest.cc. They are needed for strcmp(), memset(), and strchr() + in some environments (e.g. Solaris 10/SPARC using Sun Studio 12U2). + +4. There were a number of related bugs in the code for matching backrefences + caselessly in UTF-8 mode when codes for the characters concerned were + different numbers of bytes. For example, U+023A and U+2C65 are an upper + and lower case pair, using 2 and 3 bytes, respectively. The main bugs were: + (a) A reference to 3 copies of a 2-byte code matched only 2 of a 3-byte + code. (b) A reference to 2 copies of a 3-byte code would not match 2 of a + 2-byte code at the end of the subject (it thought there wasn't enough data + left). + +5. Comprehensive information about what went wrong is now returned by + pcre_exec() and pcre_dfa_exec() when the UTF-8 string check fails, as long + as the output vector has at least 2 elements. The offset of the start of + the failing character and a reason code are placed in the vector. + +6. When the UTF-8 string check fails for pcre_compile(), the offset that is + now returned is for the first byte of the failing character, instead of the + last byte inspected. This is an incompatible change, but I hope it is small + enough not to be a problem. It makes the returned offset consistent with + pcre_exec() and pcre_dfa_exec(). + +7. pcretest now gives a text phrase as well as the error number when + pcre_exec() or pcre_dfa_exec() fails; if the error is a UTF-8 check + failure, the offset and reason code are output. + +8. When \R was used with a maximizing quantifier it failed to skip backwards + over a \r\n pair if the subsequent match failed. Instead, it just skipped + back over a single character (\n). This seems wrong (because it treated the + two characters as a single entity when going forwards), conflicts with the + documentation that \R is equivalent to (?>\r\n|\n|...etc), and makes the + behaviour of \R* different to (\R)*, which also seems wrong. The behaviour + has been changed. + +9. Some internal refactoring has changed the processing so that the handling + of the PCRE_CASELESS and PCRE_MULTILINE options is done entirely at compile + time (the PCRE_DOTALL option was changed this way some time ago: version + 7.7 change 16). This has made it possible to abolish the OP_OPT op code, + which was always a bit of a fudge. It also means that there is one less + argument for the match() function, which reduces its stack requirements + slightly. This change also fixes an incompatibility with Perl: the pattern + (?i:([^b]))(?1) should not match "ab", but previously PCRE gave a match. + +10. More internal refactoring has drastically reduced the number of recursive + calls to match() for possessively repeated groups such as (abc)++ when + using pcre_exec(). + +11. While implementing 10, a number of bugs in the handling of groups were + discovered and fixed: + + (?<=(a)+) was not diagnosed as invalid (non-fixed-length lookbehind). + (a|)*(?1) gave a compile-time internal error. + ((a|)+)+ did not notice that the outer group could match an empty string. + (^a|^)+ was not marked as anchored. + (.*a|.*)+ was not marked as matching at start or after a newline. + +12. Yet more internal refactoring has removed another argument from the match() + function. Special calls to this function are now indicated by setting a + value in a variable in the "match data" data block. + +13. Be more explicit in pcre_study() instead of relying on "default" for + opcodes that mean there is no starting character; this means that when new + ones are added and accidentally left out of pcre_study(), testing should + pick them up. + +14. The -s option of pcretest has been documented for ages as being an old + synonym of -m (show memory usage). I have changed it to mean "force study + for every regex", that is, assume /S for every regex. This is similar to -i + and -d etc. It's slightly incompatible, but I'm hoping nobody is still + using it. It makes it easier to run collections of tests with and without + study enabled, and thereby test pcre_study() more easily. All the standard + tests are now run with and without -s (but some patterns can be marked as + "never study" - see 20 below). + +15. When (*ACCEPT) was used in a subpattern that was called recursively, the + restoration of the capturing data to the outer values was not happening + correctly. + +16. If a recursively called subpattern ended with (*ACCEPT) and matched an + empty string, and PCRE_NOTEMPTY was set, pcre_exec() thought the whole + pattern had matched an empty string, and so incorrectly returned a no + match. + +17. There was optimizing code for the last branch of non-capturing parentheses, + and also for the obeyed branch of a conditional subexpression, which used + tail recursion to cut down on stack usage. Unfortunately, now that there is + the possibility of (*THEN) occurring in these branches, tail recursion is + no longer possible because the return has to be checked for (*THEN). These + two optimizations have therefore been removed. [But see 8.20/11 above.] + +18. If a pattern containing \R was studied, it was assumed that \R always + matched two bytes, thus causing the minimum subject length to be + incorrectly computed because \R can also match just one byte. + +19. If a pattern containing (*ACCEPT) was studied, the minimum subject length + was incorrectly computed. + +20. If /S is present twice on a test pattern in pcretest input, it now + *disables* studying, thereby overriding the use of -s on the command line + (see 14 above). This is necessary for one or two tests to keep the output + identical in both cases. + +21. When (*ACCEPT) was used in an assertion that matched an empty string and + PCRE_NOTEMPTY was set, PCRE applied the non-empty test to the assertion. + +22. When an atomic group that contained a capturing parenthesis was + successfully matched, but the branch in which it appeared failed, the + capturing was not being forgotten if a higher numbered group was later + captured. For example, /(?>(a))b|(a)c/ when matching "ac" set capturing + group 1 to "a", when in fact it should be unset. This applied to multi- + branched capturing and non-capturing groups, repeated or not, and also to + positive assertions (capturing in negative assertions does not happen + in PCRE) and also to nested atomic groups. + +23. Add the ++ qualifier feature to pcretest, to show the remainder of the + subject after a captured substring, to make it easier to tell which of a + number of identical substrings has been captured. + +24. The way atomic groups are processed by pcre_exec() has been changed so that + if they are repeated, backtracking one repetition now resets captured + values correctly. For example, if ((?>(a+)b)+aabab) is matched against + "aaaabaaabaabab" the value of captured group 2 is now correctly recorded as + "aaa". Previously, it would have been "a". As part of this code + refactoring, the way recursive calls are handled has also been changed. + +25. If an assertion condition captured any substrings, they were not passed + back unless some other capturing happened later. For example, if + (?(?=(a))a) was matched against "a", no capturing was returned. + +26. When studying a pattern that contained subroutine calls or assertions, + the code for finding the minimum length of a possible match was handling + direct recursions such as (xxx(?1)|yyy) but not mutual recursions (where + group 1 called group 2 while simultaneously a separate group 2 called group + 1). A stack overflow occurred in this case. I have fixed this by limiting + the recursion depth to 10. + +27. Updated RunTest.bat in the distribution to the version supplied by Tom + Fortmann. This supports explicit test numbers on the command line, and has + argument validation and error reporting. + +28. An instance of \X with an unlimited repeat could fail if at any point the + first character it looked at was a mark character. + +29. Some minor code refactoring concerning Unicode properties and scripts + should reduce the stack requirement of match() slightly. + +30. Added the '=' option to pcretest to check the setting of unused capturing + slots at the end of the pattern, which are documented as being -1, but are + not included in the return count. + +31. If \k was not followed by a braced, angle-bracketed, or quoted name, PCRE + compiled something random. Now it gives a compile-time error (as does + Perl). + +32. A *MARK encountered during the processing of a positive assertion is now + recorded and passed back (compatible with Perl). + +33. If --only-matching or --colour was set on a pcregrep call whose pattern + had alternative anchored branches, the search for a second match in a line + was done as if at the line start. Thus, for example, /^01|^02/ incorrectly + matched the line "0102" twice. The same bug affected patterns that started + with a backwards assertion. For example /\b01|\b02/ also matched "0102" + twice. + +34. Previously, PCRE did not allow quantification of assertions. However, Perl + does, and because of capturing effects, quantifying parenthesized + assertions may at times be useful. Quantifiers are now allowed for + parenthesized assertions. + +35. A minor code tidy in pcre_compile() when checking options for \R usage. + +36. \g was being checked for fancy things in a character class, when it should + just be a literal "g". + +37. PCRE was rejecting [:a[:digit:]] whereas Perl was not. It seems that the + appearance of a nested POSIX class supersedes an apparent external class. + For example, [:a[:digit:]b:] matches "a", "b", ":", or a digit. Also, + unescaped square brackets may also appear as part of class names. For + example, [:a[:abc]b:] gives unknown class "[:abc]b:]". PCRE now behaves + more like Perl. (But see 8.20/1 above.) + +38. PCRE was giving an error for \N with a braced quantifier such as {1,} (this + was because it thought it was \N{name}, which is not supported). + +39. Add minix to OS list not supporting the -S option in pcretest. + +40. PCRE tries to detect cases of infinite recursion at compile time, but it + cannot analyze patterns in sufficient detail to catch mutual recursions + such as ((?1))((?2)). There is now a runtime test that gives an error if a + subgroup is called recursively as a subpattern for a second time at the + same position in the subject string. In previous releases this might have + been caught by the recursion limit, or it might have run out of stack. + +41. A pattern such as /(?(R)a+|(?R)b)/ is quite safe, as the recursion can + happen only once. PCRE was, however incorrectly giving a compile time error + "recursive call could loop indefinitely" because it cannot analyze the + pattern in sufficient detail. The compile time test no longer happens when + PCRE is compiling a conditional subpattern, but actual runaway loops are + now caught at runtime (see 40 above). + +42. It seems that Perl allows any characters other than a closing parenthesis + to be part of the NAME in (*MARK:NAME) and other backtracking verbs. PCRE + has been changed to be the same. + +43. Updated configure.ac to put in more quoting round AC_LANG_PROGRAM etc. so + as not to get warnings when autogen.sh is called. Also changed + AC_PROG_LIBTOOL (deprecated) to LT_INIT (the current macro). + +44. To help people who use pcregrep to scan files containing exceedingly long + lines, the following changes have been made: + + (a) The default value of the buffer size parameter has been increased from + 8K to 20K. (The actual buffer used is three times this size.) + + (b) The default can be changed by ./configure --with-pcregrep-bufsize when + PCRE is built. + + (c) A --buffer-size=n option has been added to pcregrep, to allow the size + to be set at run time. + + (d) Numerical values in pcregrep options can be followed by K or M, for + example --buffer-size=50K. + + (e) If a line being scanned overflows pcregrep's buffer, an error is now + given and the return code is set to 2. + +45. Add a pointer to the latest mark to the callout data block. + +46. The pattern /.(*F)/, when applied to "abc" with PCRE_PARTIAL_HARD, gave a + partial match of an empty string instead of no match. This was specific to + the use of ".". + +47. The pattern /f.*/8s, when applied to "for" with PCRE_PARTIAL_HARD, gave a + complete match instead of a partial match. This bug was dependent on both + the PCRE_UTF8 and PCRE_DOTALL options being set. + +48. For a pattern such as /\babc|\bdef/ pcre_study() was failing to set up the + starting byte set, because \b was not being ignored. + + Version 8.12 15-Jan-2011 ------------------------ diff -Nru php5-5.4.4/ext/pcre/pcrelib/HACKING php5-5.4.9/ext/pcre/pcrelib/HACKING --- php5-5.4.4/ext/pcre/pcrelib/HACKING 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/HACKING 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,8 @@ -------------------------- These are very rough technical notes that record potentially useful information -about PCRE internals. +about PCRE internals. For information about testing PCRE, see the pcretest +documentation and the comment at the head of the RunTest file. Historical note 1 @@ -48,6 +49,18 @@ first pass through the pattern is helpful for other reasons. +Support for 16-bit data strings +------------------------------- + +From release 8.30, PCRE supports 16-bit as well as 8-bit data strings, by being +compilable in either 8-bit or 16-bit modes, or both. Thus, two different +libraries can be created. In the description that follows, the word "short" is +used for a 16-bit data quantity, and the word "unit" is used for a quantity +that is a byte in 8-bit mode and a short in 16-bit mode. However, so as not to +over-complicate the text, the names of PCRE functions are given in 8-bit form +only. + + Computing the memory requirement: how it was -------------------------------------------- @@ -68,7 +81,7 @@ I had a flash of inspiration as to how I could run the real compile function in a "fake" mode that enables it to compute how much memory it would need, while actually only ever using a few hundred bytes of working memory, and without too -many tests of the mode that might slow it down. So I re-factored the compiling +many tests of the mode that might slow it down. So I refactored the compiling functions to work this way. This got rid of about 600 lines of source. It should make future maintenance and development easier. As this was such a major change, I never released 6.8, instead upping the number to 7.0 (other quite @@ -88,7 +101,10 @@ it implements an NFA algorithm, similar to the original Henry Spencer algorithm and the way that Perl works. This is not surprising, since it is intended to be as compatible with Perl as possible. This is the function most users of PCRE -will use most of the time. +will use most of the time. From release 8.20, if PCRE is compiled with +just-in-time (JIT) support, and studying a compiled pattern with JIT is +successful, the JIT code is run instead of the normal pcre_exec() code, but the +result is the same. Supplementary matching function @@ -108,28 +124,38 @@ ever active at once. I believe some other regex matchers work this way. +Changeable options +------------------ + +The /i, /m, or /s options (PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL) may +change in the middle of patterns. From PCRE 8.13, their processing is handled +entirely at compile time by generating different opcodes for the different +settings. The runtime functions do not need to keep track of an options state +any more. + + Format of compiled patterns --------------------------- -The compiled form of a pattern is a vector of bytes, containing items of -variable length. The first byte in an item is an opcode, and the length of the -item is either implicit in the opcode or contained in the data bytes that -follow it. - -In many cases below LINK_SIZE data values are specified for offsets within the -compiled pattern. The default value for LINK_SIZE is 2, but PCRE can be -compiled to use 3-byte or 4-byte values for these offsets (impairing the -performance). This is necessary only when patterns whose compiled length is -greater than 64K are going to be processed. In this description, we assume the -"normal" compilation options. Data values that are counts (e.g. for -quantifiers) are always just two bytes long. - -A list of the opcodes follows: +The compiled form of a pattern is a vector of units (bytes in 8-bit mode, or +shorts in 16-bit mode), containing items of variable length. The first unit in +an item contains an opcode, and the length of the item is either implicit in +the opcode or contained in the data that follows it. + +In many cases listed below, LINK_SIZE data values are specified for offsets +within the compiled pattern. LINK_SIZE always specifies a number of bytes. The +default value for LINK_SIZE is 2, but PCRE can be compiled to use 3-byte or +4-byte values for these offsets, although this impairs the performance. (3-byte +LINK_SIZE values are available only in 8-bit mode.) Specifing a LINK_SIZE +larger than 2 is necessary only when patterns whose compiled length is greater +than 64K are going to be processed. In this description, we assume the "normal" +compilation options. Data values that are counts (e.g. for quantifiers) are +always just two bytes long (one short in 16-bit mode). Opcodes with no following data ------------------------------ -These items are all just one byte long +These items are all just one unit long OP_END end of pattern OP_ANY match any one character other than newline @@ -138,7 +164,8 @@ OP_SOD match start of data: \A OP_SOM, start of match (subject + offset): \G OP_SET_SOM, set start of match (\K) - OP_CIRC ^ (start of data, or after \n in multiline) + OP_CIRC ^ (start of data) + OP_CIRCM ^ multiline mode (start of data or after newline) OP_NOT_WORD_BOUNDARY \W OP_WORD_BOUNDARY \w OP_NOT_DIGIT \D @@ -153,7 +180,8 @@ OP_WORDCHAR \w OP_EODN match end of data or \n at end: \Z OP_EOD match end of data: \z - OP_DOLL $ (end of data, or before \n in multiline) + OP_DOLL $ (end of data, or before final newline) + OP_DOLLM $ multiline mode (end of data or before newline) OP_EXTUNI match an extended Unicode character OP_ANYNL match any Unicode newline sequence @@ -164,49 +192,57 @@ OP_SKIP ) indicating which parentheses must be closed. -Backtracking control verbs with data ------------------------------------- - -OP_THEN is followed by a LINK_SIZE offset, which is the distance back to the -start of the current branch. - -OP_MARK is followed by the mark name, preceded by a one-byte length, and -followed by a binary zero. For (*PRUNE), (*SKIP), and (*THEN) with arguments, -the opcodes OP_PRUNE_ARG, OP_SKIP_ARG, and OP_THEN_ARG are used. For the first -two, the name follows immediately; for OP_THEN_ARG, it follows the LINK_SIZE -offset value. +Backtracking control verbs with (optional) data +----------------------------------------------- + +(*THEN) without an argument generates the opcode OP_THEN and no following data. +OP_MARK is followed by the mark name, preceded by a one-unit length, and +followed by a binary zero. For (*PRUNE), (*SKIP), and (*THEN) with arguments, +the opcodes OP_PRUNE_ARG, OP_SKIP_ARG, and OP_THEN_ARG are used, with the name +following in the same format. +Matching literal characters +--------------------------- + +The OP_CHAR opcode is followed by a single character that is to be matched +casefully. For caseless matching, OP_CHARI is used. In UTF-8 or UTF-16 modes, +the character may be more than one unit long. + + Repeating single characters --------------------------- -The common repeats (*, +, ?) when applied to a single character use the -following opcodes: +The common repeats (*, +, ?), when applied to a single character, use the +following opcodes, which come in caseful and caseless versions: - OP_STAR - OP_MINSTAR - OP_POSSTAR - OP_PLUS - OP_MINPLUS - OP_POSPLUS - OP_QUERY - OP_MINQUERY - OP_POSQUERY - -In ASCII mode, these are two-byte items; in UTF-8 mode, the length is variable. -Those with "MIN" in their name are the minimizing versions. Those with "POS" in -their names are possessive versions. Each is followed by the character that is -to be repeated. Other repeats make use of - - OP_UPTO - OP_MINUPTO - OP_POSUPTO - OP_EXACT - -which are followed by a two-byte count (most significant first) and the -repeated character. OP_UPTO matches from 0 to the given number. A repeat with a -non-zero minimum and a fixed maximum is coded as an OP_EXACT followed by an -OP_UPTO (or OP_MINUPTO or OPT_POSUPTO). + Caseful Caseless + OP_STAR OP_STARI + OP_MINSTAR OP_MINSTARI + OP_POSSTAR OP_POSSTARI + OP_PLUS OP_PLUSI + OP_MINPLUS OP_MINPLUSI + OP_POSPLUS OP_POSPLUSI + OP_QUERY OP_QUERYI + OP_MINQUERY OP_MINQUERYI + OP_POSQUERY OP_POSQUERYI + +Each opcode is followed by the character that is to be repeated. In ASCII mode, +these are two-unit items; in UTF-8 or UTF-16 modes, the length is variable. +Those with "MIN" in their names are the minimizing versions. Those with "POS" +in their names are possessive versions. Other repeats make use of these +opcodes: + + Caseful Caseless + OP_UPTO OP_UPTOI + OP_MINUPTO OP_MINUPTOI + OP_POSUPTO OP_POSUPTOI + OP_EXACT OP_EXACTI + +Each of these is followed by a two-byte (one short) count (most significant +byte first in 8-bit mode) and then the repeated character. OP_UPTO matches from +0 to the given number. A repeat with a non-zero minimum and a fixed maximum is +coded as an OP_EXACT followed by an OP_UPTO (or OP_MINUPTO or OPT_POSUPTO). Repeating character types @@ -214,7 +250,7 @@ Repeats of things like \d are done exactly as for single characters, except that instead of a character, the opcode for the type is stored in the data -byte. The opcodes are: +unit. The opcodes are: OP_TYPESTAR OP_TYPEMINSTAR @@ -236,65 +272,58 @@ OP_PROP and OP_NOTPROP are used for positive and negative matches of a character by testing its Unicode property (the \p and \P escape sequences). -Each is followed by two bytes that encode the desired property as a type and a +Each is followed by two units that encode the desired property as a type and a value. -Repeats of these items use the OP_TYPESTAR etc. set of opcodes, followed by -three bytes: OP_PROP or OP_NOTPROP and then the desired property type and +Repeats of these items use the OP_TYPESTAR etc. set of opcodes, followed by +three units: OP_PROP or OP_NOTPROP, and then the desired property type and value. -Matching literal characters ---------------------------- - -The OP_CHAR opcode is followed by a single character that is to be matched -casefully. For caseless matching, OP_CHARNC is used. In UTF-8 mode, the -character may be more than one byte long. (Earlier versions of PCRE used -multi-character strings, but this was changed to allow some new features to be -added.) - - Character classes ----------------- -If there is only one character, OP_CHAR or OP_CHARNC is used for a positive -class, and OP_NOT for a negative one (that is, for something like [^a]). -However, in UTF-8 mode, the use of OP_NOT applies only to characters with -values < 128, because OP_NOT is confined to single bytes. - -Another set of repeating opcodes (OP_NOTSTAR etc.) are used for a repeated, -negated, single-character class. The normal ones (OP_STAR etc.) are used for a -repeated positive single-character class. - -When there's more than one character in a class and all the characters are less -than 256, OP_CLASS is used for a positive class, and OP_NCLASS for a negative -one. In either case, the opcode is followed by a 32-byte bit map containing a 1 -bit for every character that is acceptable. The bits are counted from the least -significant end of each byte. - -The reason for having both OP_CLASS and OP_NCLASS is so that, in UTF-8 mode, -subject characters with values greater than 256 can be handled correctly. For -OP_CLASS they don't match, whereas for OP_NCLASS they do. - -For classes containing characters with values > 255, OP_XCLASS is used. It -optionally uses a bit map (if any characters lie within it), followed by a list -of pairs and single characters. There is a flag character than indicates -whether it's a positive or a negative class. +If there is only one character in the class, OP_CHAR or OP_CHARI is used for a +positive class, and OP_NOT or OP_NOTI for a negative one (that is, for +something like [^a]). + +Another set of 13 repeating opcodes (called OP_NOTSTAR etc.) are used for +repeated, negated, single-character classes. The normal single-character +opcodes (OP_STAR, etc.) are used for repeated positive single-character +classes. + +When there is more than one character in a class and all the characters are +less than 256, OP_CLASS is used for a positive class, and OP_NCLASS for a +negative one. In either case, the opcode is followed by a 32-byte (16-short) +bit map containing a 1 bit for every character that is acceptable. The bits are +counted from the least significant end of each unit. In caseless mode, bits for +both cases are set. + +The reason for having both OP_CLASS and OP_NCLASS is so that, in UTF-8/16 mode, +subject characters with values greater than 255 can be handled correctly. For +OP_CLASS they do not match, whereas for OP_NCLASS they do. + +For classes containing characters with values greater than 255, OP_XCLASS is +used. It optionally uses a bit map (if any characters lie within it), followed +by a list of pairs (for a range) and single characters. In caseless mode, both +cases are explicitly listed. There is a flag character than indicates whether +it is a positive or a negative class. Back references --------------- -OP_REF is followed by two bytes containing the reference number. +OP_REF (caseful) or OP_REFI (caseless) is followed by two bytes (one short) +containing the reference number. Repeating character classes and back references ----------------------------------------------- Single-character classes are handled specially (see above). This section -applies to OP_CLASS and OP_REF. In both cases, the repeat information follows -the base item. The matching code looks at the following opcode to see if it is -one of +applies to OP_CLASS and OP_REF[I]. In both cases, the repeat information +follows the base item. The matching code looks at the following opcode to see +if it is one of OP_CRSTAR OP_CRMINSTAR @@ -305,10 +334,10 @@ OP_CRRANGE OP_CRMINRANGE -All but the last two are just single-byte items. The others are followed by -four bytes of data, comprising the minimum and maximum repeat counts. There are -no special possessive opcodes for these repeats; a possessive repeat is -compiled into an atomic group. +All but the last two are just single-unit items. The others are followed by +four bytes (two shorts) of data, comprising the minimum and maximum repeat +counts. There are no special possessive opcodes for these repeats; a possessive +repeat is compiled into an atomic group. Brackets and alternation @@ -318,7 +347,8 @@ compile time, so alternation always happens in the context of brackets. [Note for North Americans: "bracket" to some English speakers, including -myself, can be round, square, curly, or pointy. Hence this usage.] +myself, can be round, square, curly, or pointy. Hence this usage rather than +"parentheses".] Non-capturing brackets use the opcode OP_BRA. Originally PCRE was limited to 99 capturing brackets and it used a different opcode for each one. From release @@ -330,16 +360,17 @@ next alternative OP_ALT or, if there aren't any branches, to the matching OP_KET opcode. Each OP_ALT is followed by LINK_SIZE bytes giving the offset to the next one, or to the OP_KET opcode. For capturing brackets, the bracket -number immediately follows the offset, always as a 2-byte item. +number immediately follows the offset, always as a 2-byte (one short) item. -OP_KET is used for subpatterns that do not repeat indefinitely, while +OP_KET is used for subpatterns that do not repeat indefinitely, and OP_KETRMIN and OP_KETRMAX are used for indefinite repetitions, minimally or -maximally respectively. All three are followed by LINK_SIZE bytes giving (as a -positive number) the offset back to the matching bracket opcode. +maximally respectively (see below for possessive repetitions). All three are +followed by LINK_SIZE bytes giving (as a positive number) the offset back to +the matching bracket opcode. If a subpattern is quantified such that it is permitted to match zero times, it is preceded by one of OP_BRAZERO, OP_BRAMINZERO, or OP_SKIPZERO. These are -single-byte opcodes that tell the matcher that skipping the following +single-unit opcodes that tell the matcher that skipping the following subpattern entirely is a valid branch. In the case of the first two, not skipping the pattern is also valid (greedy and non-greedy). The third is used when a pattern has the quantifier {0,0}. It cannot be entirely discarded, @@ -362,6 +393,15 @@ that it needs to check for matching an empty string when it hits OP_KETRMIN or OP_KETRMAX, and if so, to break the loop. +Possessive brackets +------------------- + +When a repeated group (capturing or non-capturing) is marked as possessive by +the "+" notation, e.g. (abc)++, different opcodes are used. Their names all +have POS on the end, e.g. OP_BRAPOS instead of OP_BRA and OP_SCPBRPOS instead +of OP_SCBRA. The end of such a group is marked by OP_KETRPOS. If the minimum +repetition is zero, the group is preceded by OP_BRAPOSZERO. + Assertions ---------- @@ -369,11 +409,11 @@ Forward assertions are just like other subpatterns, but starting with one of the opcodes OP_ASSERT or OP_ASSERT_NOT. Backward assertions use the opcodes OP_ASSERTBACK and OP_ASSERTBACK_NOT, and the first opcode inside the assertion -is OP_REVERSE, followed by a two byte count of the number of characters to move -back the pointer in the subject string. When operating in UTF-8 mode, the count -is a character count rather than a byte count. A separate count is present in -each alternative of a lookbehind assertion, allowing them to have different -fixed lengths. +is OP_REVERSE, followed by a two byte (one short) count of the number of +characters to move back the pointer in the subject string. In ASCII mode, the +count is a number of units, but in UTF-8/16 mode each character may occupy more +than one unit. A separate count is present in each alternative of a lookbehind +assertion, allowing them to have different fixed lengths. Once-only (atomic) subpatterns @@ -390,14 +430,15 @@ These are like other subpatterns, but they start with the opcode OP_COND, or OP_SCOND for one that might match an empty string in an unbounded repeat. If the condition is a back reference, this is stored at the start of the -subpattern using the opcode OP_CREF followed by two bytes containing the -reference number. OP_NCREF is used instead if the reference was generated by -name (so that the runtime code knows to check for duplicate names). +subpattern using the opcode OP_CREF followed by two bytes (one short) +containing the reference number. OP_NCREF is used instead if the reference was +generated by name (so that the runtime code knows to check for duplicate +names). If the condition is "in recursion" (coded as "(?(R)"), or "in recursion of group x" (coded as "(?(Rx)"), the group number is stored at the start of the subpattern using the opcode OP_RREF or OP_NRREF (cf OP_NCREF), and a value of -zero for "the whole pattern". For a DEFINE condition, just the single byte +zero for "the whole pattern". For a DEFINE condition, just the single unit OP_DEF is used (it has no associated data). Otherwise, a conditional subpattern always starts with one of the assertions. @@ -416,25 +457,12 @@ Callout ------- -OP_CALLOUT is followed by one byte of data that holds a callout number in the +OP_CALLOUT is followed by one unit of data that holds a callout number in the range 0 to 254 for manual callouts, or 255 for an automatic callout. In both -cases there follows a two-byte value giving the offset in the pattern to the -start of the following item, and another two-byte item giving the length of the -next item. - - -Changing options ----------------- - -If any of the /i, /m, or /s options are changed within a pattern, an OP_OPT -opcode is compiled, followed by one byte containing the new settings of these -flags. If there are several alternatives, there is an occurrence of OP_OPT at -the start of all those following the first options change, to set appropriate -options for the start of the alternative. Immediately after the end of the -group there is another such item to reset the flags to their previous values. A -change of flag right at the very start of the pattern can be handled entirely -at compile time, and so does not cause anything to be put into the compiled -data. +cases there follows a two-byte (one short) value giving the offset in the +pattern to the start of the following item, and another two-byte (one short) +item giving the length of the next item. + Philip Hazel -October 2010 +February 2012 diff -Nru php5-5.4.4/ext/pcre/pcrelib/LICENCE php5-5.4.9/ext/pcre/pcrelib/LICENCE --- php5-5.4.4/ext/pcre/pcrelib/LICENCE 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/LICENCE 2012-11-21 05:12:20.000000000 +0000 @@ -9,7 +9,9 @@ directory, is distributed under the same terms as the software itself. The basic library functions are written in C and are freestanding. Also -included in the distribution is a set of C++ wrapper functions. +included in the distribution is a set of C++ wrapper functions, and a +just-in-time compiler that can be used to optimize pattern matching. These +are both optional features that can be omitted when the library is built. THE BASIC LIBRARY FUNCTIONS @@ -22,7 +24,29 @@ University of Cambridge Computing Service, Cambridge, England. -Copyright (c) 1997-2010 University of Cambridge +Copyright (c) 1997-2012 University of Cambridge +All rights reserved. + + +PCRE JUST-IN-TIME COMPILATION SUPPORT +------------------------------------- + +Written by: Zoltan Herczeg +Email local part: hzmester +Emain domain: freemail.hu + +Copyright(c) 2010-2012 Zoltan Herczeg +All rights reserved. + + +STACK-LESS JUST-IN-TIME COMPILER +-------------------------------- + +Written by: Zoltan Herczeg +Email local part: hzmester +Emain domain: freemail.hu + +Copyright(c) 2009-2012 Zoltan Herczeg All rights reserved. @@ -31,7 +55,7 @@ Contributed by: Google Inc. -Copyright (c) 2007-2010, Google Inc. +Copyright (c) 2007-2012, Google Inc. All rights reserved. diff -Nru php5-5.4.4/ext/pcre/pcrelib/NEWS php5-5.4.9/ext/pcre/pcrelib/NEWS --- php5-5.4.4/ext/pcre/pcrelib/NEWS 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/NEWS 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,82 @@ News about PCRE releases ------------------------ +Release 8.31 06-July-2012 +------------------------- + +This is mainly a bug-fixing release, with a small number of developments: + +. The JIT compiler now supports partial matching and the (*MARK) and + (*COMMIT) verbs. + +. PCRE_INFO_MAXLOOKBEHIND can be used to find the longest lookbehing in a + pattern. + +. There should be a performance improvement when using the heap instead of the + stack for recursion. + +. pcregrep can now be linked with libedit as an alternative to libreadline. + +. pcregrep now has a --file-list option where the list of files to scan is + given as a file. + +. pcregrep now recognizes binary files and there are related options. + +. The Unicode tables have been updated to 6.1.0. + +As always, the full list of changes is in the ChangeLog file. + + +Release 8.30 04-February-2012 +----------------------------- + +Release 8.30 introduces a major new feature: support for 16-bit character +strings, compiled as a separate library. There are a few changes to the +8-bit library, in addition to some bug fixes. + +. The pcre_info() function, which has been obsolete for over 10 years, has + been removed. + +. When a compiled pattern was saved to a file and later reloaded on a host + with different endianness, PCRE used automatically to swap the bytes in some + of the data fields. With the advent of the 16-bit library, where more of this + swapping is needed, it is no longer done automatically. Instead, the bad + endianness is detected and a specific error is given. The user can then call + a new function called pcre_pattern_to_host_byte_order() (or an equivalent + 16-bit function) to do the swap. + +. In UTF-8 mode, the values 0xd800 to 0xdfff are not legal Unicode + code points and are now faulted. (They are the so-called "surrogates" + that are reserved for coding high values in UTF-16.) + + +Release 8.21 12-Dec-2011 +------------------------ + +This is almost entirely a bug-fix release. The only new feature is the ability +to obtain the size of the memory used by the JIT compiler. + + +Release 8.20 21-Oct-2011 +------------------------ + +The main change in this release is the inclusion of Zoltan Herczeg's +just-in-time compiler support, which can be accessed by building PCRE with +--enable-jit. Large performance benefits can be had in many situations. 8.20 +also fixes an unfortunate bug that was introduced in 8.13 as well as tidying up +a number of infelicities and differences from Perl. + + +Release 8.13 16-Aug-2011 +------------------------ + +This is mainly a bug-fix release. There has been a lot of internal refactoring. +The Unicode tables have been updated. The only new feature in the library is +the passing of *MARK information to callouts. Some additions have been made to +pcretest to make testing easier and more comprehensive. There is a new option +for pcregrep to adjust its internal buffer size. + + Release 8.12 15-Jan-2011 ------------------------ diff -Nru php5-5.4.4/ext/pcre/pcrelib/NON-UNIX-USE php5-5.4.9/ext/pcre/pcrelib/NON-UNIX-USE --- php5-5.4.4/ext/pcre/pcrelib/NON-UNIX-USE 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/NON-UNIX-USE 2012-11-21 05:12:20.000000000 +0000 @@ -1,501 +1,7 @@ Compiling PCRE on non-Unix systems ---------------------------------- -This document contains the following sections: +This has been renamed to better reflect its contents. Please see the file +NON-AUTOTOOLS-BUILD for details of how to build PCRE without using autotools. - General - Generic instructions for the PCRE C library - The C++ wrapper functions - Building for virtual Pascal - Stack size in Windows environments - Linking programs in Windows environments - Comments about Win32 builds - Building PCRE on Windows with CMake - Use of relative paths with CMake on Windows - Testing with RunTest.bat - Building under Windows with BCC5.5 - Building PCRE on OpenVMS - Building PCRE on Stratus OpenVOS - - -GENERAL - -I (Philip Hazel) have no experience of Windows or VMS sytems and how their -libraries work. The items in the PCRE distribution and Makefile that relate to -anything other than Unix-like systems are untested by me. - -There are some other comments and files (including some documentation in CHM -format) in the Contrib directory on the FTP site: - - ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Contrib - -If you want to compile PCRE for a non-Unix system (especially for a system that -does not support "configure" and "make" files), note that the basic PCRE -library consists entirely of code written in Standard C, and so should compile -successfully on any system that has a Standard C compiler and library. The C++ -wrapper functions are a separate issue (see below). - -The PCRE distribution includes a "configure" file for use by the Configure/Make -build system, as found in many Unix-like environments. There is also support -support for CMake, which some users prefer, especially in Windows environments. -There are some instructions for CMake under Windows in the section entitled -"Building PCRE with CMake" below. CMake can also be used to build PCRE in -Unix-like systems. - - -GENERIC INSTRUCTIONS FOR THE PCRE C LIBRARY - -The following are generic comments about building the PCRE C library "by hand". - - (1) Copy or rename the file config.h.generic as config.h, and edit the macro - settings that it contains to whatever is appropriate for your environment. - In particular, if you want to force a specific value for newline, you can - define the NEWLINE macro. When you compile any of the PCRE modules, you - must specify -DHAVE_CONFIG_H to your compiler so that config.h is included - in the sources. - - An alternative approach is not to edit config.h, but to use -D on the - compiler command line to make any changes that you need to the - configuration options. In this case -DHAVE_CONFIG_H must not be set. - - NOTE: There have been occasions when the way in which certain parameters - in config.h are used has changed between releases. (In the configure/make - world, this is handled automatically.) When upgrading to a new release, - you are strongly advised to review config.h.generic before re-using what - you had previously. - - (2) Copy or rename the file pcre.h.generic as pcre.h. - - (3) EITHER: - Copy or rename file pcre_chartables.c.dist as pcre_chartables.c. - - OR: - Compile dftables.c as a stand-alone program (using -DHAVE_CONFIG_H if - you have set up config.h), and then run it with the single argument - "pcre_chartables.c". This generates a set of standard character tables - and writes them to that file. The tables are generated using the default - C locale for your system. If you want to use a locale that is specified - by LC_xxx environment variables, add the -L option to the dftables - command. You must use this method if you are building on a system that - uses EBCDIC code. - - The tables in pcre_chartables.c are defaults. The caller of PCRE can - specify alternative tables at run time. - - (4) Ensure that you have the following header files: - - pcre_internal.h - ucp.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. - - pcre_printint.src - - (6) Compile the following source files, setting -DHAVE_CONFIG_H as a compiler - option if you have set up config.h with your configuration, or else use - other -D settings to change the configuration as required. - - pcre_chartables.c - pcre_compile.c - pcre_config.c - pcre_dfa_exec.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_ucd.c - pcre_valid_utf8.c - pcre_version.c - pcre_xclass.c - - Make sure that you include -I. in the compiler command (or equivalent for - an unusual compiler) so that all included PCRE header files are first - sought in the current directory. Otherwise you run the risk of picking up - a previously-installed file from somewhere else. - - (7) Now link all the compiled code into an object library in whichever form - your system keeps such libraries. This is the basic PCRE C library. If - your system has static and shared libraries, you may have to do this once - for each type. - - (8) Similarly, if you want to build the POSIX wrapper functions, ensure that - you have the pcreposix.h file and then compile pcreposix.c (remembering - -DHAVE_CONFIG_H if necessary). Link the result (on its own) as the - pcreposix library. - - (9) Compile the test program pcretest.c (again, don't forget -DHAVE_CONFIG_H). - This needs the functions in the PCRE library when linking. It also needs - the pcreposix wrapper functions unless you compile it with -DNOPOSIX. The - pcretest.c program also needs the pcre_printint.src source file, which it - #includes. - -(10) Run pcretest on the testinput files in the testdata directory, and check - that the output matches the corresponding testoutput files. Note that the - supplied files are in Unix format, with just LF characters as line - terminators. You may need to edit them to change this if your system uses - a different convention. If you are using Windows, you probably should use - the wintestinput3 file instead of testinput3 (and the corresponding output - file). This is a locale test; wintestinput3 sets the locale to "french" - rather than "fr_FR", and there some minor output differences. - -(11) If you want to use the pcregrep command, compile and link pcregrep.c; it - uses only the basic PCRE library (it does not need the pcreposix library). - - -THE C++ WRAPPER FUNCTIONS - -The PCRE distribution also contains some C++ wrapper functions and tests, -contributed by Google Inc. On a system that can use "configure" and "make", -the functions are automatically built into a library called pcrecpp. It should -be straightforward to compile the .cc files manually on other systems. The -files called xxx_unittest.cc are test programs for each of the corresponding -xxx.cc files. - - -BUILDING FOR VIRTUAL PASCAL - -A script for building PCRE using Borland's C++ compiler for use with VPASCAL -was contributed by Alexander Tokarev. Stefan Weber updated the script and added -additional files. The following files in the distribution are for building PCRE -for use with VP/Borland: makevp_c.txt, makevp_l.txt, makevp.bat, pcregexp.pas. - - -STACK SIZE IN WINDOWS ENVIRONMENTS - -The default processor stack size of 1Mb in some Windows environments is too -small for matching patterns that need much recursion. In particular, test 2 may -fail because of this. Normally, running out of stack causes a crash, but there -have been cases where the test program has just died silently. See your linker -documentation for how to increase stack size if you experience problems. The -Linux default of 8Mb is a reasonable choice for the stack, though even that can -be too small for some pattern/subject combinations. - -PCRE has a compile configuration option to disable the use of stack for -recursion so that heap is used instead. However, pattern matching is -significantly slower when this is done. There is more about stack usage in the -"pcrestack" documentation. - - -LINKING PROGRAMS IN WINDOWS ENVIRONMENTS - -If you want to statically link a program against a PCRE library in the form of -a non-dll .a file, you must define PCRE_STATIC before including pcre.h or -pcrecpp.h, otherwise the pcre_malloc() and pcre_free() exported functions will -be declared __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" -paradigm on Windows systems: using MinGW or using Cygwin. These are not at all -the same thing; they are completely different from each other. There is also -support for building using CMake, which some users find a more straightforward -way of building PCRE under Windows. However, the tests are not run -automatically when CMake is used. - -The MinGW home page (http://www.mingw.org/) says this: - - MinGW: A collection of freely available and freely distributable Windows - specific header files and import libraries combined with GNU toolsets that - allow one to produce native Windows programs that do not rely on any - 3rd-party C runtime DLLs. - -The Cygwin home page (http://www.cygwin.com/) says this: - - Cygwin is a Linux-like environment for Windows. It consists of two parts: - - . A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing - substantial Linux API functionality - - . A collection of tools which provide Linux look and feel. - - The Cygwin DLL currently works with all recent, commercially released x86 32 - bit and 64 bit versions of Windows, with the exception of Windows CE. - -On both MinGW and Cygwin, PCRE should build correctly using: - - ./configure && make && make install - -This should create two libraries called libpcre and libpcreposix, and, if you -have enabled building the C++ wrapper, a third one called libpcrecpp. These are -independent libraries: when you like with libpcreposix or libpcrecpp you must -also link with libpcre, which contains the basic functions. (Some earlier -releases of PCRE included the basic libpcre functions in libpcreposix. This no -longer happens.) - -A user submitted a special-purpose patch that makes it easy to create -"pcre.dll" under mingw32 using the "msys" environment. It provides "pcre.dll" -as a special target. If you use this target, no other files are built, and in -particular, the pcretest and pcregrep programs are not built. An example of how -this might be used is: - - ./configure --enable-utf --disable-cpp CFLAGS="-03 -s"; make pcre.dll - -Using Cygwin's compiler generates libraries and executables that depend on -cygwin1.dll. If a library that is generated this way is distributed, -cygwin1.dll has to be distributed as well. Since cygwin1.dll is under the GPL -licence, this forces not only PCRE to be under the GPL, but also the entire -application. A distributor who wants to keep their own code proprietary must -purchase an appropriate Cygwin licence. - -MinGW has no such restrictions. The MinGW compiler generates a library or -executable that can run standalone on Windows without any third party dll or -licensing issues. - -But there is more complication: - -If a Cygwin user uses the -mno-cygwin Cygwin gcc flag, what that really does is -to tell Cygwin's gcc to use the MinGW gcc. Cygwin's gcc is only acting as a -front end to MinGW's gcc (if you install Cygwin's gcc, you get both Cygwin's -gcc and MinGW's gcc). So, a user can: - -. Build native binaries by using MinGW or by getting Cygwin and using - -mno-cygwin. - -. Build binaries that depend on cygwin1.dll by using Cygwin with the normal - compiler flags. - -The test files that are supplied with PCRE are in Unix format, with LF -characters as line terminators. It may be necessary to change the line -terminators in order to get some of the tests to work. - - -BUILDING PCRE ON WINDOWS WITH CMAKE - -CMake is an alternative configuration facility that can be used instead of the -traditional Unix "configure". CMake creates project files (make files, solution -files, etc.) tailored to numerous development environments, including Visual -Studio, Borland, Msys, MinGW, NMake, and Unix. The following instructions -were contributed by a PCRE user. - -1. Install the latest CMake version available from http://www.cmake.org/, and - ensure that cmake\bin is on your path. - -2. Unzip (retaining folder structure) the PCRE source tree into a source - directory such as C:\pcre. - -3. Create a new, empty build directory, for example C:\pcre\build\ - -4. Run cmake-gui from the Shell envirornment of your build tool, for example, - Msys for Msys/MinGW or Visual Studio Command Prompt for VC/VC++. - -5. Enter C:\pcre\pcre-xx and C:\pcre\build for the source and build - directories, respectively. - -6. Hit the "Configure" button. - -7. Select the particular IDE / build tool that you are using (Visual - Studio, MSYS makefiles, MinGW makefiles, etc.) - -8. The GUI will then list several configuration options. This is where - you can enable UTF-8 support or other PCRE optional features. - -9. Hit "Configure" again. The adjacent "Generate" button should now be - active. - -10. Hit "Generate". - -11. The build directory should now contain a usable build system, be it a - solution file for Visual Studio, makefiles for MinGW, etc. Exit from - cmake-gui and use the generated build system with your compiler or IDE. - - -USE OF RELATIVE PATHS WITH CMAKE ON WINDOWS - -A PCRE user comments as follows: - -I thought that others may want to know the current state of -CMAKE_USE_RELATIVE_PATHS support on Windows. - -Here it is: --- AdditionalIncludeDirectories is only partially modified (only the -first path - see below) --- Only some of the contained file paths are modified - shown below for -pcre.vcproj --- It properly modifies - -I am sure CMake people can fix that if they want to. Until then one will -need to replace existing absolute paths in project files with relative -paths manually (e.g. from VS) - relative to project file location. I did -just that before being told to try CMAKE_USE_RELATIVE_PATHS. Not a big -deal. - -AdditionalIncludeDirectories="E:\builds\pcre\build;E:\builds\pcre\pcre-7.5;" -AdditionalIncludeDirectories=".;E:\builds\pcre\pcre-7.5;" - -RelativePath="pcre.h"> -RelativePath="pcre_chartables.c"> -RelativePath="pcre_chartables.c.rule"> - - -TESTING WITH RUNTEST.BAT - -1. Copy RunTest.bat into the directory where pcretest.exe has been created. - -2. Edit RunTest.bat and insert a line that indentifies the relative location of - the pcre source, e.g.: - - set srcdir=..\pcre-7.4-RC3 - -3. Run RunTest.bat from a command shell environment. Test outputs will - automatically be compared to expected results, and discrepancies will - identified in the console output. - -4. To test pcrecpp, run pcrecpp_unittest.exe, pcre_stringpiece_unittest.exe and - pcre_scanner_unittest.exe. - - -BUILDING UNDER WINDOWS WITH BCC5.5 - -Michael Roy sent these comments about building PCRE under Windows with BCC5.5: - - Some of the core BCC libraries have a version of PCRE from 1998 built in, - which can lead to pcre_exec() giving an erroneous PCRE_ERROR_NULL from a - version mismatch. I'm including an easy workaround below, if you'd like to - include it in the non-unix instructions: - - When linking a project with BCC5.5, pcre.lib must be included before any of - the libraries cw32.lib, cw32i.lib, cw32mt.lib, and cw32mti.lib on the command - line. - - -BUILDING UNDER WINDOWS CE WITH VISUAL STUDIO 200x - -Vincent Richomme sent a zip archive of files to help with this process. They -can be found in the file "pcre-vsbuild.zip" in the Contrib directory of the FTP -site. - - -BUILDING PCRE ON OPENVMS - -Dan Mooney sent the following comments about building PCRE on OpenVMS. They -relate to an older version of PCRE that used fewer source files, so the exact -commands will need changing. See the current list of source files above. - -"It was quite easy to compile and link the library. I don't have a formal -make file but the attached file [reproduced below] contains the OpenVMS DCL -commands I used to build the library. I had to add #define -POSIX_MALLOC_THRESHOLD 10 to pcre.h since it was not defined anywhere. - -The library was built on: -O/S: HP OpenVMS v7.3-1 -Compiler: Compaq C v6.5-001-48BCD -Linker: vA13-01 - -The test results did not match 100% due to the issues you mention in your -documentation regarding isprint(), iscntrl(), isgraph() and ispunct(). I -modified some of the character tables temporarily and was able to get the -results to match. Tests using the fr locale did not match since I don't have -that locale loaded. The study size was always reported to be 3 less than the -value in the standard test output files." - -========================= -$! This DCL procedure builds PCRE on OpenVMS -$! -$! I followed the instructions in the non-unix-use file in the distribution. -$! -$ COMPILE == "CC/LIST/NOMEMBER_ALIGNMENT/PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES -$ COMPILE DFTABLES.C -$ LINK/EXE=DFTABLES.EXE DFTABLES.OBJ -$ RUN DFTABLES.EXE/OUTPUT=CHARTABLES.C -$ COMPILE MAKETABLES.C -$ COMPILE GET.C -$ COMPILE STUDY.C -$! I had to set POSIX_MALLOC_THRESHOLD to 10 in PCRE.H since the symbol -$! did not seem to be defined anywhere. -$! I edited pcre.h and added #DEFINE SUPPORT_UTF8 to enable UTF8 support. -$ COMPILE PCRE.C -$ LIB/CREATE PCRE MAKETABLES.OBJ, GET.OBJ, STUDY.OBJ, PCRE.OBJ -$! I had to set POSIX_MALLOC_THRESHOLD to 10 in PCRE.H since the symbol -$! did not seem to be defined anywhere. -$ COMPILE PCREPOSIX.C -$ LIB/CREATE PCREPOSIX PCREPOSIX.OBJ -$ COMPILE PCRETEST.C -$ LINK/EXE=PCRETEST.EXE PCRETEST.OBJ, PCRE/LIB, PCREPOSIX/LIB -$! C programs that want access to command line arguments must be -$! defined as a symbol -$ PCRETEST :== "$ SYS$ROADSUSERS:[DMOONEY.REGEXP]PCRETEST.EXE" -$! Arguments must be enclosed in quotes. -$ PCRETEST "-C" -$! Test results: -$! -$! The test results did not match 100%. The functions isprint(), iscntrl(), -$! isgraph() and ispunct() on OpenVMS must not produce the same results -$! as the system that built the test output files provided with the -$! distribution. -$! -$! The study size did not match and was always 3 less on OpenVMS. -$! -$! Locale could not be set to fr -$! -========================= - - -BUILDING PCRE ON STRATUS OPENVOS - -These notes on the port of PCRE to VOS (lightly edited) were supplied by -Ashutosh Warikoo, whose email address has the local part awarikoo and the -domain nse.co.in. The port was for version 7.9 in August 2009. - -1. Building PCRE - -I built pcre on OpenVOS Release 17.0.1at using GNU Tools 3.4a without any -problems. I used the following packages to build PCRE: - - ftp://ftp.stratus.com/pub/vos/posix/ga/posix.save.evf.gz - -Please read and follow the instructions that come with these packages. To start -the build of pcre, from the root of the package type: - - ./build.sh - -2. Installing PCRE - -Once you have successfully built PCRE, login to the SysAdmin group, switch to -the root user, and type - - [ !create_dir (master_disk)>usr --if needed ] - [ !create_dir (master_disk)>usr>local --if needed ] - !gmake install - -This installs PCRE and its man pages into /usr/local. You can add -(master_disk)>usr>local>bin to your command search paths, or if you are in -BASH, add /usr/local/bin to the PATH environment variable. - -4. Restrictions - -This port requires readline library optionally. However during the build I -faced some yet unexplored errors while linking with readline. As it was an -optional component I chose to disable it. - -5. Known Problems - -I ran a the test suite, but you will have to be your own judge of whether this -command, and this port, suits your purposes. If you find any problems that -appear to be related to the port itself, please let me know. Please see the -build.log file in the root of the package also. - - -========================= -Last Updated: 26 May 2010 -**** +#### diff -Nru php5-5.4.4/ext/pcre/pcrelib/README php5-5.4.9/ext/pcre/pcrelib/README --- php5-5.4.4/ext/pcre/pcrelib/README 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/README 2012-11-21 05:12:20.000000000 +0000 @@ -18,11 +18,12 @@ The PCRE APIs Documentation for PCRE Contributions by users of PCRE - Building PCRE on non-Unix systems - Building PCRE on Unix-like systems - Retrieving configuration information on Unix-like systems - Shared libraries on Unix-like systems - Cross-compiling on Unix-like systems + Building PCRE on non-Unix-like systems + Building PCRE without using autotools + Building PCRE using autotools + Retrieving configuration information + Shared libraries + Cross-compiling using autotools Using HP's ANSI C++ compiler (aCC) Using PCRE from MySQL Making new tarballs @@ -34,16 +35,19 @@ The PCRE APIs ------------- -PCRE is written in C, and it has its own API. The distribution also includes a -set of C++ wrapper functions (see the pcrecpp man page for details), courtesy -of Google Inc. - -In addition, there is a set of C wrapper functions that are based on the POSIX -regular expression API (see the pcreposix man page). These end up in the -library called libpcreposix. Note that this just provides a POSIX calling -interface to PCRE; the regular expressions themselves still follow Perl syntax -and semantics. The POSIX API is restricted, and does not give full access to -all of PCRE's facilities. +PCRE is written in C, and it has its own API. There are two sets of functions, +one for the 8-bit library, which processes strings of bytes, and one for the +16-bit library, which processes strings of 16-bit values. The distribution also +includes a set of C++ wrapper functions (see the pcrecpp man page for details), +courtesy of Google Inc., which can be used to call the 8-bit PCRE library from +C++. + +In addition, there is a set of C wrapper functions (again, just for the 8-bit +library) that are based on the POSIX regular expression API (see the pcreposix +man page). These end up in the library called libpcreposix. Note that this just +provides a POSIX calling interface to PCRE; the regular expressions themselves +still follow Perl syntax and semantics. The POSIX API is restricted, and does +not give full access to all of PCRE's facilities. The header file for the POSIX-style functions is called pcreposix.h. The official POSIX name is regex.h, but I did not want to risk possible problems @@ -106,36 +110,45 @@ in the standard distribution, so these contibutions have been archived. -Building PCRE on non-Unix systems ---------------------------------- +Building PCRE on non-Unix-like systems +-------------------------------------- -For a non-Unix system, please read the comments in the file NON-UNIX-USE, -though if your system supports the use of "configure" and "make" you may be -able to build PCRE in the same way as for Unix-like systems. PCRE can also be -configured in many platform environments using the GUI facility provided by -CMake's cmake-gui command. This creates Makefiles, solution files, etc. +For a non-Unix-like system, please read the comments in the file +NON-AUTOTOOLS-BUILD, though if your system supports the use of "configure" and +"make" you may be able to build PCRE using autotools in the same way as for +many Unix-like systems. + +PCRE can also be configured using the GUI facility provided by CMake's +cmake-gui command. This creates Makefiles, solution files, etc. The file +NON-AUTOTOOLS-BUILD has information about CMake. PCRE has been compiled on many different operating systems. It should be straightforward to build PCRE on any system that has a Standard C compiler and library, because it uses only Standard C functions. -Building PCRE on Unix-like systems ----------------------------------- +Building PCRE without using autotools +------------------------------------- + +The use of autotools (in particular, libtool) is problematic in some +environments, even some that are Unix or Unix-like. See the NON-AUTOTOOLS-BUILD +file for ways of building PCRE without using autotools. + + +Building PCRE using autotools +----------------------------- If you are using HP's ANSI C++ compiler (aCC), please see the special note in the section entitled "Using HP's ANSI C++ compiler (aCC)" below. -The following instructions assume the use of the widely used "configure, make, -make install" process. There is also support for CMake in the PCRE -distribution; there are some comments about using CMake in the NON-UNIX-USE -file, though it can also be used in Unix-like systems. - -To build PCRE on a Unix-like system, first run the "configure" command from the -PCRE distribution directory, with your current directory set to the directory -where you want the files to be created. This command is a standard GNU -"autoconf" configuration script, for which generic instructions are supplied in -the file INSTALL. +The following instructions assume the use of the widely used "configure; make; +make install" (autotools) process. + +To build PCRE on system that supports autotools, first run the "configure" +command from the PCRE distribution directory, with your current directory set +to the directory where you want the files to be created. This command is a +standard GNU "autoconf" configuration script, for which generic instructions +are supplied in the file INSTALL. Most commonly, people build PCRE within its own distribution directory, and in this case, on many systems, just running "./configure" is sufficient. However, @@ -143,9 +156,9 @@ CFLAGS='-O2 -Wall' ./configure --prefix=/opt/local -specifies that the C compiler should be run with the flags '-O2 -Wall' instead -of the default, and that "make install" should install PCRE under /opt/local -instead of the default /usr/local. +This command specifies that the C compiler should be run with the flags '-O2 +-Wall' instead of the default, and that "make install" should install PCRE +under /opt/local instead of the default /usr/local. If you want to build in a different directory, just run "configure" with that directory as current. For example, suppose you have unpacked the PCRE source @@ -159,27 +172,59 @@ does not have any features to support this. There are some optional features that can be included or omitted from the PCRE -library. You can read more about them in the pcrebuild man page. +library. They are also documented in the pcrebuild man page. + +. By default, both shared and static libraries are built. You can change this + by adding one of these options to the "configure" command: + + --disable-shared + --disable-static -. If you want to suppress the building of the C++ wrapper library, you can add - --disable-cpp to the "configure" command. Otherwise, when "configure" is run, - it will try to find a C++ compiler and C++ header files, and if it succeeds, - it will try to build the C++ wrapper. + (See also "Shared libraries on Unix-like systems" below.) + +. By default, only the 8-bit library is built. If you add --enable-pcre16 to + the "configure" command, the 16-bit library is also built. If you want only + the 16-bit library, use "./configure --enable-pcre16 --disable-pcre8". + +. If you are building the 8-bit library and want to suppress the building of + the C++ wrapper library, you can add --disable-cpp to the "configure" + command. Otherwise, when "configure" is run without --disable-pcre8, it will + try to find a C++ compiler and C++ header files, and if it succeeds, it will + try to build the C++ wrapper. + +. If you want to include support for just-in-time compiling, which can give + large performance improvements on certain platforms, add --enable-jit to the + "configure" command. This support is available only for certain hardware + architectures. If you try to enable it on an unsupported architecture, there + will be a compile time error. + +. When JIT support is enabled, pcregrep automatically makes use of it, unless + you add --disable-pcregrep-jit to the "configure" command. . If you want to make use of the support for UTF-8 Unicode character strings in - PCRE, you must add --enable-utf8 to the "configure" command. Without it, the - code for handling UTF-8 is not included in the library. Even when included, - it still has to be enabled by an option at run time. When PCRE is compiled - with this option, its input can only either be ASCII or UTF-8, even when - running on EBCDIC platforms. It is not possible to use both --enable-utf8 and - --enable-ebcdic at the same time. - -. If, in addition to support for UTF-8 character strings, you want to include - support for the \P, \p, and \X sequences that recognize Unicode character - properties, you must add --enable-unicode-properties to the "configure" - command. This adds about 30K to the size of the library (in the form of a - property table); only the basic two-letter properties such as Lu are - supported. + the 8-bit library, or UTF-16 Unicode character strings in the 16-bit library, + you must add --enable-utf to the "configure" command. Without it, the code + for handling UTF-8 and UTF-16 is not included in the relevant library. Even + when --enable-utf is included, the use of a UTF encoding still has to be + enabled by an option at run time. When PCRE is compiled with this option, its + input can only either be ASCII or UTF-8/16, even when running on EBCDIC + platforms. It is not possible to use both --enable-utf and --enable-ebcdic at + the same time. + +. There are no separate options for enabling UTF-8 and UTF-16 independently + because that would allow ridiculous settings such as requesting UTF-16 + support while building only the 8-bit library. However, the option + --enable-utf8 is retained for backwards compatibility with earlier releases + that did not support 16-bit character strings. It is synonymous with + --enable-utf. It is not possible to configure one library with UTF support + and the other without in the same configuration. + +. If, in addition to support for UTF-8/16 character strings, you want to + include support for the \P, \p, and \X sequences that recognize Unicode + character properties, you must add --enable-unicode-properties to the + "configure" command. This adds about 30K to the size of the library (in the + form of a property table); only the basic two-letter properties such as Lu + are supported. . You can build PCRE to recognize either CR or LF or the sequence CRLF or any of the preceding, or any of the Unicode newline sequences as indicating the @@ -232,10 +277,11 @@ sizes in the pcrestack man page. . The default maximum compiled pattern size is around 64K. You can increase - this by adding --with-link-size=3 to the "configure" command. You can - increase it even more by setting --with-link-size=4, but this is unlikely - ever to be necessary. Increasing the internal link size will reduce - performance. + this by adding --with-link-size=3 to the "configure" command. In the 8-bit + library, PCRE then uses three bytes instead of two for offsets to different + parts of the compiled pattern. In the 16-bit library, --with-link-size=3 is + the same as --with-link-size=4, which (in both libraries) uses four-byte + offsets. Increasing the internal link size reduces performance. . You can build PCRE so that its internal match() function that is called from pcre_exec() does not call itself recursively. Instead, it uses memory blocks @@ -247,9 +293,10 @@ on the "configure" command. PCRE runs more slowly in this mode, but it may be necessary in environments with limited stack sizes. This applies only to the - pcre_exec() function; it does not apply to pcre_dfa_exec(), which does not - use deeply nested recursion. There is a discussion about stack sizes in the - pcrestack man page. + normal execution of the pcre_exec() function; if JIT support is being + successfully used, it is not relevant. Equally, it does not apply to + pcre_dfa_exec(), which does not use deeply nested recursion. There is a + discussion about stack sizes in the pcrestack man page. . For speed, PCRE uses four tables for manipulating and identifying characters whose code point values are less than 256. By default, it uses a set of @@ -269,27 +316,37 @@ This automatically implies --enable-rebuild-chartables (see above). However, when PCRE is built this way, it always operates in EBCDIC. It cannot support - both EBCDIC and UTF-8. + both EBCDIC and UTF-8/16. -. It is possible to compile pcregrep to use libz and/or libbz2, in order to - read .gz and .bz2 files (respectively), by specifying one or both of +. The pcregrep program currently supports only 8-bit data files, and so + requires the 8-bit PCRE library. It is possible to compile pcregrep to use + libz and/or libbz2, in order to read .gz and .bz2 files (respectively), by + specifying one or both of --enable-pcregrep-libz --enable-pcregrep-libbz2 Of course, the relevant libraries must be installed on your system. +. The default size of internal buffer used by pcregrep can be set by, for + example: + + --with-pcregrep-bufsize=50K + + The default value is 20K. + . It is possible to compile pcretest so that it links with the libreadline - library, by specifying + or libedit libraries, by specifying, respectively, - --enable-pcretest-libreadline + --enable-pcretest-libreadline or --enable-pcretest-libedit If this is done, when pcretest's input is from a terminal, it reads it using the readline() function. This provides line-editing and history facilities. Note that libreadline is GPL-licenced, so if you distribute a binary of - pcretest linked in this way, there may be licensing issues. + pcretest linked in this way, there may be licensing issues. These can be + avoided by linking with libedit (which has a BSD licence) instead. - Setting this option causes the -lreadline option to be added to the pcretest + Enabling libreadline causes the -lreadline option to be added to the pcretest build. In many operating environments with a sytem-installed readline library this is sufficient. However, in some environments (e.g. if an unmodified distribution version of readline is in use), it may be necessary @@ -302,37 +359,42 @@ The "configure" script builds the following files for the basic C library: -. Makefile is the makefile that builds the library -. config.h contains build-time configuration options for the library -. pcre.h is the public PCRE header file -. pcre-config is a script that shows the settings of "configure" options -. libpcre.pc is data for the pkg-config command -. libtool is a script that builds shared and/or static libraries -. RunTest is a script for running tests on the basic C library -. RunGrepTest is a script for running tests on the pcregrep command +. Makefile the makefile that builds the library +. config.h build-time configuration options for the library +. pcre.h the public PCRE header file +. pcre-config script that shows the building settings such as CFLAGS + that were set for "configure" +. libpcre.pc ) data for the pkg-config command +. libpcre16.pc ) +. libpcreposix.pc ) +. libtool script that builds shared and/or static libraries Versions of config.h and pcre.h are distributed in the PCRE tarballs under the names config.h.generic and pcre.h.generic. These are provided for those who have to built PCRE without using "configure" or CMake. If you use "configure" or CMake, the .generic versions are not used. -If a C++ compiler is found, the following files are also built: +When building the 8-bit library, if a C++ compiler is found, the following +files are also built: -. libpcrecpp.pc is data for the pkg-config command -. pcrecpparg.h is a header file for programs that call PCRE via the C++ wrapper -. pcre_stringpiece.h is the header for the C++ "stringpiece" functions +. libpcrecpp.pc data for the pkg-config command +. pcrecpparg.h header file for calling PCRE via the C++ wrapper +. pcre_stringpiece.h header for the C++ "stringpiece" functions The "configure" script also creates config.status, which is an executable script that can be run to recreate the configuration, and config.log, which contains compiler output from tests that "configure" runs. -Once "configure" has run, you can run "make". It builds two libraries, called -libpcre and libpcreposix, a test program called pcretest, and the pcregrep -command. If a C++ compiler was found on your system, "make" also builds the C++ -wrapper library, which is called libpcrecpp, and some test programs called -pcrecpp_unittest, pcre_scanner_unittest, and pcre_stringpiece_unittest. -Building the C++ wrapper can be disabled by adding --disable-cpp to the -"configure" command. +Once "configure" has run, you can run "make". This builds either or both of the +libraries libpcre and libpcre16, and a test program called pcretest. If you +enabled JIT support with --enable-jit, a test program called pcre_jit_test is +built as well. + +If the 8-bit library is built, libpcreposix and the pcregrep command are also +built, and if a C++ compiler was found on your system, and you did not disable +it with --disable-cpp, "make" builds the C++ wrapper library, which is called +libpcrecpp, as well as some test programs called pcrecpp_unittest, +pcre_scanner_unittest, and pcre_stringpiece_unittest. The command "make check" runs all the appropriate tests. Details of the PCRE tests are given below in a separate section of this document. @@ -343,16 +405,19 @@ Commands (bin): pcretest - pcregrep + pcregrep (if 8-bit support is enabled) pcre-config Libraries (lib): - libpcre - libpcreposix - libpcrecpp (if C++ support is enabled) + libpcre16 (if 16-bit support is enabled) + libpcre (if 8-bit support is enabled) + libpcreposix (if 8-bit support is enabled) + libpcrecpp (if 8-bit and C++ support is enabled) Configuration information (lib/pkgconfig): + libpcre16.pc libpcre.pc + libpcreposix.pc libpcrecpp.pc (if C++ support is enabled) Header files (include): @@ -366,6 +431,7 @@ Man pages (share/man/man{1,3}): pcregrep.1 pcretest.1 + pcre-config.1 pcre.3 pcre*.3 (lots more pages, all starting "pcre") @@ -380,17 +446,18 @@ LICENCE NEWS README - pcre.txt (a concatenation of the man(3) pages) - pcretest.txt the pcretest man page - pcregrep.txt the pcregrep man page + pcre.txt (a concatenation of the man(3) pages) + pcretest.txt the pcretest man page + pcregrep.txt the pcregrep man page + pcre-config.txt the pcre-config man page If you want to remove PCRE from your system, you can run "make uninstall". This removes all the files that "make install" installed. However, it does not remove any directories, because these are often shared with other programs. -Retrieving configuration information on Unix-like systems ---------------------------------------------------------- +Retrieving configuration information +------------------------------------ Running "make install" installs the command pcre-config, which can be used to recall information about the PCRE configuration and installation. For example: @@ -415,8 +482,8 @@ /lib/pkgconfig. -Shared libraries on Unix-like systems -------------------------------------- +Shared libraries +---------------- The default distribution builds PCRE as shared libraries and static libraries, as long as the operating system supports shared libraries. Shared library @@ -441,8 +508,8 @@ build only shared libraries. -Cross-compiling on Unix-like systems ------------------------------------- +Cross-compiling using autotools +------------------------------- You can specify CC and CFLAGS in the normal way to the "configure" command, in order to cross-compile PCRE for some other host. However, you should NOT @@ -514,30 +581,49 @@ Testing PCRE ------------ -To test the basic PCRE library on a Unix system, run the RunTest script that is -created by the configuring process. There is also a script called RunGrepTest -that tests the options of the pcregrep command. If the C++ wrapper library is -built, three test programs called pcrecpp_unittest, pcre_scanner_unittest, and -pcre_stringpiece_unittest are also built. +To test the basic PCRE library on a Unix-like system, run the RunTest script. +There is another script called RunGrepTest that tests the options of the +pcregrep command. If the C++ wrapper library is built, three test programs +called pcrecpp_unittest, pcre_scanner_unittest, and pcre_stringpiece_unittest +are also built. When JIT support is enabled, another test program called +pcre_jit_test is built. Both the scripts and all the program tests are run if you obey "make check" or -"make test". For other systems, see the instructions in NON-UNIX-USE. +"make test". For other environments, see the instructions in +NON-AUTOTOOLS-BUILD. The RunTest script runs the pcretest test program (which is documented in its -own man page) on each of the testinput files in the testdata directory in -turn, and compares the output with the contents of the corresponding testoutput -files. A file called testtry is used to hold the main output from pcretest -(testsavedregex is also used as a working file). To run pcretest on just one of -the test files, give its number as an argument to RunTest, for example: - - RunTest 2 - -The first test file can also be fed directly into the perltest.pl script to -check that Perl gives the same results. The only difference you should see is -in the first few lines, where the Perl version is given instead of the PCRE -version. +own man page) on each of the relevant testinput files in the testdata +directory, and compares the output with the contents of the corresponding +testoutput files. Some tests are relevant only when certain build-time options +were selected. For example, the tests for UTF-8/16 support are run only if +--enable-utf was used. RunTest outputs a comment when it skips a test. + +Many of the tests that are not skipped are run up to three times. The second +run forces pcre_study() to be called for all patterns except for a few in some +tests that are marked "never study" (see the pcretest program for how this is +done). If JIT support is available, the non-DFA tests are run a third time, +this time with a forced pcre_study() with the PCRE_STUDY_JIT_COMPILE option. + +When both 8-bit and 16-bit support is enabled, the entire set of tests is run +twice, once for each library. If you want to run just one set of tests, call +RunTest with either the -8 or -16 option. + +RunTest uses a file called testtry to hold the main output from pcretest. +Other files whose names begin with "test" are used as working files in some +tests. To run pcretest on just one or more specific test files, give their +numbers as arguments to RunTest, for example: + + RunTest 2 7 11 + +You can also call RunTest with the single argument "list" to cause it to output +a list of tests. + +The first test file can be fed directly into the perltest.pl script to check +that Perl gives the same results. The only difference you should see is in the +first few lines, where the Perl version is given instead of the PCRE version. -The second set of tests check pcre_fullinfo(), pcre_info(), pcre_study(), +The second set of tests check pcre_fullinfo(), pcre_study(), pcre_copy_substring(), pcre_get_substring(), pcre_get_substring_list(), error detection, and run-time flags that are specific to PCRE, as well as the POSIX wrapper API. It also uses the debugging flags to check some of the internals of @@ -572,33 +658,32 @@ Windows versions of test 2. More info on using RunTest.bat is included in the document entitled NON-UNIX-USE.] -The fourth test checks the UTF-8 support. It is not run automatically unless -PCRE is built with UTF-8 support. To do this you must set --enable-utf8 when -running "configure". This file can be also fed directly to the perltest.pl -script, provided you are running Perl 5.8 or higher. - -The fifth test checks error handling with UTF-8 encoding, and internal UTF-8 -features of PCRE that are not relevant to Perl. - -The sixth test (which is Perl-5.10 compatible) checks the support for Unicode -character properties. It it not run automatically unless PCRE is built with -Unicode property support. To to this you must set --enable-unicode-properties -when running "configure". - -The seventh, eighth, and ninth tests check the pcre_dfa_exec() alternative -matching function, in non-UTF-8 mode, UTF-8 mode, and UTF-8 mode with Unicode -property support, respectively. The eighth and ninth tests are not run -automatically unless PCRE is build with the relevant support. - -The tenth test checks some internal offsets and code size features; it is run -only when the default "link size" of 2 is set (in other cases the sizes -change). - -The eleventh test checks out features that are new in Perl 5.10, and the -twelfth test checks a number internals and non-Perl features concerned with -Unicode property support. It it not run automatically unless PCRE is built with -Unicode property support. To to this you must set --enable-unicode-properties -when running "configure". +The fourth and fifth tests check the UTF-8/16 support and error handling and +internal UTF features of PCRE that are not relevant to Perl, respectively. The +sixth and seventh tests do the same for Unicode character properties support. + +The eighth, ninth, and tenth tests check the pcre_dfa_exec() alternative +matching function, in non-UTF-8/16 mode, UTF-8/16 mode, and UTF-8/16 mode with +Unicode property support, respectively. + +The eleventh test checks some internal offsets and code size features; it is +run only when the default "link size" of 2 is set (in other cases the sizes +change) and when Unicode property support is enabled. + +The twelfth test is run only when JIT support is available, and the thirteenth +test is run only when JIT support is not available. They test some JIT-specific +features such as information output from pcretest about JIT compilation. + +The fourteenth, fifteenth, and sixteenth tests are run only in 8-bit mode, and +the seventeenth, eighteenth, and nineteenth tests are run only in 16-bit mode. +These are tests that generate different output in the two modes. They are for +general cases, UTF-8/16 support, and Unicode property support, respectively. + +The twentieth test is run only in 16-bit mode. It tests some specific 16-bit +features of the DFA matching engine. + +The twenty-first and twenty-second tests are run only in 16-bit mode, when the +link size is set to 2. They test reloading pre-compiled patterns. Character tables @@ -658,7 +743,9 @@ File manifest ------------- -The distribution should contain the following files: +The distribution should contain the files listed below. Where a file name is +given as pcre[16]_xxx it means that there are two files, one with the name +pcre_xxx and the other with the name pcre16_xxx. (A) Source files of the PCRE library functions and their headers: @@ -667,33 +754,40 @@ pcre_chartables.c.dist a default set of character tables that assume ASCII coding; used, unless --enable-rebuild-chartables is - specified, by copying to pcre_chartables.c + specified, by copying to pcre[16]_chartables.c pcreposix.c ) - pcre_compile.c ) - pcre_config.c ) - pcre_dfa_exec.c ) - pcre_exec.c ) - pcre_fullinfo.c ) - pcre_get.c ) sources for the functions in the library, - pcre_globals.c ) and some internal functions that they use - pcre_info.c ) - pcre_maketables.c ) - pcre_newline.c ) + pcre[16]_byte_order.c ) + pcre[16]_compile.c ) + pcre[16]_config.c ) + pcre[16]_dfa_exec.c ) + pcre[16]_exec.c ) + pcre[16]_fullinfo.c ) + pcre[16]_get.c ) sources for the functions in the library, + pcre[16]_globals.c ) and some internal functions that they use + pcre[16]_jit_compile.c ) + pcre[16]_maketables.c ) + pcre[16]_newline.c ) + pcre[16]_refcount.c ) + pcre[16]_string_utils.c ) + pcre[16]_study.c ) + pcre[16]_tables.c ) + pcre[16]_ucd.c ) + pcre[16]_version.c ) + pcre[16]_xclass.c ) pcre_ord2utf8.c ) - pcre_refcount.c ) - pcre_study.c ) - pcre_tables.c ) - pcre_try_flipped.c ) - pcre_ucd.c ) pcre_valid_utf8.c ) - pcre_version.c ) - pcre_xclass.c ) - pcre_printint.src ) debugging function that is #included in pcretest, + pcre16_ord2utf16.c ) + pcre16_utf16_utils.c ) + pcre16_valid_utf16.c ) + + pcre[16]_printint.c ) debugging function that is used by pcretest, ) and can also be #included in pcre_compile() + 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 + sljit/* 16 files that make up the JIT compiler ucp.h header for Unicode property handling config.h.in template for config.h, which is built by "configure" @@ -730,7 +824,8 @@ Makefile.am ) the automake input that was used to create ) Makefile.in NEWS important changes in this release - NON-UNIX-USE notes on building PCRE on non-Unix systems + NON-UNIX-USE the previous name for NON-AUTOTOOLS-BUILD + NON-AUTOTOOLS-BUILD notes on building PCRE without using autotools PrepareRelease script to make preparations for "make dist" README this file RunTest a Unix shell script for running tests @@ -751,6 +846,7 @@ doc/pcretest.txt plain text documentation of test program doc/perltest.txt plain text documentation of Perl test program install-sh a shell script for installing files + libpcre16.pc.in template for libpcre16.pc for pkg-config libpcre.pc.in template for libpcre.pc for pkg-config libpcreposix.pc.in template for libpcreposix.pc for pkg-config libpcrecpp.pc.in template for libpcrecpp.pc for pkg-config @@ -760,17 +856,20 @@ mkinstalldirs script for making install directories perltest.pl Perl test program pcre-config.in source of script which retains PCRE information + pcre_jit_test.c test program for the JIT compiler pcrecpp_unittest.cc ) pcre_scanner_unittest.cc ) test programs for the C++ wrapper pcre_stringpiece_unittest.cc ) testdata/testinput* test data for main library tests testdata/testoutput* expected test results testdata/grep* input and output for pcregrep tests + testdata/* other supporting test files (D) Auxiliary files for cmake support cmake/COPYING-CMAKE-SCRIPTS cmake/FindPackageHandleStandardArgs.cmake + cmake/FindEditline.cmake cmake/FindReadline.cmake CMakeLists.txt config-cmake.h.in @@ -796,4 +895,4 @@ Philip Hazel Email local part: ph10 Email domain: cam.ac.uk -Last updated: 19 January 2010 +Last updated: 18 June 2012 diff -Nru php5-5.4.4/ext/pcre/pcrelib/config.h php5-5.4.9/ext/pcre/pcrelib/config.h --- php5-5.4.4/ext/pcre/pcrelib/config.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/config.h 2012-11-21 05:12:20.000000000 +0000 @@ -282,7 +282,7 @@ #define PACKAGE_NAME "PCRE" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "PCRE 8.12" +#define PACKAGE_STRING "PCRE 8.31" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "pcre" @@ -291,7 +291,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "8.12" +#define PACKAGE_VERSION "8.31" /* If you are compiling for a system other than a Unix-like system or @@ -347,7 +347,7 @@ /* Version number of package */ #ifndef VERSION -#define VERSION "8.12" +#define VERSION "8.31" #endif /* Define to empty if `const' does not conform to ANSI C. */ diff -Nru php5-5.4.4/ext/pcre/pcrelib/dftables.c php5-5.4.9/ext/pcre/pcrelib/dftables.c --- php5-5.4.4/ext/pcre/pcrelib/dftables.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/dftables.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2008 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -112,7 +112,7 @@ "#endif\n\n" "#include \"pcre_internal.h\"\n\n"); fprintf(f, - "const unsigned char _pcre_default_tables[] = {\n\n" + "const pcre_uint8 PRIV(default_tables)[] = {\n\n" "/* This table is a lower casing table. */\n\n"); fprintf(f, " "); diff -Nru php5-5.4.4/ext/pcre/pcrelib/doc/pcre.txt php5-5.4.9/ext/pcre/pcrelib/doc/pcre.txt --- php5-5.4.4/ext/pcre/pcrelib/doc/pcre.txt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/doc/pcre.txt 2012-11-21 05:12:20.000000000 +0000 @@ -25,11 +25,27 @@ items, and there is an option for requesting some minor changes that give better JavaScript compatibility. + Starting with release 8.30, it is possible to compile two separate PCRE + libraries: the original, which supports 8-bit character strings + (including UTF-8 strings), and a second library that supports 16-bit + character strings (including UTF-16 strings). The build process allows + either one or both to be built. The majority of the work to make this + possible was done by Zoltan Herczeg. + + The two libraries contain identical sets of functions, except that the + names in the 16-bit library start with pcre16_ instead of pcre_. To + avoid over-complication and reduce the documentation maintenance load, + most of the documentation describes the 8-bit library, with the differ- + ences for the 16-bit library described separately in the pcre16 page. + References to functions or structures of the form pcre[16]_xxx should + be read as meaning "pcre_xxx when using the 8-bit library and + pcre16_xxx when using the 16-bit library". + The current implementation of PCRE corresponds approximately with Perl - 5.12, including support for UTF-8 encoded strings and Unicode general - category properties. However, UTF-8 and Unicode support has to be - explicitly enabled; it is not the default. The Unicode tables corre- - spond to Unicode release 5.2.0. + 5.12, including support for UTF-8/16 encoded strings and Unicode gen- + eral category properties. However, UTF-8/16 and Unicode support has to + be explicitly enabled; it is not the default. The Unicode tables corre- + spond to Unicode release 6.0.0. In addition to the Perl-compatible matching function, PCRE contains an alternative function that matches the same compiled patterns in a dif- @@ -39,218 +55,401 @@ PCRE is written in C and released as a C library. A number of people have written wrappers and interfaces of various kinds. In particular, - Google Inc. have provided a comprehensive C++ wrapper. This is now - included as part of the PCRE distribution. The pcrecpp page has details - of this interface. Other people's contributions can be found in the - Contrib directory at the primary FTP site, which is: + Google Inc. have provided a comprehensive C++ wrapper for the 8-bit + library. This is now included as part of the PCRE distribution. The + pcrecpp page has details of this interface. Other people's contribu- + tions can be found in the Contrib directory at the primary FTP site, + which is: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre - Details of exactly which Perl regular expression features are and are + Details of exactly which Perl regular expression features are and are not supported by PCRE are given in separate documents. See the pcrepat- - tern and pcrecompat pages. There is a syntax summary in the pcresyntax + tern and pcrecompat pages. There is a syntax summary in the pcresyntax page. - Some features of PCRE can be included, excluded, or changed when the - library is built. The pcre_config() function makes it possible for a - client to discover which features are available. The features them- - selves are described in the pcrebuild page. Documentation about build- - ing PCRE for various operating systems can be found in the README and + Some features of PCRE can be included, excluded, or changed when the + library is built. The pcre_config() function makes it possible for a + client to discover which features are available. The features them- + selves are described in the pcrebuild page. Documentation about build- + ing PCRE for various operating systems can be found in the README and NON-UNIX-USE files in the source distribution. - The library contains a number of undocumented internal functions and - data tables that are used by more than one of the exported external - functions, but which are not intended for use by external callers. - Their names all begin with "_pcre_", which hopefully will not provoke - any name clashes. In some environments, it is possible to control which - external symbols are exported when a shared library is built, and in - these cases the undocumented symbols are not exported. + The libraries contains a number of undocumented internal functions and + data tables that are used by more than one of the exported external + functions, but which are not intended for use by external callers. + Their names all begin with "_pcre_" or "_pcre16_", which hopefully will + not provoke any name clashes. In some environments, it is possible to + control which external symbols are exported when a shared library is + built, and in these cases the undocumented symbols are not exported. USER DOCUMENTATION - The user documentation for PCRE comprises a number of different sec- - tions. In the "man" format, each of these is a separate "man page". In - the HTML format, each is a separate page, linked from the index page. - In the plain text format, all the sections, except the pcredemo sec- + The user documentation for PCRE comprises a number of different sec- + tions. In the "man" format, each of these is a separate "man page". In + the HTML format, each is a separate page, linked from the index page. + In the plain text format, all the sections, except the pcredemo sec- tion, are concatenated, for ease of searching. The sections are as fol- lows: pcre this document + pcre16 details of the 16-bit library pcre-config show PCRE installation configuration information pcreapi details of PCRE's native C API pcrebuild options for building PCRE pcrecallout details of the callout feature pcrecompat discussion of Perl compatibility - pcrecpp details of the C++ wrapper + pcrecpp details of the C++ wrapper for the 8-bit library pcredemo a demonstration C program that uses PCRE - pcregrep description of the pcregrep command + pcregrep description of the pcregrep command (8-bit only) + pcrejit discussion of the just-in-time optimization support + pcrelimits details of size and other limits pcrematching discussion of the two matching algorithms pcrepartial details of the partial matching facility pcrepattern syntax and semantics of supported regular expressions pcreperform discussion of performance issues - pcreposix the POSIX-compatible C API + pcreposix the POSIX-compatible C API for the 8-bit library pcreprecompile details of saving and re-using precompiled patterns pcresample discussion of the pcredemo program pcrestack discussion of stack usage pcresyntax quick syntax reference pcretest description of the pcretest testing command + pcreunicode discussion of Unicode and UTF-8/16 support - In addition, in the "man" and HTML formats, there is a short page for - each C library function, listing its arguments and results. + In addition, in the "man" and HTML formats, there is a short page for + each 8-bit C library function, listing its arguments and results. -LIMITATIONS +AUTHOR - There are some size limitations in PCRE but it is hoped that they will - never in practice be relevant. + Philip Hazel + University Computing Service + Cambridge CB2 3QH, England. - The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE - is compiled with the default internal linkage size of 2. If you want to - process regular expressions that are truly enormous, you can compile - PCRE with an internal linkage size of 3 or 4 (see the README file in - the source distribution and the pcrebuild documentation for details). - In these cases the limit is substantially larger. However, the speed - of execution is slower. + Putting an actual email address here seems to have been a spam magnet, + so I've taken it away. If you want to email me, use my two initials, + followed by the two digits 10, at the domain cam.ac.uk. - All values in repeating quantifiers must be less than 65536. - There is no limit to the number of parenthesized subpatterns, but there - can be no more than 65535 capturing subpatterns. +REVISION - The maximum length of name for a named subpattern is 32 characters, and - the maximum number of named subpatterns is 10000. + Last updated: 10 January 2012 + Copyright (c) 1997-2012 University of Cambridge. +------------------------------------------------------------------------------ - The maximum length of a subject string is the largest positive number - that an integer variable can hold. However, when using the traditional - matching function, PCRE uses recursion to handle subpatterns and indef- - inite repetition. This means that the available stack space may limit - the size of a subject string that can be processed by certain patterns. - For a discussion of stack issues, see the pcrestack documentation. +PCRE(3) PCRE(3) -UTF-8 AND UNICODE PROPERTY SUPPORT - From release 3.3, PCRE has had some support for character strings - encoded in the UTF-8 format. For release 4.0 this was greatly extended - to cover most common requirements, and in release 5.0 additional sup- - port for Unicode general category properties was added. - - In order process UTF-8 strings, you must build PCRE to include UTF-8 - support in the code, and, in addition, you must call pcre_compile() - with the PCRE_UTF8 option flag, or the pattern must start with the - sequence (*UTF8). When either of these is the case, both the pattern - and any subject strings that are matched against it are treated as - UTF-8 strings instead of strings of 1-byte characters. - - If you compile PCRE with UTF-8 support, but do not use it at run time, - the library will be a bit bigger, but the additional run time overhead - is limited to testing the PCRE_UTF8 flag occasionally, so should not be - very big. +NAME + PCRE - Perl-compatible regular expressions - If PCRE is built with Unicode character property support (which implies - UTF-8 support), the escape sequences \p{..}, \P{..}, and \X are sup- - ported. The available properties that can be tested are limited to the - general category properties such as Lu for an upper case letter or Nd - for a decimal number, the Unicode script names such as Arabic or Han, - and the derived properties Any and L&. A full list is given in the - pcrepattern documentation. Only the short names for properties are sup- - ported. For example, \p{L} matches a letter. Its Perl synonym, \p{Let- - ter}, is not supported. Furthermore, in Perl, many properties may - optionally be prefixed by "Is", for compatibility with Perl 5.6. PCRE - does not support this. + #include - Validity of UTF-8 strings - When you set the PCRE_UTF8 flag, the strings passed as patterns and - subjects are (by default) checked for validity on entry to the relevant - functions. From release 7.3 of PCRE, the check is according the rules - of RFC 3629, which are themselves derived from the Unicode specifica- - tion. Earlier releases of PCRE followed the rules of RFC 2279, which - allows the full range of 31-bit values (0 to 0x7FFFFFFF). The current - check allows only values in the range U+0 to U+10FFFF, excluding U+D800 - to U+DFFF. - - The excluded code points are the "Low Surrogate Area" of Unicode, of - which the Unicode Standard says this: "The Low Surrogate Area does not - contain any character assignments, consequently no character code - charts or namelists are provided for this area. Surrogates are reserved - for use with UTF-16 and then must be used in pairs." The code points - that are encoded by UTF-16 pairs are available as independent code - points in the UTF-8 encoding. (In other words, the whole surrogate - thing is a fudge for UTF-16 which unfortunately messes up UTF-8.) - - If an invalid UTF-8 string is passed to PCRE, an error return - (PCRE_ERROR_BADUTF8) is given. In some situations, you may already know - that your strings are valid, and therefore want to skip these checks in - order to improve performance. If you set the PCRE_NO_UTF8_CHECK flag at - compile time or at run time, PCRE assumes that the pattern or subject - it is given (respectively) contains only valid UTF-8 codes. In this - case, it does not diagnose an invalid UTF-8 string. +PCRE 16-BIT API BASIC FUNCTIONS - If you pass an invalid UTF-8 string when PCRE_NO_UTF8_CHECK is set, - what happens depends on why the string is invalid. If the string con- - forms to the "old" definition of UTF-8 (RFC 2279), it is processed as a - string of characters in the range 0 to 0x7FFFFFFF. In other words, - apart from the initial validity test, PCRE (when in UTF-8 mode) handles - strings according to the more liberal rules of RFC 2279. However, if - the string does not even conform to RFC 2279, the result is undefined. - Your program may crash. + pcre16 *pcre16_compile(PCRE_SPTR16 pattern, int options, + const char **errptr, int *erroffset, + const unsigned char *tableptr); - If you want to process strings of values in the full range 0 to - 0x7FFFFFFF, encoded in a UTF-8-like manner as per the old RFC, you can - set PCRE_NO_UTF8_CHECK to bypass the more restrictive test. However, in - this situation, you will have to apply your own validity check. + pcre16 *pcre16_compile2(PCRE_SPTR16 pattern, int options, + int *errorcodeptr, + const char **errptr, int *erroffset, + const unsigned char *tableptr); - General comments about UTF-8 mode + pcre16_extra *pcre16_study(const pcre16 *code, int options, + const char **errptr); - 1. An unbraced hexadecimal escape sequence (such as \xb3) matches a - two-byte UTF-8 character if the value is greater than 127. + void pcre16_free_study(pcre16_extra *extra); - 2. Octal numbers up to \777 are recognized, and match two-byte UTF-8 - characters for values greater than \177. + int pcre16_exec(const pcre16 *code, const pcre16_extra *extra, + PCRE_SPTR16 subject, int length, int startoffset, + int options, int *ovector, int ovecsize); - 3. Repeat quantifiers apply to complete UTF-8 characters, not to indi- - vidual bytes, for example: \x{100}{3}. + int pcre16_dfa_exec(const pcre16 *code, const pcre16_extra *extra, + PCRE_SPTR16 subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + int *workspace, int wscount); - 4. The dot metacharacter matches one UTF-8 character instead of a sin- - gle byte. - 5. The escape sequence \C can be used to match a single byte in UTF-8 - mode, but its use can lead to some strange effects. This facility is - not available in the alternative matching function, pcre_dfa_exec(). +PCRE 16-BIT API STRING EXTRACTION FUNCTIONS - 6. The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly - test characters of any code value, but, by default, the characters that - PCRE recognizes as digits, spaces, or word characters remain the same - set as before, all with values less than 256. This remains true even - when PCRE is built to include Unicode property support, because to do - otherwise would slow down PCRE in many common cases. Note in particular - that this applies to \b and \B, because they are defined in terms of \w - and \W. If you really want to test for a wider sense of, say, "digit", - you can use explicit Unicode property tests such as \p{Nd}. Alterna- - tively, if you set the PCRE_UCP option, the way that the character - escapes work is changed so that Unicode properties are used to deter- - mine which characters match. There are more details in the section on - generic character types in the pcrepattern documentation. + int pcre16_copy_named_substring(const pcre16 *code, + PCRE_SPTR16 subject, int *ovector, + int stringcount, PCRE_SPTR16 stringname, + PCRE_UCHAR16 *buffer, int buffersize); - 7. Similarly, characters that match the POSIX named character classes - are all low-valued characters, unless the PCRE_UCP option is set. + int pcre16_copy_substring(PCRE_SPTR16 subject, int *ovector, + int stringcount, int stringnumber, PCRE_UCHAR16 *buffer, + int buffersize); - 8. However, the horizontal and vertical whitespace matching escapes - (\h, \H, \v, and \V) do match all the appropriate Unicode characters, - whether or not PCRE_UCP is set. + int pcre16_get_named_substring(const pcre16 *code, + PCRE_SPTR16 subject, int *ovector, + int stringcount, PCRE_SPTR16 stringname, + PCRE_SPTR16 *stringptr); - 9. Case-insensitive matching applies only to characters whose values - are less than 128, unless PCRE is built with Unicode property support. - Even when Unicode property support is available, PCRE still uses its - own character tables when checking the case of low-valued characters, - so as not to degrade performance. The Unicode property information is - used only for characters with higher values. Furthermore, PCRE supports - case-insensitive matching only when there is a one-to-one mapping - between a letter's cases. There are a small number of many-to-one map- - pings in Unicode; these are not supported by PCRE. + int pcre16_get_stringnumber(const pcre16 *code, + PCRE_SPTR16 name); + + int pcre16_get_stringtable_entries(const pcre16 *code, + PCRE_SPTR16 name, PCRE_UCHAR16 **first, PCRE_UCHAR16 **last); + + int pcre16_get_substring(PCRE_SPTR16 subject, int *ovector, + int stringcount, int stringnumber, + PCRE_SPTR16 *stringptr); + + int pcre16_get_substring_list(PCRE_SPTR16 subject, + int *ovector, int stringcount, PCRE_SPTR16 **listptr); + + void pcre16_free_substring(PCRE_SPTR16 stringptr); + + void pcre16_free_substring_list(PCRE_SPTR16 *stringptr); + + +PCRE 16-BIT API AUXILIARY FUNCTIONS + + pcre16_jit_stack *pcre16_jit_stack_alloc(int startsize, int maxsize); + + void pcre16_jit_stack_free(pcre16_jit_stack *stack); + + void pcre16_assign_jit_stack(pcre16_extra *extra, + pcre16_jit_callback callback, void *data); + + const unsigned char *pcre16_maketables(void); + + int pcre16_fullinfo(const pcre16 *code, const pcre16_extra *extra, + int what, void *where); + + int pcre16_refcount(pcre16 *code, int adjust); + + int pcre16_config(int what, void *where); + + const char *pcre16_version(void); + + int pcre16_pattern_to_host_byte_order(pcre16 *code, + pcre16_extra *extra, const unsigned char *tables); + + +PCRE 16-BIT API INDIRECTED FUNCTIONS + + void *(*pcre16_malloc)(size_t); + + void (*pcre16_free)(void *); + + void *(*pcre16_stack_malloc)(size_t); + + void (*pcre16_stack_free)(void *); + + int (*pcre16_callout)(pcre16_callout_block *); + + +PCRE 16-BIT API 16-BIT-ONLY FUNCTION + + int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *output, + PCRE_SPTR16 input, int length, int *byte_order, + int keep_boms); + + +THE PCRE 16-BIT LIBRARY + + Starting with release 8.30, it is possible to compile a PCRE library + that supports 16-bit character strings, including UTF-16 strings, as + well as or instead of the original 8-bit library. The majority of the + work to make this possible was done by Zoltan Herczeg. The two + libraries contain identical sets of functions, used in exactly the same + way. Only the names of the functions and the data types of their argu- + ments and results are different. To avoid over-complication and reduce + the documentation maintenance load, most of the PCRE documentation + describes the 8-bit library, with only occasional references to the + 16-bit library. This page describes what is different when you use the + 16-bit library. + + WARNING: A single application can be linked with both libraries, but + you must take care when processing any particular pattern to use func- + tions from just one library. For example, if you want to study a pat- + tern that was compiled with pcre16_compile(), you must do so with + pcre16_study(), not pcre_study(), and you must free the study data with + pcre16_free_study(). + + +THE HEADER FILE + + There is only one header file, pcre.h. It contains prototypes for all + the functions in both libraries, as well as definitions of flags, + structures, error codes, etc. + + +THE LIBRARY NAME + + In Unix-like systems, the 16-bit library is called libpcre16, and can + normally be accesss by adding -lpcre16 to the command for linking an + application that uses PCRE. + + +STRING TYPES + + In the 8-bit library, strings are passed to PCRE library functions as + vectors of bytes with the C type "char *". In the 16-bit library, + strings are passed as vectors of unsigned 16-bit quantities. The macro + PCRE_UCHAR16 specifies an appropriate data type, and PCRE_SPTR16 is + defined as "const PCRE_UCHAR16 *". In very many environments, "short + int" is a 16-bit data type. When PCRE is built, it defines PCRE_UCHAR16 + as "short int", but checks that it really is a 16-bit data type. If it + is not, the build fails with an error message telling the maintainer to + modify the definition appropriately. + + +STRUCTURE TYPES + + The types of the opaque structures that are used for compiled 16-bit + patterns and JIT stacks are pcre16 and pcre16_jit_stack respectively. + The type of the user-accessible structure that is returned by + pcre16_study() is pcre16_extra, and the type of the structure that is + used for passing data to a callout function is pcre16_callout_block. + These structures contain the same fields, with the same names, as their + 8-bit counterparts. The only difference is that pointers to character + strings are 16-bit instead of 8-bit types. + + +16-BIT FUNCTIONS + + For every function in the 8-bit library there is a corresponding func- + tion in the 16-bit library with a name that starts with pcre16_ instead + of pcre_. The prototypes are listed above. In addition, there is one + extra function, pcre16_utf16_to_host_byte_order(). This is a utility + function that converts a UTF-16 character string to host byte order if + necessary. The other 16-bit functions expect the strings they are + passed to be in host byte order. + + The input and output arguments of pcre16_utf16_to_host_byte_order() may + point to the same address, that is, conversion in place is supported. + The output buffer must be at least as long as the input. + + The length argument specifies the number of 16-bit data units in the + input string; a negative value specifies a zero-terminated string. + + If byte_order is NULL, it is assumed that the string starts off in host + byte order. This may be changed by byte-order marks (BOMs) anywhere in + the string (commonly as the first character). + + If byte_order is not NULL, a non-zero value of the integer to which it + points means that the input starts off in host byte order, otherwise + the opposite order is assumed. Again, BOMs in the string can change + this. The final byte order is passed back at the end of processing. + + If keep_boms is not zero, byte-order mark characters (0xfeff) are + copied into the output string. Otherwise they are discarded. + + The result of the function is the number of 16-bit units placed into + the output buffer, including the zero terminator if the string was + zero-terminated. + + +SUBJECT STRING OFFSETS + + The offsets within subject strings that are returned by the matching + functions are in 16-bit units rather than bytes. + + +NAMED SUBPATTERNS + + The name-to-number translation table that is maintained for named sub- + patterns uses 16-bit characters. The pcre16_get_stringtable_entries() + function returns the length of each entry in the table as the number of + 16-bit data units. + + +OPTION NAMES + + There are two new general option names, PCRE_UTF16 and + PCRE_NO_UTF16_CHECK, which correspond to PCRE_UTF8 and + PCRE_NO_UTF8_CHECK in the 8-bit library. In fact, these new options + define the same bits in the options word. There is a discussion about + the validity of UTF-16 strings in the pcreunicode page. + + For the pcre16_config() function there is an option PCRE_CONFIG_UTF16 + that returns 1 if UTF-16 support is configured, otherwise 0. If this + option is given to pcre_config(), or if the PCRE_CONFIG_UTF8 option is + given to pcre16_config(), the result is the PCRE_ERROR_BADOPTION error. + + +CHARACTER CODES + + In 16-bit mode, when PCRE_UTF16 is not set, character values are + treated in the same way as in 8-bit, non UTF-8 mode, except, of course, + that they can range from 0 to 0xffff instead of 0 to 0xff. Character + types for characters less than 0xff can therefore be influenced by the + locale in the same way as before. Characters greater than 0xff have + only one case, and no "type" (such as letter or digit). + + In UTF-16 mode, the character code is Unicode, in the range 0 to + 0x10ffff, with the exception of values in the range 0xd800 to 0xdfff + because those are "surrogate" values that are used in pairs to encode + values greater than 0xffff. + + A UTF-16 string can indicate its endianness by special code knows as a + byte-order mark (BOM). The PCRE functions do not handle this, expecting + strings to be in host byte order. A utility function called + pcre16_utf16_to_host_byte_order() is provided to help with this (see + above). + + +ERROR NAMES + + The errors PCRE_ERROR_BADUTF16_OFFSET and PCRE_ERROR_SHORTUTF16 corre- + spond to their 8-bit counterparts. The error PCRE_ERROR_BADMODE is + given when a compiled pattern is passed to a function that processes + patterns in the other mode, for example, if a pattern compiled with + pcre_compile() is passed to pcre16_exec(). + + There are new error codes whose names begin with PCRE_UTF16_ERR for + invalid UTF-16 strings, corresponding to the PCRE_UTF8_ERR codes for + UTF-8 strings that are described in the section entitled "Reason codes + for invalid UTF-8 strings" in the main pcreapi page. The UTF-16 errors + are: + + PCRE_UTF16_ERR1 Missing low surrogate at end of string + PCRE_UTF16_ERR2 Invalid low surrogate follows high surrogate + PCRE_UTF16_ERR3 Isolated low surrogate + PCRE_UTF16_ERR4 Invalid character 0xfffe + + +ERROR TEXTS + + If there is an error while compiling a pattern, the error text that is + passed back by pcre16_compile() or pcre16_compile2() is still an 8-bit + character string, zero-terminated. + + +CALLOUTS + + The subject and mark fields in the callout block that is passed to a + callout function point to 16-bit vectors. + + +TESTING + + The pcretest program continues to operate with 8-bit input and output + files, but it can be used for testing the 16-bit library. If it is run + with the command line option -16, patterns and subject strings are con- + verted from 8-bit to 16-bit before being passed to PCRE, and the 16-bit + library functions are used instead of the 8-bit ones. Returned 16-bit + strings are converted to 8-bit for output. If the 8-bit library was not + compiled, pcretest defaults to 16-bit and the -16 option is ignored. + + When PCRE is being built, the RunTest script that is called by "make + check" uses the pcretest -C option to discover which of the 8-bit and + 16-bit libraries has been built, and runs the tests appropriately. + + +NOT SUPPORTED IN 16-BIT MODE + + Not all the features of the 8-bit library are available with the 16-bit + library. The C++ and POSIX wrapper functions support only the 8-bit + library, and the pcregrep program is at present 8-bit only. AUTHOR @@ -259,15 +458,11 @@ University Computing Service Cambridge CB2 3QH, England. - Putting an actual email address here seems to have been a spam magnet, - so I've taken it away. If you want to email me, use my two initials, - followed by the two digits 10, at the domain cam.ac.uk. - REVISION - Last updated: 13 November 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 14 April 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ @@ -307,46 +502,89 @@ is not described. +BUILDING 8-BIT and 16-BIT LIBRARIES + + By default, a library called libpcre is built, containing functions + that take string arguments contained in vectors of bytes, either as + single-byte characters, or interpreted as UTF-8 strings. You can also + build a separate library, called libpcre16, in which strings are con- + tained in vectors of 16-bit data units and interpreted either as sin- + gle-unit characters or UTF-16 strings, by adding + + --enable-pcre16 + + to the configure command. If you do not want the 8-bit library, add + + --disable-pcre8 + + as well. At least one of the two libraries must be built. Note that the + C++ and POSIX wrappers are for the 8-bit library only, and that pcre- + grep is an 8-bit program. None of these are built if you select only + the 16-bit library. + + +BUILDING SHARED AND STATIC LIBRARIES + + The PCRE building process uses libtool to build both shared and static + Unix libraries by default. You can suppress one of these by adding one + of + + --disable-shared + --disable-static + + to the configure command, as required. + + C++ SUPPORT - By default, the configure script will search for a C++ compiler and C++ - header files. If it finds them, it automatically builds the C++ wrapper - library for PCRE. You can disable this by adding + By default, if the 8-bit library is being built, the configure script + will search for a C++ compiler and C++ header files. If it finds them, + it automatically builds the C++ wrapper library (which supports only + 8-bit strings). You can disable this by adding --disable-cpp to the configure command. -UTF-8 SUPPORT +UTF-8 and UTF-16 SUPPORT - To build PCRE with support for UTF-8 Unicode character strings, add + To build PCRE with support for UTF Unicode character strings, add - --enable-utf8 + --enable-utf - to the configure command. Of itself, this does not make PCRE treat - strings as UTF-8. As well as compiling PCRE with this option, you also - have have to set the PCRE_UTF8 option when you call the pcre_compile() - or pcre_compile2() functions. - - If you set --enable-utf8 when compiling in an EBCDIC environment, PCRE - expects its input to be either ASCII or UTF-8 (depending on the runtime - option). It is not possible to support both EBCDIC and UTF-8 codes in - the same version of the library. Consequently, --enable-utf8 and + to the configure command. This setting applies to both libraries, + adding support for UTF-8 to the 8-bit library and support for UTF-16 to + the 16-bit library. There are no separate options for enabling UTF-8 + and UTF-16 independently because that would allow ridiculous settings + such as requesting UTF-16 support while building only the 8-bit + library. It is not possible to build one library with UTF support and + the other without in the same configuration. (For backwards compatibil- + ity, --enable-utf8 is a synonym of --enable-utf.) + + Of itself, this setting does not make PCRE treat strings as UTF-8 or + UTF-16. As well as compiling PCRE with this option, you also have have + to set the PCRE_UTF8 or PCRE_UTF16 option when you call one of the pat- + tern compiling functions. + + If you set --enable-utf when compiling in an EBCDIC environment, PCRE + expects its input to be either ASCII or UTF-8 (depending on the run- + time option). It is not possible to support both EBCDIC and UTF-8 codes + in the same version of the library. Consequently, --enable-utf and --enable-ebcdic are mutually exclusive. UNICODE CHARACTER PROPERTY SUPPORT - UTF-8 support allows PCRE to process character values greater than 255 - in the strings that it handles. On its own, however, it does not pro- - vide any facilities for accessing the properties of such characters. If - you want to be able to use the pattern escapes \P, \p, and \X, which - refer to Unicode character properties, you must add + UTF support allows the libraries to process character codepoints up to + 0x10ffff in the strings that they handle. On its own, however, it does + not provide any facilities for accessing the properties of such charac- + ters. If you want to be able to use the pattern escapes \P, \p, and \X, + which refer to Unicode character properties, you must add --enable-unicode-properties - to the configure command. This implies UTF-8 support, even if you have + to the configure command. This implies UTF support, even if you have not explicitly requested it. Including Unicode property support adds around 30K of tables to the @@ -354,6 +592,23 @@ are supported. Details are given in the pcrepattern documentation. +JUST-IN-TIME COMPILER SUPPORT + + Just-in-time compiler support is included in the build by specifying + + --enable-jit + + This support is available only for certain hardware architectures. If + this option is set for an unsupported architecture, a compile time + error occurs. See the pcrejit documentation for a discussion of JIT + usage. When JIT support is enabled, pcregrep automatically makes use of + it, unless you add + + --disable-pcregrep-jit + + to the "configure" command. + + CODE VALUE OF NEWLINE By default, PCRE interprets the linefeed (LF) character as indicating @@ -400,28 +655,16 @@ functions are called. -BUILDING SHARED AND STATIC LIBRARIES - - The PCRE building process uses libtool to build both shared and static - Unix libraries by default. You can suppress one of these by adding one - of - - --disable-shared - --disable-static - - to the configure command, as required. - - POSIX MALLOC USAGE - When PCRE is called through the POSIX interface (see the pcreposix doc- - umentation), additional working storage is required for holding the - pointers to capturing substrings, because PCRE requires three integers - per substring, whereas the POSIX interface provides only two. If the - number of expected substrings is small, the wrapper function uses space - on the stack, because this is faster than using malloc() for each call. - The default threshold above which the stack is no longer used is 10; it - can be changed by adding a setting such as + When the 8-bit library is called through the POSIX interface (see the + pcreposix documentation), additional working storage is required for + holding the pointers to capturing substrings, because PCRE requires + three integers per substring, whereas the POSIX interface provides only + two. If the number of expected substrings is small, the wrapper func- + tion uses space on the stack, because this is faster than using mal- + loc() for each call. The default threshold above which the stack is no + longer used is 10; it can be changed by adding a setting such as --with-posix-malloc-threshold=20 @@ -435,107 +678,108 @@ nation metacharacter). By default, two-byte values are used for these offsets, leading to a maximum size for a compiled pattern of around 64K. This is sufficient to handle all but the most gigantic patterns. - Nevertheless, some people do want to process truyl enormous patterns, + Nevertheless, some people do want to process truly enormous patterns, so it is possible to compile PCRE to use three-byte or four-byte off- sets by adding a setting such as --with-link-size=3 - to the configure command. The value given must be 2, 3, or 4. Using - longer offsets slows down the operation of PCRE because it has to load - additional bytes when handling them. + to the configure command. The value given must be 2, 3, or 4. For the + 16-bit library, a value of 3 is rounded up to 4. Using longer offsets + slows down the operation of PCRE because it has to load additional data + when handling them. AVOIDING EXCESSIVE STACK USAGE When matching with the pcre_exec() function, PCRE implements backtrack- - ing by making recursive calls to an internal function called match(). - In environments where the size of the stack is limited, this can se- - verely limit PCRE's operation. (The Unix environment does not usually + ing by making recursive calls to an internal function called match(). + In environments where the size of the stack is limited, this can se- + verely limit PCRE's operation. (The Unix environment does not usually suffer from this problem, but it may sometimes be necessary to increase - the maximum stack size. There is a discussion in the pcrestack docu- - mentation.) An alternative approach to recursion that uses memory from - the heap to remember data, instead of using recursive function calls, - has been implemented to work round the problem of limited stack size. + the maximum stack size. There is a discussion in the pcrestack docu- + mentation.) An alternative approach to recursion that uses memory from + the heap to remember data, instead of using recursive function calls, + has been implemented to work round the problem of limited stack size. If you want to build a version of PCRE that works this way, add --disable-stack-for-recursion - to the configure command. With this configuration, PCRE will use the - pcre_stack_malloc and pcre_stack_free variables to call memory manage- - ment functions. By default these point to malloc() and free(), but you + to the configure command. With this configuration, PCRE will use the + pcre_stack_malloc and pcre_stack_free variables to call memory manage- + ment functions. By default these point to malloc() and free(), but you can replace the pointers so that your own functions are used instead. - Separate functions are provided rather than using pcre_malloc and - pcre_free because the usage is very predictable: the block sizes - requested are always the same, and the blocks are always freed in - reverse order. A calling program might be able to implement optimized - functions that perform better than malloc() and free(). PCRE runs + Separate functions are provided rather than using pcre_malloc and + pcre_free because the usage is very predictable: the block sizes + requested are always the same, and the blocks are always freed in + reverse order. A calling program might be able to implement optimized + functions that perform better than malloc() and free(). PCRE runs noticeably more slowly when built in this way. This option affects only the pcre_exec() function; it is not relevant for pcre_dfa_exec(). LIMITING PCRE RESOURCE USAGE - Internally, PCRE has a function called match(), which it calls repeat- - edly (sometimes recursively) when matching a pattern with the - pcre_exec() function. By controlling the maximum number of times this - function may be called during a single matching operation, a limit can - be placed on the resources used by a single call to pcre_exec(). The - limit can be changed at run time, as described in the pcreapi documen- - tation. The default is 10 million, but this can be changed by adding a + Internally, PCRE has a function called match(), which it calls repeat- + edly (sometimes recursively) when matching a pattern with the + pcre_exec() function. By controlling the maximum number of times this + function may be called during a single matching operation, a limit can + be placed on the resources used by a single call to pcre_exec(). The + limit can be changed at run time, as described in the pcreapi documen- + tation. The default is 10 million, but this can be changed by adding a setting such as --with-match-limit=500000 - to the configure command. This setting has no effect on the + to the configure command. This setting has no effect on the pcre_dfa_exec() matching function. - In some environments it is desirable to limit the depth of recursive + In some environments it is desirable to limit the depth of recursive calls of match() more strictly than the total number of calls, in order - to restrict the maximum amount of stack (or heap, if --disable-stack- + to restrict the maximum amount of stack (or heap, if --disable-stack- for-recursion is specified) that is used. A second limit controls this; - it defaults to the value that is set for --with-match-limit, which - imposes no additional constraints. However, you can set a lower limit + it defaults to the value that is set for --with-match-limit, which + imposes no additional constraints. However, you can set a lower limit by adding, for example, --with-match-limit-recursion=10000 - to the configure command. This value can also be overridden at run + to the configure command. This value can also be overridden at run time. CREATING CHARACTER TABLES AT BUILD TIME - PCRE uses fixed tables for processing characters whose code values are - less than 256. By default, PCRE is built with a set of tables that are - distributed in the file pcre_chartables.c.dist. These tables are for + PCRE uses fixed tables for processing characters whose code values are + less than 256. By default, PCRE is built with a set of tables that are + distributed in the file pcre_chartables.c.dist. These tables are for ASCII codes only. If you add --enable-rebuild-chartables - to the configure command, the distributed tables are no longer used. - Instead, a program called dftables is compiled and run. This outputs + to the configure command, the distributed tables are no longer used. + Instead, a program called dftables is compiled and run. This outputs the source for new set of tables, created in the default locale of your - C runtime system. (This method of replacing the tables does not work if - you are cross compiling, because dftables is run on the local host. If - you need to create alternative tables when cross compiling, you will + C run-time system. (This method of replacing the tables does not work + if you are cross compiling, because dftables is run on the local host. + If you need to create alternative tables when cross compiling, you will have to do so "by hand".) USING EBCDIC CODE - PCRE assumes by default that it will run in an environment where the - character code is ASCII (or Unicode, which is a superset of ASCII). - This is the case for most computer operating systems. PCRE can, how- + PCRE assumes by default that it will run in an environment where the + character code is ASCII (or Unicode, which is a superset of ASCII). + This is the case for most computer operating systems. PCRE can, how- ever, be compiled to run in an EBCDIC environment by adding --enable-ebcdic to the configure command. This setting implies --enable-rebuild-charta- - bles. You should only use it if you know that you are in an EBCDIC - environment (for example, an IBM mainframe operating system). The - --enable-ebcdic option is incompatible with --enable-utf8. + bles. You should only use it if you know that you are in an EBCDIC + environment (for example, an IBM mainframe operating system). The + --enable-ebcdic option is incompatible with --enable-utf. PCREGREP OPTIONS FOR COMPRESSED FILE SUPPORT @@ -548,10 +792,26 @@ --enable-pcregrep-libbz2 to the configure command. These options naturally require that the rel- - evant libraries are installed on your system. Configuration will fail + evant libraries are installed on your system. Configuration will fail if they are not. +PCREGREP BUFFER SIZE + + pcregrep uses an internal buffer to hold a "window" on the file it is + scanning, in order to be able to output "before" and "after" lines when + it finds a match. The size of the buffer is controlled by a parameter + whose default value is 20K. The buffer itself is three times this size, + but because of the way it is used for holding "before" lines, the long- + est line that is guaranteed to be processable is the parameter size. + You can change the default parameter value by adding, for example, + + --with-pcregrep-bufsize=50K + + to the configure command. The caller of pcregrep can, however, override + this value by specifying a run-time option. + + PCRETEST OPTION FOR LIBREADLINE SUPPORT If you add @@ -585,7 +845,7 @@ SEE ALSO - pcreapi(3), pcre_config(3). + pcreapi(3), pcre16, pcre_config(3). AUTHOR @@ -597,8 +857,8 @@ REVISION - Last updated: 29 September 2009 - Copyright (c) 1997-2009 University of Cambridge. + Last updated: 07 January 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ @@ -614,13 +874,15 @@ This document describes the two different algorithms that are available in PCRE for matching a compiled regular expression against a given sub- ject string. The "standard" algorithm is the one provided by the - pcre_exec() function. This works in the same was as Perl's matching - function, and provides a Perl-compatible matching operation. - - An alternative algorithm is provided by the pcre_dfa_exec() function; - this operates in a different way, and is not Perl-compatible. It has - advantages and disadvantages compared with the standard algorithm, and - these are described below. + pcre_exec() and pcre16_exec() functions. These work in the same was as + Perl's matching function, and provide a Perl-compatible matching opera- + tion. The just-in-time (JIT) optimization that is described in the + pcrejit documentation is compatible with these functions. + + An alternative algorithm is provided by the pcre_dfa_exec() and + pcre16_dfa_exec() functions; they operate in a different way, and are + not Perl-compatible. This alternative has advantages and disadvantages + compared with the standard algorithm, and these are described below. When there is only one possible way in which a given subject string can match a pattern, the two algorithms give the same answer. A difference @@ -748,42 +1010,43 @@ 6. Callouts are supported, but the value of the capture_top field is always 1, and the value of the capture_last field is always -1. - 7. The \C escape sequence, which (in the standard algorithm) matches a - single byte, even in UTF-8 mode, is not supported because the alterna- - tive algorithm moves through the subject string one character at a - time, for all active paths through the tree. + 7. The \C escape sequence, which (in the standard algorithm) always + matches a single data unit, even in UTF-8 or UTF-16 modes, is not sup- + ported in these modes, because the alternative algorithm moves through + the subject string one character (not data unit) at a time, for all + active paths through the tree. - 8. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) - are not supported. (*FAIL) is supported, and behaves like a failing + 8. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) + are not supported. (*FAIL) is supported, and behaves like a failing negative assertion. ADVANTAGES OF THE ALTERNATIVE ALGORITHM - Using the alternative matching algorithm provides the following advan- + Using the alternative matching algorithm provides the following advan- tages: 1. All possible matches (at a single point in the subject) are automat- - ically found, and in particular, the longest match is found. To find + ically found, and in particular, the longest match is found. To find more than one match using the standard algorithm, you have to do kludgy things with callouts. - 2. Because the alternative algorithm scans the subject string just - once, and never needs to backtrack, it is possible to pass very long - subject strings to the matching function in several pieces, checking - for partial matching each time. Although it is possible to do multi- - segment matching using the standard algorithm (pcre_exec()), by retain- - ing partially matched substrings, it is more complicated. The pcrepar- - tial documentation gives details of partial matching and discusses - multi-segment matching. + 2. Because the alternative algorithm scans the subject string just + once, and never needs to backtrack (except for lookbehinds), it is pos- + sible to pass very long subject strings to the matching function in + several pieces, checking for partial matching each time. Although it is + possible to do multi-segment matching using the standard algorithm by + retaining partially matched substrings, it is more complicated. The + pcrepartial documentation gives details of partial matching and dis- + cusses multi-segment matching. DISADVANTAGES OF THE ALTERNATIVE ALGORITHM The alternative algorithm suffers from a number of disadvantages: - 1. It is substantially slower than the standard algorithm. This is - partly because it has to search for all possible matches, but is also + 1. It is substantially slower than the standard algorithm. This is + partly because it has to search for all possible matches, but is also because it is less susceptible to optimization. 2. Capturing parentheses and back references are not supported. @@ -801,8 +1064,8 @@ REVISION - Last updated: 17 November 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 08 January 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ @@ -812,10 +1075,10 @@ NAME PCRE - Perl-compatible regular expressions + #include -PCRE NATIVE API - #include +PCRE NATIVE API BASIC FUNCTIONS pcre *pcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, @@ -829,6 +1092,8 @@ pcre_extra *pcre_study(const pcre *code, int options, const char **errptr); + void pcre_free_study(pcre_extra *extra); + int pcre_exec(const pcre *code, const pcre_extra *extra, const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize); @@ -838,6 +1103,9 @@ int options, int *ovector, int ovecsize, int *workspace, int wscount); + +PCRE NATIVE API STRING EXTRACTION FUNCTIONS + int pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, @@ -869,18 +1137,32 @@ void pcre_free_substring_list(const char **stringptr); + +PCRE NATIVE API AUXILIARY FUNCTIONS + + pcre_jit_stack *pcre_jit_stack_alloc(int startsize, int maxsize); + + void pcre_jit_stack_free(pcre_jit_stack *stack); + + void pcre_assign_jit_stack(pcre_extra *extra, + pcre_jit_callback callback, void *data); + const unsigned char *pcre_maketables(void); int pcre_fullinfo(const pcre *code, const pcre_extra *extra, int what, void *where); - int pcre_info(const pcre *code, int *optptr, int *firstcharptr); - int pcre_refcount(pcre *code, int adjust); int pcre_config(int what, void *where); - char *pcre_version(void); + const char *pcre_version(void); + + int pcre_pattern_to_host_byte_order(pcre *code, + pcre_extra *extra, const unsigned char *tables); + + +PCRE NATIVE API INDIRECTED FUNCTIONS void *(*pcre_malloc)(size_t); @@ -893,46 +1175,80 @@ int (*pcre_callout)(pcre_callout_block *); +PCRE 8-BIT AND 16-BIT LIBRARIES + + From release 8.30, PCRE can be compiled as a library for handling + 16-bit character strings as well as, or instead of, the original + library that handles 8-bit character strings. To avoid too much compli- + cation, this document describes the 8-bit versions of the functions, + with only occasional references to the 16-bit library. + + The 16-bit functions operate in the same way as their 8-bit counter- + parts; they just use different data types for their arguments and + results, and their names start with pcre16_ instead of pcre_. For every + option that has UTF8 in its name (for example, PCRE_UTF8), there is a + corresponding 16-bit name with UTF8 replaced by UTF16. This facility is + in fact just cosmetic; the 16-bit option names define the same bit val- + ues. + + References to bytes and UTF-8 in this document should be read as refer- + ences to 16-bit data quantities and UTF-16 when using the 16-bit + library, unless specified otherwise. More details of the specific dif- + ferences for the 16-bit library are given in the pcre16 page. + + PCRE API OVERVIEW PCRE has its own native API, which is described in this document. There - are also some wrapper functions that correspond to the POSIX regular - expression API. These are described in the pcreposix documentation. - Both of these APIs define a set of C function calls. A C++ wrapper is - distributed with PCRE. It is documented in the pcrecpp page. - - The native API C function prototypes are defined in the header file - pcre.h, and on Unix systems the library itself is called libpcre. It - can normally be accessed by adding -lpcre to the command for linking an - application that uses PCRE. The header file defines the macros - PCRE_MAJOR and PCRE_MINOR to contain the major and minor release num- - bers for the library. Applications can use these to include support + are also some wrapper functions (for the 8-bit library only) that cor- + respond to the POSIX regular expression API, but they do not give + access to all the functionality. They are described in the pcreposix + documentation. Both of these APIs define a set of C function calls. A + C++ wrapper (again for the 8-bit library only) is also distributed with + PCRE. It is documented in the pcrecpp page. + + The native API C function prototypes are defined in the header file + pcre.h, and on Unix-like systems the (8-bit) library itself is called + libpcre. It can normally be accessed by adding -lpcre to the command + for linking an application that uses PCRE. The header file defines the + macros PCRE_MAJOR and PCRE_MINOR to contain the major and minor release + numbers for the library. Applications can use these to include support for different releases of PCRE. In a Windows environment, if you want to statically link an application - program against a non-dll pcre.a file, you must define PCRE_STATIC - before including pcre.h or pcrecpp.h, because otherwise the pcre_mal- + program against a non-dll pcre.a file, you must define PCRE_STATIC + before including pcre.h or pcrecpp.h, because otherwise the pcre_mal- loc() and pcre_free() exported functions will be declared __declspec(dllimport), with unwanted results. - The functions pcre_compile(), pcre_compile2(), pcre_study(), and - pcre_exec() are used for compiling and matching regular expressions in - a Perl-compatible manner. A sample program that demonstrates the sim- - plest way of using them is provided in the file called pcredemo.c in + The functions pcre_compile(), pcre_compile2(), pcre_study(), and + pcre_exec() are used for compiling and matching regular expressions in + a Perl-compatible manner. A sample program that demonstrates the sim- + plest way of using them is provided in the file called pcredemo.c in the PCRE source distribution. A listing of this program is given in the - pcredemo documentation, and the pcresample documentation describes how + pcredemo documentation, and the pcresample documentation describes how to compile and run it. + Just-in-time compiler support is an optional feature of PCRE that can + be built in appropriate hardware environments. It greatly speeds up the + matching performance of many patterns. Simple programs can easily + request that it be used if available, by setting an option that is + ignored when it is not relevant. More complicated programs might need + to make use of the functions pcre_jit_stack_alloc(), + pcre_jit_stack_free(), and pcre_assign_jit_stack() in order to control + the JIT code's memory usage. These functions are discussed in the + pcrejit documentation. + A second matching function, pcre_dfa_exec(), which is not Perl-compati- - ble, is also provided. This uses a different algorithm for the match- - ing. The alternative algorithm finds all possible matches (at a given - point in the subject), and scans the subject just once (unless there - are lookbehind assertions). However, this algorithm does not return - captured substrings. A description of the two matching algorithms and - their advantages and disadvantages is given in the pcrematching docu- + ble, is also provided. This uses a different algorithm for the match- + ing. The alternative algorithm finds all possible matches (at a given + point in the subject), and scans the subject just once (unless there + are lookbehind assertions). However, this algorithm does not return + captured substrings. A description of the two matching algorithms and + their advantages and disadvantages is given in the pcrematching docu- mentation. - In addition to the main compiling and matching functions, there are + In addition to the main compiling and matching functions, there are convenience functions for extracting captured substrings from a subject string that is matched by pcre_exec(). They are: @@ -947,103 +1263,106 @@ pcre_free_substring() and pcre_free_substring_list() are also provided, to free the memory used for extracted strings. - The function pcre_maketables() is used to build a set of character - tables in the current locale for passing to pcre_compile(), - pcre_exec(), or pcre_dfa_exec(). This is an optional facility that is - provided for specialist use. Most commonly, no special tables are - passed, in which case internal tables that are generated when PCRE is + The function pcre_maketables() is used to build a set of character + tables in the current locale for passing to pcre_compile(), + pcre_exec(), or pcre_dfa_exec(). This is an optional facility that is + provided for specialist use. Most commonly, no special tables are + passed, in which case internal tables that are generated when PCRE is built are used. - The function pcre_fullinfo() is used to find out information about a - compiled pattern; pcre_info() is an obsolete version that returns only - some of the available information, but is retained for backwards com- - patibility. The function pcre_version() returns a pointer to a string - containing the version of PCRE and its date of release. + The function pcre_fullinfo() is used to find out information about a + compiled pattern. The function pcre_version() returns a pointer to a + string containing the version of PCRE and its date of release. - The function pcre_refcount() maintains a reference count in a data - block containing a compiled pattern. This is provided for the benefit + The function pcre_refcount() maintains a reference count in a data + block containing a compiled pattern. This is provided for the benefit of object-oriented applications. - The global variables pcre_malloc and pcre_free initially contain the - entry points of the standard malloc() and free() functions, respec- + The global variables pcre_malloc and pcre_free initially contain the + entry points of the standard malloc() and free() functions, respec- tively. PCRE calls the memory management functions via these variables, - so a calling program can replace them if it wishes to intercept the + so a calling program can replace them if it wishes to intercept the calls. This should be done before calling any PCRE functions. - The global variables pcre_stack_malloc and pcre_stack_free are also - indirections to memory management functions. These special functions - are used only when PCRE is compiled to use the heap for remembering + The global variables pcre_stack_malloc and pcre_stack_free are also + indirections to memory management functions. These special functions + are used only when PCRE is compiled to use the heap for remembering data, instead of recursive function calls, when running the pcre_exec() - function. See the pcrebuild documentation for details of how to do - this. It is a non-standard way of building PCRE, for use in environ- - ments that have limited stacks. Because of the greater use of memory - management, it runs more slowly. Separate functions are provided so - that special-purpose external code can be used for this case. When - used, these functions are always called in a stack-like manner (last - obtained, first freed), and always for memory blocks of the same size. - There is a discussion about PCRE's stack usage in the pcrestack docu- + function. See the pcrebuild documentation for details of how to do + this. It is a non-standard way of building PCRE, for use in environ- + ments that have limited stacks. Because of the greater use of memory + management, it runs more slowly. Separate functions are provided so + that special-purpose external code can be used for this case. When + used, these functions are always called in a stack-like manner (last + obtained, first freed), and always for memory blocks of the same size. + There is a discussion about PCRE's stack usage in the pcrestack docu- mentation. The global variable pcre_callout initially contains NULL. It can be set - by the caller to a "callout" function, which PCRE will then call at - specified points during a matching operation. Details are given in the + by the caller to a "callout" function, which PCRE will then call at + specified points during a matching operation. Details are given in the pcrecallout documentation. NEWLINES - PCRE supports five different conventions for indicating line breaks in - strings: a single CR (carriage return) character, a single LF (line- + PCRE supports five different conventions for indicating line breaks in + strings: a single CR (carriage return) character, a single LF (line- feed) character, the two-character sequence CRLF, any of the three pre- - ceding, or any Unicode newline sequence. The Unicode newline sequences - are the three just mentioned, plus the single characters VT (vertical - tab, U+000B), FF (formfeed, U+000C), NEL (next line, U+0085), LS (line + ceding, or any Unicode newline sequence. The Unicode newline sequences + are the three just mentioned, plus the single characters VT (vertical + tab, U+000B), FF (form feed, U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and PS (paragraph separator, U+2029). - Each of the first three conventions is used by at least one operating - system as its standard newline sequence. When PCRE is built, a default - can be specified. The default default is LF, which is the Unix stan- - dard. When PCRE is run, the default can be overridden, either when a + Each of the first three conventions is used by at least one operating + system as its standard newline sequence. When PCRE is built, a default + can be specified. The default default is LF, which is the Unix stan- + dard. When PCRE is run, the default can be overridden, either when a pattern is compiled, or when it is matched. At compile time, the newline convention can be specified by the options - argument of pcre_compile(), or it can be specified by special text at + argument of pcre_compile(), or it can be specified by special text at the start of the pattern itself; this overrides any other settings. See the pcrepattern page for details of the special character sequences. In the PCRE documentation the word "newline" is used to mean "the char- - acter or pair of characters that indicate a line break". The choice of - newline convention affects the handling of the dot, circumflex, and + acter or pair of characters that indicate a line break". The choice of + newline convention affects the handling of the dot, circumflex, and dollar metacharacters, the handling of #-comments in /x mode, and, when - CRLF is a recognized line ending sequence, the match position advance- + CRLF is a recognized line ending sequence, the match position advance- ment for a non-anchored pattern. There is more detail about this in the section on pcre_exec() options below. - The choice of newline convention does not affect the interpretation of - the \n or \r escape sequences, nor does it affect what \R matches, + The choice of newline convention does not affect the interpretation of + the \n or \r escape sequences, nor does it affect what \R matches, which is controlled in a similar way, but by separate options. MULTITHREADING - The PCRE functions can be used in multi-threading applications, with + The PCRE functions can be used in multi-threading applications, with the proviso that the memory management functions pointed to by pcre_malloc, pcre_free, pcre_stack_malloc, and pcre_stack_free, and the callout function pointed to by pcre_callout, are shared by all threads. - The compiled form of a regular expression is not altered during match- + The compiled form of a regular expression is not altered during match- ing, so the same compiled pattern can safely be used by several threads at once. + If the just-in-time optimization feature is being used, it needs sepa- + rate memory stack areas for each thread. See the pcrejit documentation + for more details. + SAVING PRECOMPILED PATTERNS FOR LATER USE The compiled form of a regular expression can be saved and re-used at a - later time, possibly by a different program, and even on a host other - than the one on which it was compiled. Details are given in the - pcreprecompile documentation. However, compiling a regular expression - with one version of PCRE for use with a different version is not guar- - anteed to work and may cause crashes. + later time, possibly by a different program, and even on a host other + than the one on which it was compiled. Details are given in the + pcreprecompile documentation, which includes a description of the + pcre_pattern_to_host_byte_order() function. However, compiling a regu- + lar expression with one version of PCRE for use with a different ver- + sion is not guaranteed to work and may cause crashes. CHECKING BUILD-TIME OPTIONS @@ -1057,72 +1376,99 @@ The first argument for pcre_config() is an integer, specifying which information is required; the second argument is a pointer to a variable - into which the information is placed. The following information is + into which the information is placed. The returned value is zero on + success, or the negative error code PCRE_ERROR_BADOPTION if the value + in the first argument is not recognized. The following information is available: PCRE_CONFIG_UTF8 The output is an integer that is set to one if UTF-8 support is avail- - able; otherwise it is set to zero. + able; otherwise it is set to zero. If this option is given to the + 16-bit version of this function, pcre16_config(), the result is + PCRE_ERROR_BADOPTION. + + PCRE_CONFIG_UTF16 + + The output is an integer that is set to one if UTF-16 support is avail- + able; otherwise it is set to zero. This value should normally be given + to the 16-bit version of this function, pcre16_config(). If it is given + to the 8-bit version of this function, the result is PCRE_ERROR_BADOP- + TION. PCRE_CONFIG_UNICODE_PROPERTIES The output is an integer that is set to one if support for Unicode character properties is available; otherwise it is set to zero. + PCRE_CONFIG_JIT + + The output is an integer that is set to one if support for just-in-time + compiling is available; otherwise it is set to zero. + + PCRE_CONFIG_JITTARGET + + The output is a pointer to a zero-terminated "const char *" string. If + JIT support is available, the string contains the name of the architec- + ture for which the JIT compiler is configured, for example "x86 32bit + (little endian + unaligned)". If JIT support is not available, the + result is NULL. + PCRE_CONFIG_NEWLINE - The output is an integer whose value specifies the default character - sequence that is recognized as meaning "newline". The four values that + The output is an integer whose value specifies the default character + sequence that is recognized as meaning "newline". The four values that are supported are: 10 for LF, 13 for CR, 3338 for CRLF, -2 for ANYCRLF, - and -1 for ANY. Though they are derived from ASCII, the same values + and -1 for ANY. Though they are derived from ASCII, the same values are returned in EBCDIC environments. The default should normally corre- spond to the standard sequence for your operating system. PCRE_CONFIG_BSR The output is an integer whose value indicates what character sequences - the \R escape sequence matches by default. A value of 0 means that \R - matches any Unicode line ending sequence; a value of 1 means that \R + the \R escape sequence matches by default. A value of 0 means that \R + matches any Unicode line ending sequence; a value of 1 means that \R matches only CR, LF, or CRLF. The default can be overridden when a pat- tern is compiled or matched. PCRE_CONFIG_LINK_SIZE - The output is an integer that contains the number of bytes used for - internal linkage in compiled regular expressions. The value is 2, 3, or - 4. Larger values allow larger regular expressions to be compiled, at - the expense of slower matching. The default value of 2 is sufficient - for all but the most massive patterns, since it allows the compiled - pattern to be up to 64K in size. + The output is an integer that contains the number of bytes used for + internal linkage in compiled regular expressions. For the 8-bit + library, the value can be 2, 3, or 4. For the 16-bit library, the value + is either 2 or 4 and is still a number of bytes. The default value of 2 + is sufficient for all but the most massive patterns, since it allows + the compiled pattern to be up to 64K in size. Larger values allow + larger regular expressions to be compiled, at the expense of slower + matching. PCRE_CONFIG_POSIX_MALLOC_THRESHOLD - The output is an integer that contains the threshold above which the - POSIX interface uses malloc() for output vectors. Further details are + The output is an integer that contains the threshold above which the + POSIX interface uses malloc() for output vectors. Further details are given in the pcreposix documentation. PCRE_CONFIG_MATCH_LIMIT - The output is a long integer that gives the default limit for the num- - ber of internal matching function calls in a pcre_exec() execution. + The output is a long integer that gives the default limit for the num- + ber of internal matching function calls in a pcre_exec() execution. Further details are given with pcre_exec() below. PCRE_CONFIG_MATCH_LIMIT_RECURSION The output is a long integer that gives the default limit for the depth - of recursion when calling the internal matching function in a - pcre_exec() execution. Further details are given with pcre_exec() + of recursion when calling the internal matching function in a + pcre_exec() execution. Further details are given with pcre_exec() below. PCRE_CONFIG_STACKRECURSE - The output is an integer that is set to one if internal recursion when + The output is an integer that is set to one if internal recursion when running pcre_exec() is implemented by recursive function calls that use - the stack to remember their state. This is the usual way that PCRE is + the stack to remember their state. This is the usual way that PCRE is compiled. The output is zero if PCRE was compiled to use blocks of data - on the heap instead of recursive function calls. In this case, - pcre_stack_malloc and pcre_stack_free are called to manage memory + on the heap instead of recursive function calls. In this case, + pcre_stack_malloc and pcre_stack_free are called to manage memory blocks on the heap, thus avoiding the use of the stack. @@ -1139,65 +1485,65 @@ Either of the functions pcre_compile() or pcre_compile2() can be called to compile a pattern into an internal form. The only difference between - the two interfaces is that pcre_compile2() has an additional argument, - errorcodeptr, via which a numerical error code can be returned. To - avoid too much repetition, we refer just to pcre_compile() below, but + the two interfaces is that pcre_compile2() has an additional argument, + errorcodeptr, via which a numerical error code can be returned. To + avoid too much repetition, we refer just to pcre_compile() below, but the information applies equally to pcre_compile2(). The pattern is a C string terminated by a binary zero, and is passed in - the pattern argument. A pointer to a single block of memory that is - obtained via pcre_malloc is returned. This contains the compiled code + the pattern argument. A pointer to a single block of memory that is + obtained via pcre_malloc is returned. This contains the compiled code and related data. The pcre type is defined for the returned block; this is a typedef for a structure whose contents are not externally defined. It is up to the caller to free the memory (via pcre_free) when it is no longer required. - Although the compiled code of a PCRE regex is relocatable, that is, it + Although the compiled code of a PCRE regex is relocatable, that is, it does not depend on memory location, the complete pcre data block is not - fully relocatable, because it may contain a copy of the tableptr argu- + fully relocatable, because it may contain a copy of the tableptr argu- ment, which is an address (see below). The options argument contains various bit settings that affect the com- - pilation. It should be zero if no options are required. The available - options are described below. Some of them (in particular, those that - are compatible with Perl, but some others as well) can also be set and - unset from within the pattern (see the detailed description in the - pcrepattern documentation). For those options that can be different in - different parts of the pattern, the contents of the options argument + pilation. It should be zero if no options are required. The available + options are described below. Some of them (in particular, those that + are compatible with Perl, but some others as well) can also be set and + unset from within the pattern (see the detailed description in the + pcrepattern documentation). For those options that can be different in + different parts of the pattern, the contents of the options argument specifies their settings at the start of compilation and execution. The - PCRE_ANCHORED, PCRE_BSR_xxx, PCRE_NEWLINE_xxx, PCRE_NO_UTF8_CHECK, and - PCRE_NO_START_OPT options can be set at the time of matching as well as - at compile time. + PCRE_ANCHORED, PCRE_BSR_xxx, PCRE_NEWLINE_xxx, PCRE_NO_UTF8_CHECK, and + PCRE_NO_START_OPTIMIZE options can be set at the time of matching as + well as at compile time. If errptr is NULL, pcre_compile() returns NULL immediately. Otherwise, - if compilation of a pattern fails, pcre_compile() returns NULL, and + if compilation of a pattern fails, pcre_compile() returns NULL, and sets the variable pointed to by errptr to point to a textual error mes- sage. This is a static string that is part of the library. You must not - try to free it. The offset from the start of the pattern to the byte - that was being processed when the error was discovered is placed in the - variable pointed to by erroffset, which must not be NULL. If it is, an - immediate error is given. Some errors are not detected until checks are - carried out when the whole pattern has been scanned; in this case the - offset is set to the end of the pattern. + try to free it. Normally, the offset from the start of the pattern to + the byte that was being processed when the error was discovered is + placed in the variable pointed to by erroffset, which must not be NULL + (if it is, an immediate error is given). However, for an invalid UTF-8 + string, the offset is that of the first byte of the failing character. + Some errors are not detected until the whole pattern has been scanned; + in these cases, the offset passed back is the length of the pattern. Note that the offset is in bytes, not characters, even in UTF-8 mode. - It may point into the middle of a UTF-8 character (for example, when - PCRE_ERROR_BADUTF8 is returned for an invalid UTF-8 string). + It may sometimes point into the middle of a UTF-8 character. - If pcre_compile2() is used instead of pcre_compile(), and the error- - codeptr argument is not NULL, a non-zero error code number is returned - via this argument in the event of an error. This is in addition to the + If pcre_compile2() is used instead of pcre_compile(), and the error- + codeptr argument is not NULL, a non-zero error code number is returned + via this argument in the event of an error. This is in addition to the textual error message. Error codes and messages are listed below. - If the final argument, tableptr, is NULL, PCRE uses a default set of - character tables that are built when PCRE is compiled, using the - default C locale. Otherwise, tableptr must be an address that is the - result of a call to pcre_maketables(). This value is stored with the - compiled pattern, and used again by pcre_exec(), unless another table + If the final argument, tableptr, is NULL, PCRE uses a default set of + character tables that are built when PCRE is compiled, using the + default C locale. Otherwise, tableptr must be an address that is the + result of a call to pcre_maketables(). This value is stored with the + compiled pattern, and used again by pcre_exec(), unless another table pointer is passed to it. For more discussion, see the section on locale support below. - This code fragment shows a typical straightforward call to pcre_com- + This code fragment shows a typical straightforward call to pcre_com- pile(): pcre *re; @@ -1210,147 +1556,161 @@ &erroffset, /* for error offset */ NULL); /* use default character tables */ - The following names for option bits are defined in the pcre.h header + The following names for option bits are defined in the pcre.h header file: PCRE_ANCHORED If this bit is set, the pattern is forced to be "anchored", that is, it - is constrained to match only at the first matching point in the string - that is being searched (the "subject string"). This effect can also be - achieved by appropriate constructs in the pattern itself, which is the + is constrained to match only at the first matching point in the string + that is being searched (the "subject string"). This effect can also be + achieved by appropriate constructs in the pattern itself, which is the only way to do it in Perl. PCRE_AUTO_CALLOUT If this bit is set, pcre_compile() automatically inserts callout items, - all with number 255, before each pattern item. For discussion of the + all with number 255, before each pattern item. For discussion of the callout facility, see the pcrecallout documentation. PCRE_BSR_ANYCRLF PCRE_BSR_UNICODE These options (which are mutually exclusive) control what the \R escape - sequence matches. The choice is either to match only CR, LF, or CRLF, + sequence matches. The choice is either to match only CR, LF, or CRLF, or to match any Unicode newline sequence. The default is specified when PCRE is built. It can be overridden from within the pattern, or by set- ting an option when a compiled pattern is matched. PCRE_CASELESS - If this bit is set, letters in the pattern match both upper and lower - case letters. It is equivalent to Perl's /i option, and it can be - changed within a pattern by a (?i) option setting. In UTF-8 mode, PCRE - always understands the concept of case for characters whose values are - less than 128, so caseless matching is always possible. For characters - with higher values, the concept of case is supported if PCRE is com- - piled with Unicode property support, but not otherwise. If you want to - use caseless matching for characters 128 and above, you must ensure - that PCRE is compiled with Unicode property support as well as with + If this bit is set, letters in the pattern match both upper and lower + case letters. It is equivalent to Perl's /i option, and it can be + changed within a pattern by a (?i) option setting. In UTF-8 mode, PCRE + always understands the concept of case for characters whose values are + less than 128, so caseless matching is always possible. For characters + with higher values, the concept of case is supported if PCRE is com- + piled with Unicode property support, but not otherwise. If you want to + use caseless matching for characters 128 and above, you must ensure + that PCRE is compiled with Unicode property support as well as with UTF-8 support. PCRE_DOLLAR_ENDONLY - If this bit is set, a dollar metacharacter in the pattern matches only - at the end of the subject string. Without this option, a dollar also - matches immediately before a newline at the end of the string (but not - before any other newlines). The PCRE_DOLLAR_ENDONLY option is ignored - if PCRE_MULTILINE is set. There is no equivalent to this option in + If this bit is set, a dollar metacharacter in the pattern matches only + at the end of the subject string. Without this option, a dollar also + matches immediately before a newline at the end of the string (but not + before any other newlines). The PCRE_DOLLAR_ENDONLY option is ignored + if PCRE_MULTILINE is set. There is no equivalent to this option in Perl, and no way to set it within a pattern. PCRE_DOTALL - If this bit is set, a dot metacharacter in the pattern matches a char- + If this bit is set, a dot metacharacter in the pattern matches a char- acter of any value, including one that indicates a newline. However, it - only ever matches one character, even if newlines are coded as CRLF. - Without this option, a dot does not match when the current position is + only ever matches one character, even if newlines are coded as CRLF. + Without this option, a dot does not match when the current position is at a newline. This option is equivalent to Perl's /s option, and it can - be changed within a pattern by a (?s) option setting. A negative class + be changed within a pattern by a (?s) option setting. A negative class such as [^a] always matches newline characters, independent of the set- ting of this option. PCRE_DUPNAMES - If this bit is set, names used to identify capturing subpatterns need + If this bit is set, names used to identify capturing subpatterns need not be unique. This can be helpful for certain types of pattern when it - is known that only one instance of the named subpattern can ever be - matched. There are more details of named subpatterns below; see also + is known that only one instance of the named subpattern can ever be + matched. There are more details of named subpatterns below; see also the pcrepattern documentation. PCRE_EXTENDED - If this bit is set, whitespace data characters in the pattern are - totally ignored except when escaped or inside a character class. White- + If this bit is set, white space data characters in the pattern are + totally ignored except when escaped or inside a character class. White space does not include the VT character (code 11). In addition, charac- ters between an unescaped # outside a character class and the next new- - line, inclusive, are also ignored. This is equivalent to Perl's /x - option, and it can be changed within a pattern by a (?x) option set- + line, inclusive, are also ignored. This is equivalent to Perl's /x + option, and it can be changed within a pattern by a (?x) option set- ting. - Which characters are interpreted as newlines is controlled by the - options passed to pcre_compile() or by a special sequence at the start - of the pattern, as described in the section entitled "Newline conven- + Which characters are interpreted as newlines is controlled by the + options passed to pcre_compile() or by a special sequence at the start + of the pattern, as described in the section entitled "Newline conven- tions" in the pcrepattern documentation. Note that the end of this type - of comment is a literal newline sequence in the pattern; escape + of comment is a literal newline sequence in the pattern; escape sequences that happen to represent a newline do not count. - This option makes it possible to include comments inside complicated - patterns. Note, however, that this applies only to data characters. - Whitespace characters may never appear within special character + This option makes it possible to include comments inside complicated + patterns. Note, however, that this applies only to data characters. + White space characters may never appear within special character sequences in a pattern, for example within the sequence (?( that intro- duces a conditional subpattern. PCRE_EXTRA - This option was invented in order to turn on additional functionality - of PCRE that is incompatible with Perl, but it is currently of very - little use. When set, any backslash in a pattern that is followed by a - letter that has no special meaning causes an error, thus reserving - these combinations for future expansion. By default, as in Perl, a - backslash followed by a letter with no special meaning is treated as a + This option was invented in order to turn on additional functionality + of PCRE that is incompatible with Perl, but it is currently of very + little use. When set, any backslash in a pattern that is followed by a + letter that has no special meaning causes an error, thus reserving + these combinations for future expansion. By default, as in Perl, a + backslash followed by a letter with no special meaning is treated as a literal. (Perl can, however, be persuaded to give an error for this, by - running it with the -w option.) There are at present no other features - controlled by this option. It can also be set by a (?X) option setting + running it with the -w option.) There are at present no other features + controlled by this option. It can also be set by a (?X) option setting within a pattern. PCRE_FIRSTLINE - If this option is set, an unanchored pattern is required to match - before or at the first newline in the subject string, though the + If this option is set, an unanchored pattern is required to match + before or at the first newline in the subject string, though the matched text may continue over the newline. PCRE_JAVASCRIPT_COMPAT If this option is set, PCRE's behaviour is changed in some ways so that - it is compatible with JavaScript rather than Perl. The changes are as + it is compatible with JavaScript rather than Perl. The changes are as follows: - (1) A lone closing square bracket in a pattern causes a compile-time - error, because this is illegal in JavaScript (by default it is treated + (1) A lone closing square bracket in a pattern causes a compile-time + error, because this is illegal in JavaScript (by default it is treated as a data character). Thus, the pattern AB]CD becomes illegal when this option is set. - (2) At run time, a back reference to an unset subpattern group matches - an empty string (by default this causes the current matching alterna- - tive to fail). A pattern such as (\1)(a) succeeds when this option is - set (assuming it can find an "a" in the subject), whereas it fails by + (2) At run time, a back reference to an unset subpattern group matches + an empty string (by default this causes the current matching alterna- + tive to fail). A pattern such as (\1)(a) succeeds when this option is + set (assuming it can find an "a" in the subject), whereas it fails by default, for Perl compatibility. + (3) \U matches an upper case "U" character; by default \U causes a com- + pile time error (Perl uses \U to upper case subsequent characters). + + (4) \u matches a lower case "u" character unless it is followed by four + hexadecimal digits, in which case the hexadecimal number defines the + code point to match. By default, \u causes a compile time error (Perl + uses it to upper case the following character). + + (5) \x matches a lower case "x" character unless it is followed by two + hexadecimal digits, in which case the hexadecimal number defines the + code point to match. By default, as in Perl, a hexadecimal number is + always expected after \x, but it may have zero, one, or two digits (so, + for example, \xz matches a binary zero character followed by z). + PCRE_MULTILINE - By default, PCRE treats the subject string as consisting of a single - line of characters (even if it actually contains newlines). The "start - of line" metacharacter (^) matches only at the start of the string, - while the "end of line" metacharacter ($) matches only at the end of + By default, PCRE treats the subject string as consisting of a single + line of characters (even if it actually contains newlines). The "start + of line" metacharacter (^) matches only at the start of the string, + while the "end of line" metacharacter ($) matches only at the end of the string, or before a terminating newline (unless PCRE_DOLLAR_ENDONLY is set). This is the same as Perl. - When PCRE_MULTILINE it is set, the "start of line" and "end of line" - constructs match immediately following or immediately before internal - newlines in the subject string, respectively, as well as at the very - start and end. This is equivalent to Perl's /m option, and it can be + When PCRE_MULTILINE it is set, the "start of line" and "end of line" + constructs match immediately following or immediately before internal + newlines in the subject string, respectively, as well as at the very + start and end. This is equivalent to Perl's /m option, and it can be changed within a pattern by a (?m) option setting. If there are no new- - lines in a subject string, or no occurrences of ^ or $ in a pattern, + lines in a subject string, or no occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect. PCRE_NEWLINE_CR @@ -1359,32 +1719,32 @@ PCRE_NEWLINE_ANYCRLF PCRE_NEWLINE_ANY - These options override the default newline definition that was chosen - when PCRE was built. Setting the first or the second specifies that a - newline is indicated by a single character (CR or LF, respectively). - Setting PCRE_NEWLINE_CRLF specifies that a newline is indicated by the - two-character CRLF sequence. Setting PCRE_NEWLINE_ANYCRLF specifies + These options override the default newline definition that was chosen + when PCRE was built. Setting the first or the second specifies that a + newline is indicated by a single character (CR or LF, respectively). + Setting PCRE_NEWLINE_CRLF specifies that a newline is indicated by the + two-character CRLF sequence. Setting PCRE_NEWLINE_ANYCRLF specifies that any of the three preceding sequences should be recognized. Setting - PCRE_NEWLINE_ANY specifies that any Unicode newline sequence should be + PCRE_NEWLINE_ANY specifies that any Unicode newline sequence should be recognized. The Unicode newline sequences are the three just mentioned, - plus the single characters VT (vertical tab, U+000B), FF (formfeed, - U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and PS - (paragraph separator, U+2029). The last two are recognized only in - UTF-8 mode. + plus the single characters VT (vertical tab, U+000B), FF (form feed, + U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and PS + (paragraph separator, U+2029). For the 8-bit library, the last two are + recognized only in UTF-8 mode. - The newline setting in the options word uses three bits that are + The newline setting in the options word uses three bits that are treated as a number, giving eight possibilities. Currently only six are - used (default plus the five values above). This means that if you set - more than one newline option, the combination may or may not be sensi- + used (default plus the five values above). This means that if you set + more than one newline option, the combination may or may not be sensi- ble. For example, PCRE_NEWLINE_CR with PCRE_NEWLINE_LF is equivalent to - PCRE_NEWLINE_CRLF, but other combinations may yield unused numbers and + PCRE_NEWLINE_CRLF, but other combinations may yield unused numbers and cause an error. - The only time that a line break in a pattern is specially recognized - when compiling is when PCRE_EXTENDED is set. CR and LF are whitespace - characters, and so are ignored in this mode. Also, an unescaped # out- - side a character class indicates a comment that lasts until after the - next line break sequence. In other circumstances, line break sequences + The only time that a line break in a pattern is specially recognized + when compiling is when PCRE_EXTENDED is set. CR and LF are white space + characters, and so are ignored in this mode. Also, an unescaped # out- + side a character class indicates a comment that lasts until after the + next line break sequence. In other circumstances, line break sequences in patterns are treated as literal data. The newline option that is set at compile time becomes the default that @@ -1393,66 +1753,67 @@ PCRE_NO_AUTO_CAPTURE If this option is set, it disables the use of numbered capturing paren- - theses in the pattern. Any opening parenthesis that is not followed by - ? behaves as if it were followed by ?: but named parentheses can still - be used for capturing (and they acquire numbers in the usual way). + theses in the pattern. Any opening parenthesis that is not followed by + ? behaves as if it were followed by ?: but named parentheses can still + be used for capturing (and they acquire numbers in the usual way). There is no equivalent of this option in Perl. NO_START_OPTIMIZE - This is an option that acts at matching time; that is, it is really an - option for pcre_exec() or pcre_dfa_exec(). If it is set at compile - time, it is remembered with the compiled pattern and assumed at match- - ing time. For details see the discussion of PCRE_NO_START_OPTIMIZE + This is an option that acts at matching time; that is, it is really an + option for pcre_exec() or pcre_dfa_exec(). If it is set at compile + time, it is remembered with the compiled pattern and assumed at match- + ing time. For details see the discussion of PCRE_NO_START_OPTIMIZE below. PCRE_UCP - This option changes the way PCRE processes \B, \b, \D, \d, \S, \s, \W, - \w, and some of the POSIX character classes. By default, only ASCII - characters are recognized, but if PCRE_UCP is set, Unicode properties - are used instead to classify characters. More details are given in the - section on generic character types in the pcrepattern page. If you set - PCRE_UCP, matching one of the items it affects takes much longer. The - option is available only if PCRE has been compiled with Unicode prop- + This option changes the way PCRE processes \B, \b, \D, \d, \S, \s, \W, + \w, and some of the POSIX character classes. By default, only ASCII + characters are recognized, but if PCRE_UCP is set, Unicode properties + are used instead to classify characters. More details are given in the + section on generic character types in the pcrepattern page. If you set + PCRE_UCP, matching one of the items it affects takes much longer. The + option is available only if PCRE has been compiled with Unicode prop- erty support. PCRE_UNGREEDY - This option inverts the "greediness" of the quantifiers so that they - are not greedy by default, but become greedy if followed by "?". It is - not compatible with Perl. It can also be set by a (?U) option setting + This option inverts the "greediness" of the quantifiers so that they + are not greedy by default, but become greedy if followed by "?". It is + not compatible with Perl. It can also be set by a (?U) option setting within the pattern. PCRE_UTF8 - This option causes PCRE to regard both the pattern and the subject as - strings of UTF-8 characters instead of single-byte character strings. - However, it is available only when PCRE is built to include UTF-8 sup- - port. If not, the use of this option provokes an error. Details of how - this option changes the behaviour of PCRE are given in the section on - UTF-8 support in the main pcre page. + This option causes PCRE to regard both the pattern and the subject as + strings of UTF-8 characters instead of single-byte strings. However, it + is available only when PCRE is built to include UTF support. If not, + the use of this option provokes an error. Details of how this option + changes the behaviour of PCRE are given in the pcreunicode page. PCRE_NO_UTF8_CHECK When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is automatically checked. There is a discussion about the validity of - UTF-8 strings in the main pcre page. If an invalid UTF-8 sequence of - bytes is found, pcre_compile() returns an error. If you already know - that your pattern is valid, and you want to skip this check for perfor- - mance reasons, you can set the PCRE_NO_UTF8_CHECK option. When it is - set, the effect of passing an invalid UTF-8 string as a pattern is - undefined. It may cause your program to crash. Note that this option - can also be passed to pcre_exec() and pcre_dfa_exec(), to suppress the - UTF-8 validity checking of subject strings. + UTF-8 strings in the pcreunicode page. If an invalid UTF-8 sequence is + found, pcre_compile() returns an error. If you already know that your + pattern is valid, and you want to skip this check for performance rea- + sons, you can set the PCRE_NO_UTF8_CHECK option. When it is set, the + effect of passing an invalid UTF-8 string as a pattern is undefined. It + may cause your program to crash. Note that this option can also be + passed to pcre_exec() and pcre_dfa_exec(), to suppress the validity + checking of subject strings. COMPILATION ERROR CODES The following table lists the error codes than may be returned by pcre_compile2(), along with the error messages that may be returned by - both compiling functions. As PCRE has developed, some error codes have - fallen out of use. To avoid confusion, they have not been re-used. + both compiling functions. Note that error messages are always 8-bit + ASCII strings, even in 16-bit mode. As PCRE has developed, some error + codes have fallen out of use. To avoid confusion, they have not been + re-used. 0 no error 1 \ at end of pattern @@ -1486,26 +1847,26 @@ 29 (?R or (?[+-]digits must be followed by ) 30 unknown POSIX class name 31 POSIX collating elements are not supported - 32 this version of PCRE is not compiled with PCRE_UTF8 support + 32 this version of PCRE is compiled without UTF support 33 [this code is not in use] 34 character value in \x{...} sequence is too large 35 invalid condition (?(0) 36 \C not allowed in lookbehind assertion - 37 PCRE does not support \L, \l, \N, \U, or \u + 37 PCRE does not support \L, \l, \N{name}, \U, or \u 38 number after (?C is > 255 39 closing ) for (?C expected 40 recursive call could loop indefinitely 41 unrecognized character after (?P 42 syntax error in subpattern name (missing terminator) 43 two named subpatterns have the same name - 44 invalid UTF-8 string + 44 invalid UTF-8 string (specifically UTF-8) 45 support for \P, \p, and \X has not been compiled 46 malformed \P or \p sequence 47 unknown property name after \P or \p 48 subpattern name is too long (maximum 32 characters) 49 too many named subpatterns (maximum 10000) 50 [this code is not in use] - 51 octal value is greater than \377 (not in UTF-8 mode) + 51 octal value is greater than \377 in 8-bit non-UTF-8 mode 52 internal error: overran compiling workspace 53 internal error: previously-checked referenced subpattern not found @@ -1524,7 +1885,17 @@ 65 different names for subpatterns of the same number are not allowed 66 (*MARK) must have an argument - 67 this version of PCRE is not compiled with PCRE_UCP support + 67 this version of PCRE is not compiled with Unicode property + support + 68 \c must be followed by an ASCII character + 69 \k is not followed by a braced, angle-bracketed, or quoted name + 70 internal error: unknown opcode in find_fixedlength() + 71 \N is not supported in a class + 72 too many forward references + 73 disallowed Unicode code point (>= 0xd800 && <= 0xdfff) + 74 invalid UTF-16 string (specifically UTF-16) + 75 name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN) + 76 character value in \u.... sequence is too large The numbers 32 and 10000 in errors 48 and 49 are defaults; different values may be used if the limits were changed when PCRE was built. @@ -1553,8 +1924,26 @@ wants to pass any of the other fields to pcre_exec() or pcre_dfa_exec(), it must set up its own pcre_extra block. - The second argument of pcre_study() contains option bits. At present, - no options are defined, and this argument should always be zero. + The second argument of pcre_study() contains option bits. There are + three options: + + PCRE_STUDY_JIT_COMPILE + PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE + PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE + + If any of these are set, and the just-in-time compiler is available, + the pattern is further compiled into machine code that executes much + faster than the pcre_exec() interpretive matching function. If the + just-in-time compiler is not available, these options are ignored. All + other bits in the options argument must be zero. + + JIT compilation is a heavyweight optimization. It can take some time + for patterns to be analyzed, and for one-off matches and simple pat- + terns the benefit of faster execution might be offset by a much slower + study time. Not all patterns can be optimized by the JIT compiler. For + those that cannot be handled, matching automatically falls back to the + pcre_exec() interpreter. For more details, see the pcrejit documenta- + tion. The third argument for pcre_study() is a pointer for an error message. If studying succeeds (even if no data is returned), the variable it @@ -1563,13 +1952,29 @@ must not try to free it. You should test the error pointer for NULL after calling pcre_study(), to be sure that it has run successfully. - This is a typical call to pcre_study(): + When you are finished with a pattern, you can free the memory used for + the study data by calling pcre_free_study(). This function was added to + the API for release 8.20. For earlier versions, the memory could be + freed with pcre_free(), just like the pattern itself. This will still + work in cases where JIT optimization is not used, but it is advisable + to change to the new function when convenient. - pcre_extra *pe; - pe = pcre_study( + This is a typical way in which pcre_study() is used (except that in a + real application there should be tests for errors): + + int rc; + pcre *re; + pcre_extra *sd; + re = pcre_compile("pattern", 0, &error, &erroroffset, NULL); + sd = pcre_study( re, /* result of pcre_compile() */ - 0, /* no options exist */ + 0, /* no options */ &error); /* set to NULL or points to a message */ + rc = pcre_exec( /* see below for details of pcre_exec() options */ + re, sd, "subject", 7, 0, 0, ovector, 30); + ... + pcre_free_study(sd); + pcre_free(re); Studying a pattern does two things: first, a lower bound for the length of subject string that is needed to match the pattern is computed. This @@ -1582,70 +1987,73 @@ Studying a pattern is also useful for non-anchored patterns that do not have a single fixed starting character. A bitmap of possible starting bytes is created. This speeds up finding a position in the subject at - which to start matching. + which to start matching. (In 16-bit mode, the bitmap is used for 16-bit + values less than 256.) - The two optimizations just described can be disabled by setting the - PCRE_NO_START_OPTIMIZE option when calling pcre_exec() or - pcre_dfa_exec(). You might want to do this if your pattern contains - callouts or (*MARK), and you want to make use of these facilities in - cases where matching fails. See the discussion of PCRE_NO_START_OPTI- - MIZE below. + These two optimizations apply to both pcre_exec() and pcre_dfa_exec(), + and the information is also used by the JIT compiler. The optimiza- + tions can be disabled by setting the PCRE_NO_START_OPTIMIZE option when + calling pcre_exec() or pcre_dfa_exec(), but if this is done, JIT execu- + tion is also disabled. You might want to do this if your pattern con- + tains callouts or (*MARK) and you want to make use of these facilities + in cases where matching fails. See the discussion of + PCRE_NO_START_OPTIMIZE below. LOCALE SUPPORT - PCRE handles caseless matching, and determines whether characters are - letters, digits, or whatever, by reference to a set of tables, indexed - by character value. When running in UTF-8 mode, this applies only to - characters with codes less than 128. By default, higher-valued codes + PCRE handles caseless matching, and determines whether characters are + letters, digits, or whatever, by reference to a set of tables, indexed + by character value. When running in UTF-8 mode, this applies only to + characters with codes less than 128. By default, higher-valued codes never match escapes such as \w or \d, but they can be tested with \p if - PCRE is built with Unicode character property support. Alternatively, - the PCRE_UCP option can be set at compile time; this causes \w and + PCRE is built with Unicode character property support. Alternatively, + the PCRE_UCP option can be set at compile time; this causes \w and friends to use Unicode property support instead of built-in tables. The use of locales with Unicode is discouraged. If you are handling charac- - ters with codes greater than 128, you should either use UTF-8 and Uni- + ters with codes greater than 128, you should either use UTF-8 and Uni- code, or use locales, but not try to mix the two. - PCRE contains an internal set of tables that are used when the final - argument of pcre_compile() is NULL. These are sufficient for many + PCRE contains an internal set of tables that are used when the final + argument of pcre_compile() is NULL. These are sufficient for many applications. Normally, the internal tables recognize only ASCII char- acters. However, when PCRE is built, it is possible to cause the inter- nal tables to be rebuilt in the default "C" locale of the local system, which may cause them to be different. - The internal tables can always be overridden by tables supplied by the + The internal tables can always be overridden by tables supplied by the application that calls PCRE. These may be created in a different locale - from the default. As more and more applications change to using Uni- + from the default. As more and more applications change to using Uni- code, the need for this locale support is expected to die away. - External tables are built by calling the pcre_maketables() function, - which has no arguments, in the relevant locale. The result can then be - passed to pcre_compile() or pcre_exec() as often as necessary. For - example, to build and use tables that are appropriate for the French - locale (where accented characters with values greater than 128 are + External tables are built by calling the pcre_maketables() function, + which has no arguments, in the relevant locale. The result can then be + passed to pcre_compile() or pcre_exec() as often as necessary. For + example, to build and use tables that are appropriate for the French + locale (where accented characters with values greater than 128 are treated as letters), the following code could be used: setlocale(LC_CTYPE, "fr_FR"); tables = pcre_maketables(); re = pcre_compile(..., tables); - The locale name "fr_FR" is used on Linux and other Unix-like systems; + The locale name "fr_FR" is used on Linux and other Unix-like systems; if you are using Windows, the name for the French locale is "french". - When pcre_maketables() runs, the tables are built in memory that is - obtained via pcre_malloc. It is the caller's responsibility to ensure - that the memory containing the tables remains available for as long as + When pcre_maketables() runs, the tables are built in memory that is + obtained via pcre_malloc. It is the caller's responsibility to ensure + that the memory containing the tables remains available for as long as it is needed. The pointer that is passed to pcre_compile() is saved with the compiled - pattern, and the same tables are used via this pointer by pcre_study() + pattern, and the same tables are used via this pointer by pcre_study() and normally also by pcre_exec(). Thus, by default, for any single pat- tern, compilation, studying and matching all happen in the same locale, but different patterns can be compiled in different locales. - It is possible to pass a table pointer or NULL (indicating the use of - the internal tables) to pcre_exec(). Although not intended for this - purpose, this facility could be used to match a pattern in a different + It is possible to pass a table pointer or NULL (indicating the use of + the internal tables) to pcre_exec(). Although not intended for this + purpose, this facility could be used to match a pattern in a different locale from the one in which it was compiled. Passing table pointers at run time is discussed below in the section on matching a pattern. @@ -1655,32 +2063,35 @@ int pcre_fullinfo(const pcre *code, const pcre_extra *extra, int what, void *where); - The pcre_fullinfo() function returns information about a compiled pat- - tern. It replaces the obsolete pcre_info() function, which is neverthe- - less retained for backwards compability (and is documented below). - - The first argument for pcre_fullinfo() is a pointer to the compiled - pattern. The second argument is the result of pcre_study(), or NULL if - the pattern was not studied. The third argument specifies which piece - of information is required, and the fourth argument is a pointer to a - variable to receive the data. The yield of the function is zero for + The pcre_fullinfo() function returns information about a compiled pat- + tern. It replaces the pcre_info() function, which was removed from the + library at version 8.30, after more than 10 years of obsolescence. + + The first argument for pcre_fullinfo() is a pointer to the compiled + pattern. The second argument is the result of pcre_study(), or NULL if + the pattern was not studied. The third argument specifies which piece + of information is required, and the fourth argument is a pointer to a + variable to receive the data. The yield of the function is zero for success, or one of the following negative numbers: - PCRE_ERROR_NULL the argument code was NULL - the argument where was NULL - PCRE_ERROR_BADMAGIC the "magic number" was not found - PCRE_ERROR_BADOPTION the value of what was invalid - - The "magic number" is placed at the start of each compiled pattern as - an simple check against passing an arbitrary memory pointer. Here is a - typical call of pcre_fullinfo(), to obtain the length of the compiled - pattern: + PCRE_ERROR_NULL the argument code was NULL + the argument where was NULL + PCRE_ERROR_BADMAGIC the "magic number" was not found + PCRE_ERROR_BADENDIANNESS the pattern was compiled with different + endianness + PCRE_ERROR_BADOPTION the value of what was invalid + + The "magic number" is placed at the start of each compiled pattern as + an simple check against passing an arbitrary memory pointer. The endi- + anness error can occur if a compiled pattern is saved and reloaded on a + different host. Here is a typical call of pcre_fullinfo(), to obtain + the length of the compiled pattern: int rc; size_t length; rc = pcre_fullinfo( re, /* result of pcre_compile() */ - pe, /* result of pcre_study(), or NULL */ + sd, /* result of pcre_study(), or NULL */ PCRE_INFO_SIZE, /* what is required */ &length); /* where to put the data */ @@ -1708,13 +2119,17 @@ PCRE_INFO_FIRSTBYTE - Return information about the first byte of any matched string, for a - non-anchored pattern. The fourth argument should point to an int vari- - able. (This option used to be called PCRE_INFO_FIRSTCHAR; the old name - is still recognized for backwards compatibility.) + Return information about the first data unit of any matched string, for + a non-anchored pattern. (The name of this option refers to the 8-bit + library, where data units are bytes.) The fourth argument should point + to an int variable. + + If there is a fixed first value, for example, the letter "c" from a + pattern such as (cat|cow|coyote), its value is returned. In the 8-bit + library, the value is always less than 256; in the 16-bit library the + value can be up to 0xffff. - If there is a fixed first byte, for example, from a pattern such as - (cat|cow|coyote), its value is returned. Otherwise, if either + If there is no fixed first value, and if either (a) the pattern was compiled with the PCRE_MULTILINE option, and every branch starts with "^", or @@ -1729,10 +2144,10 @@ PCRE_INFO_FIRSTTABLE If the pattern was studied, and this resulted in the construction of a - 256-bit table indicating a fixed set of bytes for the first byte in any - matching string, a pointer to the table is returned. Otherwise NULL is - returned. The fourth argument should point to an unsigned char * vari- - able. + 256-bit table indicating a fixed set of values for the first data unit + in any matching string, a pointer to the table is returned. Otherwise + NULL is returned. The fourth argument should point to an unsigned char + * variable. PCRE_INFO_HASCRORLF @@ -1747,25 +2162,49 @@ otherwise 0. The fourth argument should point to an int variable. (?J) and (?-J) set and unset the local PCRE_DUPNAMES option, respectively. + PCRE_INFO_JIT + + Return 1 if the pattern was studied with one of the JIT options, and + just-in-time compiling was successful. The fourth argument should point + to an int variable. A return value of 0 means that JIT support is not + available in this version of PCRE, or that the pattern was not studied + with a JIT option, or that the JIT compiler could not handle this par- + ticular pattern. See the pcrejit documentation for details of what can + and cannot be handled. + + PCRE_INFO_JITSIZE + + If the pattern was successfully studied with a JIT option, return the + size of the JIT compiled code, otherwise return zero. The fourth argu- + ment should point to a size_t variable. + PCRE_INFO_LASTLITERAL - Return the value of the rightmost literal byte that must exist in any - matched string, other than at its start, if such a byte has been + Return the value of the rightmost literal data unit that must exist in + any matched string, other than at its start, if such a value has been recorded. The fourth argument should point to an int variable. If there - is no such byte, -1 is returned. For anchored patterns, a last literal - byte is recorded only if it follows something of variable length. For + is no such value, -1 is returned. For anchored patterns, a last literal + value is recorded only if it follows something of variable length. For example, for the pattern /^a\d+z\d+/ the returned value is "z", but for /^a\dz\d/ the returned value is -1. + PCRE_INFO_MAXLOOKBEHIND + + Return the number of characters (NB not bytes) in the longest lookbe- + hind assertion in the pattern. Note that the simple assertions \b and + \B require a one-character lookbehind. This information is useful when + doing multi-segment matching using the partial matching facilities. + PCRE_INFO_MINLENGTH - If the pattern was studied and a minimum length for matching subject - strings was computed, its value is returned. Otherwise the returned - value is -1. The value is a number of characters, not bytes (this may - be relevant in UTF-8 mode). The fourth argument should point to an int - variable. A non-negative value is a lower bound to the length of any - matching string. There may not be any strings of that length that do - actually match, but every string that does match is at least that long. + If the pattern was studied and a minimum length for matching subject + strings was computed, its value is returned. Otherwise the returned + value is -1. The value is a number of characters, which in UTF-8 mode + may be different from the number of bytes. The fourth argument should + point to an int variable. A non-negative value is a lower bound to the + length of any matching string. There may not be any strings of that + length that do actually match, but every string that does match is at + least that long. PCRE_INFO_NAMECOUNT PCRE_INFO_NAMEENTRYSIZE @@ -1785,10 +2224,12 @@ gives the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size of each entry; both of these return an int value. The entry size depends on the length of the longest name. PCRE_INFO_NAMETABLE returns - a pointer to the first entry of the table (a pointer to char). The - first two bytes of each entry are the number of the capturing parenthe- - sis, most significant byte first. The rest of the entry is the corre- - sponding name, zero terminated. + a pointer to the first entry of the table. This is a pointer to char in + the 8-bit library, where the first two bytes of each entry are the num- + ber of the capturing parenthesis, most significant byte first. In the + 16-bit library, the pointer points to 16-bit data units, the first of + which contains the parenthesis number. The rest of the entry is the + corresponding name, zero terminated. The names are in alphabetical order. Duplicate names may appear if (?| is used to create multiple groups with the same number, as described in @@ -1801,8 +2242,8 @@ terns may have lower numbers. As a simple example of the name/number table, consider the following - pattern (assume PCRE_EXTENDED is set, so white space - including new- - lines - is ignored): + pattern after compilation by the 8-bit library (assume PCRE_EXTENDED is + set, so white space - including newlines - is ignored): (? (?(\d\d)?\d\d) - (?\d\d) - (?\d\d) ) @@ -1855,62 +2296,47 @@ PCRE_INFO_SIZE - Return the size of the compiled pattern, that is, the value that was - passed as the argument to pcre_malloc() when PCRE was getting memory in - which to place the compiled data. The fourth argument should point to a - size_t variable. + Return the size of the compiled pattern in bytes (for both libraries). + The fourth argument should point to a size_t variable. This value does + not include the size of the pcre structure that is returned by + pcre_compile(). The value that is passed as the argument to pcre_mal- + loc() when pcre_compile() is getting memory in which to place the com- + piled data is the value returned by this option plus the size of the + pcre structure. Studying a compiled pattern, with or without JIT, does + not alter the value returned by this option. PCRE_INFO_STUDYSIZE - Return the size of the data block pointed to by the study_data field in - a pcre_extra block. That is, it is the value that was passed to - pcre_malloc() when PCRE was getting memory into which to place the data - created by pcre_study(). If pcre_extra is NULL, or there is no study - data, zero is returned. The fourth argument should point to a size_t - variable. - - -OBSOLETE INFO FUNCTION - - int pcre_info(const pcre *code, int *optptr, int *firstcharptr); - - The pcre_info() function is now obsolete because its interface is too - restrictive to return all the available data about a compiled pattern. - New programs should use pcre_fullinfo() instead. The yield of - pcre_info() is the number of capturing subpatterns, or one of the fol- - lowing negative numbers: - - PCRE_ERROR_NULL the argument code was NULL - PCRE_ERROR_BADMAGIC the "magic number" was not found - - If the optptr argument is not NULL, a copy of the options with which - the pattern was compiled is placed in the integer it points to (see - PCRE_INFO_OPTIONS above). - - If the pattern is not anchored and the firstcharptr argument is not - NULL, it is used to pass back information about the first character of - any matched string (see PCRE_INFO_FIRSTBYTE above). + Return the size in bytes of the data block pointed to by the study_data + field in a pcre_extra block. If pcre_extra is NULL, or there is no + study data, zero is returned. The fourth argument should point to a + size_t variable. The study_data field is set by pcre_study() to record + information that will speed up matching (see the section entitled + "Studying a pattern" above). The format of the study_data block is pri- + vate, but its length is made available via this option so that it can + be saved and restored (see the pcreprecompile documentation for + details). REFERENCE COUNTS int pcre_refcount(pcre *code, int adjust); - The pcre_refcount() function is used to maintain a reference count in + The pcre_refcount() function is used to maintain a reference count in the data block that contains a compiled pattern. It is provided for the - benefit of applications that operate in an object-oriented manner, + benefit of applications that operate in an object-oriented manner, where different parts of the application may be using the same compiled pattern, but you want to free the block when they are all done. When a pattern is compiled, the reference count field is initialized to - zero. It is changed only by calling this function, whose action is to - add the adjust value (which may be positive or negative) to it. The + zero. It is changed only by calling this function, whose action is to + add the adjust value (which may be positive or negative) to it. The yield of the function is the new value. However, the value of the count - is constrained to lie between 0 and 65535, inclusive. If the new value + is constrained to lie between 0 and 65535, inclusive. If the new value is outside these limits, it is forced to the appropriate limit value. - Except when it is zero, the reference count is not correctly preserved - if a pattern is compiled on one host and then transferred to a host + Except when it is zero, the reference count is not correctly preserved + if a pattern is compiled on one host and then transferred to a host whose byte-order is different. (This seems a highly unlikely scenario.) @@ -1920,18 +2346,22 @@ const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize); - The function pcre_exec() is called to match a subject string against a - compiled pattern, which is passed in the code argument. If the pattern - was studied, the result of the study should be passed in the extra - argument. This function is the main matching facility of the library, - and it operates in a Perl-like manner. For specialist use there is also - an alternative matching function, which is described below in the sec- - tion about the pcre_dfa_exec() function. + The function pcre_exec() is called to match a subject string against a + compiled pattern, which is passed in the code argument. If the pattern + was studied, the result of the study should be passed in the extra + argument. You can call pcre_exec() with the same code and extra argu- + ments as many times as you like, in order to match different subject + strings with the same pattern. + + This function is the main matching facility of the library, and it + operates in a Perl-like manner. For specialist use there is also an + alternative matching function, which is described below in the section + about the pcre_dfa_exec() function. - In most applications, the pattern will have been compiled (and option- - ally studied) in the same process that calls pcre_exec(). However, it + In most applications, the pattern will have been compiled (and option- + ally studied) in the same process that calls pcre_exec(). However, it is possible to save compiled patterns and study data, and then use them - later in different processes, possibly even on different hosts. For a + later in different processes, possibly even on different hosts. For a discussion about this, see the pcreprecompile documentation. Here is an example of a simple call to pcre_exec(): @@ -1950,35 +2380,40 @@ Extra data for pcre_exec() - If the extra argument is not NULL, it must point to a pcre_extra data - block. The pcre_study() function returns such a block (when it doesn't - return NULL), but you can also create one for yourself, and pass addi- - tional information in it. The pcre_extra block contains the following + If the extra argument is not NULL, it must point to a pcre_extra data + block. The pcre_study() function returns such a block (when it doesn't + return NULL), but you can also create one for yourself, and pass addi- + tional information in it. The pcre_extra block contains the following fields (not necessarily in this order): unsigned long int flags; void *study_data; + void *executable_jit; unsigned long int match_limit; unsigned long int match_limit_recursion; void *callout_data; const unsigned char *tables; unsigned char **mark; - The flags field is a bitmap that specifies which of the other fields - are set. The flag bits are: + In the 16-bit version of this structure, the mark field has type + "PCRE_UCHAR16 **". - PCRE_EXTRA_STUDY_DATA + The flags field is used to specify which of the other fields are set. + The flag bits are: + + PCRE_EXTRA_CALLOUT_DATA + PCRE_EXTRA_EXECUTABLE_JIT + PCRE_EXTRA_MARK PCRE_EXTRA_MATCH_LIMIT PCRE_EXTRA_MATCH_LIMIT_RECURSION - PCRE_EXTRA_CALLOUT_DATA + PCRE_EXTRA_STUDY_DATA PCRE_EXTRA_TABLES - PCRE_EXTRA_MARK - Other flag bits should be set to zero. The study_data field is set in - the pcre_extra block that is returned by pcre_study(), together with - the appropriate flag bit. You should not set this yourself, but you may - add to the block by setting the other fields and their corresponding - flag bits. + Other flag bits should be set to zero. The study_data field and some- + times the executable_jit field are set in the pcre_extra block that is + returned by pcre_study(), together with the appropriate flag bits. You + should not set these yourself, but you may add to the block by setting + other fields and their corresponding flag bits. The match_limit field provides a means of preventing PCRE from using up a vast amount of resources when running patterns that are not going to @@ -1986,70 +2421,86 @@ search trees. The classic example is a pattern that uses nested unlim- ited repeats. - Internally, PCRE uses a function called match() which it calls repeat- - edly (sometimes recursively). The limit set by match_limit is imposed - on the number of times this function is called during a match, which - has the effect of limiting the amount of backtracking that can take - place. For patterns that are not anchored, the count restarts from zero - for each position in the subject string. - - The default value for the limit can be set when PCRE is built; the - default default is 10 million, which handles all but the most extreme - cases. You can override the default by suppling pcre_exec() with a - pcre_extra block in which match_limit is set, and - PCRE_EXTRA_MATCH_LIMIT is set in the flags field. If the limit is + Internally, pcre_exec() uses a function called match(), which it calls + repeatedly (sometimes recursively). The limit set by match_limit is + imposed on the number of times this function is called during a match, + which has the effect of limiting the amount of backtracking that can + take place. For patterns that are not anchored, the count restarts from + zero for each position in the subject string. + + When pcre_exec() is called with a pattern that was successfully studied + with a JIT option, the way that the matching is executed is entirely + different. However, there is still the possibility of runaway matching + that goes on for a very long time, and so the match_limit value is also + used in this case (but in a different way) to limit how long the match- + ing can continue. + + The default value for the limit can be set when PCRE is built; the + default default is 10 million, which handles all but the most extreme + cases. You can override the default by suppling pcre_exec() with a + pcre_extra block in which match_limit is set, and + PCRE_EXTRA_MATCH_LIMIT is set in the flags field. If the limit is exceeded, pcre_exec() returns PCRE_ERROR_MATCHLIMIT. - The match_limit_recursion field is similar to match_limit, but instead + The match_limit_recursion field is similar to match_limit, but instead of limiting the total number of times that match() is called, it limits - the depth of recursion. The recursion depth is a smaller number than - the total number of calls, because not all calls to match() are recur- + the depth of recursion. The recursion depth is a smaller number than + the total number of calls, because not all calls to match() are recur- sive. This limit is of use only if it is set smaller than match_limit. - Limiting the recursion depth limits the amount of stack that can be - used, or, when PCRE has been compiled to use memory on the heap instead - of the stack, the amount of heap memory that can be used. - - The default value for match_limit_recursion can be set when PCRE is - built; the default default is the same value as the default for - match_limit. You can override the default by suppling pcre_exec() with - a pcre_extra block in which match_limit_recursion is set, and - PCRE_EXTRA_MATCH_LIMIT_RECURSION is set in the flags field. If the + Limiting the recursion depth limits the amount of machine stack that + can be used, or, when PCRE has been compiled to use memory on the heap + instead of the stack, the amount of heap memory that can be used. This + limit is not relevant, and is ignored, when matching is done using JIT + compiled code. + + The default value for match_limit_recursion can be set when PCRE is + built; the default default is the same value as the default for + match_limit. You can override the default by suppling pcre_exec() with + a pcre_extra block in which match_limit_recursion is set, and + PCRE_EXTRA_MATCH_LIMIT_RECURSION is set in the flags field. If the limit is exceeded, pcre_exec() returns PCRE_ERROR_RECURSIONLIMIT. - The callout_data field is used in conjunction with the "callout" fea- + The callout_data field is used in conjunction with the "callout" fea- ture, and is described in the pcrecallout documentation. - The tables field is used to pass a character tables pointer to - pcre_exec(); this overrides the value that is stored with the compiled - pattern. A non-NULL value is stored with the compiled pattern only if - custom tables were supplied to pcre_compile() via its tableptr argu- + The tables field is used to pass a character tables pointer to + pcre_exec(); this overrides the value that is stored with the compiled + pattern. A non-NULL value is stored with the compiled pattern only if + custom tables were supplied to pcre_compile() via its tableptr argu- ment. If NULL is passed to pcre_exec() using this mechanism, it forces - PCRE's internal tables to be used. This facility is helpful when re- - using patterns that have been saved after compiling with an external - set of tables, because the external tables might be at a different - address when pcre_exec() is called. See the pcreprecompile documenta- + PCRE's internal tables to be used. This facility is helpful when re- + using patterns that have been saved after compiling with an external + set of tables, because the external tables might be at a different + address when pcre_exec() is called. See the pcreprecompile documenta- tion for a discussion of saving compiled patterns for later use. - If PCRE_EXTRA_MARK is set in the flags field, the mark field must be - set to point to a char * variable. If the pattern contains any back- - tracking control verbs such as (*MARK:NAME), and the execution ends up - with a name to pass back, a pointer to the name string (zero termi- - nated) is placed in the variable pointed to by the mark field. The - names are within the compiled pattern; if you wish to retain such a - name you must copy it before freeing the memory of a compiled pattern. - If there is no name to pass back, the variable pointed to by the mark - field set to NULL. For details of the backtracking control verbs, see - the section entitled "Backtracking control" in the pcrepattern documen- - tation. + If PCRE_EXTRA_MARK is set in the flags field, the mark field must be + set to point to a suitable variable. If the pattern contains any back- + tracking control verbs such as (*MARK:NAME), and the execution ends up + with a name to pass back, a pointer to the name string (zero termi- + nated) is placed in the variable pointed to by the mark field. The + names are within the compiled pattern; if you wish to retain such a + name you must copy it before freeing the memory of a compiled pattern. + If there is no name to pass back, the variable pointed to by the mark + field is set to NULL. For details of the backtracking control verbs, + see the section entitled "Backtracking control" in the pcrepattern doc- + umentation. Option bits for pcre_exec() - The unused bits of the options argument for pcre_exec() must be zero. - The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_xxx, - PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, - PCRE_NO_START_OPTIMIZE, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_SOFT, and - PCRE_PARTIAL_HARD. + The unused bits of the options argument for pcre_exec() must be zero. + The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_xxx, + PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, + PCRE_NO_START_OPTIMIZE, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_HARD, and + PCRE_PARTIAL_SOFT. + + If the pattern was successfully studied with one of the just-in-time + (JIT) compile options, the only supported options for JIT execution are + PCRE_NO_UTF8_CHECK, PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, + PCRE_NOTEMPTY_ATSTART, PCRE_PARTIAL_HARD, and PCRE_PARTIAL_SOFT. If an + unsupported option is used, JIT execution is disabled and the normal + interpretive code in pcre_exec() is run. PCRE_ANCHORED @@ -2172,7 +2623,9 @@ where the result is "no match", the callouts do occur, and that items such as (*COMMIT) and (*MARK) are considered at every possible starting position in the subject string. If PCRE_NO_START_OPTIMIZE is set at - compile time, it cannot be unset at matching time. + compile time, it cannot be unset at matching time. The use of + PCRE_NO_START_OPTIMIZE disables JIT execution; when it is set, matching + is always done using interpretively. Setting PCRE_NO_START_OPTIMIZE can change the outcome of a matching operation. Consider the pattern @@ -2206,182 +2659,201 @@ When PCRE_UTF8 is set at compile time, the validity of the subject as a UTF-8 string is automatically checked when pcre_exec() is subsequently - called. The value of startoffset is also checked to ensure that it - points to the start of a UTF-8 character. There is a discussion about - the validity of UTF-8 strings in the section on UTF-8 support in the - main pcre page. If an invalid UTF-8 sequence of bytes is found, - pcre_exec() returns the error PCRE_ERROR_BADUTF8 or, if PCRE_PAR- - TIAL_HARD is set and the problem is a truncated UTF-8 character at the - end of the subject, PCRE_ERROR_SHORTUTF8. If startoffset contains a - value that does not point to the start of a UTF-8 character (or to the - end of the subject), PCRE_ERROR_BADUTF8_OFFSET is returned. - - If you already know that your subject is valid, and you want to skip - these checks for performance reasons, you can set the - PCRE_NO_UTF8_CHECK option when calling pcre_exec(). You might want to - do this for the second and subsequent calls to pcre_exec() if you are - making repeated calls to find all the matches in a single subject - string. However, you should be sure that the value of startoffset - points to the start of a UTF-8 character (or the end of the subject). - When PCRE_NO_UTF8_CHECK is set, the effect of passing an invalid UTF-8 - string as a subject or an invalid value of startoffset is undefined. - Your program may crash. + called. The entire string is checked before any other processing takes + place. The value of startoffset is also checked to ensure that it + points to the start of a UTF-8 character. There is a discussion about + the validity of UTF-8 strings in the pcreunicode page. If an invalid + sequence of bytes is found, pcre_exec() returns the error + PCRE_ERROR_BADUTF8 or, if PCRE_PARTIAL_HARD is set and the problem is a + truncated character at the end of the subject, PCRE_ERROR_SHORTUTF8. In + both cases, information about the precise nature of the error may also + be returned (see the descriptions of these errors in the section enti- + tled Error return values from pcre_exec() below). If startoffset con- + tains a value that does not point to the start of a UTF-8 character (or + to the end of the subject), PCRE_ERROR_BADUTF8_OFFSET is returned. + + If you already know that your subject is valid, and you want to skip + these checks for performance reasons, you can set the + PCRE_NO_UTF8_CHECK option when calling pcre_exec(). You might want to + do this for the second and subsequent calls to pcre_exec() if you are + making repeated calls to find all the matches in a single subject + string. However, you should be sure that the value of startoffset + points to the start of a character (or the end of the subject). When + PCRE_NO_UTF8_CHECK is set, the effect of passing an invalid string as a + subject or an invalid value of startoffset is undefined. Your program + may crash. PCRE_PARTIAL_HARD PCRE_PARTIAL_SOFT - These options turn on the partial matching feature. For backwards com- - patibility, PCRE_PARTIAL is a synonym for PCRE_PARTIAL_SOFT. A partial - match occurs if the end of the subject string is reached successfully, - but there are not enough subject characters to complete the match. If + These options turn on the partial matching feature. For backwards com- + patibility, PCRE_PARTIAL is a synonym for PCRE_PARTIAL_SOFT. A partial + match occurs if the end of the subject string is reached successfully, + but there are not enough subject characters to complete the match. If this happens when PCRE_PARTIAL_SOFT (but not PCRE_PARTIAL_HARD) is set, - matching continues by testing any remaining alternatives. Only if no - complete match can be found is PCRE_ERROR_PARTIAL returned instead of - PCRE_ERROR_NOMATCH. In other words, PCRE_PARTIAL_SOFT says that the - caller is prepared to handle a partial match, but only if no complete + matching continues by testing any remaining alternatives. Only if no + complete match can be found is PCRE_ERROR_PARTIAL returned instead of + PCRE_ERROR_NOMATCH. In other words, PCRE_PARTIAL_SOFT says that the + caller is prepared to handle a partial match, but only if no complete match can be found. - If PCRE_PARTIAL_HARD is set, it overrides PCRE_PARTIAL_SOFT. In this - case, if a partial match is found, pcre_exec() immediately returns - PCRE_ERROR_PARTIAL, without considering any other alternatives. In - other words, when PCRE_PARTIAL_HARD is set, a partial match is consid- + If PCRE_PARTIAL_HARD is set, it overrides PCRE_PARTIAL_SOFT. In this + case, if a partial match is found, pcre_exec() immediately returns + PCRE_ERROR_PARTIAL, without considering any other alternatives. In + other words, when PCRE_PARTIAL_HARD is set, a partial match is consid- ered to be more important that an alternative complete match. - In both cases, the portion of the string that was inspected when the + In both cases, the portion of the string that was inspected when the partial match was found is set as the first matching string. There is a - more detailed discussion of partial and multi-segment matching, with + more detailed discussion of partial and multi-segment matching, with examples, in the pcrepartial documentation. The string to be matched by pcre_exec() - The subject string is passed to pcre_exec() as a pointer in subject, a - length (in bytes) in length, and a starting byte offset in startoffset. - If this is negative or greater than the length of the subject, - pcre_exec() returns PCRE_ERROR_BADOFFSET. When the starting offset is - zero, the search for a match starts at the beginning of the subject, + The subject string is passed to pcre_exec() as a pointer in subject, a + length in bytes in length, and a starting byte offset in startoffset. + If this is negative or greater than the length of the subject, + pcre_exec() returns PCRE_ERROR_BADOFFSET. 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. In UTF-8 mode, the byte offset - must point to the start of a UTF-8 character (or the end of the sub- - ject). Unlike the pattern string, the subject may contain binary zero + must point to the start of a UTF-8 character (or the end of the sub- + ject). Unlike the pattern string, the subject may contain binary zero bytes. - 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 + 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. - Finding all the matches in a subject is tricky when the pattern can + Finding all the matches in a subject is tricky when the pattern can match an empty string. It is possible to emulate Perl's /g behaviour by - first trying the match again at the same offset, with the - PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED options, and then if that - fails, advancing the starting offset and trying an ordinary match + first trying the match again at the same offset, with the + PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED options, and then if that + fails, advancing the starting offset and trying an ordinary match again. There is some code that demonstrates how to do this in the pcre- demo sample program. In the most general case, you have to check to see - if the newline convention recognizes CRLF as a newline, and if so, and + if the newline convention recognizes CRLF as a newline, and if so, and the current character is CR followed by LF, advance the starting offset by two characters instead of one. - 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 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: + 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 + 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 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 + 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 + 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 + 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, + 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. 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. + function returns a value of zero. If neither the actual string matched + nor any captured substrings are of interest, pcre_exec() may be called + with ovector passed as NULL and ovecsize as zero. However, if the pat- + tern 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 + of reasonable size. + + There are some cases where zero is returned (indicating vector over- + flow) when in fact the vector is exactly the right size for the final + match. For example, consider the pattern + + (a)(?:(b)c|bd) + + If a vector of 6 elements (allowing for only 1 captured substring) is + given with subject string "abd", pcre_exec() will try to set the second + captured string, thereby recording a vector overflow, before failing to + match "c" and backing up to try the second alternative. The zero + return, however, does correctly indicate that the maximum number of + slots (namely 2) have been filled. In similar cases where there is tem- + porary overflow, but the final number of used slots is actually less + than the maximum, a non-zero value is returned. The pcre_fullinfo() function can be used to find out how many capturing - subpatterns there are in a compiled pattern. The smallest size for - ovector that will allow for n captured substrings, in addition to the + subpatterns there are in a compiled pattern. The smallest size for + ovector that will allow for n captured substrings, in addition to the offsets of the substring matched by the whole pattern, is (n+1)*3. - It is possible for capturing subpattern number n+1 to match some part + It is possible for capturing subpattern number n+1 to match some part of the subject when subpattern n has not been used at all. For example, - if the string "abc" is matched against the pattern (a|(z))(bc) the + if the string "abc" is matched against the pattern (a|(z))(bc) the return from the function is 4, and subpatterns 1 and 3 are matched, but - 2 is not. When this happens, both values in the offset pairs corre- + 2 is not. When this happens, both values in the offset pairs corre- sponding to unused subpatterns are set to -1. - Offset values that correspond to unused subpatterns at the end of the - expression are also set to -1. For example, if the string "abc" is - matched against the pattern (abc)(x(yz)?)? subpatterns 2 and 3 are not - matched. The return from the function is 2, because the highest used - capturing subpattern number is 1, and the offsets for for the second - and third capturing subpatterns (assuming the vector is large enough, + Offset values that correspond to unused subpatterns at the end of the + expression are also set to -1. For example, if the string "abc" is + matched against the pattern (abc)(x(yz)?)? subpatterns 2 and 3 are not + matched. The return from the function is 2, because the highest used + capturing subpattern number is 1, and the offsets for for the second + and third capturing subpatterns (assuming the vector is large enough, of course) are set to -1. - Note: Elements of ovector that do not correspond to capturing parenthe- - ses in the pattern are never changed. That is, if a pattern contains n - capturing parentheses, no more than ovector[0] to ovector[2n+1] are set - by pcre_exec(). The other elements retain whatever values they previ- - ously had. + Note: Elements in the first two-thirds of ovector that do not corre- + spond to capturing parentheses in the pattern are never changed. That + is, if a pattern contains n capturing parentheses, no more than ovec- + tor[0] to ovector[2n+1] are set by pcre_exec(). The other elements (in + the first two-thirds) retain whatever values they previously had. - Some convenience functions are provided for extracting the captured + Some convenience functions are provided for extracting the captured substrings as separate strings. These are described below. Error return values from pcre_exec() - If pcre_exec() fails, it returns a negative number. The following are + If pcre_exec() fails, it returns a negative number. The following are defined in the header file: PCRE_ERROR_NOMATCH (-1) @@ -2390,7 +2862,7 @@ PCRE_ERROR_NULL (-2) - Either code or subject was passed as NULL, or ovector was NULL and + Either code or subject was passed as NULL, or ovector was NULL and ovecsize was not zero. PCRE_ERROR_BADOPTION (-3) @@ -2399,76 +2871,82 @@ PCRE_ERROR_BADMAGIC (-4) - PCRE stores a 4-byte "magic number" at the start of the compiled code, + PCRE stores a 4-byte "magic number" at the start of the compiled code, to catch the case when it is passed a junk pointer and to detect when a pattern that was compiled in an environment of one endianness is run in - an environment with the other endianness. This is the error that PCRE + an environment with the other endianness. This is the error that PCRE gives when the magic number is not present. PCRE_ERROR_UNKNOWN_OPCODE (-5) While running the pattern match, an unknown item was encountered in the - compiled pattern. This error could be caused by a bug in PCRE or by + compiled pattern. This error could be caused by a bug in PCRE or by overwriting of the compiled pattern. PCRE_ERROR_NOMEMORY (-6) - If a pattern contains back references, but the ovector that is passed + If a pattern contains back references, but the ovector that is passed to pcre_exec() is not big enough to remember the referenced substrings, - PCRE gets a block of memory at the start of matching to use for this - purpose. If the call via pcre_malloc() fails, this error is given. The + PCRE gets a block of memory at the start of matching to use for this + purpose. If the call via pcre_malloc() fails, this error is given. The memory is automatically freed at the end of matching. - This error is also given if pcre_stack_malloc() fails in pcre_exec(). - This can happen only when PCRE has been compiled with --disable-stack- + This error is also given if pcre_stack_malloc() fails in pcre_exec(). + This can happen only when PCRE has been compiled with --disable-stack- for-recursion. PCRE_ERROR_NOSUBSTRING (-7) - This error is used by the pcre_copy_substring(), pcre_get_substring(), + This error is used by the pcre_copy_substring(), pcre_get_substring(), and pcre_get_substring_list() functions (see below). It is never returned by pcre_exec(). PCRE_ERROR_MATCHLIMIT (-8) - The backtracking limit, as specified by the match_limit field in a - pcre_extra structure (or defaulted) was reached. See the description + The backtracking limit, as specified by the match_limit field in a + pcre_extra structure (or defaulted) was reached. See the description above. PCRE_ERROR_CALLOUT (-9) This error is never generated by pcre_exec() itself. It is provided for - use by callout functions that want to yield a distinctive error code. + use by callout functions that want to yield a distinctive error code. See the pcrecallout documentation for details. PCRE_ERROR_BADUTF8 (-10) - A string that contains an invalid UTF-8 byte sequence was passed as a - subject. However, if PCRE_PARTIAL_HARD is set and the problem is a - truncated UTF-8 character at the end of the subject, PCRE_ERROR_SHORT- - UTF8 is used instead. + A string that contains an invalid UTF-8 byte sequence was passed as a + subject, and the PCRE_NO_UTF8_CHECK option was not set. If the size of + the output vector (ovecsize) is at least 2, the byte offset to the + start of the the invalid UTF-8 character is placed in the first ele- + ment, and a reason code is placed in the second element. The reason + codes are listed in the following section. For backward compatibility, + if PCRE_PARTIAL_HARD is set and the problem is a truncated UTF-8 char- + acter at the end of the subject (reason codes 1 to 5), + PCRE_ERROR_SHORTUTF8 is returned instead of PCRE_ERROR_BADUTF8. PCRE_ERROR_BADUTF8_OFFSET (-11) - The UTF-8 byte sequence that was passed as a subject was valid, but the - value of startoffset did not point to the beginning of a UTF-8 charac- + The UTF-8 byte sequence that was passed as a subject was checked and + found to be valid (the PCRE_NO_UTF8_CHECK option was not set), but the + value of startoffset did not point to the beginning of a UTF-8 charac- ter or the end of the subject. PCRE_ERROR_PARTIAL (-12) - The subject string did not match, but it did match partially. See the + The subject string did not match, but it did match partially. See the pcrepartial documentation for details of partial matching. PCRE_ERROR_BADPARTIAL (-13) - This code is no longer in use. It was formerly returned when the - PCRE_PARTIAL option was used with a compiled pattern containing items - that were not supported for partial matching. From release 8.00 + This code is no longer in use. It was formerly returned when the + PCRE_PARTIAL option was used with a compiled pattern containing items + that were not supported for partial matching. From release 8.00 onwards, there are no restrictions on partial matching. PCRE_ERROR_INTERNAL (-14) - An unexpected internal error has occurred. This error could be caused + An unexpected internal error has occurred. This error could be caused by a bug in PCRE or by overwriting of the compiled pattern. PCRE_ERROR_BADCOUNT (-15) @@ -2478,7 +2956,7 @@ PCRE_ERROR_RECURSIONLIMIT (-21) The internal recursion limit, as specified by the match_limit_recursion - field in a pcre_extra structure (or defaulted) was reached. See the + field in a pcre_extra structure (or defaulted) was reached. See the description above. PCRE_ERROR_BADNEWLINE (-23) @@ -2492,11 +2970,118 @@ PCRE_ERROR_SHORTUTF8 (-25) - The subject string ended with an incomplete (truncated) UTF-8 charac- - ter, and the PCRE_PARTIAL_HARD option was set. Without this option, - PCRE_ERROR_BADUTF8 is returned in this situation. + This error is returned instead of PCRE_ERROR_BADUTF8 when the subject + string ends with a truncated UTF-8 character and the PCRE_PARTIAL_HARD + option is set. Information about the failure is returned as for + PCRE_ERROR_BADUTF8. It is in fact sufficient to detect this case, but + this special error code for PCRE_PARTIAL_HARD precedes the implementa- + tion of returned information; it is retained for backwards compatibil- + ity. + + PCRE_ERROR_RECURSELOOP (-26) + + This error is returned when pcre_exec() detects a recursion loop within + the pattern. Specifically, it means that either the whole pattern or a + subpattern has been called recursively for the second time at the same + position in the subject string. Some simple patterns that might do this + are detected and faulted at compile time, but more complicated cases, + in particular mutual recursions between two different subpatterns, can- + not be detected until run time. + + PCRE_ERROR_JIT_STACKLIMIT (-27) + + This error is returned when a pattern that was successfully studied + using a JIT compile option is being matched, but the memory available + for the just-in-time processing stack is not large enough. See the + pcrejit documentation for more details. + + PCRE_ERROR_BADMODE (-28) + + This error is given if a pattern that was compiled by the 8-bit library + is passed to a 16-bit library function, or vice versa. + + PCRE_ERROR_BADENDIANNESS (-29) + + This error is given if a pattern that was compiled and saved is + reloaded on a host with different endianness. The utility function + pcre_pattern_to_host_byte_order() can be used to convert such a pattern + so that it runs on the new host. + + Error numbers -16 to -20, -22, and -30 are not used by pcre_exec(). + + Reason codes for invalid UTF-8 strings + + This section applies only to the 8-bit library. The corresponding + information for the 16-bit library is given in the pcre16 page. + + When pcre_exec() returns either PCRE_ERROR_BADUTF8 or PCRE_ERROR_SHORT- + UTF8, and the size of the output vector (ovecsize) is at least 2, the + offset of the start of the invalid UTF-8 character is placed in the + first output vector element (ovector[0]) and a reason code is placed in + the second element (ovector[1]). The reason codes are given names in + the pcre.h header file: + + PCRE_UTF8_ERR1 + PCRE_UTF8_ERR2 + PCRE_UTF8_ERR3 + PCRE_UTF8_ERR4 + PCRE_UTF8_ERR5 + + The string ends with a truncated UTF-8 character; the code specifies + how many bytes are missing (1 to 5). Although RFC 3629 restricts UTF-8 + characters to be no longer than 4 bytes, the encoding scheme (origi- + nally defined by RFC 2279) allows for up to 6 bytes, and this is + checked first; hence the possibility of 4 or 5 missing bytes. + + PCRE_UTF8_ERR6 + PCRE_UTF8_ERR7 + PCRE_UTF8_ERR8 + PCRE_UTF8_ERR9 + PCRE_UTF8_ERR10 + + The two most significant bits of the 2nd, 3rd, 4th, 5th, or 6th byte of + the character do not have the binary value 0b10 (that is, either the + most significant bit is 0, or the next bit is 1). + + PCRE_UTF8_ERR11 + PCRE_UTF8_ERR12 + + A character that is valid by the RFC 2279 rules is either 5 or 6 bytes + long; these code points are excluded by RFC 3629. + + PCRE_UTF8_ERR13 + + A 4-byte character has a value greater than 0x10fff; these code points + are excluded by RFC 3629. + + PCRE_UTF8_ERR14 + + A 3-byte character has a value in the range 0xd800 to 0xdfff; this + range of code points are reserved by RFC 3629 for use with UTF-16, and + so are excluded from UTF-8. + + PCRE_UTF8_ERR15 + PCRE_UTF8_ERR16 + PCRE_UTF8_ERR17 + PCRE_UTF8_ERR18 + PCRE_UTF8_ERR19 + + A 2-, 3-, 4-, 5-, or 6-byte character is "overlong", that is, it codes + for a value that can be represented by fewer bytes, which is invalid. + For example, the two bytes 0xc0, 0xae give the value 0x2e, whose cor- + rect coding uses just one byte. + + PCRE_UTF8_ERR20 + + The two most significant bits of the first byte of a character have the + binary value 0b10 (that is, the most significant bit is 1 and the sec- + ond is 0). Such a byte can only validly occur as the second or subse- + quent byte of a multi-byte character. - Error numbers -16 to -20 and -22 are not used by pcre_exec(). + PCRE_UTF8_ERR21 + + The first byte of a character has the value 0xfe or 0xff. These values + can never occur in a valid UTF-8 string. EXTRACTING CAPTURED SUBSTRINGS BY NUMBER @@ -2512,78 +3097,78 @@ int pcre_get_substring_list(const char *subject, int *ovector, int stringcount, const char ***listptr); - Captured substrings can be accessed directly by using the offsets - returned by pcre_exec() in ovector. For convenience, the functions + Captured substrings can be accessed directly by using the offsets + returned by pcre_exec() in ovector. For convenience, the functions pcre_copy_substring(), pcre_get_substring(), and pcre_get_sub- - string_list() are provided for extracting captured substrings as new, - separate, zero-terminated strings. These functions identify substrings - by number. The next section describes functions for extracting named + string_list() are provided for extracting captured substrings as new, + separate, zero-terminated strings. These functions identify substrings + by number. The next section describes functions for extracting named substrings. - A substring that contains a binary zero is correctly extracted and has - a further zero added on the end, but the result is not, of course, a C - string. However, you can process such a string by referring to the - length that is returned by pcre_copy_substring() and pcre_get_sub- + A substring that contains a binary zero is correctly extracted and has + a further zero added on the end, but the result is not, of course, a C + string. However, you can process such a string by referring to the + length that is returned by pcre_copy_substring() and pcre_get_sub- string(). Unfortunately, the interface to pcre_get_substring_list() is - not adequate for handling strings containing binary zeros, because the + not adequate for handling strings containing binary zeros, because the end of the final string is not independently indicated. - The first three arguments are the same for all three of these func- - tions: subject is the subject string that has just been successfully + The first three arguments are the same for all three of these func- + tions: subject is the subject string that has just been successfully matched, ovector is a pointer to the vector of integer offsets that was passed to pcre_exec(), and stringcount is the number of substrings that - were captured by the match, including the substring that matched the + were captured by the match, including the substring that matched the entire regular expression. This is the value returned by pcre_exec() if - it is greater than zero. If pcre_exec() returned zero, indicating that - it ran out of space in ovector, the value passed as stringcount should + it is greater than zero. If pcre_exec() returned zero, indicating that + it ran out of space in ovector, the value passed as stringcount should be the number of elements in the vector divided by three. - The functions pcre_copy_substring() and pcre_get_substring() extract a - single substring, whose number is given as stringnumber. A value of - zero extracts the substring that matched the entire pattern, whereas - higher values extract the captured substrings. For pcre_copy_sub- - string(), the string is placed in buffer, whose length is given by - buffersize, while for pcre_get_substring() a new block of memory is - obtained via pcre_malloc, and its address is returned via stringptr. - The yield of the function is the length of the string, not including + The functions pcre_copy_substring() and pcre_get_substring() extract a + single substring, whose number is given as stringnumber. A value of + zero extracts the substring that matched the entire pattern, whereas + higher values extract the captured substrings. For pcre_copy_sub- + string(), the string is placed in buffer, whose length is given by + buffersize, while for pcre_get_substring() a new block of memory is + obtained via pcre_malloc, and its address is returned via stringptr. + The yield of the function is the length of the string, not including the terminating zero, or one of these error codes: PCRE_ERROR_NOMEMORY (-6) - The buffer was too small for pcre_copy_substring(), or the attempt to + The buffer was too small for pcre_copy_substring(), or the attempt to get memory failed for pcre_get_substring(). PCRE_ERROR_NOSUBSTRING (-7) There is no substring whose number is stringnumber. - The pcre_get_substring_list() function extracts all available sub- - strings and builds a list of pointers to them. All this is done in a + The pcre_get_substring_list() function extracts all available sub- + strings and builds a list of pointers to them. All this is done in a single block of memory that is obtained via pcre_malloc. The address of - the memory block is returned via listptr, which is also the start of - the list of string pointers. The end of the list is marked by a NULL - pointer. The yield of the function is zero if all went well, or the + the memory block is returned via listptr, which is also the start of + the list of string pointers. The end of the list is marked by a NULL + pointer. The yield of the function is zero if all went well, or the error code PCRE_ERROR_NOMEMORY (-6) if the attempt to get the memory block failed. - When any of these functions encounter a substring that is unset, which - can happen when capturing subpattern number n+1 matches some part of - the subject, but subpattern n has not been used at all, they return an + When any of these functions encounter a substring that is unset, which + can happen when capturing subpattern number n+1 matches some part of + the subject, but subpattern n has not been used at all, they return an empty string. This can be distinguished from a genuine zero-length sub- - string by inspecting the appropriate offset in ovector, which is nega- + string by inspecting the appropriate offset in ovector, which is nega- tive for unset substrings. - The two convenience functions pcre_free_substring() and pcre_free_sub- - string_list() can be used to free the memory returned by a previous + The two convenience functions pcre_free_substring() and pcre_free_sub- + string_list() can be used to free the memory returned by a previous call of pcre_get_substring() or pcre_get_substring_list(), respec- - tively. They do nothing more than call the function pointed to by - pcre_free, which of course could be called directly from a C program. - However, PCRE is used in some situations where it is linked via a spe- - cial interface to another programming language that cannot use - pcre_free directly; it is for these cases that the functions are pro- + tively. They do nothing more than call the function pointed to by + pcre_free, which of course could be called directly from a C program. + However, PCRE is used in some situations where it is linked via a spe- + cial interface to another programming language that cannot use + pcre_free directly; it is for these cases that the functions are pro- vided. @@ -2602,7 +3187,7 @@ int stringcount, const char *stringname, const char **stringptr); - To extract a substring by name, you first have to find associated num- + To extract a substring by name, you first have to find associated num- ber. For example, for this pattern (a+)b(?\d+)... @@ -2611,35 +3196,35 @@ be unique (PCRE_DUPNAMES was not set), you can find the number from the name by calling pcre_get_stringnumber(). The first argument is the com- piled pattern, and the second is the name. The yield of the function is - the subpattern number, or PCRE_ERROR_NOSUBSTRING (-7) if there is no + the subpattern number, or PCRE_ERROR_NOSUBSTRING (-7) if there is no subpattern of that name. Given the number, you can extract the substring directly, or use one of the functions described in the previous section. For convenience, there are also two functions that do the whole job. - Most of the arguments of pcre_copy_named_substring() and - pcre_get_named_substring() are the same as those for the similarly - named functions that extract by number. As these are described in the - previous section, they are not re-described here. There are just two + Most of the arguments of pcre_copy_named_substring() and + pcre_get_named_substring() are the same as those for the similarly + named functions that extract by number. As these are described in the + previous section, they are not re-described here. There are just two differences: - First, instead of a substring number, a substring name is given. Sec- + First, instead of a substring number, a substring name is given. Sec- ond, there is an extra argument, given at the start, which is a pointer - to the compiled pattern. This is needed in order to gain access to the + to the compiled pattern. This is needed in order to gain access to the name-to-number translation table. - These functions call pcre_get_stringnumber(), and if it succeeds, they - then call pcre_copy_substring() or pcre_get_substring(), as appropri- - ate. NOTE: If PCRE_DUPNAMES is set and there are duplicate names, the + These functions call pcre_get_stringnumber(), and if it succeeds, they + then call pcre_copy_substring() or pcre_get_substring(), as appropri- + ate. NOTE: If PCRE_DUPNAMES is set and there are duplicate names, the behaviour may not be what you want (see the next section). Warning: If the pattern uses the (?| feature to set up multiple subpat- - terns with the same number, as described in the section on duplicate - subpattern numbers in the pcrepattern page, you cannot use names to - distinguish the different subpatterns, because names are not included - in the compiled code. The matching process uses only numbers. For this - reason, the use of different names for subpatterns of the same number + terns with the same number, as described in the section on duplicate + subpattern numbers in the pcrepattern page, you cannot use names to + distinguish the different subpatterns, because names are not included + in the compiled code. The matching process uses only numbers. For this + reason, the use of different names for subpatterns of the same number causes an error at compile time. @@ -2648,54 +3233,79 @@ int pcre_get_stringtable_entries(const pcre *code, const char *name, char **first, char **last); - When a pattern is compiled with the PCRE_DUPNAMES option, names for - subpatterns are not required to be unique. (Duplicate names are always - allowed for subpatterns with the same number, created by using the (?| - feature. Indeed, if such subpatterns are named, they are required to + When a pattern is compiled with the PCRE_DUPNAMES option, names for + subpatterns are not required to be unique. (Duplicate names are always + allowed for subpatterns with the same number, created by using the (?| + feature. Indeed, if such subpatterns are named, they are required to use the same names.) Normally, patterns with duplicate names are such that in any one match, - only one of the named subpatterns participates. An example is shown in + only one of the named subpatterns participates. An example is shown in the pcrepattern documentation. - When duplicates are present, pcre_copy_named_substring() and - pcre_get_named_substring() return the first substring corresponding to - the given name that is set. If none are set, PCRE_ERROR_NOSUBSTRING - (-7) is returned; no data is returned. The pcre_get_stringnumber() - function returns one of the numbers that are associated with the name, + When duplicates are present, pcre_copy_named_substring() and + pcre_get_named_substring() return the first substring corresponding to + the given name that is set. If none are set, PCRE_ERROR_NOSUBSTRING + (-7) is returned; no data is returned. The pcre_get_stringnumber() + function returns one of the numbers that are associated with the name, but it is not defined which it is. - If you want to get full details of all captured substrings for a given - name, you must use the pcre_get_stringtable_entries() function. The + If you want to get full details of all captured substrings for a given + name, you must use the pcre_get_stringtable_entries() function. The first argument is the compiled pattern, and the second is the name. The - third and fourth are pointers to variables which are updated by the + third and fourth are pointers to variables which are updated by the function. After it has run, they point to the first and last entries in - the name-to-number table for the given name. The function itself - returns the length of each entry, or PCRE_ERROR_NOSUBSTRING (-7) if - there are none. The format of the table is described above in the sec- - tion entitled Information about a pattern. Given all the relevant - entries for the name, you can extract each of their numbers, and hence - the captured data, if any. + the name-to-number table for the given name. The function itself + returns the length of each entry, or PCRE_ERROR_NOSUBSTRING (-7) if + there are none. The format of the table is described above in the sec- + tion entitled Information about a pattern above. Given all the rele- + vant entries for the name, you can extract each of their numbers, and + hence the captured data, if any. FINDING ALL POSSIBLE MATCHES - The traditional matching function uses a similar algorithm to Perl, + The traditional matching function uses a similar algorithm to Perl, which stops when it finds the first match, starting at a given point in - the subject. If you want to find all possible matches, or the longest - possible match, consider using the alternative matching function (see - below) instead. If you cannot use the alternative function, but still - need to find all possible matches, you can kludge it up by making use + the subject. If you want to find all possible matches, or the longest + possible match, consider using the alternative matching function (see + below) instead. If you cannot use the alternative function, but still + need to find all possible matches, you can kludge it up by making use of the callout facility, which is described in the pcrecallout documen- tation. What you have to do is to insert a callout right at the end of the pat- - tern. When your callout function is called, extract and save the cur- - rent matched substring. Then return 1, which forces pcre_exec() to - backtrack and try other alternatives. Ultimately, when it runs out of + tern. When your callout function is called, extract and save the cur- + rent matched substring. Then return 1, which forces pcre_exec() to + backtrack and try other alternatives. Ultimately, when it runs out of matches, pcre_exec() will yield PCRE_ERROR_NOMATCH. +OBTAINING AN ESTIMATE OF STACK USAGE + + Matching certain patterns using pcre_exec() can use a lot of process + stack, which in certain environments can be rather limited in size. + Some users find it helpful to have an estimate of the amount of stack + that is used by pcre_exec(), to help them set recursion limits, as + described in the pcrestack documentation. The estimate that is output + by pcretest when called with the -m and -C options is obtained by call- + ing pcre_exec with the values NULL, NULL, NULL, -999, and -999 for its + first five arguments. + + Normally, if its first argument is NULL, pcre_exec() immediately + returns the negative error code PCRE_ERROR_NULL, but with this special + combination of arguments, it returns instead a negative number whose + absolute value is the approximate stack frame size in bytes. (A nega- + tive number is used so that it is clear that no match has happened.) + The value is approximate because in some cases, recursive calls to + pcre_exec() occur when there are one or two additional variables on the + stack. + + If PCRE has been compiled to use the heap instead of the stack for + recursion, the value returned is the size of each block that is + obtained from the heap. + + MATCHING A PATTERN: THE ALTERNATIVE FUNCTION int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, @@ -2703,26 +3313,26 @@ int options, int *ovector, int ovecsize, int *workspace, int wscount); - The function pcre_dfa_exec() is called to match a subject string - against a compiled pattern, using a matching algorithm that scans the - subject string just once, and does not backtrack. This has different - characteristics to the normal algorithm, and is not compatible with - Perl. Some of the features of PCRE patterns are not supported. Never- - theless, there are times when this kind of matching can be useful. For - a discussion of the two matching algorithms, and a list of features - that pcre_dfa_exec() does not support, see the pcrematching documenta- + The function pcre_dfa_exec() is called to match a subject string + against a compiled pattern, using a matching algorithm that scans the + subject string just once, and does not backtrack. This has different + characteristics to the normal algorithm, and is not compatible with + Perl. Some of the features of PCRE patterns are not supported. Never- + theless, there are times when this kind of matching can be useful. For + a discussion of the two matching algorithms, and a list of features + that pcre_dfa_exec() does not support, see the pcrematching documenta- tion. - The arguments for the pcre_dfa_exec() function are the same as for + The arguments for the pcre_dfa_exec() function are the same as for pcre_exec(), plus two extras. The ovector argument is used in a differ- - ent way, and this is described below. The other common arguments are - used in the same way as for pcre_exec(), so their description is not + ent way, and this is described below. The other common arguments are + used in the same way as for pcre_exec(), so their description is not repeated here. - The two additional arguments provide workspace for the function. The - workspace vector should contain at least 20 elements. It is used for + The two additional arguments provide workspace for the function. The + workspace vector should contain at least 20 elements. It is used for keeping track of multiple paths through the pattern tree. More - workspace will be needed for patterns and subjects where there are a + workspace will be needed for patterns and subjects where there are a lot of potential matches. Here is an example of a simple call to pcre_dfa_exec(): @@ -2744,55 +3354,55 @@ Option bits for pcre_dfa_exec() - The unused bits of the options argument for pcre_dfa_exec() must be - zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEW- + The unused bits of the options argument for pcre_dfa_exec() must be + zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEW- LINE_xxx, PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, - PCRE_NOTEMPTY_ATSTART, PCRE_NO_UTF8_CHECK, PCRE_BSR_ANYCRLF, - PCRE_BSR_UNICODE, PCRE_NO_START_OPTIMIZE, PCRE_PARTIAL_HARD, PCRE_PAR- - TIAL_SOFT, PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. All but the last - four of these are exactly the same as for pcre_exec(), so their + PCRE_NOTEMPTY_ATSTART, PCRE_NO_UTF8_CHECK, PCRE_BSR_ANYCRLF, + PCRE_BSR_UNICODE, PCRE_NO_START_OPTIMIZE, PCRE_PARTIAL_HARD, PCRE_PAR- + TIAL_SOFT, PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. All but the last + four of these are exactly the same as for pcre_exec(), so their description is not repeated here. PCRE_PARTIAL_HARD PCRE_PARTIAL_SOFT - These have the same general effect as they do for pcre_exec(), but the - details are slightly different. When PCRE_PARTIAL_HARD is set for - pcre_dfa_exec(), it returns PCRE_ERROR_PARTIAL if the end of the sub- - ject is reached and there is still at least one matching possibility + These have the same general effect as they do for pcre_exec(), but the + details are slightly different. When PCRE_PARTIAL_HARD is set for + pcre_dfa_exec(), it returns PCRE_ERROR_PARTIAL if the end of the sub- + ject is reached and there is still at least one matching possibility that requires additional characters. This happens even if some complete matches have also been found. When PCRE_PARTIAL_SOFT is set, the return code PCRE_ERROR_NOMATCH is converted into PCRE_ERROR_PARTIAL if the end - of the subject is reached, there have been no complete matches, but - there is still at least one matching possibility. The portion of the - string that was inspected when the longest partial match was found is - set as the first matching string in both cases. There is a more - detailed discussion of partial and multi-segment matching, with exam- + of the subject is reached, there have been no complete matches, but + there is still at least one matching possibility. The portion of the + string that was inspected when the longest partial match was found is + set as the first matching string in both cases. There is a more + detailed discussion of partial and multi-segment matching, with exam- ples, in the pcrepartial documentation. PCRE_DFA_SHORTEST - Setting the PCRE_DFA_SHORTEST option causes the matching algorithm to + Setting the PCRE_DFA_SHORTEST option causes the matching algorithm to stop as soon as it has found one match. Because of the way the alterna- - tive algorithm works, this is necessarily the shortest possible match + tive algorithm works, this is necessarily the shortest possible match at the first possible matching point in the subject string. PCRE_DFA_RESTART When pcre_dfa_exec() returns a partial match, it is possible to call it - again, with additional subject characters, and have it continue with - the same match. The PCRE_DFA_RESTART option requests this action; when - it is set, the workspace and wscount options must reference the same - vector as before because data about the match so far is left in them + again, with additional subject characters, and have it continue with + the same match. The PCRE_DFA_RESTART option requests this action; when + it is set, the workspace and wscount options must reference the same + vector as before because data about the match so far is left in them after a partial match. There is more discussion of this facility in the pcrepartial documentation. Successful returns from pcre_dfa_exec() - When pcre_dfa_exec() succeeds, it may have matched more than one sub- + When pcre_dfa_exec() succeeds, it may have matched more than one sub- string in the subject. Note, however, that all the matches from one run - of the function start at the same point in the subject. The shorter - matches are all initial substrings of the longer matches. For example, + of the function start at the same point in the subject. The shorter + matches are all initial substrings of the longer matches. For example, if the pattern <.*> @@ -2807,19 +3417,20 @@ - On success, the yield of the function is a number greater than zero, - which is the number of matched substrings. The substrings themselves - are returned in ovector. Each string uses two elements; the first is - the offset to the start, and the second is the offset to the end. In - fact, all the strings have the same start offset. (Space could have - been saved by giving this only once, but it was decided to retain some - compatibility with the way pcre_exec() returns data, even though the + On success, the yield of the function is a number greater than zero, + which is the number of matched substrings. The substrings themselves + are returned in ovector. Each string uses two elements; the first is + the offset to the start, and the second is the offset to the end. In + fact, all the strings have the same start offset. (Space could have + been saved by giving this only once, but it was decided to retain some + compatibility with the way pcre_exec() returns data, even though the meaning of the strings is different.) The strings are returned in reverse order of length; that is, the long- - est matching string is given first. If there were too many matches to - fit into ovector, the yield of the function is zero, and the vector is - filled with the longest matches. + est matching string is given first. If there were too many matches to + fit into ovector, the yield of the function is zero, and the vector is + filled with the longest matches. Unlike pcre_exec(), pcre_dfa_exec() + can use the entire ovector for returning matched strings. Error returns from pcre_dfa_exec() @@ -2843,26 +3454,35 @@ PCRE_ERROR_DFA_UMLIMIT (-18) This return is given if pcre_dfa_exec() is called with an extra block - that contains a setting of the match_limit field. This is not supported - (it is meaningless). + that contains a setting of the match_limit or match_limit_recursion + fields. This is not supported (these fields are meaningless for DFA + matching). PCRE_ERROR_DFA_WSSIZE (-19) - This return is given if pcre_dfa_exec() runs out of space in the + This return is given if pcre_dfa_exec() runs out of space in the workspace vector. PCRE_ERROR_DFA_RECURSE (-20) - When a recursive subpattern is processed, the matching function calls - itself recursively, using private vectors for ovector and workspace. - This error is given if the output vector is not large enough. This + When a recursive subpattern is processed, the matching function calls + itself recursively, using private vectors for ovector and workspace. + This error is given if the output vector is not large enough. This should be extremely rare, as a vector of size 1000 is used. + PCRE_ERROR_DFA_BADRESTART (-30) + + When pcre_dfa_exec() is called with the PCRE_DFA_RESTART option, some + plausibility checks are made on the contents of the workspace, which + should contain data about the previous partial match. If any of these + checks fail, this error is given. + SEE ALSO - pcrebuild(3), pcrecallout(3), pcrecpp(3)(3), pcrematching(3), pcrepar- - tial(3), pcreposix(3), pcreprecompile(3), pcresample(3), pcrestack(3). + pcre16(3), pcrebuild(3), pcrecallout(3), pcrecpp(3)(3), pcrematch- + ing(3), pcrepartial(3), pcreposix(3), pcreprecompile(3), pcresample(3), + pcrestack(3). AUTHOR @@ -2874,8 +3494,8 @@ REVISION - Last updated: 21 November 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 17 June 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ @@ -2890,24 +3510,27 @@ int (*pcre_callout)(pcre_callout_block *); + int (*pcre16_callout)(pcre16_callout_block *); + PCRE provides a feature called "callout", which is a means of temporar- ily passing control to the caller of PCRE in the middle of pattern matching. The caller of PCRE provides an external function by putting - its entry point in the global variable pcre_callout. By default, this - variable contains NULL, which disables all calling out. - - Within a regular expression, (?C) indicates the points at which the - external function is to be called. Different callout points can be - identified by putting a number less than 256 after the letter C. The - default value is zero. For example, this pattern has two callout + its entry point in the global variable pcre_callout (pcre16_callout for + the 16-bit library). By default, this variable contains NULL, which + disables all calling out. + + Within a regular expression, (?C) indicates the points at which the + external function is to be called. Different callout points can be + identified by putting a number less than 256 after the letter C. The + default value is zero. For example, this pattern has two callout points: (?C1)abc(?C2)def - If the PCRE_AUTO_CALLOUT option bit is set when pcre_compile() or - pcre_compile2() is called, PCRE automatically inserts callouts, all - with number 255, before each item in the pattern. For example, if - PCRE_AUTO_CALLOUT is used with the pattern + If the PCRE_AUTO_CALLOUT option bit is set when a pattern is compiled, + PCRE automatically inserts callouts, all with number 255, before each + item in the pattern. For example, if PCRE_AUTO_CALLOUT is used with the + pattern A(\d{2}|--) @@ -2915,62 +3538,68 @@ (?C255)A(?C255)((?C255)\d{2}(?C255)|(?C255)-(?C255)-(?C255))(?C255) - Notice that there is a callout before and after each parenthesis and - alternation bar. Automatic callouts can be used for tracking the - progress of pattern matching. The pcretest command has an option that - sets automatic callouts; when it is used, the output indicates how the - pattern is matched. This is useful information when you are trying to + Notice that there is a callout before and after each parenthesis and + alternation bar. Automatic callouts can be used for tracking the + progress of pattern matching. The pcretest command has an option that + sets automatic callouts; when it is used, the output indicates how the + pattern is matched. This is useful information when you are trying to optimize the performance of a particular pattern. + The use of callouts in a pattern makes it ineligible for optimization + by the just-in-time compiler. Studying such a pattern with the + PCRE_STUDY_JIT_COMPILE option always fails. + MISSING CALLOUTS - You should be aware that, because of optimizations in the way PCRE - matches patterns by default, callouts sometimes do not happen. For + You should be aware that, because of optimizations in the way PCRE + matches patterns by default, callouts sometimes do not happen. For example, if the pattern is ab(?C4)cd PCRE knows that any matching string must contain the letter "d". If the - subject string is "abyz", the lack of "d" means that matching doesn't - ever start, and the callout is never reached. However, with "abyd", + subject string is "abyz", the lack of "d" means that matching doesn't + ever start, and the callout is never reached. However, with "abyd", though the result is still no match, the callout is obeyed. - If the pattern is studied, PCRE knows the minimum length of a matching - string, and will immediately give a "no match" return without actually - running a match if the subject is not long enough, or, for unanchored + If the pattern is studied, PCRE knows the minimum length of a matching + string, and will immediately give a "no match" return without actually + running a match if the subject is not long enough, or, for unanchored patterns, if it has been scanned far enough. - You can disable these optimizations by passing the PCRE_NO_START_OPTI- - MIZE option to pcre_compile(), pcre_exec(), or pcre_dfa_exec(), or by - starting the pattern with (*NO_START_OPT). This slows down the matching - process, but does ensure that callouts such as the example above are - obeyed. + You can disable these optimizations by passing the PCRE_NO_START_OPTI- + MIZE option to the matching function, or by starting the pattern with + (*NO_START_OPT). This slows down the matching process, but does ensure + that callouts such as the example above are obeyed. THE CALLOUT INTERFACE During matching, when PCRE reaches a callout point, the external func- - tion defined by pcre_callout is called (if it is set). This applies to - both the pcre_exec() and the pcre_dfa_exec() matching functions. The - only argument to the callout function is a pointer to a pcre_callout - block. This structure contains the following fields: - - int version; - int callout_number; - int *offset_vector; - const char *subject; - int subject_length; - int start_match; - int current_position; - int capture_top; - int capture_last; - void *callout_data; - int pattern_position; - int next_item_length; + tion defined by pcre_callout or pcre16_callout is called (if it is + set). This applies to both normal and DFA matching. The only argument + to the callout function is a pointer to a pcre_callout or pcre16_call- + out block. These structures contains the following fields: + + int version; + int callout_number; + int *offset_vector; + const char *subject; (8-bit version) + PCRE_SPTR16 subject; (16-bit version) + int subject_length; + int start_match; + int current_position; + int capture_top; + int capture_last; + void *callout_data; + int pattern_position; + int next_item_length; + const unsigned char *mark; (8-bit version) + const PCRE_UCHAR16 *mark; (16-bit version) The version field is an integer containing the version number of the - block format. The initial version was 0; the current version is 1. The + block format. The initial version was 0; the current version is 2. The version number will change again in future if additional fields are added, but the intention is never to remove any of the existing fields. @@ -2979,14 +3608,14 @@ outs, and 255 for automatically generated callouts). The offset_vector field is a pointer to the vector of offsets that was - passed by the caller to pcre_exec() or pcre_dfa_exec(). When - pcre_exec() is used, the contents can be inspected in order to extract - substrings that have been matched so far, in the same way as for - extracting substrings after a match has completed. For pcre_dfa_exec() - this field is not useful. + passed by the caller to the matching function. When pcre_exec() or + pcre16_exec() is used, the contents can be inspected, in order to + extract substrings that have been matched so far, in the same way as + for extracting substrings after a match has completed. For the DFA + matching functions, this field is not useful. The subject and subject_length fields contain copies of the values that - were passed to pcre_exec(). + were passed to the matching function. The start_match field normally contains the offset within the subject at which the current match attempt started. However, if the escape @@ -2998,38 +3627,46 @@ The current_position field contains the offset within the subject of the current match pointer. - When the pcre_exec() function is used, the capture_top field contains - one more than the number of the highest numbered captured substring so - far. If no substrings have been captured, the value of capture_top is - one. This is always the case when pcre_dfa_exec() is used, because it - does not support captured substrings. + When the pcre_exec() or pcre16_exec() is used, the capture_top field + contains one more than the number of the highest numbered captured sub- + string so far. If no substrings have been captured, the value of cap- + ture_top is one. This is always the case when the DFA functions are + used, because they do not support captured substrings. The capture_last field contains the number of the most recently cap- tured substring. If no substrings have been captured, its value is -1. - This is always the case when pcre_dfa_exec() is used. + This is always the case for the DFA matching functions. - The callout_data field contains a value that is passed to pcre_exec() - or pcre_dfa_exec() specifically so that it can be passed back in call- - outs. It is passed in the pcre_callout field of the pcre_extra data + The callout_data field contains a value that is passed to a matching + function specifically so that it can be passed back in callouts. It is + passed in the callout_data field of a pcre_extra or pcre16_extra data structure. If no such data was passed, the value of callout_data in a - pcre_callout block is NULL. There is a description of the pcre_extra - structure in the pcreapi documentation. + callout block is NULL. There is a description of the pcre_extra struc- + ture in the pcreapi documentation. - The pattern_position field is present from version 1 of the pcre_call- - out structure. It contains the offset to the next item to be matched in - the pattern string. - - The next_item_length field is present from version 1 of the pcre_call- - out structure. It contains the length of the next item to be matched in - the pattern string. When the callout immediately precedes an alterna- - tion bar, a closing parenthesis, or the end of the pattern, the length - is zero. When the callout precedes an opening parenthesis, the length - is that of the entire subpattern. + The pattern_position field is present from version 1 of the callout + structure. It contains the offset to the next item to be matched in the + pattern string. + + The next_item_length field is present from version 1 of the callout + structure. It contains the length of the next item to be matched in the + pattern string. When the callout immediately precedes an alternation + bar, a closing parenthesis, or the end of the pattern, the length is + zero. When the callout precedes an opening parenthesis, the length is + that of the entire subpattern. The pattern_position and next_item_length fields are intended to help in distinguishing between different automatic callouts, which all have the same callout number. However, they are set for all callouts. + The mark field is present from version 2 of the callout structure. In + callouts from pcre_exec() or pcre16_exec() it contains a pointer to the + zero-terminated name of the most recently passed (*MARK), (*PRUNE), or + (*THEN) item in the match, or NULL if no such items have been passed. + Instances of (*PRUNE) or (*THEN) without a name do not obliterate a + previous (*MARK). In callouts from the DFA matching functions this + field always contains NULL. + RETURN VALUES @@ -3037,8 +3674,8 @@ is zero, matching proceeds as normal. If the value is greater than zero, matching fails at the current point, but the testing of other matching possibilities goes ahead, just as if a lookahead assertion had - failed. If the value is less than zero, the match is abandoned, and - pcre_exec() or pcre_dfa_exec() returns the negative value. + failed. If the value is less than zero, the match is abandoned, the + matching function returns the negative value. Negative values should normally be chosen from the set of PCRE_ERROR_xxx values. In particular, PCRE_ERROR_NOMATCH forces a stan- @@ -3056,8 +3693,8 @@ REVISION - Last updated: 21 November 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 08 Janurary 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ @@ -3074,43 +3711,53 @@ handle regular expressions. The differences described here are with respect to Perl versions 5.10 and above. - 1. PCRE has only a subset of Perl's UTF-8 and Unicode support. Details - of what it does have are given in the section on UTF-8 support in the - main pcre page. - - 2. PCRE does not allow repeat quantifiers on lookahead assertions. Perl - permits them, but they do not mean what you might think. For example, - (?!a){3} does not assert that the next three characters are not "a". It - just asserts that the next character is not "a" three times. - - 3. Capturing subpatterns that occur inside negative lookahead asser- - tions are counted, but their entries in the offsets vector are never - set. Perl sets its numerical variables from any such patterns that are + 1. PCRE has only a subset of Perl's Unicode support. Details of what it + does have are given in the pcreunicode page. + + 2. PCRE allows repeat quantifiers only on parenthesized assertions, but + they do not mean what you might think. For example, (?!a){3} does not + assert that the next three characters are not "a". It just asserts that + the next character is not "a" three times (in principle: PCRE optimizes + this to run the assertion just once). Perl allows repeat quantifiers on + other assertions such as \b, but these do not seem to have any use. + + 3. Capturing subpatterns that occur inside negative lookahead asser- + tions are counted, but their entries in the offsets vector are never + set. Perl sets its numerical variables from any such patterns that are matched before the assertion fails to match something (thereby succeed- - ing), but only if the negative lookahead assertion contains just one + ing), but only if the negative lookahead assertion contains just one branch. - 4. Though binary zero characters are supported in the subject string, + 4. Though binary zero characters are supported in the subject string, they are not allowed in a pattern string because it is passed as a nor- mal C string, terminated by zero. The escape sequence \0 can be used in the pattern to represent a binary zero. - 5. The following Perl escape sequences are not supported: \l, \u, \L, - \U, and \N. In fact these are implemented by Perl's general string-han- - dling and are not part of its pattern matching engine. If any of these - are encountered by PCRE, an error is generated. - - 6. The Perl escape sequences \p, \P, and \X are supported only if PCRE - is built with Unicode character property support. The properties that - can be tested with \p and \P are limited to the general category prop- - erties such as Lu and Nd, script names such as Greek or Han, and the - derived properties Any and L&. PCRE does support the Cs (surrogate) - property, which Perl does not; the Perl documentation says "Because + 5. The following Perl escape sequences are not supported: \l, \u, \L, + \U, and \N when followed by a character name or Unicode value. (\N on + its own, matching a non-newline character, is supported.) In fact these + are implemented by Perl's general string-handling and are not part of + its pattern matching engine. If any of these are encountered by PCRE, + an error is generated by default. However, if the PCRE_JAVASCRIPT_COM- + PAT option is set, \U and \u are interpreted as JavaScript interprets + them. + + 6. The Perl escape sequences \p, \P, and \X are supported only if PCRE + is built with Unicode character property support. The properties that + can be tested with \p and \P are limited to the general category prop- + erties such as Lu and Nd, script names such as Greek or Han, and the + derived properties Any and L&. PCRE does support the Cs (surrogate) + property, which Perl does not; the Perl documentation says "Because Perl hides the need for the user to understand the internal representa- - tion of Unicode characters, there is no need to implement the somewhat + tion of Unicode characters, there is no need to implement the somewhat messy concept of surrogates." - 7. PCRE does support the \Q...\E escape for quoting substrings. Charac- + 7. PCRE implements a simpler version of \X than Perl, which changed to + make \X match what Unicode calls an "extended grapheme cluster". This + is more complicated than an extended Unicode sequence, which is what + PCRE matches. + + 8. PCRE does support the \Q...\E escape for quoting substrings. Charac- ters in between are treated as literals. This is slightly different from Perl in that $ and @ are also handled as literals inside the quotes. In Perl, they cause variable interpolation (but of course PCRE @@ -3126,55 +3773,70 @@ The \Q...\E sequence is recognized both inside and outside character classes. - 8. Fairly obviously, PCRE does not support the (?{code}) and (??{code}) + 9. Fairly obviously, PCRE does not support the (?{code}) and (??{code}) constructions. However, there is support for recursive patterns. This is not available in Perl 5.8, but it is in Perl 5.10. Also, the PCRE "callout" feature allows an external function to be called during pat- tern matching. See the pcrecallout documentation for details. - 9. Subpatterns that are called recursively or as "subroutines" are - always treated as atomic groups in PCRE. This is like Python, but - unlike Perl. There is a discussion of an example that explains this in - more detail in the section on recursion differences from Perl in the - pcrepattern page. - - 10. There are some differences that are concerned with the settings of - captured strings when part of a pattern is repeated. For example, - matching "aba" against the pattern /^(a(b)?)+$/ in Perl leaves $2 + 10. Subpatterns that are called as subroutines (whether or not recur- + sively) are always treated as atomic groups in PCRE. This is like + Python, but unlike Perl. Captured values that are set outside a sub- + routine call can be reference from inside in PCRE, but not in Perl. + There is a discussion that explains these differences in more detail in + the section on recursion differences from Perl in the pcrepattern page. + + 11. If any of the backtracking control verbs are used in an assertion + or in a subpattern that is called as a subroutine (whether or not + recursively), their effect is confined to that subpattern; it does not + extend to the surrounding pattern. This is not always the case in Perl. + In particular, if (*THEN) is present in a group that is called as a + subroutine, its action is limited to that group, even if the group does + not contain any | characters. There is one exception to this: the name + from a *(MARK), (*PRUNE), or (*THEN) that is encountered in a success- + ful positive assertion is passed back when a match succeeds (compare + capturing parentheses in assertions). Note that such subpatterns are + processed as anchored at the point where they are tested. + + 12. There are some differences that are concerned with the settings of + captured strings when part of a pattern is repeated. For example, + matching "aba" against the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE it is set to "b". - 11. PCRE's handling of duplicate subpattern numbers and duplicate sub- + 13. PCRE's handling of duplicate subpattern numbers and duplicate sub- pattern names is not as general as Perl's. This is a consequence of the fact the PCRE works internally just with numbers, using an external ta- - ble to translate between numbers and names. In particular, a pattern - such as (?|(?A)|(?A)|(?\r\n|\n|\x0b|\f|\r|\x85) This is an example of an "atomic group", details of which are given below. This particular group matches either the two-character sequence CR followed by LF, or one of the single characters LF (linefeed, - U+000A), VT (vertical tab, U+000B), FF (formfeed, U+000C), CR (carriage - return, U+000D), or NEL (next line, U+0085). The two-character sequence - is treated as a single unit that cannot be split. + U+000A), VT (vertical tab, U+000B), FF (form feed, U+000C), CR (car- + riage return, U+000D), or NEL (next line, U+0085). The two-character + sequence is treated as a single unit that cannot be split. - In UTF-8 mode, two additional characters whose codepoints are greater + In other modes, two additional characters whose codepoints are greater than 255 are added: LS (line separator, U+2028) and PS (paragraph sepa- rator, U+2029). Unicode character property support is not needed for these characters to be recognized. @@ -3656,28 +4357,28 @@ (*BSR_ANYCRLF) CR, LF, or CRLF only (*BSR_UNICODE) any Unicode newline sequence - These override the default and the options given to pcre_compile() or - pcre_compile2(), but they can be overridden by options given to - pcre_exec() or pcre_dfa_exec(). Note that these special settings, which - are not Perl-compatible, are recognized only at the very start of a - pattern, and that they must be in upper case. If more than one of them - is present, the last one is used. They can be combined with a change of + These override the default and the options given to the compiling func- + tion, but they can themselves be overridden by options given to a + matching function. Note that these special settings, which are not + Perl-compatible, are recognized only at the very start of a pattern, + and that they must be in upper case. If more than one of them is + present, the last one is used. They can be combined with a change of newline convention; for example, a pattern can start with: (*ANY)(*BSR_ANYCRLF) - They can also be combined with the (*UTF8) or (*UCP) special sequences. - Inside a character class, \R is treated as an unrecognized escape - sequence, and so matches the letter "R" by default, but causes an error - if PCRE_EXTRA is set. + They can also be combined with the (*UTF8), (*UTF16), or (*UCP) special + sequences. Inside a character class, \R is treated as an unrecognized + escape sequence, and so matches the letter "R" by default, but causes + an error if PCRE_EXTRA is set. Unicode character properties When PCRE is built with Unicode character property support, three addi- tional escape sequences that match characters with specific properties - are available. When not in UTF-8 mode, these sequences are of course - limited to testing characters whose codepoints are less than 256, but - they do work in this mode. The extra escape sequences are: + are available. When in 8-bit non-UTF-8 mode, these sequences are of + course limited to testing characters whose codepoints are less than + 256, but they do work in this mode. The extra escape sequences are: \p{xx} a character with the xx property \P{xx} a character without the xx property @@ -3700,20 +4401,22 @@ Those that are not part of an identified script are lumped together as "Common". The current list of scripts is: - Arabic, Armenian, Avestan, Balinese, Bamum, Bengali, Bopomofo, Braille, - Buginese, Buhid, Canadian_Aboriginal, Carian, Cham, Cherokee, Common, - Coptic, Cuneiform, Cypriot, Cyrillic, Deseret, Devanagari, Egyp- - tian_Hieroglyphs, Ethiopic, Georgian, Glagolitic, Gothic, Greek, - Gujarati, Gurmukhi, Han, Hangul, Hanunoo, Hebrew, Hiragana, Impe- - rial_Aramaic, Inherited, Inscriptional_Pahlavi, Inscriptional_Parthian, - Javanese, Kaithi, Kannada, Katakana, Kayah_Li, Kharoshthi, Khmer, Lao, - Latin, Lepcha, Limbu, Linear_B, Lisu, Lycian, Lydian, Malayalam, - Meetei_Mayek, Mongolian, Myanmar, New_Tai_Lue, Nko, Ogham, Old_Italic, - Old_Persian, Old_South_Arabian, Old_Turkic, Ol_Chiki, Oriya, Osmanya, - Phags_Pa, Phoenician, Rejang, Runic, Samaritan, Saurashtra, Shavian, - Sinhala, Sundanese, Syloti_Nagri, Syriac, Tagalog, Tagbanwa, Tai_Le, - Tai_Tham, Tai_Viet, Tamil, Telugu, Thaana, Thai, Tibetan, Tifinagh, - Ugaritic, Vai, Yi. + Arabic, Armenian, Avestan, Balinese, Bamum, Batak, Bengali, Bopomofo, + Brahmi, Braille, Buginese, Buhid, Canadian_Aboriginal, Carian, Chakma, + Cham, Cherokee, Common, Coptic, Cuneiform, Cypriot, Cyrillic, Deseret, + Devanagari, Egyptian_Hieroglyphs, Ethiopic, Georgian, Glagolitic, + Gothic, Greek, Gujarati, Gurmukhi, Han, Hangul, Hanunoo, Hebrew, Hira- + gana, Imperial_Aramaic, Inherited, Inscriptional_Pahlavi, Inscrip- + tional_Parthian, Javanese, Kaithi, Kannada, Katakana, Kayah_Li, + Kharoshthi, Khmer, Lao, Latin, Lepcha, Limbu, Linear_B, Lisu, Lycian, + Lydian, Malayalam, Mandaic, Meetei_Mayek, Meroitic_Cursive, + Meroitic_Hieroglyphs, Miao, Mongolian, Myanmar, New_Tai_Lue, Nko, + Ogham, Old_Italic, Old_Persian, Old_South_Arabian, Old_Turkic, + Ol_Chiki, Oriya, Osmanya, Phags_Pa, Phoenician, Rejang, Runic, Samari- + tan, Saurashtra, Sharada, Shavian, Sinhala, Sora_Sompeng, Sundanese, + Syloti_Nagri, Syriac, Tagalog, Tagbanwa, Tai_Le, Tai_Tham, Tai_Viet, + Takri, Tamil, Telugu, Thaana, Thai, Tibetan, Tifinagh, Ugaritic, Vai, + Yi. Each character has exactly one Unicode general category property, spec- ified by a two-letter abbreviation. For compatibility with Perl, nega- @@ -3780,45 +4483,50 @@ classified as a modifier or "other". The Cs (Surrogate) property applies only to characters in the range - U+D800 to U+DFFF. Such characters are not valid in UTF-8 strings (see - RFC 3629) and so cannot be tested by PCRE, unless UTF-8 validity check- - ing has been turned off (see the discussion of PCRE_NO_UTF8_CHECK in - the pcreapi page). Perl does not support the Cs property. + U+D800 to U+DFFF. Such characters are not valid in Unicode strings and + so cannot be tested by PCRE, unless UTF validity checking has been + turned off (see the discussion of PCRE_NO_UTF8_CHECK and + PCRE_NO_UTF16_CHECK in the pcreapi page). Perl does not support the Cs + property. - The long synonyms for property names that Perl supports (such as - \p{Letter}) are not supported by PCRE, nor is it permitted to prefix + The long synonyms for property names that Perl supports (such as + \p{Letter}) are not supported by PCRE, nor is it permitted to prefix any of these properties with "Is". No character that is in the Unicode table has the Cn (unassigned) prop- erty. Instead, this property is assumed for any code point that is not in the Unicode table. - Specifying caseless matching does not affect these escape sequences. + Specifying caseless matching does not affect these escape sequences. For example, \p{Lu} always matches only upper case letters. - The \X escape matches any number of Unicode characters that form an + The \X escape matches any number of Unicode characters that form an extended Unicode sequence. \X is equivalent to (?>\PM\pM*) - That is, it matches a character without the "mark" property, followed - by zero or more characters with the "mark" property, and treats the - sequence as an atomic group (see below). Characters with the "mark" - property are typically accents that affect the preceding character. - None of them have codepoints less than 256, so in non-UTF-8 mode \X - matches any one character. + That is, it matches a character without the "mark" property, followed + by zero or more characters with the "mark" property, and treats the + sequence as an atomic group (see below). Characters with the "mark" + property are typically accents that affect the preceding character. + None of them have codepoints less than 256, so in 8-bit non-UTF-8 mode + \X matches any one character. + + Note that recent versions of Perl have changed \X to match what Unicode + calls an "extended grapheme cluster", which has a more complicated def- + inition. - Matching characters by Unicode property is not fast, because PCRE has - to search a structure that contains data for over fifteen thousand + Matching characters by Unicode property is not fast, because PCRE has + to search a structure that contains data for over fifteen thousand characters. That is why the traditional escape sequences such as \d and - \w do not use Unicode properties in PCRE by default, though you can - make them do so by setting the PCRE_UCP option for pcre_compile() or by - starting the pattern with (*UCP). + \w do not use Unicode properties in PCRE by default, though you can + make them do so by setting the PCRE_UCP option or by starting the pat- + tern with (*UCP). PCRE's additional properties - As well as the standard Unicode properties described in the previous - section, PCRE supports four more that make it possible to convert tra- + As well as the standard Unicode properties described in the previous + section, PCRE supports four more that make it possible to convert tra- ditional escape sequences such as \w and \s and POSIX character classes to use Unicode properties. PCRE uses these non-standard, non-Perl prop- erties internally when PCRE_UCP is set. They are: @@ -3828,40 +4536,40 @@ Xsp Any Perl space character Xwd Any Perl "word" character - Xan matches characters that have either the L (letter) or the N (num- - ber) property. Xps matches the characters tab, linefeed, vertical tab, - formfeed, or carriage return, and any other character that has the Z + Xan matches characters that have either the L (letter) or the N (num- + ber) property. Xps matches the characters tab, linefeed, vertical tab, + form feed, or carriage return, and any other character that has the Z (separator) property. Xsp is the same as Xps, except that vertical tab is excluded. Xwd matches the same characters as Xan, plus underscore. Resetting the match start - The escape sequence \K causes any previously matched characters not to + The escape sequence \K causes any previously matched characters not to be included in the final matched sequence. For example, the pattern: foo\Kbar - matches "foobar", but reports that it has matched "bar". This feature - is similar to a lookbehind assertion (described below). However, in - this case, the part of the subject before the real match does not have - to be of fixed length, as lookbehind assertions do. The use of \K does - not interfere with the setting of captured substrings. For example, + matches "foobar", but reports that it has matched "bar". This feature + is similar to a lookbehind assertion (described below). However, in + this case, the part of the subject before the real match does not have + to be of fixed length, as lookbehind assertions do. The use of \K does + not interfere with the setting of captured substrings. For example, when the pattern (foo)\Kbar matches "foobar", the first substring is still set to "foo". - Perl documents that the use of \K within assertions is "not well - defined". In PCRE, \K is acted upon when it occurs inside positive + Perl documents that the use of \K within assertions is "not well + defined". In PCRE, \K is acted upon when it occurs inside positive assertions, but is ignored in negative assertions. Simple assertions - The final use of backslash is for certain simple assertions. An asser- - tion specifies a condition that has to be met at a particular point in - a match, without consuming any characters from the subject string. The - use of subpatterns for more complicated assertions is described below. + The final use of backslash is for certain simple assertions. An asser- + tion specifies a condition that has to be met at a particular point in + a match, without consuming any characters from the subject string. The + use of subpatterns for more complicated assertions is described below. The backslashed assertions are: \b matches at a word boundary @@ -3872,49 +4580,49 @@ \z matches only at the end of the subject \G matches at the first matching position in the subject - Inside a character class, \b has a different meaning; it matches the - backspace character. If any other of these assertions appears in a - character class, by default it matches the corresponding literal char- + Inside a character class, \b has a different meaning; it matches the + backspace character. If any other of these assertions appears in a + character class, by default it matches the corresponding literal char- acter (for example, \B matches the letter B). However, if the - PCRE_EXTRA option is set, an "invalid escape sequence" error is gener- + PCRE_EXTRA option is set, an "invalid escape sequence" error is gener- ated instead. - A word boundary is a position in the subject string where the current - character and the previous character do not both match \w or \W (i.e. - one matches \w and the other matches \W), or the start or end of the - string if the first or last character matches \w, respectively. In - UTF-8 mode, the meanings of \w and \W can be changed by setting the - PCRE_UCP option. When this is done, it also affects \b and \B. Neither - PCRE nor Perl has a separate "start of word" or "end of word" metase- - quence. However, whatever follows \b normally determines which it is. + A word boundary is a position in the subject string where the current + character and the previous character do not both match \w or \W (i.e. + one matches \w and the other matches \W), or the start or end of the + string if the first or last character matches \w, respectively. In a + UTF mode, the meanings of \w and \W can be changed by setting the + PCRE_UCP option. When this is done, it also affects \b and \B. Neither + PCRE nor Perl has a separate "start of word" or "end of word" metase- + quence. However, whatever follows \b normally determines which it is. For example, the fragment \ba matches "a" at the start of a word. - The \A, \Z, and \z assertions differ from the traditional circumflex + The \A, \Z, and \z assertions differ from the traditional circumflex and dollar (described in the next section) in that they only ever match - at the very start and end of the subject string, whatever options are - set. Thus, they are independent of multiline mode. These three asser- + at the very start and end of the subject string, whatever options are + set. Thus, they are independent of multiline mode. These three asser- tions are not affected by the PCRE_NOTBOL or PCRE_NOTEOL options, which - affect only the behaviour of the circumflex and dollar metacharacters. - However, if the startoffset argument of pcre_exec() is non-zero, indi- + affect only the behaviour of the circumflex and dollar metacharacters. + However, if the startoffset argument of pcre_exec() is non-zero, indi- cating that matching is to start at a point other than the beginning of - the subject, \A can never match. The difference between \Z and \z is + the subject, \A can never match. The difference between \Z and \z is that \Z matches before a newline at the end of the string as well as at the very end, whereas \z matches only at the end. - The \G assertion is true only when the current matching position is at - the start point of the match, as specified by the startoffset argument - of pcre_exec(). It differs from \A when the value of startoffset is - non-zero. By calling pcre_exec() multiple times with appropriate argu- + The \G assertion is true only when the current matching position is at + the start point of the match, as specified by the startoffset argument + of pcre_exec(). It differs from \A when the value of startoffset is + non-zero. By calling pcre_exec() multiple times with appropriate argu- ments, you can mimic Perl's /g option, and it is in this kind of imple- mentation where \G can be useful. - Note, however, that PCRE's interpretation of \G, as the start of the + Note, however, that PCRE's interpretation of \G, as the start of the current match, is subtly different from Perl's, which defines it as the - end of the previous match. In Perl, these can be different when the - previously matched string was empty. Because PCRE does just one match + end of the previous match. In Perl, these can be different when the + previously matched string was empty. Because PCRE does just one match at a time, it cannot reproduce this behaviour. - If all the alternatives of a pattern begin with \G, the expression is + If all the alternatives of a pattern begin with \G, the expression is anchored to the starting match position, and the "anchored" flag is set in the compiled regular expression. @@ -3922,60 +4630,59 @@ CIRCUMFLEX AND DOLLAR Outside a character class, in the default matching mode, the circumflex - character is an assertion that is true only if the current matching - point is at the start of the subject string. If the startoffset argu- - ment of pcre_exec() is non-zero, circumflex can never match if the - PCRE_MULTILINE option is unset. Inside a character class, circumflex + character is an assertion that is true only if the current matching + point is at the start of the subject string. If the startoffset argu- + ment of pcre_exec() is non-zero, circumflex can never match if the + PCRE_MULTILINE option is unset. Inside a character class, circumflex has an entirely different meaning (see below). - Circumflex need not be the first character of the pattern if a number - of alternatives are involved, but it should be the first thing in each - alternative in which it appears if the pattern is ever to match that - branch. If all possible alternatives start with a circumflex, that is, - if the pattern is constrained to match only at the start of the sub- - ject, it is said to be an "anchored" pattern. (There are also other + Circumflex need not be the first character of the pattern if a number + of alternatives are involved, but it should be the first thing in each + alternative in which it appears if the pattern is ever to match that + branch. If all possible alternatives start with a circumflex, that is, + if the pattern is constrained to match only at the start of the sub- + ject, it is said to be an "anchored" pattern. (There are also other constructs that can cause a pattern to be anchored.) - A dollar character is an assertion that is true only if the current - matching point is at the end of the subject string, or immediately + A dollar character is an assertion that is true only if the current + matching point is at the end of the subject string, or immediately before a newline at the end of the string (by default). Dollar need not - be the last character of the pattern if a number of alternatives are - involved, but it should be the last item in any branch in which it + be the last character of the pattern if a number of alternatives are + involved, but it should be the last item in any branch in which it appears. Dollar has no special meaning in a character class. - The meaning of dollar can be changed so that it matches only at the - very end of the string, by setting the PCRE_DOLLAR_ENDONLY option at + The meaning of dollar can be changed so that it matches only at the + very end of the string, by setting the PCRE_DOLLAR_ENDONLY option at compile time. This does not affect the \Z assertion. The meanings of the circumflex and dollar characters are changed if the - PCRE_MULTILINE option is set. When this is the case, a circumflex - matches immediately after internal newlines as well as at the start of - the subject string. It does not match after a newline that ends the - string. A dollar matches before any newlines in the string, as well as - at the very end, when PCRE_MULTILINE is set. When newline is specified - as the two-character sequence CRLF, isolated CR and LF characters do + PCRE_MULTILINE option is set. When this is the case, a circumflex + matches immediately after internal newlines as well as at the start of + the subject string. It does not match after a newline that ends the + string. A dollar matches before any newlines in the string, as well as + at the very end, when PCRE_MULTILINE is set. When newline is specified + as the two-character sequence CRLF, isolated CR and LF characters do not indicate newlines. - For example, the pattern /^abc$/ matches the subject string "def\nabc" - (where \n represents a newline) in multiline mode, but not otherwise. - Consequently, patterns that are anchored in single line mode because - all branches start with ^ are not anchored in multiline mode, and a - match for circumflex is possible when the startoffset argument of - pcre_exec() is non-zero. The PCRE_DOLLAR_ENDONLY option is ignored if + For example, the pattern /^abc$/ matches the subject string "def\nabc" + (where \n represents a newline) in multiline mode, but not otherwise. + Consequently, patterns that are anchored in single line mode because + all branches start with ^ are not anchored in multiline mode, and a + match for circumflex is possible when the startoffset argument of + pcre_exec() is non-zero. The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. - Note that the sequences \A, \Z, and \z can be used to match the start - and end of the subject in both modes, and if all branches of a pattern - start with \A it is always anchored, whether or not PCRE_MULTILINE is + Note that the sequences \A, \Z, and \z can be used to match the start + and end of the subject in both modes, and if all branches of a pattern + start with \A it is always anchored, whether or not PCRE_MULTILINE is set. FULL STOP (PERIOD, DOT) AND \N Outside a character class, a dot in the pattern matches any one charac- - ter in the subject string except (by default) a character that signi- - fies the end of a line. In UTF-8 mode, the matched character may be - more than one byte long. + ter in the subject string except (by default) a character that signi- + fies the end of a line. When a line ending is defined as a single character, dot never matches that character; when the two-character sequence CRLF is used, dot does @@ -3995,23 +4702,47 @@ The escape sequence \N behaves like a dot, except that it is not affected by the PCRE_DOTALL option. In other words, it matches any - character except one that signifies the end of a line. + character except one that signifies the end of a line. Perl also uses + \N to match characters by name; PCRE does not support this. -MATCHING A SINGLE BYTE +MATCHING A SINGLE DATA UNIT - Outside a character class, the escape sequence \C matches any one byte, - both in and out of UTF-8 mode. Unlike a dot, it always matches any - line-ending characters. The feature is provided in Perl in order to - match individual bytes in UTF-8 mode. Because it breaks up UTF-8 char- - acters into individual bytes, the rest of the string may start with a - malformed UTF-8 character. For this reason, the \C escape sequence is - best avoided. + Outside a character class, the escape sequence \C matches any one data + unit, whether or not a UTF mode is set. In the 8-bit library, one data + unit is one byte; in the 16-bit library it is a 16-bit unit. Unlike a + dot, \C always matches line-ending characters. The feature is provided + in Perl in order to match individual bytes in UTF-8 mode, but it is + unclear how it can usefully be used. Because \C breaks up characters + into individual data units, matching one unit with \C in a UTF mode + means that the rest of the string may start with a malformed UTF char- + acter. This has undefined results, because PCRE assumes that it is + dealing with valid UTF strings (and by default it checks this at the + start of processing unless the PCRE_NO_UTF8_CHECK or + PCRE_NO_UTF16_CHECK option is used). PCRE does not allow \C to appear in lookbehind assertions (described - below), because in UTF-8 mode this would make it impossible to calcu- + below) in a UTF mode, because this would make it impossible to calcu- late the length of the lookbehind. + In general, the \C escape sequence is best avoided. However, one way of + using it that avoids the problem of malformed UTF characters is to use + a lookahead to check the length of the next character, as in this pat- + tern, which could be used with a UTF-8 string (ignore white space and + line breaks): + + (?| (?=[\x00-\x7f])(\C) | + (?=[\x80-\x{7ff}])(\C)(\C) | + (?=[\x{800}-\x{ffff}])(\C)(\C)(\C) | + (?=[\x{10000}-\x{1fffff}])(\C)(\C)(\C)(\C)) + + A group that starts with (?| resets the capturing parentheses numbers + in each alternative (see "Duplicate Subpattern Numbers" below). The + assertions at the start of each branch check the next UTF-8 character + for values whose encoding uses 1, 2, 3, or 4 bytes, respectively. The + character's individual bytes are then captured by the appropriate num- + ber of groups. + SQUARE BRACKETS AND CHARACTER CLASSES @@ -4019,109 +4750,109 @@ closing square bracket. A closing square bracket on its own is not spe- cial by default. However, if the PCRE_JAVASCRIPT_COMPAT option is set, a lone closing square bracket causes a compile-time error. If a closing - square bracket is required as a member of the class, it should be the - first data character in the class (after an initial circumflex, if + square bracket is required as a member of the class, it should be the + first data character in the class (after an initial circumflex, if present) or escaped with a backslash. - A character class matches a single character in the subject. In UTF-8 - mode, the character may be more than one byte long. A matched character - must be in the set of characters defined by the class, unless the first - character in the class definition is a circumflex, in which case the - subject character must not be in the set defined by the class. If a - circumflex is actually required as a member of the class, ensure it is - not the first character, or escape it with a backslash. + A character class matches a single character in the subject. In a UTF + mode, the character may be more than one data unit long. A matched + character must be in the set of characters defined by the class, unless + the first character in the class definition is a circumflex, in which + case the subject character must not be in the set defined by the class. + If a circumflex is actually required as a member of the class, ensure + it is not the first character, or escape it with a backslash. - For example, the character class [aeiou] matches any lower case vowel, - while [^aeiou] matches any character that is not a lower case vowel. + For example, the character class [aeiou] matches any lower case vowel, + while [^aeiou] matches any character that is not a lower case vowel. Note that a circumflex is just a convenient notation for specifying the - characters that are in the class by enumerating those that are not. A - class that starts with a circumflex is not an assertion; it still con- - sumes a character from the subject string, and therefore it fails if + characters that are in the class by enumerating those that are not. A + class that starts with a circumflex is not an assertion; it still con- + sumes a character from the subject string, and therefore it fails if the current pointer is at the end of the string. - In UTF-8 mode, characters with values greater than 255 can be included - in a class as a literal string of bytes, or by using the \x{ escaping - mechanism. - - When caseless matching is set, any letters in a class represent both - their upper case and lower case versions, so for example, a caseless - [aeiou] matches "A" as well as "a", and a caseless [^aeiou] does not - match "A", whereas a caseful version would. In UTF-8 mode, PCRE always - understands the concept of case for characters whose values are less - than 128, so caseless matching is always possible. For characters with - higher values, the concept of case is supported if PCRE is compiled - with Unicode property support, but not otherwise. If you want to use - caseless matching in UTF8-mode for characters 128 and above, you must - ensure that PCRE is compiled with Unicode property support as well as - with UTF-8 support. - - Characters that might indicate line breaks are never treated in any - special way when matching character classes, whatever line-ending - sequence is in use, and whatever setting of the PCRE_DOTALL and + In UTF-8 (UTF-16) mode, characters with values greater than 255 + (0xffff) can be included in a class as a literal string of data units, + or by using the \x{ escaping mechanism. + + When caseless matching is set, any letters in a class represent both + their upper case and lower case versions, so for example, a caseless + [aeiou] matches "A" as well as "a", and a caseless [^aeiou] does not + match "A", whereas a caseful version would. In a UTF mode, PCRE always + understands the concept of case for characters whose values are less + than 128, so caseless matching is always possible. For characters with + higher values, the concept of case is supported if PCRE is compiled + with Unicode property support, but not otherwise. If you want to use + caseless matching in a UTF mode for characters 128 and above, you must + ensure that PCRE is compiled with Unicode property support as well as + with UTF support. + + Characters that might indicate line breaks are never treated in any + special way when matching character classes, whatever line-ending + sequence is in use, and whatever setting of the PCRE_DOTALL and PCRE_MULTILINE options is used. A class such as [^a] always matches one of these characters. - The minus (hyphen) character can be used to specify a range of charac- - ters in a character class. For example, [d-m] matches any letter - between d and m, inclusive. If a minus character is required in a - class, it must be escaped with a backslash or appear in a position - where it cannot be interpreted as indicating a range, typically as the + The minus (hyphen) character can be used to specify a range of charac- + ters in a character class. For example, [d-m] matches any letter + between d and m, inclusive. If a minus character is required in a + class, it must be escaped with a backslash or appear in a position + where it cannot be interpreted as indicating a range, typically as the first or last character in the class. It is not possible to have the literal character "]" as the end charac- - ter of a range. A pattern such as [W-]46] is interpreted as a class of - two characters ("W" and "-") followed by a literal string "46]", so it - would match "W46]" or "-46]". However, if the "]" is escaped with a - backslash it is interpreted as the end of range, so [W-\]46] is inter- - preted as a class containing a range followed by two other characters. - The octal or hexadecimal representation of "]" can also be used to end + ter of a range. A pattern such as [W-]46] is interpreted as a class of + two characters ("W" and "-") followed by a literal string "46]", so it + would match "W46]" or "-46]". However, if the "]" is escaped with a + backslash it is interpreted as the end of range, so [W-\]46] is inter- + preted as a class containing a range followed by two other characters. + The octal or hexadecimal representation of "]" can also be used to end a range. - Ranges operate in the collating sequence of character values. They can - also be used for characters specified numerically, for example - [\000-\037]. In UTF-8 mode, ranges can include characters whose values - are greater than 255, for example [\x{100}-\x{2ff}]. + Ranges operate in the collating sequence of character values. They can + also be used for characters specified numerically, for example + [\000-\037]. Ranges can include any characters that are valid for the + current mode. If a range that includes letters is used when caseless matching is set, it matches the letters in either case. For example, [W-c] is equivalent - to [][\\^_`wxyzabc], matched caselessly, and in non-UTF-8 mode, if - character tables for a French locale are in use, [\xc8-\xcb] matches - accented E characters in both cases. In UTF-8 mode, PCRE supports the - concept of case for characters with values greater than 128 only when + to [][\\^_`wxyzabc], matched caselessly, and in a non-UTF mode, if + character tables for a French locale are in use, [\xc8-\xcb] matches + accented E characters in both cases. In UTF modes, PCRE supports the + concept of case for characters with values greater than 128 only when it is compiled with Unicode property support. - The character escape sequences \d, \D, \h, \H, \p, \P, \s, \S, \v, \V, + The character escape sequences \d, \D, \h, \H, \p, \P, \s, \S, \v, \V, \w, and \W may appear in a character class, and add the characters that - they match to the class. For example, [\dABCDEF] matches any hexadeci- - mal digit. In UTF-8 mode, the PCRE_UCP option affects the meanings of - \d, \s, \w and their upper case partners, just as it does when they - appear outside a character class, as described in the section entitled + they match to the class. For example, [\dABCDEF] matches any hexadeci- + mal digit. In UTF modes, the PCRE_UCP option affects the meanings of + \d, \s, \w and their upper case partners, just as it does when they + appear outside a character class, as described in the section entitled "Generic character types" above. The escape sequence \b has a different - meaning inside a character class; it matches the backspace character. - The sequences \B, \N, \R, and \X are not special inside a character - class. Like any other unrecognized escape sequences, they are treated - as the literal characters "B", "N", "R", and "X" by default, but cause + meaning inside a character class; it matches the backspace character. + The sequences \B, \N, \R, and \X are not special inside a character + class. Like any other unrecognized escape sequences, they are treated + as the literal characters "B", "N", "R", and "X" by default, but cause an error if the PCRE_EXTRA option is set. - A circumflex can conveniently be used with the upper case character - types to specify a more restricted set of characters than the matching - lower case type. For example, the class [^\W_] matches any letter or + A circumflex can conveniently be used with the upper case character + types to specify a more restricted set of characters than the matching + lower case type. For example, the class [^\W_] matches any letter or digit, but not underscore, whereas [\w] includes underscore. A positive character class should be read as "something OR something OR ..." and a negative class as "NOT something AND NOT something AND NOT ...". - The only metacharacters that are recognized in character classes are - backslash, hyphen (only where it can be interpreted as specifying a - range), circumflex (only at the start), opening square bracket (only - when it can be interpreted as introducing a POSIX class name - see the - next section), and the terminating closing square bracket. However, + The only metacharacters that are recognized in character classes are + backslash, hyphen (only where it can be interpreted as specifying a + range), circumflex (only at the start), opening square bracket (only + when it can be interpreted as introducing a POSIX class name - see the + next section), and the terminating closing square bracket. However, escaping other non-alphanumeric characters does no harm. POSIX CHARACTER CLASSES Perl supports the POSIX notation for character classes. This uses names - enclosed by [: and :] within the enclosing square brackets. PCRE also + enclosed by [: and :] within the enclosing square brackets. PCRE also supports this notation. For example, [01[:alpha:]%] @@ -4144,24 +4875,24 @@ word "word" characters (same as \w) xdigit hexadecimal digits - The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), - and space (32). Notice that this list includes the VT character (code + The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), + and space (32). Notice that this list includes the VT character (code 11). This makes "space" different to \s, which does not include VT (for Perl compatibility). - The name "word" is a Perl extension, and "blank" is a GNU extension - from Perl 5.8. Another Perl extension is negation, which is indicated + The name "word" is a Perl extension, and "blank" is a GNU extension + from Perl 5.8. Another Perl extension is negation, which is indicated by a ^ character after the colon. For example, [12[:^digit:]] - matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the + matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the POSIX syntax [.ch.] and [=ch=] where "ch" is a "collating element", but these are not supported, and an error is given if they are encountered. - By default, in UTF-8 mode, characters with values greater than 128 do - not match any of the POSIX character classes. However, if the PCRE_UCP - option is passed to pcre_compile(), some of the classes are changed so + By default, in UTF modes, characters with values greater than 128 do + not match any of the POSIX character classes. However, if the PCRE_UCP + option is passed to pcre_compile(), some of the classes are changed so that Unicode character properties are used. This is achieved by replac- ing the POSIX classes by other sequences, as follows: @@ -4174,31 +4905,31 @@ [:upper:] becomes \p{Lu} [:word:] becomes \p{Xwd} - Negated versions, such as [:^alpha:] use \P instead of \p. The other + Negated versions, such as [:^alpha:] use \P instead of \p. The other POSIX classes are unchanged, and match only characters with code points less than 128. VERTICAL BAR - Vertical bar characters are used to separate alternative patterns. For + Vertical bar characters are used to separate alternative patterns. For example, the pattern gilbert|sullivan - matches either "gilbert" or "sullivan". Any number of alternatives may - appear, and an empty alternative is permitted (matching the empty + matches either "gilbert" or "sullivan". Any number of alternatives may + appear, and an empty alternative is permitted (matching the empty string). The matching process tries each alternative in turn, from left - to right, and the first one that succeeds is used. If the alternatives - are within a subpattern (defined below), "succeeds" means matching the + to right, and the first one that succeeds is used. If the alternatives + are within a subpattern (defined below), "succeeds" means matching the rest of the main pattern as well as the alternative in the subpattern. INTERNAL OPTION SETTING - The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and - PCRE_EXTENDED options (which are Perl-compatible) can be changed from - within the pattern by a sequence of Perl option letters enclosed + The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and + PCRE_EXTENDED options (which are Perl-compatible) can be changed from + within the pattern by a sequence of Perl option letters enclosed between "(?" and ")". The option letters are i for PCRE_CASELESS @@ -4208,48 +4939,49 @@ For example, (?im) sets caseless, multiline matching. It is also possi- ble to unset these options by preceding the letter with a hyphen, and a - combined setting and unsetting such as (?im-sx), which sets PCRE_CASE- - LESS and PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, - is also permitted. If a letter appears both before and after the + combined setting and unsetting such as (?im-sx), which sets PCRE_CASE- + LESS and PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, + is also permitted. If a letter appears both before and after the hyphen, the option is unset. - The PCRE-specific options PCRE_DUPNAMES, PCRE_UNGREEDY, and PCRE_EXTRA - can be changed in the same way as the Perl-compatible options by using + The PCRE-specific options PCRE_DUPNAMES, PCRE_UNGREEDY, and PCRE_EXTRA + can be changed in the same way as the Perl-compatible options by using the characters J, U and X respectively. - When one of these option changes occurs at top level (that is, not - inside subpattern parentheses), the change applies to the remainder of + When one of these option changes occurs at top level (that is, not + inside subpattern parentheses), the change applies to the remainder of the pattern that follows. If the change is placed right at the start of a pattern, PCRE extracts it into the global options (and it will there- fore show up in data extracted by the pcre_fullinfo() function). - An option change within a subpattern (see below for a description of - subpatterns) affects only that part of the subpattern that follows it, + An option change within a subpattern (see below for a description of + subpatterns) affects only that part of the subpattern that follows it, so (a(?i)b)c matches abc and aBc and no other strings (assuming PCRE_CASELESS is not - used). By this means, options can be made to have different settings - in different parts of the pattern. Any changes made in one alternative - do carry on into subsequent branches within the same subpattern. For + used). By this means, options can be made to have different settings + in different parts of the pattern. Any changes made in one alternative + do carry on into subsequent branches within the same subpattern. For example, (a(?i)b|c) - matches "ab", "aB", "c", and "C", even though when matching "C" the - first branch is abandoned before the option setting. This is because - the effects of option settings happen at compile time. There would be + matches "ab", "aB", "c", and "C", even though when matching "C" the + first branch is abandoned before the option setting. This is because + the effects of option settings happen at compile time. There would be some very weird behaviour otherwise. - Note: There are other PCRE-specific options that can be set by the - application when the compile or match functions are called. In some - cases the pattern can contain special leading sequences such as (*CRLF) - to override what the application has set or what has been defaulted. - Details are given in the section entitled "Newline sequences" above. - There are also the (*UTF8) and (*UCP) leading sequences that can be - used to set UTF-8 and Unicode property modes; they are equivalent to - setting the PCRE_UTF8 and the PCRE_UCP options, respectively. + Note: There are other PCRE-specific options that can be set by the + application when the compiling or matching functions are called. In + some cases the pattern can contain special leading sequences such as + (*CRLF) to override what the application has set or what has been + defaulted. Details are given in the section entitled "Newline + sequences" above. There are also the (*UTF8), (*UTF16), and (*UCP) + leading sequences that can be used to set UTF and Unicode property + modes; they are equivalent to setting the PCRE_UTF8, PCRE_UTF16, and + the PCRE_UCP options, respectively. SUBPATTERNS @@ -4267,22 +4999,25 @@ 2. It sets up the subpattern as a capturing subpattern. This means that, when the whole pattern matches, that portion of the subject string that matched the subpattern is passed back to the caller via the - ovector argument of pcre_exec(). Opening parentheses are counted from - left to right (starting from 1) to obtain numbers for the capturing - subpatterns. For example, if the string "the red king" is matched - against the pattern + ovector argument of the matching function. (This applies only to the + traditional matching functions; the DFA matching functions do not sup- + port capturing.) + + Opening parentheses are counted from left to right (starting from 1) to + obtain numbers for the capturing subpatterns. For example, if the + string "the red king" is matched against the pattern the ((red|white) (king|queen)) the captured substrings are "red king", "red", and "king", and are num- bered 1, 2, and 3, respectively. - The fact that plain parentheses fulfil two functions is not always - helpful. There are often times when a grouping subpattern is required - without a capturing requirement. If an opening parenthesis is followed - by a question mark and a colon, the subpattern does not do any captur- - ing, and is not counted when computing the number of any subsequent - capturing subpatterns. For example, if the string "the white queen" is + The fact that plain parentheses fulfil two functions is not always + helpful. There are often times when a grouping subpattern is required + without a capturing requirement. If an opening parenthesis is followed + by a question mark and a colon, the subpattern does not do any captur- + ing, and is not counted when computing the number of any subsequent + capturing subpatterns. For example, if the string "the white queen" is matched against the pattern the ((?:red|white) (king|queen)) @@ -4290,37 +5025,37 @@ the captured substrings are "white queen" and "queen", and are numbered 1 and 2. The maximum number of capturing subpatterns is 65535. - As a convenient shorthand, if any option settings are required at the - start of a non-capturing subpattern, the option letters may appear + As a convenient shorthand, if any option settings are required at the + start of a non-capturing subpattern, the option letters may appear between the "?" and the ":". Thus the two patterns (?i:saturday|sunday) (?:(?i)saturday|sunday) match exactly the same set of strings. Because alternative branches are - tried from left to right, and options are not reset until the end of - the subpattern is reached, an option setting in one branch does affect - subsequent branches, so the above patterns match "SUNDAY" as well as + tried from left to right, and options are not reset until the end of + the subpattern is reached, an option setting in one branch does affect + subsequent branches, so the above patterns match "SUNDAY" as well as "Saturday". DUPLICATE SUBPATTERN NUMBERS Perl 5.10 introduced a feature whereby each alternative in a subpattern - uses the same numbers for its capturing parentheses. Such a subpattern - starts with (?| and is itself a non-capturing subpattern. For example, + uses the same numbers for its capturing parentheses. Such a subpattern + starts with (?| and is itself a non-capturing subpattern. For example, consider this pattern: (?|(Sat)ur|(Sun))day - Because the two alternatives are inside a (?| group, both sets of cap- - turing parentheses are numbered one. Thus, when the pattern matches, - you can look at captured substring number one, whichever alternative - matched. This construct is useful when you want to capture part, but + Because the two alternatives are inside a (?| group, both sets of cap- + turing parentheses are numbered one. Thus, when the pattern matches, + you can look at captured substring number one, whichever alternative + matched. This construct is useful when you want to capture part, but not all, of one of a number of alternatives. Inside a (?| group, paren- - theses are numbered as usual, but the number is reset at the start of - each branch. The numbers of any capturing parentheses that follow the - subpattern start after the highest number used in any branch. The fol- + theses are numbered as usual, but the number is reset at the start of + each branch. The numbers of any capturing parentheses that follow the + subpattern start after the highest number used in any branch. The fol- lowing example is taken from the Perl documentation. The numbers under- neath show in which buffer the captured content will be stored. @@ -4328,58 +5063,58 @@ / ( a ) (?| x ( y ) z | (p (q) r) | (t) u (v) ) ( z ) /x # 1 2 2 3 2 3 4 - A back reference to a numbered subpattern uses the most recent value - that is set for that number by any subpattern. The following pattern + A back reference to a numbered subpattern uses the most recent value + that is set for that number by any subpattern. The following pattern matches "abcabc" or "defdef": /(?|(abc)|(def))\1/ - In contrast, a recursive or "subroutine" call to a numbered subpattern - always refers to the first one in the pattern with the given number. - The following pattern matches "abcabc" or "defabc": + In contrast, a subroutine call to a numbered subpattern always refers + to the first one in the pattern with the given number. The following + pattern matches "abcabc" or "defabc": /(?|(abc)|(def))(?1)/ - If a condition test for a subpattern's having matched refers to a non- - unique number, the test is true if any of the subpatterns of that num- + If a condition test for a subpattern's having matched refers to a non- + unique number, the test is true if any of the subpatterns of that num- ber have matched. - An alternative approach to using this "branch reset" feature is to use + An alternative approach to using this "branch reset" feature is to use duplicate named subpatterns, as described in the next section. NAMED SUBPATTERNS - Identifying capturing parentheses by number is simple, but it can be - very hard to keep track of the numbers in complicated regular expres- - sions. Furthermore, if an expression is modified, the numbers may - change. To help with this difficulty, PCRE supports the naming of sub- + Identifying capturing parentheses by number is simple, but it can be + very hard to keep track of the numbers in complicated regular expres- + sions. Furthermore, if an expression is modified, the numbers may + change. To help with this difficulty, PCRE supports the naming of sub- patterns. This feature was not added to Perl until release 5.10. Python - had the feature earlier, and PCRE introduced it at release 4.0, using - the Python syntax. PCRE now supports both the Perl and the Python syn- - tax. Perl allows identically numbered subpatterns to have different + had the feature earlier, and PCRE introduced it at release 4.0, using + the Python syntax. PCRE now supports both the Perl and the Python syn- + tax. Perl allows identically numbered subpatterns to have different names, but PCRE does not. - In PCRE, a subpattern can be named in one of three ways: (?...) - or (?'name'...) as in Perl, or (?P...) as in Python. References - to capturing parentheses from other parts of the pattern, such as back - references, recursion, and conditions, can be made by name as well as + In PCRE, a subpattern can be named in one of three ways: (?...) + or (?'name'...) as in Perl, or (?P...) as in Python. References + to capturing parentheses from other parts of the pattern, such as back + references, recursion, and conditions, can be made by name as well as by number. - Names consist of up to 32 alphanumeric characters and underscores. - Named capturing parentheses are still allocated numbers as well as - names, exactly as if the names were not present. The PCRE API provides + Names consist of up to 32 alphanumeric characters and underscores. + Named capturing parentheses are still allocated numbers as well as + names, exactly as if the names were not present. The PCRE API provides function calls for extracting the name-to-number translation table from a compiled pattern. There is also a convenience function for extracting a captured substring by name. - By default, a name must be unique within a pattern, but it is possible + By default, a name must be unique within a pattern, but it is possible to relax this constraint by setting the PCRE_DUPNAMES option at compile - time. (Duplicate names are also always permitted for subpatterns with - the same number, set up as described in the previous section.) Dupli- - cate names can be useful for patterns where only one instance of the - named parentheses can match. Suppose you want to match the name of a - weekday, either as a 3-letter abbreviation or as the full name, and in + time. (Duplicate names are also always permitted for subpatterns with + the same number, set up as described in the previous section.) Dupli- + cate names can be useful for patterns where only one instance of the + named parentheses can match. Suppose you want to match the name of a + weekday, either as a 3-letter abbreviation or as the full name, and in both cases you want to extract the abbreviation. This pattern (ignoring the line breaks) does the job: @@ -4389,62 +5124,62 @@ (?Thu)(?:rsday)?| (?Sat)(?:urday)? - There are five capturing substrings, but only one is ever set after a + There are five capturing substrings, but only one is ever set after a match. (An alternative way of solving this problem is to use a "branch reset" subpattern, as described in the previous section.) - The convenience function for extracting the data by name returns the - substring for the first (and in this example, the only) subpattern of - that name that matched. This saves searching to find which numbered + The convenience function for extracting the data by name returns the + substring for the first (and in this example, the only) subpattern of + that name that matched. This saves searching to find which numbered subpattern it was. - If you make a back reference to a non-unique named subpattern from - elsewhere in the pattern, the one that corresponds to the first occur- + If you make a back reference to a non-unique named subpattern from + elsewhere in the pattern, the one that corresponds to the first occur- rence of the name is used. In the absence of duplicate numbers (see the - previous section) this is the one with the lowest number. If you use a - named reference in a condition test (see the section about conditions - below), either to check whether a subpattern has matched, or to check - for recursion, all subpatterns with the same name are tested. If the - condition is true for any one of them, the overall condition is true. + previous section) this is the one with the lowest number. If you use a + named reference in a condition test (see the section about conditions + below), either to check whether a subpattern has matched, or to check + for recursion, all subpatterns with the same name are tested. If the + condition is true for any one of them, the overall condition is true. This is the same behaviour as testing by number. For further details of the interfaces for handling named subpatterns, see the pcreapi documen- tation. Warning: You cannot use different names to distinguish between two sub- - patterns with the same number because PCRE uses only the numbers when + patterns with the same number because PCRE uses only the numbers when matching. For this reason, an error is given at compile time if differ- - ent names are given to subpatterns with the same number. However, you - can give the same name to subpatterns with the same number, even when + ent names are given to subpatterns with the same number. However, you + can give the same name to subpatterns with the same number, even when PCRE_DUPNAMES is not set. REPETITION - Repetition is specified by quantifiers, which can follow any of the + Repetition is specified by quantifiers, which can follow any of the following items: a literal data character the dot metacharacter the \C escape sequence - the \X escape sequence (in UTF-8 mode with Unicode properties) + the \X escape sequence the \R escape sequence an escape such as \d or \pL that matches a single character a character class a back reference (see next section) - a parenthesized subpattern (unless it is an assertion) - a recursive or "subroutine" call to a subpattern + a parenthesized subpattern (including assertions) + a subroutine call to a subpattern (recursive or otherwise) - The general repetition quantifier specifies a minimum and maximum num- - ber of permitted matches, by giving the two numbers in curly brackets - (braces), separated by a comma. The numbers must be less than 65536, + The general repetition quantifier specifies a minimum and maximum num- + ber of permitted matches, by giving the two numbers in curly brackets + (braces), separated by a comma. The numbers must be less than 65536, and the first must be less than or equal to the second. For example: z{2,4} - matches "zz", "zzz", or "zzzz". A closing brace on its own is not a - special character. If the second number is omitted, but the comma is - present, there is no upper limit; if the second number and the comma - are both omitted, the quantifier specifies an exact number of required + matches "zz", "zzz", or "zzzz". A closing brace on its own is not a + special character. If the second number is omitted, but the comma is + present, there is no upper limit; if the second number and the comma + are both omitted, the quantifier specifies an exact number of required matches. Thus [aeiou]{3,} @@ -4453,17 +5188,16 @@ \d{8} - matches exactly 8 digits. An opening curly bracket that appears in a - position where a quantifier is not allowed, or one that does not match - the syntax of a quantifier, is taken as a literal character. For exam- + matches exactly 8 digits. An opening curly bracket that appears in a + position where a quantifier is not allowed, or one that does not match + the syntax of a quantifier, is taken as a literal character. For exam- ple, {,6} is not a quantifier, but a literal string of four characters. - In UTF-8 mode, quantifiers apply to UTF-8 characters rather than to - individual bytes. Thus, for example, \x{100}{2} matches two UTF-8 char- - acters, each of which is represented by a two-byte sequence. Similarly, - when Unicode property support is available, \X{3} matches three Unicode - extended sequences, each of which may be several bytes long (and they - may be of different lengths). + In UTF modes, quantifiers apply to characters rather than to individual + data units. Thus, for example, \x{100}{2} matches two characters, each + of which is represented by a two-byte sequence in a UTF-8 string. Simi- + larly, \X{3} matches three Unicode extended sequences, each of which + may be several data units long (and they may be of different lengths). The quantifier {0} is permitted, causing the expression to behave as if the previous item and the quantifier were not present. This may be use- @@ -4769,8 +5503,8 @@ its following a backslash are taken as part of a potential back refer- ence number. If the pattern continues with a digit character, some delimiter must be used to terminate the back reference. If the - PCRE_EXTENDED option is set, this can be whitespace. Otherwise, the \g{ - syntax or an empty comment (see "Comments" below) can be used. + PCRE_EXTENDED option is set, this can be white space. Otherwise, the + \g{ syntax or an empty comment (see "Comments" below) can be used. Recursive back references @@ -4807,13 +5541,29 @@ matched in the normal way, except that it does not cause the current matching position to be changed. - Assertion subpatterns are not capturing subpatterns, and may not be - repeated, because it makes no sense to assert the same thing several - times. If any kind of assertion contains capturing subpatterns within - it, these are counted for the purposes of numbering the capturing sub- - patterns in the whole pattern. However, substring capturing is carried - out only for positive assertions, because it does not make sense for - negative assertions. + Assertion subpatterns are not capturing subpatterns. If such an asser- + tion contains capturing subpatterns within it, these are counted for + the purposes of numbering the capturing subpatterns in the whole pat- + tern. However, substring capturing is carried out only for positive + assertions, because it does not make sense for negative assertions. + + For compatibility with Perl, assertion subpatterns may be repeated; + though it makes no sense to assert the same thing several times, the + side effect of capturing parentheses may occasionally be useful. In + practice, there only three cases: + + (1) If the quantifier is {0}, the assertion is never obeyed during + matching. However, it may contain internal capturing parenthesized + groups that are called from elsewhere via the subroutine mechanism. + + (2) If quantifier is {0,n} where n is greater than zero, it is treated + as if it were {0,1}. At run time, the rest of the pattern match is + tried with and without the assertion, the order depending on the greed- + iness of the quantifier. + + (3) If the minimum repetition is greater than zero, the quantifier is + ignored. The assertion is obeyed just once when encountered during + matching. Lookahead assertions @@ -4883,40 +5633,41 @@ then try to match. If there are insufficient characters before the cur- rent position, the assertion fails. - PCRE does not allow the \C escape (which matches a single byte in UTF-8 - mode) to appear in lookbehind assertions, because it makes it impossi- - ble to calculate the length of the lookbehind. The \X and \R escapes, - which can match different numbers of bytes, are also not permitted. + In a UTF mode, PCRE does not allow the \C escape (which matches a sin- + gle data unit even in a UTF mode) to appear in lookbehind assertions, + because it makes it impossible to calculate the length of the lookbe- + hind. The \X and \R escapes, which can match different numbers of data + units, are also not permitted. - "Subroutine" calls (see below) such as (?2) or (?&X) are permitted in - lookbehinds, as long as the subpattern matches a fixed-length string. + "Subroutine" calls (see below) such as (?2) or (?&X) are permitted in + lookbehinds, as long as the subpattern matches a fixed-length string. Recursion, however, is not supported. - Possessive quantifiers can be used in conjunction with lookbehind + Possessive quantifiers can be used in conjunction with lookbehind assertions to specify efficient matching of fixed-length strings at the end of subject strings. Consider a simple pattern such as abcd$ - when applied to a long string that does not match. Because matching + when applied to a long string that does not match. Because matching proceeds from left to right, PCRE will look for each "a" in the subject - and then see if what follows matches the rest of the pattern. If the + and then see if what follows matches the rest of the pattern. If the pattern is specified as ^.*abcd$ - the initial .* matches the entire string at first, but when this fails + the initial .* matches the entire string at first, but when this fails (because there is no following "a"), it backtracks to match all but the - last character, then all but the last two characters, and so on. Once - again the search for "a" covers the entire string, from right to left, + last character, then all but the last two characters, and so on. Once + again the search for "a" covers the entire string, from right to left, so we are no better off. However, if the pattern is written as ^.*+(?<=abcd) - there can be no backtracking for the .*+ item; it can match only the - entire string. The subsequent lookbehind assertion does a single test - on the last four characters. If it fails, the match fails immediately. - For long strings, this approach makes a significant difference to the + there can be no backtracking for the .*+ item; it can match only the + entire string. The subsequent lookbehind assertion does a single test + on the last four characters. If it fails, the match fails immediately. + For long strings, this approach makes a significant difference to the processing time. Using multiple assertions @@ -4925,18 +5676,18 @@ (?<=\d{3})(?)...) or (?('name')...) to test for a - used subpattern by name. For compatibility with earlier versions of - PCRE, which had this facility before Perl, the syntax (?(name)...) is - also recognized. However, there is a possible ambiguity with this syn- - tax, because subpattern names may consist entirely of digits. PCRE - looks first for a named subpattern; if it cannot find one and the name - consists entirely of digits, PCRE looks for a subpattern of that num- - ber, which must be greater than zero. Using subpattern names that con- + Perl uses the syntax (?()...) or (?('name')...) to test for a + used subpattern by name. For compatibility with earlier versions of + PCRE, which had this facility before Perl, the syntax (?(name)...) is + also recognized. However, there is a possible ambiguity with this syn- + tax, because subpattern names may consist entirely of digits. PCRE + looks first for a named subpattern; if it cannot find one and the name + consists entirely of digits, PCRE looks for a subpattern of that num- + ber, which must be greater than zero. Using subpattern names that con- sist entirely of digits is not recommended. Rewriting the above example to use a named subpattern gives this: (? \( )? [^()]+ (?() \) ) - If the name used in a condition of this kind is a duplicate, the test - is applied to all subpatterns of the same name, and is true if any one + If the name used in a condition of this kind is a duplicate, the test + is applied to all subpatterns of the same name, and is true if any one of them has matched. Checking for pattern recursion If the condition is the string (R), and there is no subpattern with the - name R, the condition is true if a recursive call to the whole pattern + name R, the condition is true if a recursive call to the whole pattern or any subpattern has been made. If digits or a name preceded by amper- sand follow the letter R, for example: @@ -5049,24 +5800,23 @@ the condition is true if the most recent recursion is into a subpattern whose number or name is given. This condition does not check the entire - recursion stack. If the name used in a condition of this kind is a + recursion stack. If the name used in a condition of this kind is a duplicate, the test is applied to all subpatterns of the same name, and is true if any one of them is the most recent recursion. - At "top level", all these recursion test conditions are false. The + At "top level", all these recursion test conditions are false. The syntax for recursive patterns is described below. Defining subpatterns for use by reference only - If the condition is the string (DEFINE), and there is no subpattern - with the name DEFINE, the condition is always false. In this case, - there may be only one alternative in the subpattern. It is always - skipped if control reaches this point in the pattern; the idea of - DEFINE is that it can be used to define "subroutines" that can be ref- - erenced from elsewhere. (The use of "subroutines" is described below.) - For example, a pattern to match an IPv4 address such as - "192.168.23.245" could be written like this (ignore whitespace and line - breaks): + If the condition is the string (DEFINE), and there is no subpattern + with the name DEFINE, the condition is always false. In this case, + there may be only one alternative in the subpattern. It is always + skipped if control reaches this point in the pattern; the idea of + DEFINE is that it can be used to define subroutines that can be refer- + enced from elsewhere. (The use of subroutines is described below.) For + example, a pattern to match an IPv4 address such as "192.168.23.245" + could be written like this (ignore white space and line breaks): (?(DEFINE) (? 2[0-4]\d | 25[0-5] | 1\d\d | [1-9]?\d) ) \b (?&byte) (\.(?&byte)){3} \b @@ -5112,12 +5862,12 @@ comment, which in this case continues to immediately after the next newline character or character sequence in the pattern. Which charac- ters are interpreted as newlines is controlled by the options passed to - pcre_compile() or by a special sequence at the start of the pattern, as - described in the section entitled "Newline conventions" above. Note - that the end of this type of comment is a literal newline sequence in - the pattern; escape sequences that happen to represent a newline do not - count. For example, consider this pattern when PCRE_EXTENDED is set, - and the default newline convention is in force: + a compiling function or by a special sequence at the start of the pat- + tern, as described in the section entitled "Newline conventions" above. + Note that the end of this type of comment is a literal newline sequence + in the pattern; escape sequences that happen to represent a newline do + not count. For example, consider this pattern when PCRE_EXTENDED is + set, and the default newline convention is in force: abc #comment \n still comment @@ -5153,11 +5903,11 @@ into Perl at release 5.10. A special item that consists of (? followed by a number greater than - zero and a closing parenthesis is a recursive call of the subpattern of - the given number, provided that it occurs inside that subpattern. (If - not, it is a "subroutine" call, which is described in the next sec- - tion.) The special item (?R) or (?0) is a recursive call of the entire - regular expression. + zero and a closing parenthesis is a recursive subroutine call of the + subpattern of the given number, provided that it occurs inside that + subpattern. (If not, it is a non-recursive subroutine call, which is + described in the next section.) The special item (?R) or (?0) is a + recursive call of the entire regular expression. This PCRE pattern solves the nested parentheses problem (assume the PCRE_EXTENDED option is set so that white space is ignored): @@ -5189,8 +5939,8 @@ It is also possible to refer to subsequently opened parentheses, by writing references such as (?+2). However, these cannot be recursive because the reference is not inside the parentheses that are refer- - enced. They are always "subroutine" calls, as described in the next - section. + enced. They are always non-recursive subroutine calls, as described in + the next section. An alternative approach is to use named parentheses instead. The Perl syntax for this is (?&name); PCRE's earlier syntax (?P>name) is also @@ -5223,28 +5973,30 @@ the value for the inner capturing parentheses (numbered 2) is "ef", which is the last value taken on at the top level. If a capturing sub- - pattern is not matched at the top level, its final value is unset, even - if it is (temporarily) set at a deeper level. + pattern is not matched at the top level, its final captured value is + unset, even if it was (temporarily) set at a deeper level during the + matching process. - If there are more than 15 capturing parentheses in a pattern, PCRE has - to obtain extra memory to store data during a recursion, which it does + If there are more than 15 capturing parentheses in a pattern, PCRE has + to obtain extra memory to store data during a recursion, which it does by using pcre_malloc, freeing it via pcre_free afterwards. If no memory can be obtained, the match fails with the PCRE_ERROR_NOMEMORY error. - Do not confuse the (?R) item with the condition (R), which tests for - recursion. Consider this pattern, which matches text in angle brack- - ets, allowing for arbitrary nesting. Only digits are allowed in nested - brackets (that is, when recursing), whereas any characters are permit- + Do not confuse the (?R) item with the condition (R), which tests for + recursion. Consider this pattern, which matches text in angle brack- + ets, allowing for arbitrary nesting. Only digits are allowed in nested + brackets (that is, when recursing), whereas any characters are permit- ted at the outer level. < (?: (?(R) \d++ | [^<>]*+) | (?R)) * > - In this pattern, (?(R) is the start of a conditional subpattern, with - two different alternatives for the recursive and non-recursive cases. + In this pattern, (?(R) is the start of a conditional subpattern, with + two different alternatives for the recursive and non-recursive cases. The (?R) item is the actual recursive call. - Recursion difference from Perl + Differences in recursion processing between PCRE and Perl + Recursion processing in PCRE differs from Perl in two important ways. In PCRE (like Python, but unlike Perl), a recursive subpattern call is always treated as an atomic group. That is, once it has matched some of the subject string, it is never re-entered, even if it contains untried @@ -5317,14 +6069,30 @@ Once again, it cannot jump back into the recursion to try other alter- natives, so the entire match fails. + The second way in which PCRE and Perl differ in their recursion pro- + cessing is in the handling of captured values. In Perl, when a subpat- + tern is called recursively or as a subpattern (see the next section), + it has no access to any values that were captured outside the recur- + sion, whereas in PCRE these values can be referenced. Consider this + pattern: + + ^(.)(\1|a(?2)) + + In PCRE, this pattern matches "bab". The first capturing parentheses + match "b", then in the second group, when the back reference \1 fails + to match "b", the second alternative matches "a" and then recurses. In + the recursion, \1 does now match "b" and so the whole match succeeds. + In Perl, the pattern fails to match because inside the recursive call + \1 cannot access the externally set value. + SUBPATTERNS AS SUBROUTINES - If the syntax for a recursive subpattern reference (either by number or - by name) is used outside the parentheses to which it refers, it oper- - ates like a subroutine in a programming language. The "called" subpat- - tern may be defined before or after the reference. A numbered reference - can be absolute or relative, as in these examples: + If the syntax for a recursive subpattern call (either by number or by + name) is used outside the parentheses to which it refers, it operates + like a subroutine in a programming language. The called subpattern may + be defined before or after the reference. A numbered reference can be + absolute or relative, as in these examples: (...(absolute)...)...(?2)... (...(relative)...)...(?-1)... @@ -5343,15 +6111,15 @@ two strings. Another example is given in the discussion of DEFINE above. - Like recursive subpatterns, a subroutine call is always treated as an - atomic group. That is, once it has matched some of the subject string, - it is never re-entered, even if it contains untried alternatives and - there is a subsequent matching failure. Any capturing parentheses that - are set during the subroutine call revert to their previous values - afterwards. + All subroutine calls, whether recursive or not, are always treated as + atomic groups. That is, once a subroutine has matched some of the sub- + ject string, it is never re-entered, even if it contains untried alter- + natives and there is a subsequent matching failure. Any capturing + parentheses that are set during the subroutine call revert to their + previous values afterwards. - When a subpattern is used as a subroutine, processing options such as - case-independence are fixed when the subpattern is defined. They cannot + Processing options such as case-independence are fixed when a subpat- + tern is defined, so if it is used as a subroutine, such options cannot be changed for different calls. For example, consider this pattern: (abc)(?i:(?-1)) @@ -5392,8 +6160,8 @@ PCRE provides a similar feature, but of course it cannot obey arbitrary Perl code. The feature is called "callout". The caller of PCRE provides an external function by putting its entry point in the global variable - pcre_callout. By default, this variable contains NULL, which disables - all calling out. + pcre_callout (8-bit library) or pcre16_callout (16-bit library). By + default, this variable contains NULL, which disables all calling out. Within a regular expression, (?C) indicates the points at which the external function is to be called. If you want to identify different @@ -5403,17 +6171,17 @@ (?C1)abc(?C2)def - If the PCRE_AUTO_CALLOUT flag is passed to pcre_compile(), callouts are - automatically installed before each item in the pattern. They are all - numbered 255. - - During matching, when PCRE reaches a callout point (and pcre_callout is - set), the external function is called. It is provided with the number - of the callout, the position in the pattern, and, optionally, one item - of data originally supplied by the caller of pcre_exec(). The callout - function may cause matching to proceed, to backtrack, or to fail alto- - gether. A complete description of the interface to the callout function - is given in the pcrecallout documentation. + If the PCRE_AUTO_CALLOUT flag is passed to a compiling function, call- + outs are automatically installed before each item in the pattern. They + are all numbered 255. + + During matching, when PCRE reaches a callout point, the external func- + tion is called. It is provided with the number of the callout, the + position in the pattern, and, optionally, one item of data originally + supplied by the caller of the matching function. The callout function + may cause matching to proceed, to backtrack, or to fail altogether. A + complete description of the interface to the callout function is given + in the pcrecallout documentation. BACKTRACKING CONTROL @@ -5426,25 +6194,33 @@ in this section. Since these verbs are specifically related to backtracking, most of - them can be used only when the pattern is to be matched using - pcre_exec(), which uses a backtracking algorithm. With the exception of - (*FAIL), which behaves like a failing negative assertion, they cause an - error if encountered by pcre_dfa_exec(). - - If any of these verbs are used in an assertion or subroutine subpattern - (including recursive subpatterns), their effect is confined to that - subpattern; it does not extend to the surrounding pattern. Note that - such subpatterns are processed as anchored at the point where they are - tested. + them can be used only when the pattern is to be matched using one of + the traditional matching functions, which use a backtracking algorithm. + With the exception of (*FAIL), which behaves like a failing negative + assertion, they cause an error if encountered by a DFA matching func- + tion. - The new verbs make use of what was previously invalid syntax: an open- + If any of these verbs are used in an assertion or in a subpattern that + is called as a subroutine (whether or not recursively), their effect is + confined to that subpattern; it does not extend to the surrounding pat- + tern, with one exception: the name from a *(MARK), (*PRUNE), or (*THEN) + that is encountered in a successful positive assertion is passed back + when a match succeeds (compare capturing parentheses in assertions). + Note that such subpatterns are processed as anchored at the point where + they are tested. Note also that Perl's treatment of subroutines and + assertions is different in some cases. + + The new verbs make use of what was previously invalid syntax: an open- ing parenthesis followed by an asterisk. They are generally of the form - (*VERB) or (*VERB:NAME). Some may take either form, with differing be- - haviour, depending on whether or not an argument is present. An name is - a sequence of letters, digits, and underscores. If the name is empty, - that is, if the closing parenthesis immediately follows the colon, the - effect is as if the colon were not there. Any number of these verbs may - occur in a pattern. + (*VERB) or (*VERB:NAME). Some may take either form, with differing be- + haviour, depending on whether or not an argument is present. A name is + any sequence of characters that does not include a closing parenthesis. + The maximum length of name is 255 in the 8-bit library and 65535 in the + 16-bit library. If the name is empty, that is, if the closing parenthe- + sis immediately follows the colon, the effect is as if the colon were + not there. Any number of these verbs may occur in a pattern. + + Optimizations that affect backtracking verbs PCRE contains some optimizations that are used to speed up matching by running some checks at the start of each match attempt. For example, it @@ -5454,60 +6230,64 @@ course, be processed. You can suppress the start-of-match optimizations by setting the PCRE_NO_START_OPTIMIZE option when calling pcre_com- pile() or pcre_exec(), or by starting the pattern with (*NO_START_OPT). + There is more discussion of this option in the section entitled "Option + bits for pcre_exec()" in the pcreapi documentation. + + Experiments with Perl suggest that it too has similar optimizations, + sometimes leading to anomalous results. Verbs that act immediately - The following verbs act as soon as they are encountered. They may not + The following verbs act as soon as they are encountered. They may not be followed by a name. (*ACCEPT) - This verb causes the match to end successfully, skipping the remainder - of the pattern. When inside a recursion, only the innermost pattern is - ended immediately. If (*ACCEPT) is inside capturing parentheses, the - data so far is captured. (This feature was added to PCRE at release - 8.00.) For example: + This verb causes the match to end successfully, skipping the remainder + of the pattern. However, when it is inside a subpattern that is called + as a subroutine, only that subpattern is ended successfully. Matching + then continues at the outer level. If (*ACCEPT) is inside capturing + parentheses, the data so far is captured. For example: A((?:A|B(*ACCEPT)|C)D) - This matches "AB", "AAD", or "ACD"; when it matches "AB", "B" is cap- + This matches "AB", "AAD", or "ACD"; when it matches "AB", "B" is cap- tured by the outer parentheses. (*FAIL) or (*F) - This verb causes the match to fail, forcing backtracking to occur. It - is equivalent to (?!) but easier to read. The Perl documentation notes - that it is probably useful only when combined with (?{}) or (??{}). - Those are, of course, Perl features that are not present in PCRE. The - nearest equivalent is the callout feature, as for example in this pat- + This verb causes a matching failure, forcing backtracking to occur. It + is equivalent to (?!) but easier to read. The Perl documentation notes + that it is probably useful only when combined with (?{}) or (??{}). + Those are, of course, Perl features that are not present in PCRE. The + nearest equivalent is the callout feature, as for example in this pat- tern: a+(?C)(*FAIL) - A match with the string "aaaa" always fails, but the callout is taken + A match with the string "aaaa" always fails, but the callout is taken before each backtrack happens (in this example, 10 times). Recording which path was taken - There is one verb whose main purpose is to track how a match was - arrived at, though it also has a secondary use in conjunction with + There is one verb whose main purpose is to track how a match was + arrived at, though it also has a secondary use in conjunction with advancing the match starting point (see (*SKIP) below). (*MARK:NAME) or (*:NAME) - A name is always required with this verb. There may be as many - instances of (*MARK) as you like in a pattern, and their names do not + A name is always required with this verb. There may be as many + instances of (*MARK) as you like in a pattern, and their names do not have to be unique. - When a match succeeds, the name of the last-encountered (*MARK) is - passed back to the caller via the pcre_extra data structure, as - described in the section on pcre_extra in the pcreapi documentation. No - data is returned for a partial match. Here is an example of pcretest - output, where the /K modifier requests the retrieval and outputting of - (*MARK) data: + When a match succeeds, the name of the last-encountered (*MARK) on the + matching path is passed back to the caller as described in the section + entitled "Extra data for pcre_exec()" in the pcreapi documentation. + Here is an example of pcretest output, where the /K modifier requests + the retrieval and outputting of (*MARK) data: - /X(*MARK:A)Y|X(*MARK:B)Z/K - XY + re> /X(*MARK:A)Y|X(*MARK:B)Z/K + data> XY 0: XY MK: A XZ @@ -5519,98 +6299,86 @@ efficient way of obtaining this information than putting each alterna- tive in its own capturing parentheses. - A name may also be returned after a failed match if the final path - through the pattern involves (*MARK). However, unless (*MARK) used in - conjunction with (*COMMIT), this is unlikely to happen for an unan- - chored pattern because, as the starting point for matching is advanced, - the final check is often with an empty string, causing a failure before - (*MARK) is reached. For example: - - /X(*MARK:A)Y|X(*MARK:B)Z/K - XP - No match + If (*MARK) is encountered in a positive assertion, its name is recorded + and passed back if it is the last-encountered. This does not happen for + negative assertions. - There are three potential starting points for this match (starting with - X, starting with P, and with an empty string). If the pattern is - anchored, the result is different: + After a partial match or a failed match, the name of the last encoun- + tered (*MARK) in the entire match process is returned. For example: - /^X(*MARK:A)Y|^X(*MARK:B)Z/K - XP + re> /X(*MARK:A)Y|X(*MARK:B)Z/K + data> XP No match, mark = B - PCRE's start-of-match optimizations can also interfere with this. For - example, if, as a result of a call to pcre_study(), it knows the mini- - mum subject length for a match, a shorter subject will not be scanned - at all. - - Note that similar anomalies (though different in detail) exist in Perl, - no doubt for the same reasons. The use of (*MARK) data after a failed - match of an unanchored pattern is not recommended, unless (*COMMIT) is - involved. + Note that in this unanchored example the mark is retained from the + match attempt that started at the letter "X" in the subject. Subsequent + match attempts starting at "P" and then with an empty string do not get + as far as the (*MARK) item, but nevertheless do not reset it. + + If you are interested in (*MARK) values after failed matches, you + should probably set the PCRE_NO_START_OPTIMIZE option (see above) to + ensure that the match is always attempted. Verbs that act after backtracking The following verbs do nothing when they are encountered. Matching con- - tinues with what follows, but if there is no subsequent match, causing - a backtrack to the verb, a failure is forced. That is, backtracking - cannot pass to the left of the verb. However, when one of these verbs - appears inside an atomic group, its effect is confined to that group, - because once the group has been matched, there is never any backtrack- - ing into it. In this situation, backtracking can "jump back" to the - left of the entire atomic group. (Remember also, as stated above, that + tinues with what follows, but if there is no subsequent match, causing + a backtrack to the verb, a failure is forced. That is, backtracking + cannot pass to the left of the verb. However, when one of these verbs + appears inside an atomic group, its effect is confined to that group, + because once the group has been matched, there is never any backtrack- + ing into it. In this situation, backtracking can "jump back" to the + left of the entire atomic group. (Remember also, as stated above, that this localization also applies in subroutine calls and assertions.) - These verbs differ in exactly what kind of failure occurs when back- + These verbs differ in exactly what kind of failure occurs when back- tracking reaches them. (*COMMIT) - This verb, which may not be followed by a name, causes the whole match + This verb, which may not be followed by a name, causes the whole match to fail outright if the rest of the pattern does not match. Even if the pattern is unanchored, no further attempts to find a match by advancing the starting point take place. Once (*COMMIT) has been passed, - pcre_exec() is committed to finding a match at the current starting + pcre_exec() is committed to finding a match at the current starting point, or not at all. For example: a+(*COMMIT)b - This matches "xxaab" but not "aacaab". It can be thought of as a kind + This matches "xxaab" but not "aacaab". It can be thought of as a kind of dynamic anchor, or "I've started, so I must finish." The name of the - most recently passed (*MARK) in the path is passed back when (*COMMIT) + most recently passed (*MARK) in the path is passed back when (*COMMIT) forces a match failure. - Note that (*COMMIT) at the start of a pattern is not the same as an - anchor, unless PCRE's start-of-match optimizations are turned off, as + Note that (*COMMIT) at the start of a pattern is not the same as an + anchor, unless PCRE's start-of-match optimizations are turned off, as shown in this pcretest example: - /(*COMMIT)abc/ - xyzabc + re> /(*COMMIT)abc/ + data> xyzabc 0: abc xyzabc\Y No match - PCRE knows that any match must start with "a", so the optimization - skips along the subject to "a" before running the first match attempt, - which succeeds. When the optimization is disabled by the \Y escape in + PCRE knows that any match must start with "a", so the optimization + skips along the subject to "a" before running the first match attempt, + which succeeds. When the optimization is disabled by the \Y escape in the second subject, the match starts at "x" and so the (*COMMIT) causes it to fail without trying any other starting points. (*PRUNE) or (*PRUNE:NAME) - This verb causes the match to fail at the current starting position in - the subject if the rest of the pattern does not match. If the pattern - is unanchored, the normal "bumpalong" advance to the next starting - character then happens. Backtracking can occur as usual to the left of - (*PRUNE), before it is reached, or when matching to the right of - (*PRUNE), but if there is no match to the right, backtracking cannot - cross (*PRUNE). In simple cases, the use of (*PRUNE) is just an alter- - native to an atomic group or possessive quantifier, but there are some + This verb causes the match to fail at the current starting position in + the subject if the rest of the pattern does not match. If the pattern + is unanchored, the normal "bumpalong" advance to the next starting + character then happens. Backtracking can occur as usual to the left of + (*PRUNE), before it is reached, or when matching to the right of + (*PRUNE), but if there is no match to the right, backtracking cannot + cross (*PRUNE). In simple cases, the use of (*PRUNE) is just an alter- + native to an atomic group or possessive quantifier, but there are some uses of (*PRUNE) that cannot be expressed in any other way. The behav- - iour of (*PRUNE:NAME) is the same as (*MARK:NAME)(*PRUNE) when the - match fails completely; the name is passed back if this is the final - attempt. (*PRUNE:NAME) does not pass back a name if the match suc- - ceeds. In an anchored pattern (*PRUNE) has the same effect as (*COM- - MIT). + iour of (*PRUNE:NAME) is the same as (*MARK:NAME)(*PRUNE). In an + anchored pattern (*PRUNE) has the same effect as (*COMMIT). (*SKIP) @@ -5637,49 +6405,85 @@ is searched for the most recent (*MARK) that has the same name. If one is found, the "bumpalong" advance is to the subject position that cor- responds to that (*MARK) instead of to where (*SKIP) was encountered. - If no (*MARK) with a matching name is found, normal "bumpalong" of one - character happens (the (*SKIP) is ignored). + If no (*MARK) with a matching name is found, the (*SKIP) is ignored. (*THEN) or (*THEN:NAME) - This verb causes a skip to the next alternation in the innermost - enclosing group if the rest of the pattern does not match. That is, it - cancels pending backtracking, but only within the current alternation. - Its name comes from the observation that it can be used for a pattern- - based if-then-else block: + This verb causes a skip to the next innermost alternative if the rest + of the pattern does not match. That is, it cancels pending backtrack- + ing, but only within the current alternative. Its name comes from the + observation that it can be used for a pattern-based if-then-else block: ( COND1 (*THEN) FOO | COND2 (*THEN) BAR | COND3 (*THEN) BAZ ) ... If the COND1 pattern matches, FOO is tried (and possibly further items - after the end of the group if FOO succeeds); on failure the matcher + after the end of the group if FOO succeeds); on failure, the matcher skips to the second alternative and tries COND2, without backtracking into COND1. The behaviour of (*THEN:NAME) is exactly the same as - (*MARK:NAME)(*THEN) if the overall match fails. If (*THEN) is not - directly inside an alternation, it acts like (*PRUNE). + (*MARK:NAME)(*THEN). If (*THEN) is not inside an alternation, it acts + like (*PRUNE). - The above verbs provide four different "strengths" of control when sub- - sequent matching fails. (*THEN) is the weakest, carrying on the match - at the next alternation. (*PRUNE) comes next, failing the match at the - current starting position, but allowing an advance to the next charac- - ter (for an unanchored pattern). (*SKIP) is similar, except that the - advance may be more than one character. (*COMMIT) is the strongest, + Note that a subpattern that does not contain a | character is just a + part of the enclosing alternative; it is not a nested alternation with + only one alternative. The effect of (*THEN) extends beyond such a sub- + pattern to the enclosing alternative. Consider this pattern, where A, + B, etc. are complex pattern fragments that do not contain any | charac- + ters at this level: + + A (B(*THEN)C) | D + + If A and B are matched, but there is a failure in C, matching does not + backtrack into A; instead it moves to the next alternative, that is, D. + However, if the subpattern containing (*THEN) is given an alternative, + it behaves differently: + + A (B(*THEN)C | (*FAIL)) | D + + The effect of (*THEN) is now confined to the inner subpattern. After a + failure in C, matching moves to (*FAIL), which causes the whole subpat- + tern to fail because there are no more alternatives to try. In this + case, matching does now backtrack into A. + + Note also that a conditional subpattern is not considered as having two + alternatives, because only one is ever used. In other words, the | + character in a conditional subpattern has a different meaning. Ignoring + white space, consider: + + ^.*? (?(?=a) a | b(*THEN)c ) + + If the subject is "ba", this pattern does not match. Because .*? is + ungreedy, it initially matches zero characters. The condition (?=a) + then fails, the character "b" is matched, but "c" is not. At this + point, matching does not backtrack to .*? as might perhaps be expected + from the presence of the | character. The conditional subpattern is + part of the single alternative that comprises the whole pattern, and so + the match fails. (If there was a backtrack into .*?, allowing it to + match "b", the match would succeed.) + + The verbs just described provide four different "strengths" of control + when subsequent matching fails. (*THEN) is the weakest, carrying on the + match at the next alternative. (*PRUNE) comes next, failing the match + at the current starting position, but allowing an advance to the next + character (for an unanchored pattern). (*SKIP) is similar, except that + the advance may be more than one character. (*COMMIT) is the strongest, causing the entire match to fail. - If more than one is present in a pattern, the "stongest" one wins. For - example, consider this pattern, where A, B, etc. are complex pattern - fragments: + If more than one such verb is present in a pattern, the "strongest" one + wins. For example, consider this pattern, where A, B, etc. are complex + pattern fragments: (A(*COMMIT)B(*THEN)C|D) - Once A has matched, PCRE is committed to this match, at the current - starting position. If subsequently B matches, but C does not, the nor- - mal (*THEN) action of trying the next alternation (that is, D) does not + Once A has matched, PCRE is committed to this match, at the current + starting position. If subsequently B matches, but C does not, the nor- + mal (*THEN) action of trying the next alternative (that is, D) does not happen because (*COMMIT) overrides. SEE ALSO - pcreapi(3), pcrecallout(3), pcrematching(3), pcresyntax(3), pcre(3). + pcreapi(3), pcrecallout(3), pcrematching(3), pcresyntax(3), pcre(3), + pcre16(3). AUTHOR @@ -5691,8 +6495,8 @@ REVISION - Last updated: 21 November 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 17 June 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ @@ -5707,7 +6511,7 @@ The full syntax and semantics of the regular expressions that are sup- ported by PCRE are described in the pcrepattern documentation. This - document contains just a quick-reference summary of the syntax. + document contains a quick-reference summary of the syntax. QUOTING @@ -5721,7 +6525,7 @@ \a alarm, that is, the BEL character (hex 07) \cx "control-x", where x is any ASCII character \e escape (hex 1B) - \f formfeed (hex 0C) + \f form feed (hex 0C) \n newline (hex 0A) \r carriage return (hex 0D) \t tab (hex 09) @@ -5734,25 +6538,25 @@ . any character except newline; in dotall mode, any character whatsoever - \C one byte, even in UTF-8 mode (best avoided) + \C one data unit, even in UTF mode (best avoided) \d a decimal digit \D a character that is not a decimal digit - \h a horizontal whitespace character - \H a character that is not a horizontal whitespace character + \h a horizontal white space character + \H a character that is not a horizontal white space character \N a character that is not a newline \p{xx} a character with the xx property \P{xx} a character without the xx property \R a newline sequence - \s a whitespace character - \S a character that is not a whitespace character - \v a vertical whitespace character - \V a character that is not a vertical whitespace character + \s a white space character + \S a character that is not a white space character + \v a vertical white space character + \V a character that is not a vertical white space character \w a "word" character \W a "non-word" character \X an extended Unicode sequence In PCRE, by default, \d, \D, \s, \S, \w, and \W recognize only ASCII - characters, even in UTF-8 mode. However, this can be changed by setting + characters, even in a UTF mode. However, this can be changed by setting the PCRE_UCP option. @@ -5814,20 +6618,22 @@ SCRIPT NAMES FOR \p AND \P - Arabic, Armenian, Avestan, Balinese, Bamum, Bengali, Bopomofo, Braille, - Buginese, Buhid, Canadian_Aboriginal, Carian, Cham, Cherokee, Common, - Coptic, Cuneiform, Cypriot, Cyrillic, Deseret, Devanagari, Egyp- - tian_Hieroglyphs, Ethiopic, Georgian, Glagolitic, Gothic, Greek, - Gujarati, Gurmukhi, Han, Hangul, Hanunoo, Hebrew, Hiragana, Impe- - rial_Aramaic, Inherited, Inscriptional_Pahlavi, Inscriptional_Parthian, - Javanese, Kaithi, Kannada, Katakana, Kayah_Li, Kharoshthi, Khmer, Lao, - Latin, Lepcha, Limbu, Linear_B, Lisu, Lycian, Lydian, Malayalam, - Meetei_Mayek, Mongolian, Myanmar, New_Tai_Lue, Nko, Ogham, Old_Italic, - Old_Persian, Old_South_Arabian, Old_Turkic, Ol_Chiki, Oriya, Osmanya, - Phags_Pa, Phoenician, Rejang, Runic, Samaritan, Saurashtra, Shavian, - Sinhala, Sundanese, Syloti_Nagri, Syriac, Tagalog, Tagbanwa, Tai_Le, - Tai_Tham, Tai_Viet, Tamil, Telugu, Thaana, Thai, Tibetan, Tifinagh, - Ugaritic, Vai, Yi. + Arabic, Armenian, Avestan, Balinese, Bamum, Batak, Bengali, Bopomofo, + Brahmi, Braille, Buginese, Buhid, Canadian_Aboriginal, Carian, Chakma, + Cham, Cherokee, Common, Coptic, Cuneiform, Cypriot, Cyrillic, Deseret, + Devanagari, Egyptian_Hieroglyphs, Ethiopic, Georgian, Glagolitic, + Gothic, Greek, Gujarati, Gurmukhi, Han, Hangul, Hanunoo, Hebrew, Hira- + gana, Imperial_Aramaic, Inherited, Inscriptional_Pahlavi, Inscrip- + tional_Parthian, Javanese, Kaithi, Kannada, Katakana, Kayah_Li, + Kharoshthi, Khmer, Lao, Latin, Lepcha, Limbu, Linear_B, Lisu, Lycian, + Lydian, Malayalam, Mandaic, Meetei_Mayek, Meroitic_Cursive, + Meroitic_Hieroglyphs, Miao, Mongolian, Myanmar, New_Tai_Lue, Nko, + Ogham, Old_Italic, Old_Persian, Old_South_Arabian, Old_Turkic, + Ol_Chiki, Oriya, Osmanya, Phags_Pa, Phoenician, Rejang, Runic, Samari- + tan, Saurashtra, Sharada, Shavian, Sinhala, Sora_Sompeng, Sundanese, + Syloti_Nagri, Syriac, Tagalog, Tagbanwa, Tai_Le, Tai_Tham, Tai_Viet, + Takri, Tamil, Telugu, Thaana, Thai, Tibetan, Tifinagh, Ugaritic, Vai, + Yi. CHARACTER CLASSES @@ -5848,7 +6654,7 @@ lower lower case letter print printing, including space punct printing, excluding alphanumeric - space whitespace + space white space upper upper case letter word same as \w xdigit hexadecimal digit @@ -5939,7 +6745,8 @@ one of the newline-setting options with similar syntax: (*NO_START_OPT) no start-match optimization (PCRE_NO_START_OPTIMIZE) - (*UTF8) set UTF-8 mode (PCRE_UTF8) + (*UTF8) set UTF-8 mode: 8-bit library (PCRE_UTF8) + (*UTF16) set UTF-16 mode: 16-bit library (PCRE_UTF16) (*UCP) set PCRE_UCP (use Unicode properties for \d etc) @@ -6008,6 +6815,7 @@ (*ACCEPT) force successful match (*FAIL) force backtrack; synonym (*F) + (*MARK:NAME) set name to be passed back; synonym (*:NAME) The following act only when a subsequent match failure causes a back- track to reach them. They all force a match failure, but they differ in @@ -6016,14 +6824,18 @@ (*COMMIT) overall failure, no advance of starting point (*PRUNE) advance to next starting character - (*SKIP) advance start to current matching position + (*PRUNE:NAME) equivalent to (*MARK:NAME)(*PRUNE) + (*SKIP) advance to current matching position + (*SKIP:NAME) advance to position corresponding to an earlier + (*MARK:NAME); if not found, the (*SKIP) is ignored (*THEN) local failure, backtrack to next alternation + (*THEN:NAME) equivalent to (*MARK:NAME)(*THEN) NEWLINE CONVENTIONS These are recognized only at the very start of the pattern or after a - (*BSR_...) or (*UTF8) or (*UCP) option. + (*BSR_...), (*UTF8), (*UTF16) or (*UCP) option. (*CR) carriage return only (*LF) linefeed only @@ -6035,7 +6847,7 @@ WHAT \R MATCHES These are recognized only at the very start of the pattern or after a - (*...) option that sets the newline convention or UTF-8 or UCP mode. + (*...) option that sets the newline convention or a UTF or UCP mode. (*BSR_ANYCRLF) CR, LF, or CRLF (*BSR_UNICODE) any Unicode newline sequence @@ -6061,8 +6873,594 @@ REVISION - Last updated: 21 November 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 10 January 2012 + Copyright (c) 1997-2012 University of Cambridge. +------------------------------------------------------------------------------ + + +PCREUNICODE(3) PCREUNICODE(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +UTF-8, UTF-16, AND UNICODE PROPERTY SUPPORT + + From Release 8.30, in addition to its previous UTF-8 support, PCRE also + supports UTF-16 by means of a separate 16-bit library. This can be + built as well as, or instead of, the 8-bit library. + + +UTF-8 SUPPORT + + In order process UTF-8 strings, you must build PCRE's 8-bit library + with UTF support, and, in addition, you must call pcre_compile() with + the PCRE_UTF8 option flag, or the pattern must start with the sequence + (*UTF8). When either of these is the case, both the pattern and any + subject strings that are matched against it are treated as UTF-8 + strings instead of strings of 1-byte characters. + + +UTF-16 SUPPORT + + In order process UTF-16 strings, you must build PCRE's 16-bit library + with UTF support, and, in addition, you must call pcre16_compile() with + the PCRE_UTF16 option flag, or the pattern must start with the sequence + (*UTF16). When either of these is the case, both the pattern and any + subject strings that are matched against it are treated as UTF-16 + strings instead of strings of 16-bit characters. + + +UTF SUPPORT OVERHEAD + + If you compile PCRE with UTF support, but do not use it at run time, + the library will be a bit bigger, but the additional run time overhead + is limited to testing the PCRE_UTF8/16 flag occasionally, so should not + be very big. + + +UNICODE PROPERTY SUPPORT + + If PCRE is built with Unicode character property support (which implies + UTF support), the escape sequences \p{..}, \P{..}, and \X can be used. + The available properties that can be tested are limited to the general + category properties such as Lu for an upper case letter or Nd for a + decimal number, the Unicode script names such as Arabic or Han, and the + derived properties Any and L&. A full list is given in the pcrepattern + documentation. Only the short names for properties are supported. For + example, \p{L} matches a letter. Its Perl synonym, \p{Letter}, is not + supported. Furthermore, in Perl, many properties may optionally be + prefixed by "Is", for compatibility with Perl 5.6. PCRE does not sup- + port this. + + Validity of UTF-8 strings + + When you set the PCRE_UTF8 flag, the byte strings passed as patterns + and subjects are (by default) checked for validity on entry to the rel- + evant functions. The entire string is checked before any other process- + ing takes place. From release 7.3 of PCRE, the check is according the + rules of RFC 3629, which are themselves derived from the Unicode speci- + fication. Earlier releases of PCRE followed the rules of RFC 2279, + which allows the full range of 31-bit values (0 to 0x7FFFFFFF). The + current check allows only values in the range U+0 to U+10FFFF, exclud- + ing U+D800 to U+DFFF. + + The excluded code points are the "Surrogate Area" of Unicode. They are + reserved for use by UTF-16, where they are used in pairs to encode + codepoints with values greater than 0xFFFF. The code points that are + encoded by UTF-16 pairs are available independently in the UTF-8 encod- + ing. (In other words, the whole surrogate thing is a fudge for UTF-16 + which unfortunately messes up UTF-8.) + + If an invalid UTF-8 string is passed to PCRE, an error return is given. + At compile time, the only additional information is the offset to the + first byte of the failing character. The run-time functions pcre_exec() + and pcre_dfa_exec() also pass back this information, as well as a more + detailed reason code if the caller has provided memory in which to do + this. + + In some situations, you may already know that your strings are valid, + and therefore want to skip these checks in order to improve perfor- + mance, for example in the case of a long subject string that is being + scanned repeatedly with different patterns. If you set the + PCRE_NO_UTF8_CHECK flag at compile time or at run time, PCRE assumes + that the pattern or subject it is given (respectively) contains only + valid UTF-8 codes. In this case, it does not diagnose an invalid UTF-8 + string. + + If you pass an invalid UTF-8 string when PCRE_NO_UTF8_CHECK is set, + what happens depends on why the string is invalid. If the string con- + forms to the "old" definition of UTF-8 (RFC 2279), it is processed as a + string of characters in the range 0 to 0x7FFFFFFF by pcre_dfa_exec() + and the interpreted version of pcre_exec(). In other words, apart from + the initial validity test, these functions (when in UTF-8 mode) handle + strings according to the more liberal rules of RFC 2279. However, the + just-in-time (JIT) optimization for pcre_exec() supports only RFC 3629. + If you are using JIT optimization, or if the string does not even con- + form to RFC 2279, the result is undefined. Your program may crash. + + If you want to process strings of values in the full range 0 to + 0x7FFFFFFF, encoded in a UTF-8-like manner as per the old RFC, you can + set PCRE_NO_UTF8_CHECK to bypass the more restrictive test. However, in + this situation, you will have to apply your own validity check, and + avoid the use of JIT optimization. + + Validity of UTF-16 strings + + When you set the PCRE_UTF16 flag, the strings of 16-bit data units that + are passed as patterns and subjects are (by default) checked for valid- + ity on entry to the relevant functions. Values other than those in the + surrogate range U+D800 to U+DFFF are independent code points. Values in + the surrogate range must be used in pairs in the correct manner. + + If an invalid UTF-16 string is passed to PCRE, an error return is + given. At compile time, the only additional information is the offset + to the first data unit of the failing character. The run-time functions + pcre16_exec() and pcre16_dfa_exec() also pass back this information, as + well as a more detailed reason code if the caller has provided memory + in which to do this. + + In some situations, you may already know that your strings are valid, + and therefore want to skip these checks in order to improve perfor- + mance. If you set the PCRE_NO_UTF16_CHECK flag at compile time or at + run time, PCRE assumes that the pattern or subject it is given (respec- + tively) contains only valid UTF-16 sequences. In this case, it does not + diagnose an invalid UTF-16 string. + + General comments about UTF modes + + 1. Codepoints less than 256 can be specified by either braced or + unbraced hexadecimal escape sequences (for example, \x{b3} or \xb3). + Larger values have to use braced sequences. + + 2. Octal numbers up to \777 are recognized, and in UTF-8 mode, they + match two-byte characters for values greater than \177. + + 3. Repeat quantifiers apply to complete UTF characters, not to individ- + ual data units, for example: \x{100}{3}. + + 4. The dot metacharacter matches one UTF character instead of a single + data unit. + + 5. The escape sequence \C can be used to match a single byte in UTF-8 + mode, or a single 16-bit data unit in UTF-16 mode, but its use can lead + to some strange effects because it breaks up multi-unit characters (see + the description of \C in the pcrepattern documentation). The use of \C + is not supported in the alternative matching function + pcre[16]_dfa_exec(), nor is it supported in UTF mode by the JIT opti- + mization of pcre[16]_exec(). If JIT optimization is requested for a UTF + pattern that contains \C, it will not succeed, and so the matching will + be carried out by the normal interpretive function. + + 6. The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly + test characters of any code value, but, by default, the characters that + PCRE recognizes as digits, spaces, or word characters remain the same + set as in non-UTF mode, all with values less than 256. This remains + true even when PCRE is built to include Unicode property support, + because to do otherwise would slow down PCRE in many common cases. Note + in particular that this applies to \b and \B, because they are defined + in terms of \w and \W. If you really want to test for a wider sense of, + say, "digit", you can use explicit Unicode property tests such as + \p{Nd}. Alternatively, if you set the PCRE_UCP option, the way that the + character escapes work is changed so that Unicode properties are used + to determine which characters match. There are more details in the sec- + tion on generic character types in the pcrepattern documentation. + + 7. Similarly, characters that match the POSIX named character classes + are all low-valued characters, unless the PCRE_UCP option is set. + + 8. However, the horizontal and vertical white space matching escapes + (\h, \H, \v, and \V) do match all the appropriate Unicode characters, + whether or not PCRE_UCP is set. + + 9. Case-insensitive matching applies only to characters whose values + are less than 128, unless PCRE is built with Unicode property support. + Even when Unicode property support is available, PCRE still uses its + own character tables when checking the case of low-valued characters, + so as not to degrade performance. The Unicode property information is + used only for characters with higher values. Furthermore, PCRE supports + case-insensitive matching only when there is a one-to-one mapping + between a letter's cases. There are a small number of many-to-one map- + pings in Unicode; these are not supported by PCRE. + + +AUTHOR + + Philip Hazel + University Computing Service + Cambridge CB2 3QH, England. + + +REVISION + + Last updated: 14 April 2012 + Copyright (c) 1997-2012 University of Cambridge. +------------------------------------------------------------------------------ + + +PCREJIT(3) PCREJIT(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +PCRE JUST-IN-TIME COMPILER SUPPORT + + Just-in-time compiling is a heavyweight optimization that can greatly + speed up pattern matching. However, it comes at the cost of extra pro- + cessing before the match is performed. Therefore, it is of most benefit + when the same pattern is going to be matched many times. This does not + necessarily mean many calls of a matching function; if the pattern is + not anchored, matching attempts may take place many times at various + positions in the subject, even for a single call. Therefore, if the + subject string is very long, it may still pay to use JIT for one-off + matches. + + JIT support applies only to the traditional Perl-compatible matching + function. It does not apply when the DFA matching function is being + used. The code for this support was written by Zoltan Herczeg. + + +8-BIT and 16-BIT SUPPORT + + JIT support is available for both the 8-bit and 16-bit PCRE libraries. + To keep this documentation simple, only the 8-bit interface is + described in what follows. If you are using the 16-bit library, substi- + tute the 16-bit functions and 16-bit structures (for example, + pcre16_jit_stack instead of pcre_jit_stack). + + +AVAILABILITY OF JIT SUPPORT + + JIT support is an optional feature of PCRE. The "configure" option + --enable-jit (or equivalent CMake option) must be set when PCRE is + built if you want to use JIT. The support is limited to the following + hardware platforms: + + ARM v5, v7, and Thumb2 + Intel x86 32-bit and 64-bit + MIPS 32-bit + Power PC 32-bit and 64-bit + + If --enable-jit is set on an unsupported platform, compilation fails. + + A program that is linked with PCRE 8.20 or later can tell if JIT sup- + port is available by calling pcre_config() with the PCRE_CONFIG_JIT + option. The result is 1 when JIT is available, and 0 otherwise. How- + ever, a simple program does not need to check this in order to use JIT. + The API is implemented in a way that falls back to the interpretive + code if JIT is not available. + + If your program may sometimes be linked with versions of PCRE that are + older than 8.20, but you want to use JIT when it is available, you can + test the values of PCRE_MAJOR and PCRE_MINOR, or the existence of a JIT + macro such as PCRE_CONFIG_JIT, for compile-time control of your code. + + +SIMPLE USE OF JIT + + You have to do two things to make use of the JIT support in the sim- + plest way: + + (1) Call pcre_study() with the PCRE_STUDY_JIT_COMPILE option for + each compiled pattern, and pass the resulting pcre_extra block to + pcre_exec(). + + (2) Use pcre_free_study() to free the pcre_extra block when it is + no longer needed, instead of just freeing it yourself. This + ensures that any JIT data is also freed. + + For a program that may be linked with pre-8.20 versions of PCRE, you + can insert + + #ifndef PCRE_STUDY_JIT_COMPILE + #define PCRE_STUDY_JIT_COMPILE 0 + #endif + + so that no option is passed to pcre_study(), and then use something + like this to free the study data: + + #ifdef PCRE_CONFIG_JIT + pcre_free_study(study_ptr); + #else + pcre_free(study_ptr); + #endif + + PCRE_STUDY_JIT_COMPILE requests the JIT compiler to generate code for + complete matches. If you want to run partial matches using the + PCRE_PARTIAL_HARD or PCRE_PARTIAL_SOFT options of pcre_exec(), you + should set one or both of the following options in addition to, or + instead of, PCRE_STUDY_JIT_COMPILE when you call pcre_study(): + + PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE + PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE + + The JIT compiler generates different optimized code for each of the + three modes (normal, soft partial, hard partial). When pcre_exec() is + called, the appropriate code is run if it is available. Otherwise, the + pattern is matched using interpretive code. + + In some circumstances you may need to call additional functions. These + are described in the section entitled "Controlling the JIT stack" + below. + + If JIT support is not available, PCRE_STUDY_JIT_COMPILE etc. are + ignored, and no JIT data is created. Otherwise, the compiled pattern is + passed to the JIT compiler, which turns it into machine code that exe- + cutes much faster than the normal interpretive code. When pcre_exec() + is passed a pcre_extra block containing a pointer to JIT code of the + appropriate mode (normal or hard/soft partial), it obeys that code + instead of running the interpreter. The result is identical, but the + compiled JIT code runs much faster. + + There are some pcre_exec() options that are not supported for JIT exe- + cution. There are also some pattern items that JIT cannot handle. + Details are given below. In both cases, execution automatically falls + back to the interpretive code. If you want to know whether JIT was + actually used for a particular match, you should arrange for a JIT + callback function to be set up as described in the section entitled + "Controlling the JIT stack" below, even if you do not need to supply a + non-default JIT stack. Such a callback function is called whenever JIT + code is about to be obeyed. If the execution options are not right for + JIT execution, the callback function is not obeyed. + + If the JIT compiler finds an unsupported item, no JIT data is gener- + ated. You can find out if JIT execution is available after studying a + pattern by calling pcre_fullinfo() with the PCRE_INFO_JIT option. A + result of 1 means that JIT compilation was successful. A result of 0 + means that JIT support is not available, or the pattern was not studied + with PCRE_STUDY_JIT_COMPILE etc., or the JIT compiler was not able to + handle the pattern. + + Once a pattern has been studied, with or without JIT, it can be used as + many times as you like for matching different subject strings. + + +UNSUPPORTED OPTIONS AND PATTERN ITEMS + + The only pcre_exec() options that are supported for JIT execution are + PCRE_NO_UTF8_CHECK, PCRE_NO_UTF16_CHECK, PCRE_NOTBOL, PCRE_NOTEOL, + PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, PCRE_PARTIAL_HARD, and PCRE_PAR- + TIAL_SOFT. + + The unsupported pattern items are: + + \C match a single byte; not supported in UTF-8 mode + (?Cn) callouts + (*PRUNE) ) + (*SKIP) ) backtracking control verbs + (*THEN) ) + + Support for some of these may be added in future. + + +RETURN VALUES FROM JIT EXECUTION + + When a pattern is matched using JIT execution, the return values are + the same as those given by the interpretive pcre_exec() code, with the + addition of one new error code: PCRE_ERROR_JIT_STACKLIMIT. This means + that the memory used for the JIT stack was insufficient. See "Control- + ling the JIT stack" below for a discussion of JIT stack usage. For com- + patibility with the interpretive pcre_exec() code, no more than two- + thirds of the ovector argument is used for passing back captured sub- + strings. + + The error code PCRE_ERROR_MATCHLIMIT is returned by the JIT code if + searching a very large pattern tree goes on for too long, as it is in + the same circumstance when JIT is not used, but the details of exactly + what is counted are not the same. The PCRE_ERROR_RECURSIONLIMIT error + code is never returned by JIT execution. + + +SAVING AND RESTORING COMPILED PATTERNS + + The code that is generated by the JIT compiler is architecture-spe- + cific, and is also position dependent. For those reasons it cannot be + saved (in a file or database) and restored later like the bytecode and + other data of a compiled pattern. Saving and restoring compiled pat- + terns is not something many people do. More detail about this facility + is given in the pcreprecompile documentation. It should be possible to + run pcre_study() on a saved and restored pattern, and thereby recreate + the JIT data, but because JIT compilation uses significant resources, + it is probably not worth doing this; you might as well recompile the + original pattern. + + +CONTROLLING THE JIT STACK + + When the compiled JIT code runs, it needs a block of memory to use as a + stack. By default, it uses 32K on the machine stack. However, some + large or complicated patterns need more than this. The error + PCRE_ERROR_JIT_STACKLIMIT is given when there is not enough stack. + Three functions are provided for managing blocks of memory for use as + JIT stacks. There is further discussion about the use of JIT stacks in + the section entitled "JIT stack FAQ" below. + + The pcre_jit_stack_alloc() function creates a JIT stack. Its arguments + are a starting size and a maximum size, and it returns a pointer to an + opaque structure of type pcre_jit_stack, or NULL if there is an error. + The pcre_jit_stack_free() function can be used to free a stack that is + no longer needed. (For the technically minded: the address space is + allocated by mmap or VirtualAlloc.) + + JIT uses far less memory for recursion than the interpretive code, and + a maximum stack size of 512K to 1M should be more than enough for any + pattern. + + The pcre_assign_jit_stack() function specifies which stack JIT code + should use. Its arguments are as follows: + + pcre_extra *extra + pcre_jit_callback callback + void *data + + The extra argument must be the result of studying a pattern with + PCRE_STUDY_JIT_COMPILE etc. There are three cases for the values of the + other two options: + + (1) If callback is NULL and data is NULL, an internal 32K block + on the machine stack is used. + + (2) If callback is NULL and data is not NULL, data must be + a valid JIT stack, the result of calling pcre_jit_stack_alloc(). + + (3) If callback is not NULL, it must point to a function that is + called with data as an argument at the start of matching, in + order to set up a JIT stack. If the return from the callback + function is NULL, the internal 32K stack is used; otherwise the + return value must be a valid JIT stack, the result of calling + pcre_jit_stack_alloc(). + + A callback function is obeyed whenever JIT code is about to be run; it + is not obeyed when pcre_exec() is called with options that are incom- + patible for JIT execution. A callback function can therefore be used to + determine whether a match operation was executed by JIT or by the + interpreter. + + You may safely use the same JIT stack for more than one pattern (either + by assigning directly or by callback), as long as the patterns are all + matched sequentially in the same thread. In a multithread application, + if you do not specify a JIT stack, or if you assign or pass back NULL + from a callback, that is thread-safe, because each thread has its own + machine stack. However, if you assign or pass back a non-NULL JIT + stack, this must be a different stack for each thread so that the + application is thread-safe. + + Strictly speaking, even more is allowed. You can assign the same non- + NULL stack to any number of patterns as long as they are not used for + matching by multiple threads at the same time. For example, you can + assign the same stack to all compiled patterns, and use a global mutex + in the callback to wait until the stack is available for use. However, + this is an inefficient solution, and not recommended. + + This is a suggestion for how a multithreaded program that needs to set + up non-default JIT stacks might operate: + + During thread initalization + thread_local_var = pcre_jit_stack_alloc(...) + + During thread exit + pcre_jit_stack_free(thread_local_var) + + Use a one-line callback function + return thread_local_var + + All the functions described in this section do nothing if JIT is not + available, and pcre_assign_jit_stack() does nothing unless the extra + argument is non-NULL and points to a pcre_extra block that is the + result of a successful study with PCRE_STUDY_JIT_COMPILE etc. + + +JIT STACK FAQ + + (1) Why do we need JIT stacks? + + PCRE (and JIT) is a recursive, depth-first engine, so it needs a stack + where the local data of the current node is pushed before checking its + child nodes. Allocating real machine stack on some platforms is diffi- + cult. For example, the stack chain needs to be updated every time if we + extend the stack on PowerPC. Although it is possible, its updating + time overhead decreases performance. So we do the recursion in memory. + + (2) Why don't we simply allocate blocks of memory with malloc()? + + Modern operating systems have a nice feature: they can reserve an + address space instead of allocating memory. We can safely allocate mem- + ory pages inside this address space, so the stack could grow without + moving memory data (this is important because of pointers). Thus we can + allocate 1M address space, and use only a single memory page (usually + 4K) if that is enough. However, we can still grow up to 1M anytime if + needed. + + (3) Who "owns" a JIT stack? + + The owner of the stack is the user program, not the JIT studied pattern + or anything else. The user program must ensure that if a stack is used + by pcre_exec(), (that is, it is assigned to the pattern currently run- + ning), that stack must not be used by any other threads (to avoid over- + writing the same memory area). The best practice for multithreaded pro- + grams is to allocate a stack for each thread, and return this stack + through the JIT callback function. + + (4) When should a JIT stack be freed? + + You can free a JIT stack at any time, as long as it will not be used by + pcre_exec() again. When you assign the stack to a pattern, only a + pointer is set. There is no reference counting or any other magic. You + can free the patterns and stacks in any order, anytime. Just do not + call pcre_exec() with a pattern pointing to an already freed stack, as + that will cause SEGFAULT. (Also, do not free a stack currently used by + pcre_exec() in another thread). You can also replace the stack for a + pattern at any time. You can even free the previous stack before + assigning a replacement. + + (5) Should I allocate/free a stack every time before/after calling + pcre_exec()? + + No, because this is too costly in terms of resources. However, you + could implement some clever idea which release the stack if it is not + used in let's say two minutes. The JIT callback can help to achive this + without keeping a list of the currently JIT studied patterns. + + (6) OK, the stack is for long term memory allocation. But what happens + if a pattern causes stack overflow with a stack of 1M? Is that 1M kept + until the stack is freed? + + Especially on embedded sytems, it might be a good idea to release mem- + ory sometimes without freeing the stack. There is no API for this at + the moment. Probably a function call which returns with the currently + allocated memory for any stack and another which allows releasing mem- + ory (shrinking the stack) would be a good idea if someone needs this. + + (7) This is too much of a headache. Isn't there any better solution for + JIT stack handling? + + No, thanks to Windows. If POSIX threads were used everywhere, we could + throw out this complicated API. + + +EXAMPLE CODE + + This is a single-threaded example that specifies a JIT stack without + using a callback. + + int rc; + int ovector[30]; + pcre *re; + pcre_extra *extra; + pcre_jit_stack *jit_stack; + + re = pcre_compile(pattern, 0, &error, &erroffset, NULL); + /* Check for errors */ + extra = pcre_study(re, PCRE_STUDY_JIT_COMPILE, &error); + jit_stack = pcre_jit_stack_alloc(32*1024, 512*1024); + /* Check for error (NULL) */ + pcre_assign_jit_stack(extra, NULL, jit_stack); + rc = pcre_exec(re, extra, subject, length, 0, 0, ovector, 30); + /* Check results */ + pcre_free(re); + pcre_free_study(extra); + pcre_jit_stack_free(jit_stack); + + +SEE ALSO + + pcreapi(3) + + +AUTHOR + + Philip Hazel (FAQ by Zoltan Herczeg) + University Computing Service + Cambridge CB2 3QH, England. + + +REVISION + + Last updated: 04 May 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ @@ -6075,11 +7473,11 @@ PARTIAL MATCHING IN PCRE - In normal use of PCRE, if the subject string that is passed to - pcre_exec() or pcre_dfa_exec() matches as far as it goes, but is too - short to match the entire pattern, PCRE_ERROR_NOMATCH is returned. - There are circumstances where it might be helpful to distinguish this - case from other cases in which there is no match. + In normal use of PCRE, if the subject string that is passed to a match- + ing function matches as far as it goes, but is too short to match the + entire pattern, PCRE_ERROR_NOMATCH is returned. There are circumstances + where it might be helpful to distinguish this case from other cases in + which there is no match. Consider, for example, an application where a human is required to type in data for a field with specific formatting requirements. An example @@ -6097,41 +7495,52 @@ available at once. PCRE supports partial matching by means of the PCRE_PARTIAL_SOFT and - PCRE_PARTIAL_HARD options, which can be set when calling pcre_exec() or - pcre_dfa_exec(). For backwards compatibility, PCRE_PARTIAL is a synonym - for PCRE_PARTIAL_SOFT. The essential difference between the two options - is whether or not a partial match is preferred to an alternative com- - plete match, though the details differ between the two matching func- - tions. If both options are set, PCRE_PARTIAL_HARD takes precedence. - - Setting a partial matching option disables two of PCRE's optimizations. - PCRE remembers the last literal byte in a pattern, and abandons match- - ing immediately if such a byte is not present in the subject string. - This optimization cannot be used for a subject string that might match - only partially. If the pattern was studied, PCRE knows the minimum - length of a matching string, and does not bother to run the matching - function on shorter strings. This optimization is also disabled for - partial matching. - - -PARTIAL MATCHING USING pcre_exec() - - A partial match occurs during a call to pcre_exec() when the end of the - subject string is reached successfully, but matching cannot continue - because more characters are needed. However, at least one character in - the subject must have been inspected. This character need not form part - of the final matched string; lookbehind assertions and the \K escape - sequence provide ways of inspecting characters before the start of a - matched substring. The requirement for inspecting at least one charac- - ter exists because an empty string can always be matched; without such - a restriction there would always be a partial match of an empty string - at the end of the subject. - - If there are at least two slots in the offsets vector when pcre_exec() - returns with a partial match, the first slot is set to the offset of - the earliest character that was inspected when the partial match was - found. For convenience, the second offset points to the end of the sub- - ject so that a substring can easily be identified. + PCRE_PARTIAL_HARD options, which can be set when calling any of the + matching functions. For backwards compatibility, PCRE_PARTIAL is a syn- + onym for PCRE_PARTIAL_SOFT. The essential difference between the two + options is whether or not a partial match is preferred to an alterna- + tive complete match, though the details differ between the two types of + matching function. If both options are set, PCRE_PARTIAL_HARD takes + precedence. + + If you want to use partial matching with just-in-time optimized code, + you must call pcre_study() or pcre16_study() with one or both of these + options: + + PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE + PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE + + PCRE_STUDY_JIT_COMPILE should also be set if you are going to run non- + partial matches on the same pattern. If the appropriate JIT study mode + has not been set for a match, the interpretive matching code is used. + + Setting a partial matching option disables two of PCRE's standard opti- + mizations. PCRE remembers the last literal data unit in a pattern, and + abandons matching immediately if it is not present in the subject + string. This optimization cannot be used for a subject string that + might match only partially. If the pattern was studied, PCRE knows the + minimum length of a matching string, and does not bother to run the + matching function on shorter strings. This optimization is also dis- + abled for partial matching. + + +PARTIAL MATCHING USING pcre_exec() OR pcre16_exec() + + A partial match occurs during a call to pcre_exec() or pcre16_exec() + when the end of the subject string is reached successfully, but match- + ing cannot continue because more characters are needed. However, at + least one character in the subject must have been inspected. This char- + acter need not form part of the final matched string; lookbehind asser- + tions and the \K escape sequence provide ways of inspecting characters + before the start of a matched substring. The requirement for inspecting + at least one character exists because an empty string can always be + matched; without such a restriction there would always be a partial + match of an empty string at the end of the subject. + + If there are at least two slots in the offsets vector when a partial + match is returned, the first slot is set to the offset of the earliest + character that was inspected. For convenience, the second offset points + to the end of the subject so that a substring can easily be identified. For the majority of patterns, the first offset identifies the start of the partially matched string. However, for patterns that contain look- @@ -6148,13 +7557,13 @@ What happens when a partial match is identified depends on which of the two partial matching options are set. - PCRE_PARTIAL_SOFT with pcre_exec() + PCRE_PARTIAL_SOFT WITH pcre_exec() OR pcre16_exec() - If PCRE_PARTIAL_SOFT is set when pcre_exec() identifies a partial - match, the partial match is remembered, but matching continues as nor- - mal, and other alternatives in the pattern are tried. If no complete - match can be found, pcre_exec() returns PCRE_ERROR_PARTIAL instead of - PCRE_ERROR_NOMATCH. + If PCRE_PARTIAL_SOFT is set when pcre_exec() or pcre16_exec() identi- + fies a partial match, the partial match is remembered, but matching + continues as normal, and other alternatives in the pattern are tried. + If no complete match can be found, PCRE_ERROR_PARTIAL is returned + instead of PCRE_ERROR_NOMATCH. This option is "soft" because it prefers a complete match over a par- tial match. All the various matching items in a pattern behave as if @@ -6174,22 +7583,24 @@ (In this example, there are two partial matches, because "dog" on its own partially matches the second alternative.) - PCRE_PARTIAL_HARD with pcre_exec() + PCRE_PARTIAL_HARD WITH pcre_exec() OR pcre16_exec() - If PCRE_PARTIAL_HARD is set for pcre_exec(), it returns PCRE_ERROR_PAR- - TIAL as soon as a partial match is found, without continuing to search - for possible complete matches. This option is "hard" because it prefers - an earlier partial match over a later complete match. For this reason, - the assumption is made that the end of the supplied subject string may - not be the true end of the available data, and so, if \z, \Z, \b, \B, - or $ are encountered at the end of the subject, the result is - PCRE_ERROR_PARTIAL. - - Setting PCRE_PARTIAL_HARD also affects the way pcre_exec() checks UTF-8 - subject strings for validity. Normally, an invalid UTF-8 sequence - causes the error PCRE_ERROR_BADUTF8. However, in the special case of a - truncated UTF-8 character at the end of the subject, PCRE_ERROR_SHORT- - UTF8 is returned when PCRE_PARTIAL_HARD is set. + If PCRE_PARTIAL_HARD is set for pcre_exec() or pcre16_exec(), + PCRE_ERROR_PARTIAL is returned as soon as a partial match is found, + without continuing to search for possible complete matches. This option + is "hard" because it prefers an earlier partial match over a later com- + plete match. For this reason, the assumption is made that the end of + the supplied subject string may not be the true end of the available + data, and so, if \z, \Z, \b, \B, or $ are encountered at the end of the + subject, the result is PCRE_ERROR_PARTIAL, provided that at least one + character in the subject has been inspected. + + Setting PCRE_PARTIAL_HARD also affects the way UTF-8 and UTF-16 subject + strings are checked for validity. Normally, an invalid sequence causes + the error PCRE_ERROR_BADUTF8 or PCRE_ERROR_BADUTF16. However, in the + special case of a truncated character at the end of the subject, + PCRE_ERROR_SHORTUTF8 or PCRE_ERROR_SHORTUTF16 is returned when + PCRE_PARTIAL_HARD is set. Comparing hard and soft partial matching @@ -6207,25 +7618,25 @@ /dog(sbody)??/ - In this case the result is always a complete match because pcre_exec() - finds that first, and it never continues after finding a match. It - might be easier to follow this explanation by thinking of the two pat- - terns like this: + In this case the result is always a complete match because that is + found first, and matching never continues after finding a complete + match. It might be easier to follow this explanation by thinking of the + two patterns like this: /dog(sbody)?/ is the same as /dogsbody|dog/ /dog(sbody)??/ is the same as /dog|dogsbody/ - The second pattern will never match "dogsbody" when pcre_exec() is - used, because it will always find the shorter match first. + The second pattern will never match "dogsbody", because it will always + find the shorter match first. -PARTIAL MATCHING USING pcre_dfa_exec() +PARTIAL MATCHING USING pcre_dfa_exec() OR pcre16_dfa_exec() - The pcre_dfa_exec() function moves along the subject string character - by character, without backtracking, searching for all possible matches - simultaneously. If the end of the subject is reached before the end of - the pattern, there is the possibility of a partial match, again pro- - vided that at least one character has been inspected. + The DFA functions move along the subject string character by character, + without backtracking, searching for all possible matches simultane- + ously. If the end of the subject is reached before the end of the pat- + tern, there is the possibility of a partial match, again provided that + at least one character has been inspected. When PCRE_PARTIAL_SOFT is set, PCRE_ERROR_PARTIAL is returned only if there have been no complete matches. Otherwise, the complete matches @@ -6235,17 +7646,17 @@ the first matching string, provided there are at least two slots in the offsets vector. - Because pcre_dfa_exec() always searches for all possible matches, and - there is no difference between greedy and ungreedy repetition, its be- - haviour is different from pcre_exec when PCRE_PARTIAL_HARD is set. Con- - sider the string "dog" matched against the ungreedy pattern shown - above: + Because the DFA functions always search for all possible matches, and + there is no difference between greedy and ungreedy repetition, their + behaviour is different from the standard functions when PCRE_PAR- + TIAL_HARD is set. Consider the string "dog" matched against the + ungreedy pattern shown above: /dog(sbody)??/ - Whereas pcre_exec() stops as soon as it finds the complete match for - "dog", pcre_dfa_exec() also finds the partial match for "dogsbody", and - so returns that when PCRE_PARTIAL_HARD is set. + Whereas the standard functions stop as soon as they find the complete + match for "dog", the DFA functions also find the partial match for + "dogsbody", and so return that when PCRE_PARTIAL_HARD is set. PARTIAL MATCHING AND WORD BOUNDARIES @@ -6259,37 +7670,34 @@ This matches "cat", provided there is a word boundary at either end. If the subject string is "the cat", the comparison of the final "t" with a following character cannot take place, so a partial match is found. - However, pcre_exec() carries on with normal matching, which matches \b - at the end of the subject when the last character is a letter, thus - finding a complete match. The result, therefore, is not PCRE_ERROR_PAR- - TIAL. The same thing happens with pcre_dfa_exec(), because it also - finds the complete match. - - Using PCRE_PARTIAL_HARD in this case does yield PCRE_ERROR_PARTIAL, - because then the partial match takes precedence. + However, normal matching carries on, and \b matches at the end of the + subject when the last character is a letter, so a complete match is + found. The result, therefore, is not PCRE_ERROR_PARTIAL. Using + PCRE_PARTIAL_HARD in this case does yield PCRE_ERROR_PARTIAL, because + then the partial match takes precedence. FORMERLY RESTRICTED PATTERNS For releases of PCRE prior to 8.00, because of the way certain internal - optimizations were implemented in the pcre_exec() function, the - PCRE_PARTIAL option (predecessor of PCRE_PARTIAL_SOFT) could not be - used with all patterns. From release 8.00 onwards, the restrictions no - longer apply, and partial matching with pcre_exec() can be requested - for any pattern. + optimizations were implemented in the pcre_exec() function, the + PCRE_PARTIAL option (predecessor of PCRE_PARTIAL_SOFT) could not be + used with all patterns. From release 8.00 onwards, the restrictions no + longer apply, and partial matching with can be requested for any pat- + tern. Items that were formerly restricted were repeated single characters and - repeated metasequences. If PCRE_PARTIAL was set for a pattern that did - not conform to the restrictions, pcre_exec() returned the error code - PCRE_ERROR_BADPARTIAL (-13). This error code is no longer in use. The - PCRE_INFO_OKPARTIAL call to pcre_fullinfo() to find out if a compiled + repeated metasequences. If PCRE_PARTIAL was set for a pattern that did + not conform to the restrictions, pcre_exec() returned the error code + PCRE_ERROR_BADPARTIAL (-13). This error code is no longer in use. The + PCRE_INFO_OKPARTIAL call to pcre_fullinfo() to find out if a compiled pattern can be used for partial matching now always returns 1. EXAMPLE OF PARTIAL MATCHING USING PCRETEST - If the escape sequence \P is present in a pcretest data line, the - PCRE_PARTIAL_SOFT option is used for the match. Here is a run of + If the escape sequence \P is present in a pcretest data line, the + PCRE_PARTIAL_SOFT option is used for the match. Here is a run of pcretest that uses the date example quoted above: re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ @@ -6305,25 +7713,25 @@ data> j\P No match - The first data string is matched completely, so pcretest shows the - matched substrings. The remaining four strings do not match the com- + The first data string is matched completely, so pcretest shows the + matched substrings. The remaining four strings do not match the com- plete pattern, but the first two are partial matches. Similar output is - obtained when pcre_dfa_exec() is used. + obtained if DFA matching is used. - If the escape sequence \P is present more than once in a pcretest data + If the escape sequence \P is present more than once in a pcretest data line, the PCRE_PARTIAL_HARD option is set for the match. -MULTI-SEGMENT MATCHING WITH pcre_dfa_exec() +MULTI-SEGMENT MATCHING WITH pcre_dfa_exec() OR pcre16_dfa_exec() - When a partial match has been found using pcre_dfa_exec(), it is possi- - ble to continue the match by providing additional subject data and - calling pcre_dfa_exec() again with the same compiled regular expres- - sion, this time setting the PCRE_DFA_RESTART option. You must pass the + When a partial match has been found using a DFA matching function, it + is possible to continue the match by providing additional subject data + and calling the function again with the same compiled regular expres- + sion, this time setting the PCRE_DFA_RESTART option. You must pass the same working space as before, because this is where details of the pre- - vious partial match are stored. Here is an example using pcretest, - using the \R escape sequence to set the PCRE_DFA_RESTART option (\D - specifies the use of pcre_dfa_exec()): + vious partial match are stored. Here is an example using pcretest, + using the \R escape sequence to set the PCRE_DFA_RESTART option (\D + specifies the use of the DFA matching function): re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ data> 23ja\P\D @@ -6331,46 +7739,49 @@ data> n05\R\D 0: n05 - The first call has "23ja" as the subject, and requests partial match- - ing; the second call has "n05" as the subject for the continued - (restarted) match. Notice that when the match is complete, only the - last part is shown; PCRE does not retain the previously partially- - matched string. It is up to the calling program to do that if it needs + The first call has "23ja" as the subject, and requests partial match- + ing; the second call has "n05" as the subject for the continued + (restarted) match. Notice that when the match is complete, only the + last part is shown; PCRE does not retain the previously partially- + matched string. It is up to the calling program to do that if it needs to. - You can set the PCRE_PARTIAL_SOFT or PCRE_PARTIAL_HARD options with - PCRE_DFA_RESTART to continue partial matching over multiple segments. - This facility can be used to pass very long subject strings to - pcre_dfa_exec(). - - -MULTI-SEGMENT MATCHING WITH pcre_exec() - - From release 8.00, pcre_exec() can also be used to do multi-segment - matching. Unlike pcre_dfa_exec(), it is not possible to restart the - previous match with a new segment of data. Instead, new data must be - added to the previous subject string, and the entire match re-run, - starting from the point where the partial match occurred. Earlier data - can be discarded. It is best to use PCRE_PARTIAL_HARD in this situa- - tion, because it does not treat the end of a segment as the end of the - subject when matching \z, \Z, \b, \B, and $. Consider an unanchored - pattern that matches dates: + You can set the PCRE_PARTIAL_SOFT or PCRE_PARTIAL_HARD options with + PCRE_DFA_RESTART to continue partial matching over multiple segments. + This facility can be used to pass very long subject strings to the DFA + matching functions. + + +MULTI-SEGMENT MATCHING WITH pcre_exec() OR pcre16_exec() + + From release 8.00, the standard matching functions can also be used to + do multi-segment matching. Unlike the DFA functions, it is not possible + to restart the previous match with a new segment of data. Instead, new + data must be added to the previous subject string, and the entire match + re-run, starting from the point where the partial match occurred. Ear- + lier data can be discarded. + + It is best to use PCRE_PARTIAL_HARD in this situation, because it does + not treat the end of a segment as the end of the subject when matching + \z, \Z, \b, \B, and $. Consider an unanchored pattern that matches + dates: re> /\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d/ data> The date is 23ja\P\P Partial match: 23ja - At this stage, an application could discard the text preceding "23ja", - add on text from the next segment, and call pcre_exec() again. Unlike - pcre_dfa_exec(), the entire matching string must always be available, - and the complete matching process occurs for each call, so more memory - and more processing time is needed. - - Note: If the pattern contains lookbehind assertions, or \K, or starts - with \b or \B, the string that is returned for a partial match will - include characters that precede the partially matched string itself, - because these must be retained when adding on more characters for a - subsequent matching attempt. + At this stage, an application could discard the text preceding "23ja", + add on text from the next segment, and call the matching function + again. Unlike the DFA matching functions, the entire matching string + must always be available, and the complete matching process occurs for + each call, so more memory and more processing time is needed. + + Note: If the pattern contains lookbehind assertions, or \K, or starts + with \b or \B, the string that is returned for a partial match includes + characters that precede the partially matched string itself, because + these must be retained when adding on more characters for a subsequent + matching attempt. However, in some cases you may need to retain even + earlier characters, as discussed in the next section. ISSUES WITH MULTI-SEGMENT MATCHING @@ -6384,23 +7795,40 @@ option, but in practice when doing multi-segment matching you should be using PCRE_PARTIAL_HARD, which includes the effect of PCRE_NOTEOL. - 2. Lookbehind assertions at the start of a pattern are catered for in - the offsets that are returned for a partial match. However, in theory, - a lookbehind assertion later in the pattern could require even earlier - characters to be inspected, and it might not have been reached when a - partial match occurs. This is probably an extremely unlikely case; you - could guard against it to a certain extent by always including extra - characters at the start. - - 3. Matching a subject string that is split into multiple segments may - not always produce exactly the same result as matching over one single - long string, especially when PCRE_PARTIAL_SOFT is used. The section - "Partial Matching and Word Boundaries" above describes an issue that - arises if the pattern ends with \b or \B. Another kind of difference - may occur when there are multiple matching possibilities, because (for - PCRE_PARTIAL_SOFT) a partial match result is given only when there are + 2. Lookbehind assertions that have already been obeyed are catered for + in the offsets that are returned for a partial match. However a lookbe- + hind assertion later in the pattern could require even earlier charac- + ters to be inspected. You can handle this case by using the + PCRE_INFO_MAXLOOKBEHIND option of the pcre_fullinfo() or + pcre16_fullinfo() functions to obtain the length of the largest lookbe- + hind in the pattern. This length is given in characters, not bytes. If + you always retain at least that many characters before the partially + matched string, all should be well. (Of course, near the start of the + subject, fewer characters may be present; in that case all characters + should be retained.) + + 3. Because a partial match must always contain at least one character, + what might be considered a partial match of an empty string actually + gives a "no match" result. For example: + + re> /c(?<=abc)x/ + data> ab\P + No match + + If the next segment begins "cx", a match should be found, but this will + only happen if characters from the previous segment are retained. For + this reason, a "no match" result should be interpreted as "partial + match of an empty string" when the pattern contains lookbehinds. + + 4. Matching a subject string that is split into multiple segments may + not always produce exactly the same result as matching over one single + long string, especially when PCRE_PARTIAL_SOFT is used. The section + "Partial Matching and Word Boundaries" above describes an issue that + arises if the pattern ends with \b or \B. Another kind of difference + may occur when there are multiple matching possibilities, because (for + PCRE_PARTIAL_SOFT) a partial match result is given only when there are no completed matches. This means that as soon as the shortest match has - been found, continuation to a new subject segment is no longer possi- + been found, continuation to a new subject segment is no longer possi- ble. Consider again this pcretest example: re> /dog(sbody)?/ @@ -6414,14 +7842,15 @@ 0: dogsbody 1: dog - The first data line passes the string "dogsb" to pcre_exec(), setting - the PCRE_PARTIAL_SOFT option. Although the string is a partial match - for "dogsbody", the result is not PCRE_ERROR_PARTIAL, because the - shorter string "dog" is a complete match. Similarly, when the subject - is presented to pcre_dfa_exec() in several parts ("do" and "gsb" being - the first two) the match stops when "dog" has been found, and it is not - possible to continue. On the other hand, if "dogsbody" is presented as - a single string, pcre_dfa_exec() finds both matches. + The first data line passes the string "dogsb" to a standard matching + function, setting the PCRE_PARTIAL_SOFT option. Although the string is + a partial match for "dogsbody", the result is not PCRE_ERROR_PARTIAL, + because the shorter string "dog" is a complete match. Similarly, when + the subject is presented to a DFA matching function in several parts + ("do" and "gsb" being the first two) the match stops when "dog" has + been found, and it is not possible to continue. On the other hand, if + "dogsbody" is presented as a single string, a DFA matching function + finds both matches. Because of these problems, it is best to use PCRE_PARTIAL_HARD when matching multi-segment data. The example above then behaves differ- @@ -6435,28 +7864,27 @@ data> gsb\R\P\P\D Partial match: gsb - 4. Patterns that contain alternatives at the top level which do not all + 5. Patterns that contain alternatives at the top level which do not all start with the same pattern item may not work as expected when - PCRE_DFA_RESTART is used with pcre_dfa_exec(). For example, consider - this pattern: + PCRE_DFA_RESTART is used. For example, consider this pattern: 1234|3789 - If the first part of the subject is "ABC123", a partial match of the - first alternative is found at offset 3. There is no partial match for + If the first part of the subject is "ABC123", a partial match of the + first alternative is found at offset 3. There is no partial match for the second alternative, because such a match does not start at the same - point in the subject string. Attempting to continue with the string - "7890" does not yield a match because only those alternatives that - match at one point in the subject are remembered. The problem arises - because the start of the second alternative matches within the first - alternative. There is no problem with anchored patterns or patterns + point in the subject string. Attempting to continue with the string + "7890" does not yield a match because only those alternatives that + match at one point in the subject are remembered. The problem arises + because the start of the second alternative matches within the first + alternative. There is no problem with anchored patterns or patterns such as: 1234|ABCD - where no string can be a partial match for both alternatives. This is - not a problem if pcre_exec() is used, because the entire match has to - be rerun each time: + where no string can be a partial match for both alternatives. This is + not a problem if a standard matching function is used, because the + entire match has to be rerun each time: re> /1234|3789/ data> ABC123\P\P @@ -6465,11 +7893,11 @@ 0: 3789 Of course, instead of using PCRE_DFA_RESTART, the same technique of re- - running the entire match can also be used with pcre_dfa_exec(). Another - possibility is to work with two buffers. If a partial match at offset n - in the first buffer is followed by "no match" when PCRE_DFA_RESTART is - used on the second buffer, you can then try a new match starting at - offset n+1 in the first buffer. + running the entire match can also be used with the DFA matching func- + tions. Another possibility is to work with two buffers. If a partial + match at offset n in the first buffer is followed by "no match" when + PCRE_DFA_RESTART is used on the second buffer, you can then try a new + match starting at offset n+1 in the first buffer. AUTHOR @@ -6481,8 +7909,8 @@ REVISION - Last updated: 07 November 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 24 February 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ @@ -6500,26 +7928,32 @@ form instead of having to compile them every time the application is run. If you are not using any private character tables (see the pcre_maketables() documentation), this is relatively straightforward. - If you are using private tables, it is a little bit more complicated. + If you are using private tables, it is a little bit more complicated. + However, if you are using the just-in-time optimization feature, it is + not possible to save and reload the JIT data. If you save compiled patterns to a file, you can copy them to a differ- - ent host and run them there. This works even if the new host has the - opposite endianness to the one on which the patterns were compiled. - There may be a small performance penalty, but it should be insignifi- - cant. However, compiling regular expressions with one version of PCRE - for use with a different version is not guaranteed to work and may - cause crashes. + ent host and run them there. If the two hosts have different endianness + (byte order), you should run the pcre[16]_pattern_to_host_byte_order() + function on the new host before trying to match the pattern. The match- + ing functions return PCRE_ERROR_BADENDIANNESS if they detect a pattern + with the wrong endianness. + + Compiling regular expressions with one version of PCRE for use with a + different version is not guaranteed to work and may cause crashes, and + saving and restoring a compiled pattern loses any JIT optimization + data. SAVING A COMPILED PATTERN - The value returned by pcre_compile() points to a single block of memory - that holds the compiled pattern and associated data. You can find the - length of this block in bytes by calling pcre_fullinfo() with an argu- - ment of PCRE_INFO_SIZE. You can then save the data in any appropriate - manner. Here is sample code that compiles a pattern and writes it to a - file. It assumes that the variable fd refers to a file that is open for - output: + The value returned by pcre[16]_compile() points to a single block of + memory that holds the compiled pattern and associated data. You can + find the length of this block in bytes by calling pcre[16]_fullinfo() + with an argument of PCRE_INFO_SIZE. You can then save the data in any + appropriate manner. Here is sample code for the 8-bit library that com- + piles a pattern and writes it to a file. It assumes that the variable + fd refers to a file that is open for output: int erroroffset, rc, size; char *error; @@ -6549,45 +7983,49 @@ in the memory of some daemon process that passes them via sockets to the processes that want them. - If the pattern has been studied, it is also possible to save the study - data in a similar way to the compiled pattern itself. When studying - generates additional information, pcre_study() returns a pointer to a - pcre_extra data block. Its format is defined in the section on matching - a pattern in the pcreapi documentation. The study_data field points to - the binary study data, and this is what you must save (not the - pcre_extra block itself). The length of the study data can be obtained - by calling pcre_fullinfo() with an argument of PCRE_INFO_STUDYSIZE. - Remember to check that pcre_study() did return a non-NULL value before - trying to save the study data. + If the pattern has been studied, it is also possible to save the normal + study data in a similar way to the compiled pattern itself. However, if + the PCRE_STUDY_JIT_COMPILE was used, the just-in-time data that is cre- + ated cannot be saved because it is too dependent on the current envi- + ronment. When studying generates additional information, + pcre[16]_study() returns a pointer to a pcre[16]_extra data block. Its + format is defined in the section on matching a pattern in the pcreapi + documentation. The study_data field points to the binary study data, + and this is what you must save (not the pcre[16]_extra block itself). + The length of the study data can be obtained by calling + pcre[16]_fullinfo() with an argument of PCRE_INFO_STUDYSIZE. Remember + to check that pcre[16]_study() did return a non-NULL value before try- + ing to save the study data. RE-USING A PRECOMPILED PATTERN - Re-using a precompiled pattern is straightforward. Having reloaded it - into main memory, you pass its pointer to pcre_exec() or - pcre_dfa_exec() in the usual way. This should work even on another - host, and even if that host has the opposite endianness to the one - where the pattern was compiled. + Re-using a precompiled pattern is straightforward. Having reloaded it + into main memory, called pcre[16]_pattern_to_host_byte_order() if nec- + essary, you pass its pointer to pcre[16]_exec() or pcre[16]_dfa_exec() + in the usual way. However, if you passed a pointer to custom character tables when the - pattern was compiled (the tableptr argument of pcre_compile()), you - must now pass a similar pointer to pcre_exec() or pcre_dfa_exec(), - because the value saved with the compiled pattern will obviously be - nonsense. A field in a pcre_extra() block is used to pass this data, as - described in the section on matching a pattern in the pcreapi documen- - tation. + pattern was compiled (the tableptr argument of pcre[16]_compile()), you + must now pass a similar pointer to pcre[16]_exec() or + pcre[16]_dfa_exec(), because the value saved with the compiled pattern + will obviously be nonsense. A field in a pcre[16]_extra() block is used + to pass this data, as described in the section on matching a pattern in + the pcreapi documentation. If you did not provide custom character tables when the pattern was - compiled, the pointer in the compiled pattern is NULL, which causes - pcre_exec() to use PCRE's internal tables. Thus, you do not need to - take any special action at run time in this case. + compiled, the pointer in the compiled pattern is NULL, which causes the + matching functions to use PCRE's internal tables. Thus, you do not need + to take any special action at run time in this case. If you saved study data with the compiled pattern, you need to create - your own pcre_extra data block and set the study_data field to point to - the reloaded study data. You must also set the PCRE_EXTRA_STUDY_DATA - bit in the flags field to indicate that study data is present. Then - pass the pcre_extra block to pcre_exec() or pcre_dfa_exec() in the - usual way. + your own pcre[16]_extra data block and set the study_data field to + point to the reloaded study data. You must also set the + PCRE_EXTRA_STUDY_DATA bit in the flags field to indicate that study + data is present. Then pass the pcre[16]_extra block to the matching + function in the usual way. If the pattern was studied for just-in-time + optimization, that data cannot be saved, and so is lost by a + save/restore cycle. COMPATIBILITY WITH DIFFERENT PCRE RELEASES @@ -6606,8 +8044,8 @@ REVISION - Last updated: 17 November 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 10 January 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ @@ -6627,12 +8065,12 @@ COMPILED PATTERN MEMORY USAGE - Patterns are compiled by PCRE into a reasonably efficient byte code, so - that most simple patterns do not use much memory. However, there is one - case where the memory usage of a compiled pattern can be unexpectedly - large. If a parenthesized subpattern has a quantifier with a minimum - greater than 1 and/or a limited maximum, the whole subpattern is - repeated in the compiled code. For example, the pattern + Patterns are compiled by PCRE into a reasonably efficient interpretive + code, so that most simple patterns do not use much memory. However, + there is one case where the memory usage of a compiled pattern can be + unexpectedly large. If a parenthesized subpattern has a quantifier with + a minimum greater than 1 and/or a limited maximum, the whole subpattern + is repeated in the compiled code. For example, the pattern (abc|def){2,4} @@ -6650,64 +8088,66 @@ ((ab){1,1000}c){1,3} - uses 51K bytes when compiled. When PCRE is compiled with its default - internal pointer size of two bytes, the size limit on a compiled pat- - tern is 64K, and this is reached with the above pattern if the outer - repetition is increased from 3 to 4. PCRE can be compiled to use larger - internal pointers and thus handle larger compiled patterns, but it is - better to try to rewrite your pattern to use less memory if you can. + uses 51K bytes when compiled using the 8-bit library. When PCRE is com- + piled with its default internal pointer size of two bytes, the size + limit on a compiled pattern is 64K data units, and this is reached with + the above pattern if the outer repetition is increased from 3 to 4. + PCRE can be compiled to use larger internal pointers and thus handle + larger compiled patterns, but it is better to try to rewrite your pat- + tern to use less memory if you can. - One way of reducing the memory usage for such patterns is to make use + One way of reducing the memory usage for such patterns is to make use of PCRE's "subroutine" facility. Re-writing the above pattern as ((ab)(?2){0,999}c)(?1){0,2} reduces the memory requirements to 18K, and indeed it remains under 20K - even with the outer repetition increased to 100. However, this pattern - is not exactly equivalent, because the "subroutine" calls are treated - as atomic groups into which there can be no backtracking if there is a - subsequent matching failure. Therefore, PCRE cannot do this kind of - rewriting automatically. Furthermore, there is a noticeable loss of - speed when executing the modified pattern. Nevertheless, if the atomic - grouping is not a problem and the loss of speed is acceptable, this - kind of rewriting will allow you to process patterns that PCRE cannot + even with the outer repetition increased to 100. However, this pattern + is not exactly equivalent, because the "subroutine" calls are treated + as atomic groups into which there can be no backtracking if there is a + subsequent matching failure. Therefore, PCRE cannot do this kind of + rewriting automatically. Furthermore, there is a noticeable loss of + speed when executing the modified pattern. Nevertheless, if the atomic + grouping is not a problem and the loss of speed is acceptable, this + kind of rewriting will allow you to process patterns that PCRE cannot otherwise handle. STACK USAGE AT RUN TIME - When pcre_exec() is used for matching, certain kinds of pattern can - cause it to use large amounts of the process stack. In some environ- - ments the default process stack is quite small, and if it runs out the - result is often SIGSEGV. This issue is probably the most frequently - raised problem with PCRE. Rewriting your pattern can often help. The - pcrestack documentation discusses this issue in detail. + When pcre_exec() or pcre16_exec() is used for matching, certain kinds + of pattern can cause it to use large amounts of the process stack. In + some environments the default process stack is quite small, and if it + runs out the result is often SIGSEGV. This issue is probably the most + frequently raised problem with PCRE. Rewriting your pattern can often + help. The pcrestack documentation discusses this issue in detail. PROCESSING TIME - Certain items in regular expression patterns are processed more effi- + Certain items in regular expression patterns are processed more effi- ciently than others. It is more efficient to use a character class like - [aeiou] than a set of single-character alternatives such as - (a|e|i|o|u). In general, the simplest construction that provides the + [aeiou] than a set of single-character alternatives such as + (a|e|i|o|u). In general, the simplest construction that provides the required behaviour is usually the most efficient. Jeffrey Friedl's book - contains a lot of useful general discussion about optimizing regular - expressions for efficient performance. This document contains a few + contains a lot of useful general discussion about optimizing regular + expressions for efficient performance. This document contains a few observations about PCRE. - Using Unicode character properties (the \p, \P, and \X escapes) is - slow, because PCRE has to scan a structure that contains data for over - fifteen thousand characters whenever it needs a character's property. - If you can find an alternative pattern that does not use character + Using Unicode character properties (the \p, \P, and \X escapes) is + slow, because PCRE has to scan a structure that contains data for over + fifteen thousand characters whenever it needs a character's property. + If you can find an alternative pattern that does not use character properties, it will probably be faster. - By default, the escape sequences \b, \d, \s, and \w, and the POSIX - character classes such as [:alpha:] do not use Unicode properties, + By default, the escape sequences \b, \d, \s, and \w, and the POSIX + character classes such as [:alpha:] do not use Unicode properties, partly for backwards compatibility, and partly for performance reasons. - However, you can set PCRE_UCP if you want Unicode character properties - to be used. This can double the matching time for items such as \d, - when matched with pcre_exec(); the performance loss is less with - pcre_dfa_exec(), and in both cases there is not much difference for \b. + However, you can set PCRE_UCP if you want Unicode character properties + to be used. This can double the matching time for items such as \d, + when matched with a traditional matching function; the performance loss + is less with a DFA matching function, and in both cases there is not + much difference for \b. When a pattern begins with .* not in parentheses, or in parentheses that are not the subject of a backreference, and the PCRE_DOTALL option @@ -6774,8 +8214,8 @@ REVISION - Last updated: 16 May 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 09 January 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ @@ -6804,51 +8244,52 @@ DESCRIPTION - This set of functions provides a POSIX-style API to the PCRE regular - expression package. See the pcreapi documentation for a description of - PCRE's native API, which contains much additional functionality. + This set of functions provides a POSIX-style API for the PCRE regular + expression 8-bit library. See the pcreapi documentation for a descrip- + tion of PCRE's native API, which contains much additional functional- + ity. There is no POSIX-style wrapper for PCRE's 16-bit library. The functions described here are just wrapper functions that ultimately call the PCRE native API. Their prototypes are defined in the - pcreposix.h header file, and on Unix systems the library itself is - called pcreposix.a, so can be accessed by adding -lpcreposix to the - command for linking an application that uses them. Because the POSIX + pcreposix.h header file, and on Unix systems the library itself is + called pcreposix.a, so can be accessed by adding -lpcreposix to the + command for linking an application that uses them. Because the POSIX functions call the native ones, it is also necessary to add -lpcre. - I have implemented only those POSIX option bits that can be reasonably - mapped to PCRE native options. In addition, the option REG_EXTENDED is - defined with the value zero. This has no effect, but since programs - that are written to the POSIX interface often use it, this makes it - easier to slot in PCRE as a replacement library. Other POSIX options + I have implemented only those POSIX option bits that can be reasonably + mapped to PCRE native options. In addition, the option REG_EXTENDED is + defined with the value zero. This has no effect, but since programs + that are written to the POSIX interface often use it, this makes it + easier to slot in PCRE as a replacement library. Other POSIX options are not even defined. - There are also some other options that are not defined by POSIX. These + There are also some other options that are not defined by POSIX. These have been added at the request of users who want to make use of certain PCRE-specific features via the POSIX calling interface. - When PCRE is called via these functions, it is only the API that is - POSIX-like in style. The syntax and semantics of the regular expres- - sions themselves are still those of Perl, subject to the setting of - various PCRE options, as described below. "POSIX-like in style" means - that the API approximates to the POSIX definition; it is not fully - POSIX-compatible, and in multi-byte encoding domains it is probably + When PCRE is called via these functions, it is only the API that is + POSIX-like in style. The syntax and semantics of the regular expres- + sions themselves are still those of Perl, subject to the setting of + various PCRE options, as described below. "POSIX-like in style" means + that the API approximates to the POSIX definition; it is not fully + POSIX-compatible, and in multi-byte encoding domains it is probably even less compatible. - The header for these functions is supplied as pcreposix.h to avoid any - potential clash with other POSIX libraries. It can, of course, be + The header for these functions is supplied as pcreposix.h to avoid any + potential clash with other POSIX libraries. It can, of course, be renamed or aliased as regex.h, which is the "correct" name. It provides - two structure types, regex_t for compiled internal forms, and reg- - match_t for returning captured substrings. It also defines some con- - stants whose names start with "REG_"; these are used for setting + two structure types, regex_t for compiled internal forms, and reg- + match_t for returning captured substrings. It also defines some con- + stants whose names start with "REG_"; these are used for setting options and identifying error codes. COMPILING A PATTERN - The function regcomp() is called to compile a pattern into an internal - form. The pattern is a C string terminated by a binary zero, and is - passed in the argument pattern. The preg argument is a pointer to a - regex_t structure that is used as a base for storing information about + The function regcomp() is called to compile a pattern into an internal + form. The pattern is a C string terminated by a binary zero, and is + passed in the argument pattern. The preg argument is a pointer to a + regex_t structure that is used as a base for storing information about the compiled regular expression. The argument cflags is either zero, or contains one or more of the bits @@ -6862,58 +8303,58 @@ REG_ICASE - The PCRE_CASELESS option is set when the regular expression is passed + The PCRE_CASELESS option is set when the regular expression is passed for compilation to the native function. REG_NEWLINE - The PCRE_MULTILINE option is set when the regular expression is passed - for compilation to the native function. Note that this does not mimic - the defined POSIX behaviour for REG_NEWLINE (see the following sec- + The PCRE_MULTILINE option is set when the regular expression is passed + for compilation to the native function. Note that this does not mimic + the defined POSIX behaviour for REG_NEWLINE (see the following sec- tion). REG_NOSUB - The PCRE_NO_AUTO_CAPTURE option is set when the regular expression is + The PCRE_NO_AUTO_CAPTURE option is set when the regular expression is passed for compilation to the native function. In addition, when a pat- - tern that is compiled with this flag is passed to regexec() for match- - ing, the nmatch and pmatch arguments are ignored, and no captured + tern that is compiled with this flag is passed to regexec() for match- + ing, the nmatch and pmatch arguments are ignored, and no captured strings are returned. REG_UCP - The PCRE_UCP option is set when the regular expression is passed for - compilation to the native function. This causes PCRE to use Unicode - properties when matchine \d, \w, etc., instead of just recognizing + The PCRE_UCP option is set when the regular expression is passed for + compilation to the native function. This causes PCRE to use Unicode + properties when matchine \d, \w, etc., instead of just recognizing ASCII values. Note that REG_UTF8 is not part of the POSIX standard. REG_UNGREEDY - The PCRE_UNGREEDY option is set when the regular expression is passed - for compilation to the native function. Note that REG_UNGREEDY is not + The PCRE_UNGREEDY option is set when the regular expression is passed + for compilation to the native function. Note that REG_UNGREEDY is not part of the POSIX standard. REG_UTF8 - The PCRE_UTF8 option is set when the regular expression is passed for - compilation to the native function. This causes the pattern itself and - all data strings used for matching it to be treated as UTF-8 strings. + The PCRE_UTF8 option is set when the regular expression is passed for + compilation to the native function. This causes the pattern itself and + all data strings used for matching it to be treated as UTF-8 strings. Note that REG_UTF8 is not part of the POSIX standard. - In the absence of these flags, no options are passed to the native - function. This means the the regex is compiled with PCRE default - semantics. In particular, the way it handles newline characters in the - subject string is the Perl way, not the POSIX way. Note that setting - PCRE_MULTILINE has only some of the effects specified for REG_NEWLINE. - It does not affect the way newlines are matched by . (they are not) or + In the absence of these flags, no options are passed to the native + function. This means the the regex is compiled with PCRE default + semantics. In particular, the way it handles newline characters in the + subject string is the Perl way, not the POSIX way. Note that setting + PCRE_MULTILINE has only some of the effects specified for REG_NEWLINE. + It does not affect the way newlines are matched by . (they are not) or by a negative class such as [^a] (they are). - The yield of regcomp() is zero on success, and non-zero otherwise. The + The yield of regcomp() is zero on success, and non-zero otherwise. The preg structure is filled in on success, and one member of the structure - is public: re_nsub contains the number of capturing subpatterns in the + is public: re_nsub contains the number of capturing subpatterns in the regular expression. Various error codes are defined in the header file. - NOTE: If the yield of regcomp() is non-zero, you must not attempt to + NOTE: If the yield of regcomp() is non-zero, you must not attempt to use the contents of the preg structure. If, for example, you pass it to regexec(), the result is undefined and your program is likely to crash. @@ -6921,9 +8362,9 @@ MATCHING NEWLINE CHARACTERS This area is not simple, because POSIX and Perl take different views of - things. It is not possible to get PCRE to obey POSIX semantics, but - then PCRE was never intended to be a POSIX engine. The following table - lists the different possibilities for matching newline characters in + things. It is not possible to get PCRE to obey POSIX semantics, but + then PCRE was never intended to be a POSIX engine. The following table + lists the different possibilities for matching newline characters in PCRE: Default Change with @@ -6945,19 +8386,19 @@ ^ matches \n in middle no REG_NEWLINE PCRE's behaviour is the same as Perl's, except that there is no equiva- - lent for PCRE_DOLLAR_ENDONLY in Perl. In both PCRE and Perl, there is + lent for PCRE_DOLLAR_ENDONLY in Perl. In both PCRE and Perl, there is no way to stop newline from matching [^a]. - The default POSIX newline handling can be obtained by setting - PCRE_DOTALL and PCRE_DOLLAR_ENDONLY, but there is no way to make PCRE + The default POSIX newline handling can be obtained by setting + PCRE_DOTALL and PCRE_DOLLAR_ENDONLY, but there is no way to make PCRE behave exactly as for the REG_NEWLINE action. MATCHING A PATTERN - The function regexec() is called to match a compiled pattern preg - against a given string, which is by default terminated by a zero byte - (but see REG_STARTEND below), subject to the options in eflags. These + The function regexec() is called to match a compiled pattern preg + against a given string, which is by default terminated by a zero byte + (but see REG_STARTEND below), subject to the options in eflags. These can be: REG_NOTBOL @@ -6979,17 +8420,17 @@ REG_STARTEND - The string is considered to start at string + pmatch[0].rm_so and to - have a terminating NUL located at string + pmatch[0].rm_eo (there need - not actually be a NUL at that location), regardless of the value of - nmatch. This is a BSD extension, compatible with but not specified by - IEEE Standard 1003.2 (POSIX.2), and should be used with caution in + The string is considered to start at string + pmatch[0].rm_so and to + have a terminating NUL located at string + pmatch[0].rm_eo (there need + not actually be a NUL at that location), regardless of the value of + nmatch. This is a BSD extension, compatible with but not specified by + IEEE Standard 1003.2 (POSIX.2), and should be used with caution in software intended to be portable to other systems. Note that a non-zero rm_so does not imply REG_NOTBOL; REG_STARTEND affects only the location of the string, not how it is matched. - If the pattern was compiled with the REG_NOSUB flag, no data about any - matched strings is returned. The nmatch and pmatch arguments of + If the pattern was compiled with the REG_NOSUB flag, no data about any + matched strings is returned. The nmatch and pmatch arguments of regexec() are ignored. If the value of nmatch is zero, or if the value pmatch is NULL, no data @@ -6997,34 +8438,34 @@ Otherwise,the portion of the string that was matched, and also any cap- tured substrings, are returned via the pmatch argument, which points to - an array of nmatch structures of type regmatch_t, containing the mem- - bers rm_so and rm_eo. These contain the offset to the first character - of each substring and the offset to the first character after the end - of each substring, respectively. The 0th element of the vector relates - to the entire portion of string that was matched; subsequent elements - relate to the capturing subpatterns of the regular expression. Unused + an array of nmatch structures of type regmatch_t, containing the mem- + bers rm_so and rm_eo. These contain the offset to the first character + of each substring and the offset to the first character after the end + of each substring, respectively. The 0th element of the vector relates + to the entire portion of string that was matched; subsequent elements + relate to the capturing subpatterns of the regular expression. Unused entries in the array have both structure members set to -1. - A successful match yields a zero return; various error codes are - defined in the header file, of which REG_NOMATCH is the "expected" + A successful match yields a zero return; various error codes are + defined in the header file, of which REG_NOMATCH is the "expected" failure code. ERROR MESSAGES The regerror() function maps a non-zero errorcode from either regcomp() - or regexec() to a printable message. If preg is not NULL, the error + or regexec() to a printable message. If preg is not NULL, the error should have arisen from the use of that structure. A message terminated - by a binary zero is placed in errbuf. The length of the message, - including the zero, is limited to errbuf_size. The yield of the func- + by a binary zero is placed in errbuf. The length of the message, + including the zero, is limited to errbuf_size. The yield of the func- tion is the size of buffer needed to hold the whole message. MEMORY USAGE - Compiling a regular expression causes memory to be allocated and asso- - ciated with the preg structure. The function regfree() frees all such - memory, after which preg may no longer be used as a compiled expres- + Compiling a regular expression causes memory to be allocated and asso- + ciated with the preg structure. The function regfree() frees all such + memory, after which preg may no longer be used as a compiled expres- sion. @@ -7037,8 +8478,8 @@ REVISION - Last updated: 16 May 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 09 January 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ @@ -7059,13 +8500,14 @@ The C++ wrapper for PCRE was provided by Google Inc. Some additional functionality was added by Giuseppe Maxia. This brief man page was con- structed from the notes in the pcrecpp.h file, which should be con- - sulted for further details. + sulted for further details. Note that the C++ wrapper supports only the + original 8-bit PCRE library. There is no 16-bit support at present. MATCHING INTERFACE - The "FullMatch" operation checks that supplied text matches a supplied - pattern exactly. If pointer arguments are supplied, it copies matched + The "FullMatch" operation checks that supplied text matches a supplied + pattern exactly. If pointer arguments are supplied, it copies matched sub-strings that match sub-patterns into them. Example: successful match @@ -7079,10 +8521,10 @@ Example: creating a temporary RE object: pcrecpp::RE("h.*o").FullMatch("hello"); - You can pass in a "const char*" or a "string" for "text". The examples - below tend to use a const char*. You can, as in the different examples - above, store the RE object explicitly in a variable or use a temporary - RE object. The examples below use one mode or the other arbitrarily. + You can pass in a "const char*" or a "string" for "text". The examples + below tend to use a const char*. You can, as in the different examples + above, store the RE object explicitly in a variable or use a temporary + RE object. The examples below use one mode or the other arbitrarily. Either could correctly be used for any of these examples. You must supply extra pointer arguments to extract matched subpieces. @@ -7108,7 +8550,7 @@ Example: fails because string cannot be stored in integer !pcrecpp::RE("(.*)").FullMatch("ruby", &i); - The provided pointer arguments can be pointers to any scalar numeric + The provided pointer arguments can be pointers to any scalar numeric type, or one of: string (matched piece is copied to string) @@ -7116,7 +8558,7 @@ T (where "bool T::ParseFrom(const char*, int)" exists) NULL (the corresponding matched sub-pattern is not copied) - The function returns true iff all of the following conditions are sat- + The function returns true iff all of the following conditions are sat- isfied: a. "text" matches "pattern" exactly; @@ -7131,41 +8573,41 @@ number of sub-patterns, "i"th captured sub-pattern is ignored. - CAVEAT: An optional sub-pattern that does not exist in the matched - string is assigned the empty string. Therefore, the following will + CAVEAT: An optional sub-pattern that does not exist in the matched + string is assigned the empty string. Therefore, the following will return false (because the empty string is not a valid number): int number; pcrecpp::RE::FullMatch("abc", "[a-z]+(\\d+)?", &number); - The matching interface supports at most 16 arguments per call. If you - need more, consider using the more general interface + The matching interface supports at most 16 arguments per call. If you + need more, consider using the more general interface pcrecpp::RE::DoMatch. See pcrecpp.h for the signature for DoMatch. - NOTE: Do not use no_arg, which is used internally to mark the end of a - list of optional arguments, as a placeholder for missing arguments, as + NOTE: Do not use no_arg, which is used internally to mark the end of a + list of optional arguments, as a placeholder for missing arguments, as this can lead to segfaults. QUOTING METACHARACTERS - You can use the "QuoteMeta" operation to insert backslashes before all - potentially meaningful characters in a string. The returned string, + You can use the "QuoteMeta" operation to insert backslashes before all + potentially meaningful characters in a string. The returned string, used as a regular expression, will exactly match the original string. Example: string quoted = RE::QuoteMeta(unquoted); - Note that it's legal to escape a character even if it has no special - meaning in a regular expression -- so this function does that. (This - also makes it identical to the perl function of the same name; see - "perldoc -f quotemeta".) For example, "1.5-2.0?" becomes + Note that it's legal to escape a character even if it has no special + meaning in a regular expression -- so this function does that. (This + also makes it identical to the perl function of the same name; see + "perldoc -f quotemeta".) For example, "1.5-2.0?" becomes "1\.5\-2\.0\?". PARTIAL MATCHES - You can use the "PartialMatch" operation when you want the pattern to + You can use the "PartialMatch" operation when you want the pattern to match any substring of the text. Example: simple search for a string: @@ -7180,13 +8622,13 @@ UTF-8 AND THE MATCHING INTERFACE - By default, pattern and text are plain text, one byte per character. - The UTF8 flag, passed to the constructor, causes both pattern and + By default, pattern and text are plain text, one byte per character. + The UTF8 flag, passed to the constructor, causes both pattern and string to be treated as UTF-8 text, still a byte stream but potentially - multiple bytes per character. In practice, the text is likelier to be - UTF-8 than the pattern, but the match returned may depend on the UTF8 - flag, so always use it when matching UTF8 text. For example, "." will - match one byte normally but with UTF8 set may match up to three bytes + multiple bytes per character. In practice, the text is likelier to be + UTF-8 than the pattern, but the match returned may depend on the UTF8 + flag, so always use it when matching UTF8 text. For example, "." will + match one byte normally but with UTF8 set may match up to three bytes of a multi-byte character. Example: @@ -7205,9 +8647,9 @@ PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE - PCRE defines some modifiers to change the behavior of the regular - expression engine. The C++ wrapper defines an auxiliary class, - RE_Options, as a vehicle to pass such modifiers to a RE class. Cur- + PCRE defines some modifiers to change the behavior of the regular + expression engine. The C++ wrapper defines an auxiliary class, + RE_Options, as a vehicle to pass such modifiers to a RE class. Cur- rently, the following modifiers are supported: modifier description Perl corresponding @@ -7217,20 +8659,20 @@ PCRE_DOTALL dot matches newlines /s PCRE_DOLLAR_ENDONLY $ matches only at end N/A PCRE_EXTRA strict escape parsing N/A - PCRE_EXTENDED ignore whitespaces /x + PCRE_EXTENDED ignore white spaces /x PCRE_UTF8 handles UTF8 chars built-in PCRE_UNGREEDY reverses * and *? N/A PCRE_NO_AUTO_CAPTURE disables capturing parens N/A (*) - (*) Both Perl and PCRE allow non capturing parentheses by means of the - "?:" modifier within the pattern itself. e.g. (?:ab|cd) does not cap- + (*) Both Perl and PCRE allow non capturing parentheses by means of the + "?:" modifier within the pattern itself. e.g. (?:ab|cd) does not cap- ture, while (ab|cd) does. - For a full account on how each modifier works, please check the PCRE + For a full account on how each modifier works, please check the PCRE API reference page. - For each modifier, there are two member functions whose name is made - out of the modifier in lowercase, without the "PCRE_" prefix. For + For each modifier, there are two member functions whose name is made + out of the modifier in lowercase, without the "PCRE_" prefix. For instance, PCRE_CASELESS is handled by bool caseless() @@ -7240,28 +8682,28 @@ RE_Options & set_caseless(bool) which sets or unsets the modifier. Moreover, PCRE_EXTRA_MATCH_LIMIT can - be accessed through the set_match_limit() and match_limit() member - functions. Setting match_limit to a non-zero value will limit the exe- - cution of pcre to keep it from doing bad things like blowing the stack - or taking an eternity to return a result. A value of 5000 is good - enough to stop stack blowup in a 2MB thread stack. Setting match_limit - to zero disables match limiting. Alternatively, you can call - match_limit_recursion() which uses PCRE_EXTRA_MATCH_LIMIT_RECURSION to - limit how much PCRE recurses. match_limit() limits the number of + be accessed through the set_match_limit() and match_limit() member + functions. Setting match_limit to a non-zero value will limit the exe- + cution of pcre to keep it from doing bad things like blowing the stack + or taking an eternity to return a result. A value of 5000 is good + enough to stop stack blowup in a 2MB thread stack. Setting match_limit + to zero disables match limiting. Alternatively, you can call + match_limit_recursion() which uses PCRE_EXTRA_MATCH_LIMIT_RECURSION to + limit how much PCRE recurses. match_limit() limits the number of matches PCRE does; match_limit_recursion() limits the depth of internal recursion, and therefore the amount of stack that is used. - Normally, to pass one or more modifiers to a RE class, you declare a + Normally, to pass one or more modifiers to a RE class, you declare a RE_Options object, set the appropriate options, and pass this object to a RE constructor. Example: - RE_options opt; + RE_Options opt; opt.set_caseless(true); if (RE("HELLO", opt).PartialMatch("hello world")) ... RE_options has two constructors. The default constructor takes no argu- - ments and creates a set of flags that are off by default. The optional - parameter option_flags is to facilitate transfer of legacy code from C + ments and creates a set of flags that are off by default. The optional + parameter option_flags is to facilitate transfer of legacy code from C programs. This lets you do RE(pattern, @@ -7275,15 +8717,15 @@ If you are going to pass one of the most used modifiers, there are some convenience functions that return a RE_Options class with the appropri- - ate modifier already set: CASELESS(), UTF8(), MULTILINE(), DOTALL(), + ate modifier already set: CASELESS(), UTF8(), MULTILINE(), DOTALL(), and EXTENDED(). - If you need to set several options at once, and you don't want to go - through the pains of declaring a RE_Options object and setting several - options, there is a parallel method that give you such ability on the - fly. You can concatenate several set_xxxxx() member functions, since - each of them returns a reference to its class object. For example, to - pass PCRE_CASELESS, PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one + If you need to set several options at once, and you don't want to go + through the pains of declaring a RE_Options object and setting several + options, there is a parallel method that give you such ability on the + fly. You can concatenate several set_xxxxx() member functions, since + each of them returns a reference to its class object. For example, to + pass PCRE_CASELESS, PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one statement, you may write: RE(" ^ xyz \\s+ .* blah$", @@ -7295,10 +8737,10 @@ SCANNING TEXT INCREMENTALLY - The "Consume" operation may be useful if you want to repeatedly match + The "Consume" operation may be useful if you want to repeatedly match regular expressions at the front of a string and skip over them as they - match. This requires use of the "StringPiece" type, which represents a - sub-range of a real string. Like RE, StringPiece is defined in the + match. This requires use of the "StringPiece" type, which represents a + sub-range of a real string. Like RE, StringPiece is defined in the pcrecpp namespace. Example: read lines of the form "var = value" from a string. @@ -7312,11 +8754,11 @@ ...; } - Each successful call to "Consume" will set "var/value", and also + Each successful call to "Consume" will set "var/value", and also advance "input" so it points past the matched text. - The "FindAndConsume" operation is similar to "Consume" but does not - anchor your match at the beginning of the string. For example, you + The "FindAndConsume" operation is similar to "Consume" but does not + anchor your match at the beginning of the string. For example, you could extract all words from a string by repeatedly calling pcrecpp::RE("(\\w+)").FindAndConsume(&input, &word) @@ -7325,10 +8767,10 @@ PARSING HEX/OCTAL/C-RADIX NUMBERS By default, if you pass a pointer to a numeric value, the corresponding - text is interpreted as a base-10 number. You can instead wrap the + text is interpreted as a base-10 number. You can instead wrap the pointer with a call to one of the operators Hex(), Octal(), or CRadix() - to interpret the text in another base. The CRadix operator interprets - C-style "0" (base-8) and "0x" (base-16) prefixes, but defaults to + to interpret the text in another base. The CRadix operator interprets + C-style "0" (base-8) and "0x" (base-16) prefixes, but defaults to base-10. Example: @@ -7343,30 +8785,30 @@ REPLACING PARTS OF STRINGS - You can replace the first match of "pattern" in "str" with "rewrite". - Within "rewrite", backslash-escaped digits (\1 to \9) can be used to - insert text matching corresponding parenthesized group from the pat- + You can replace the first match of "pattern" in "str" with "rewrite". + Within "rewrite", backslash-escaped digits (\1 to \9) can be used to + insert text matching corresponding parenthesized group from the pat- tern. \0 in "rewrite" refers to the entire matching text. For example: string s = "yabba dabba doo"; pcrecpp::RE("b+").Replace("d", &s); - will leave "s" containing "yada dabba doo". The result is true if the + will leave "s" containing "yada dabba doo". The result is true if the pattern matches and a replacement occurs, false otherwise. - GlobalReplace is like Replace except that it replaces all occurrences - of the pattern in the string with the rewrite. Replacements are not + GlobalReplace is like Replace except that it replaces all occurrences + of the pattern in the string with the rewrite. Replacements are not subject to re-matching. For example: string s = "yabba dabba doo"; pcrecpp::RE("b+").GlobalReplace("d", &s); - will leave "s" containing "yada dada doo". It returns the number of + will leave "s" containing "yada dada doo". It returns the number of replacements made. - Extract is like Replace, except that if the pattern matches, "rewrite" - is copied into "out" (an additional argument) with substitutions. The - non-matching portions of "text" are ignored. Returns true iff a match + Extract is like Replace, except that if the pattern matches, "rewrite" + is copied into "out" (an additional argument) with substitutions. The + non-matching portions of "text" are ignored. Returns true iff a match occurred and the extraction happened successfully; if no match occurs, the string is left unaffected. @@ -7379,7 +8821,7 @@ REVISION - Last updated: 17 March 2009 + Last updated: 08 January 2012 ------------------------------------------------------------------------------ @@ -7398,57 +8840,58 @@ do not have a copy of the PCRE distribution, you can save this listing to re-create pcredemo.c. - The program compiles the regular expression that is its first argument, - and matches it against the subject string in its second argument. No - PCRE options are set, and default character tables are used. If match- - ing succeeds, the program outputs the portion of the subject that - matched, together with the contents of any captured substrings. + The demonstration program, which uses the original PCRE 8-bit library, + compiles the regular expression that is its first argument, and matches + it against the subject string in its second argument. No PCRE options + are set, and default character tables are used. If matching succeeds, + the program outputs the portion of the subject that matched, together + with the contents of any captured substrings. If the -g option is given on the command line, the program then goes on to check for further matches of the same regular expression in the same - subject string. The logic is a little bit tricky because of the possi- - bility of matching an empty string. Comments in the code explain what + subject string. The logic is a little bit tricky because of the possi- + bility of matching an empty string. Comments in the code explain what is going on. - If PCRE is installed in the standard include and library directories + If PCRE is installed in the standard include and library directories for your operating system, you should be able to compile the demonstra- tion program using this command: gcc -o pcredemo pcredemo.c -lpcre - If PCRE is installed elsewhere, you may need to add additional options - to the command line. For example, on a Unix-like system that has PCRE - installed in /usr/local, you can compile the demonstration program + If PCRE is installed elsewhere, you may need to add additional options + to the command line. For example, on a Unix-like system that has PCRE + installed in /usr/local, you can compile the demonstration program using a command like this: gcc -o pcredemo -I/usr/local/include pcredemo.c \ -L/usr/local/lib -lpcre - In a Windows environment, if you want to statically link the program + In a Windows environment, if you want to statically link the program against a non-dll pcre.a file, you must uncomment the line that defines - PCRE_STATIC before including pcre.h, because otherwise the pcre_mal- + PCRE_STATIC before including pcre.h, because otherwise the pcre_mal- loc() and pcre_free() exported functions will be declared __declspec(dllimport), with unwanted results. - Once you have compiled and linked the demonstration program, you can + Once you have compiled and linked the demonstration program, you can run simple tests like this: ./pcredemo 'cat|dog' 'the cat sat on the mat' ./pcredemo -g 'cat|dog' 'the dog sat on the cat' - Note that there is a much more comprehensive test program, called - pcretest, which supports many more facilities for testing regular - expressions and the PCRE library. The pcredemo program is provided as a - simple coding example. + Note that there is a much more comprehensive test program, called + pcretest, which supports many more facilities for testing regular + expressions and both PCRE libraries. The pcredemo program is provided + as a simple coding example. - If you try to run pcredemo when PCRE is not installed in the standard - library directory, you may get an error like this on some operating + If you try to run pcredemo when PCRE is not installed in the standard + library directory, you may get an error like this on some operating systems (e.g. Solaris): - ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or + ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory - This is caused by the way shared library support works on those sys- + This is caused by the way shared library support works on those sys- tems. You need to add -R/usr/local/lib @@ -7465,9 +8908,71 @@ REVISION - Last updated: 17 November 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 10 January 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ +PCRELIMITS(3) PCRELIMITS(3) + + +NAME + PCRE - Perl-compatible regular expressions + + +SIZE AND OTHER LIMITATIONS + + There are some size limitations in PCRE but it is hoped that they will + never in practice be relevant. + + The maximum length of a compiled pattern is approximately 64K data + units (bytes for the 8-bit library, 16-bit units for the 16-bit + library) if PCRE is compiled with the default internal linkage size of + 2 bytes. If you want to process regular expressions that are truly + enormous, you can compile PCRE with an internal linkage size of 3 or 4 + (when building the 16-bit library, 3 is rounded up to 4). See the + README file in the source distribution and the pcrebuild documentation + for details. In these cases the limit is substantially larger. How- + ever, the speed of execution is slower. + + All values in repeating quantifiers must be less than 65536. + + There is no limit to the number of parenthesized subpatterns, but there + can be no more than 65535 capturing subpatterns. + + There is a limit to the number of forward references to subsequent sub- + patterns of around 200,000. Repeated forward references with fixed + upper limits, for example, (?2){0,100} when subpattern number 2 is to + the right, are included in the count. There is no limit to the number + of backward references. + + The maximum length of name for a named subpattern is 32 characters, and + the maximum number of named subpatterns is 10000. + + The maximum length of a name in a (*MARK), (*PRUNE), (*SKIP), or + (*THEN) verb is 255 for the 8-bit library and 65535 for the 16-bit + library. + + The maximum length of a subject string is the largest positive number + that an integer variable can hold. However, when using the traditional + matching function, PCRE uses recursion to handle subpatterns and indef- + inite repetition. This means that the available stack space may limit + the size of a subject string that can be processed by certain patterns. + For a discussion of stack issues, see the pcrestack documentation. + + +AUTHOR + + Philip Hazel + University Computing Service + Cambridge CB2 3QH, England. + + +REVISION + + Last updated: 04 May 2012 + Copyright (c) 1997-2012 University of Cambridge. +------------------------------------------------------------------------------ + + PCRESTACK(3) PCRESTACK(3) @@ -7477,12 +8982,14 @@ PCRE DISCUSSION OF STACK USAGE - When you call pcre_exec(), it makes use of an internal function called - match(). This calls itself recursively at branch points in the pattern, - in order to remember the state of the match so that it can back up and - try a different alternative if the first one fails. As matching pro- - ceeds deeper and deeper into the tree of possibilities, the recursion - depth increases. + When you call pcre[16]_exec(), it makes use of an internal function + called match(). This calls itself recursively at branch points in the + pattern, in order to remember the state of the match so that it can + back up and try a different alternative if the first one fails. As + matching proceeds deeper and deeper into the tree of possibilities, the + recursion depth increases. The match() function is also called in other + circumstances, for example, whenever a parenthesized sub-pattern is + entered, and in certain cases of repetition. Not all calls of match() increase the recursion depth; for an item such as a* it may be called several times at the same level, after matching @@ -7491,20 +8998,28 @@ result of the current call (a "tail recursion"), the function is just restarted instead. - The pcre_dfa_exec() function operates in an entirely different way, and - uses recursion only when there is a regular expression recursion or + The above comments apply when pcre[16]_exec() is run in its normal + interpretive manner. If the pattern was studied with the + PCRE_STUDY_JIT_COMPILE option, and just-in-time compiling was success- + ful, and the options passed to pcre[16]_exec() were not incompatible, + the matching process uses the JIT-compiled code instead of the match() + function. In this case, the memory requirements are handled entirely + differently. See the pcrejit documentation for details. + + The pcre[16]_dfa_exec() function operates in an entirely different way, + and uses recursion only when there is a regular expression recursion or subroutine call in the pattern. This includes the processing of asser- tion and "once-only" subpatterns, which are handled like subroutine calls. Normally, these are never very deep, and the limit on the com- - plexity of pcre_dfa_exec() is controlled by the amount of workspace it - is given. However, it is possible to write patterns with runaway infi- - nite recursions; such patterns will cause pcre_dfa_exec() to run out of - stack. At present, there is no protection against this. + plexity of pcre[16]_dfa_exec() is controlled by the amount of workspace + it is given. However, it is possible to write patterns with runaway + infinite recursions; such patterns will cause pcre[16]_dfa_exec() to + run out of stack. At present, there is no protection against this. - The comments that follow do NOT apply to pcre_dfa_exec(); they are rel- - evant only for pcre_exec(). + The comments that follow do NOT apply to pcre[16]_dfa_exec(); they are + relevant only for pcre[16]_exec() without the JIT optimization. - Reducing pcre_exec()'s stack usage + Reducing pcre[16]_exec()'s stack usage Each time that match() is actually called recursively, it uses memory from the process stack. For certain kinds of pattern and data, very @@ -7537,31 +9052,31 @@ 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 for pcre_exec() + Compiling PCRE to use heap instead of stack for pcre[16]_exec() 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 when pcre_exec() is running. This makes it run a lot more + up points when pcre[16]_exec() is running. This makes it run a lot more slowly, however. Details of how to do this are given in the pcrebuild documentation. When built in this way, instead of using the stack, PCRE obtains and frees memory by calling the functions that are pointed to - by the pcre_stack_malloc and pcre_stack_free variables. By default, - these point to malloc() and free(), but you can replace the pointers to - cause PCRE to use your own functions. Since the block sizes are always - the same, and are always freed in reverse order, it may be possible to - implement customized memory handlers that are more efficient than the - standard functions. + by the pcre[16]_stack_malloc and pcre[16]_stack_free variables. By + default, these point to malloc() and free(), but you can replace the + pointers to cause PCRE to use your own functions. Since the block sizes + are always the same, and are always freed in reverse order, it may be + possible to implement customized memory handlers that are more effi- + cient than the standard functions. - Limiting pcre_exec()'s stack usage + Limiting pcre[16]_exec()'s stack usage You can set limits on the number of times that match() is called, both - in total and recursively. If a limit is exceeded, pcre_exec() returns - an error code. Setting suitable limits should prevent it from running - out of stack. The default values of the limits are very large, and - unlikely ever to operate. They can be changed when PCRE is built, and - they can also be set when pcre_exec() is called. For details of these - interfaces, see the pcrebuild documentation and the section on extra - data for pcre_exec() in the pcreapi documentation. + in total and recursively. If a limit is exceeded, pcre[16]_exec() + returns an error code. Setting suitable limits should prevent it from + running out of stack. The default values of the limits are very large, + and unlikely ever to operate. They can be changed when PCRE is built, + and they can also be set when pcre[16]_exec() is called. For details of + these interfaces, see the pcrebuild documentation and the section on + extra data for pcre[16]_exec() in the 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 @@ -7572,9 +9087,33 @@ option (-S) that can be used to increase the size of its stack. As long as the stack is large enough, another option (-M) can be used to find the smallest limits that allow a particular pattern to match a given - subject string. This is done by calling pcre_exec() repeatedly with + subject string. This is done by calling pcre[16]_exec() repeatedly with different limits. + Obtaining an estimate of stack usage + + The actual amount of stack used per recursion can vary quite a lot, + depending on the compiler that was used to build PCRE and the optimiza- + tion or debugging options that were set for it. The rule of thumb value + of 500 bytes mentioned above may be larger or smaller than what is + actually needed. A better approximation can be obtained by running this + command: + + pcretest -m -C + + The -C option causes pcretest to output information about the options + with which PCRE was compiled. When -m is also given (before -C), infor- + mation about stack use is given in a line like this: + + Match recursion uses stack: approximate frame size = 640 bytes + + The value is approximate because some recursions need a bit more (up to + perhaps 16 more bytes). + + If the above command is given when PCRE is compiled to use the heap + instead of the stack for recursion, the value that is output is the + size of each block that is obtained from the heap. + Changing stack size in Unix-like systems In Unix-like environments, there is not often a problem with the stack @@ -7595,7 +9134,7 @@ This reads the current limits (soft and hard) using getrlimit(), then attempts to increase the soft limit to 100Mb using setrlimit(). You - must do this before calling pcre_exec(). + must do this before calling pcre[16]_exec(). Changing stack size in Mac OS X @@ -7614,8 +9153,8 @@ REVISION - Last updated: 03 January 2010 - Copyright (c) 1997-2010 University of Cambridge. + Last updated: 21 January 2012 + Copyright (c) 1997-2012 University of Cambridge. ------------------------------------------------------------------------------ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre.h php5-5.4.9/ext/pcre/pcrelib/pcre.h --- php5-5.4.4/ext/pcre/pcrelib/pcre.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre.h 2012-11-21 05:12:20.000000000 +0000 @@ -5,7 +5,7 @@ /* This is the public header file for the PCRE library, to be #included by applications that call the PCRE functions. - Copyright (c) 1997-2010 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -42,9 +42,9 @@ /* The current PCRE version information. */ #define PCRE_MAJOR 8 -#define PCRE_MINOR 12 +#define PCRE_MINOR 31 #define PCRE_PRERELEASE -#define PCRE_DATE 2011-01-15 +#define PCRE_DATE 2012-07-06 /* 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 @@ -98,28 +98,37 @@ /* Options. Some are compile-time only, some are run-time only, and some are both, so we keep them all distinct. However, almost all the bits in the options word are now used. In the long run, we may have to re-use some of the -compile-time only bits for runtime options, or vice versa. */ +compile-time only bits for runtime options, or vice versa. In the comments +below, "compile", "exec", and "DFA exec" mean that the option is permitted to +be set for those functions; "used in" means that an option may be set only for +compile, but is subsequently referenced in exec and/or DFA exec. Any of the +compile-time options may be inspected during studying (and therefore JIT +compiling). */ #define PCRE_CASELESS 0x00000001 /* Compile */ #define PCRE_MULTILINE 0x00000002 /* Compile */ #define PCRE_DOTALL 0x00000004 /* Compile */ #define PCRE_EXTENDED 0x00000008 /* Compile */ #define PCRE_ANCHORED 0x00000010 /* Compile, exec, DFA exec */ -#define PCRE_DOLLAR_ENDONLY 0x00000020 /* Compile */ +#define PCRE_DOLLAR_ENDONLY 0x00000020 /* Compile, used in exec, DFA exec */ #define PCRE_EXTRA 0x00000040 /* Compile */ #define PCRE_NOTBOL 0x00000080 /* Exec, DFA exec */ #define PCRE_NOTEOL 0x00000100 /* Exec, DFA exec */ #define PCRE_UNGREEDY 0x00000200 /* Compile */ #define PCRE_NOTEMPTY 0x00000400 /* Exec, DFA exec */ -#define PCRE_UTF8 0x00000800 /* Compile */ +/* The next two are also used in exec and DFA exec */ +#define PCRE_UTF8 0x00000800 /* Compile (same as PCRE_UTF16) */ +#define PCRE_UTF16 0x00000800 /* Compile (same as PCRE_UTF8) */ #define PCRE_NO_AUTO_CAPTURE 0x00001000 /* Compile */ -#define PCRE_NO_UTF8_CHECK 0x00002000 /* Compile, exec, DFA exec */ +/* The next two are also used in exec and DFA exec */ +#define PCRE_NO_UTF8_CHECK 0x00002000 /* Compile (same as PCRE_NO_UTF16_CHECK) */ +#define PCRE_NO_UTF16_CHECK 0x00002000 /* Compile (same as PCRE_NO_UTF8_CHECK) */ #define PCRE_AUTO_CALLOUT 0x00004000 /* Compile */ #define PCRE_PARTIAL_SOFT 0x00008000 /* Exec, DFA exec */ #define PCRE_PARTIAL 0x00008000 /* Backwards compatible synonym */ #define PCRE_DFA_SHORTEST 0x00010000 /* DFA exec */ #define PCRE_DFA_RESTART 0x00020000 /* DFA exec */ -#define PCRE_FIRSTLINE 0x00040000 /* Compile */ +#define PCRE_FIRSTLINE 0x00040000 /* Compile, used in exec, DFA exec */ #define PCRE_DUPNAMES 0x00080000 /* Compile */ #define PCRE_NEWLINE_CR 0x00100000 /* Compile, exec, DFA exec */ #define PCRE_NEWLINE_LF 0x00200000 /* Compile, exec, DFA exec */ @@ -128,41 +137,82 @@ #define PCRE_NEWLINE_ANYCRLF 0x00500000 /* Compile, exec, DFA exec */ #define PCRE_BSR_ANYCRLF 0x00800000 /* Compile, exec, DFA exec */ #define PCRE_BSR_UNICODE 0x01000000 /* Compile, exec, DFA exec */ -#define PCRE_JAVASCRIPT_COMPAT 0x02000000 /* Compile */ +#define PCRE_JAVASCRIPT_COMPAT 0x02000000 /* Compile, used in exec */ #define PCRE_NO_START_OPTIMIZE 0x04000000 /* Compile, exec, DFA exec */ #define PCRE_NO_START_OPTIMISE 0x04000000 /* Synonym */ #define PCRE_PARTIAL_HARD 0x08000000 /* Exec, DFA exec */ #define PCRE_NOTEMPTY_ATSTART 0x10000000 /* Exec, DFA exec */ -#define PCRE_UCP 0x20000000 /* Compile */ +#define PCRE_UCP 0x20000000 /* Compile, used in exec, DFA exec */ /* Exec-time and get/set-time error codes */ -#define PCRE_ERROR_NOMATCH (-1) -#define PCRE_ERROR_NULL (-2) -#define PCRE_ERROR_BADOPTION (-3) -#define PCRE_ERROR_BADMAGIC (-4) -#define PCRE_ERROR_UNKNOWN_OPCODE (-5) -#define PCRE_ERROR_UNKNOWN_NODE (-5) /* For backward compatibility */ -#define PCRE_ERROR_NOMEMORY (-6) -#define PCRE_ERROR_NOSUBSTRING (-7) -#define PCRE_ERROR_MATCHLIMIT (-8) -#define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */ -#define PCRE_ERROR_BADUTF8 (-10) -#define PCRE_ERROR_BADUTF8_OFFSET (-11) -#define PCRE_ERROR_PARTIAL (-12) -#define PCRE_ERROR_BADPARTIAL (-13) -#define PCRE_ERROR_INTERNAL (-14) -#define PCRE_ERROR_BADCOUNT (-15) -#define PCRE_ERROR_DFA_UITEM (-16) -#define PCRE_ERROR_DFA_UCOND (-17) -#define PCRE_ERROR_DFA_UMLIMIT (-18) -#define PCRE_ERROR_DFA_WSSIZE (-19) -#define PCRE_ERROR_DFA_RECURSE (-20) -#define PCRE_ERROR_RECURSIONLIMIT (-21) -#define PCRE_ERROR_NULLWSLIMIT (-22) /* No longer actually used */ -#define PCRE_ERROR_BADNEWLINE (-23) -#define PCRE_ERROR_BADOFFSET (-24) -#define PCRE_ERROR_SHORTUTF8 (-25) +#define PCRE_ERROR_NOMATCH (-1) +#define PCRE_ERROR_NULL (-2) +#define PCRE_ERROR_BADOPTION (-3) +#define PCRE_ERROR_BADMAGIC (-4) +#define PCRE_ERROR_UNKNOWN_OPCODE (-5) +#define PCRE_ERROR_UNKNOWN_NODE (-5) /* For backward compatibility */ +#define PCRE_ERROR_NOMEMORY (-6) +#define PCRE_ERROR_NOSUBSTRING (-7) +#define PCRE_ERROR_MATCHLIMIT (-8) +#define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */ +#define PCRE_ERROR_BADUTF8 (-10) /* Same for 8/16 */ +#define PCRE_ERROR_BADUTF16 (-10) /* Same for 8/16 */ +#define PCRE_ERROR_BADUTF8_OFFSET (-11) /* Same for 8/16 */ +#define PCRE_ERROR_BADUTF16_OFFSET (-11) /* Same for 8/16 */ +#define PCRE_ERROR_PARTIAL (-12) +#define PCRE_ERROR_BADPARTIAL (-13) +#define PCRE_ERROR_INTERNAL (-14) +#define PCRE_ERROR_BADCOUNT (-15) +#define PCRE_ERROR_DFA_UITEM (-16) +#define PCRE_ERROR_DFA_UCOND (-17) +#define PCRE_ERROR_DFA_UMLIMIT (-18) +#define PCRE_ERROR_DFA_WSSIZE (-19) +#define PCRE_ERROR_DFA_RECURSE (-20) +#define PCRE_ERROR_RECURSIONLIMIT (-21) +#define PCRE_ERROR_NULLWSLIMIT (-22) /* No longer actually used */ +#define PCRE_ERROR_BADNEWLINE (-23) +#define PCRE_ERROR_BADOFFSET (-24) +#define PCRE_ERROR_SHORTUTF8 (-25) +#define PCRE_ERROR_SHORTUTF16 (-25) /* Same for 8/16 */ +#define PCRE_ERROR_RECURSELOOP (-26) +#define PCRE_ERROR_JIT_STACKLIMIT (-27) +#define PCRE_ERROR_BADMODE (-28) +#define PCRE_ERROR_BADENDIANNESS (-29) +#define PCRE_ERROR_DFA_BADRESTART (-30) + +/* Specific error codes for UTF-8 validity checks */ + +#define PCRE_UTF8_ERR0 0 +#define PCRE_UTF8_ERR1 1 +#define PCRE_UTF8_ERR2 2 +#define PCRE_UTF8_ERR3 3 +#define PCRE_UTF8_ERR4 4 +#define PCRE_UTF8_ERR5 5 +#define PCRE_UTF8_ERR6 6 +#define PCRE_UTF8_ERR7 7 +#define PCRE_UTF8_ERR8 8 +#define PCRE_UTF8_ERR9 9 +#define PCRE_UTF8_ERR10 10 +#define PCRE_UTF8_ERR11 11 +#define PCRE_UTF8_ERR12 12 +#define PCRE_UTF8_ERR13 13 +#define PCRE_UTF8_ERR14 14 +#define PCRE_UTF8_ERR15 15 +#define PCRE_UTF8_ERR16 16 +#define PCRE_UTF8_ERR17 17 +#define PCRE_UTF8_ERR18 18 +#define PCRE_UTF8_ERR19 19 +#define PCRE_UTF8_ERR20 20 +#define PCRE_UTF8_ERR21 21 + +/* Specific error codes for UTF-16 validity checks */ + +#define PCRE_UTF16_ERR0 0 +#define PCRE_UTF16_ERR1 1 +#define PCRE_UTF16_ERR2 2 +#define PCRE_UTF16_ERR3 3 +#define PCRE_UTF16_ERR4 4 /* Request types for pcre_fullinfo() */ @@ -183,6 +233,9 @@ #define PCRE_INFO_JCHANGED 13 #define PCRE_INFO_HASCRORLF 14 #define PCRE_INFO_MINLENGTH 15 +#define PCRE_INFO_JIT 16 +#define PCRE_INFO_JITSIZE 17 +#define PCRE_INFO_MAXLOOKBEHIND 18 /* Request types for pcre_config(). Do not re-arrange, in order to remain compatible. */ @@ -196,8 +249,18 @@ #define PCRE_CONFIG_UNICODE_PROPERTIES 6 #define PCRE_CONFIG_MATCH_LIMIT_RECURSION 7 #define PCRE_CONFIG_BSR 8 +#define PCRE_CONFIG_JIT 9 +#define PCRE_CONFIG_UTF16 10 +#define PCRE_CONFIG_JITTARGET 11 -/* Bit flags for the pcre_extra structure. Do not re-arrange or redefine +/* Request types for pcre_study(). Do not re-arrange, in order to remain +compatible. */ + +#define PCRE_STUDY_JIT_COMPILE 0x0001 +#define PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE 0x0002 +#define PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE 0x0004 + +/* Bit flags for the pcre[16]_extra structure. Do not re-arrange or redefine these bits, just add new ones on the end, in order to remain compatible. */ #define PCRE_EXTRA_STUDY_DATA 0x0001 @@ -206,12 +269,33 @@ #define PCRE_EXTRA_TABLES 0x0008 #define PCRE_EXTRA_MATCH_LIMIT_RECURSION 0x0010 #define PCRE_EXTRA_MARK 0x0020 +#define PCRE_EXTRA_EXECUTABLE_JIT 0x0040 /* Types */ struct real_pcre; /* declaration; the definition is private */ typedef struct real_pcre pcre; +struct real_pcre16; /* declaration; the definition is private */ +typedef struct real_pcre16 pcre16; + +struct real_pcre_jit_stack; /* declaration; the definition is private */ +typedef struct real_pcre_jit_stack pcre_jit_stack; + +struct real_pcre16_jit_stack; /* declaration; the definition is private */ +typedef struct real_pcre16_jit_stack pcre16_jit_stack; + +/* If PCRE is compiled with 16 bit character support, PCRE_UCHAR16 must contain +a 16 bit wide signed data type. Otherwise it can be a dummy data type since +pcre16 functions are not implemented. There is a check for this in pcre_internal.h. */ +#ifndef PCRE_UCHAR16 +#define PCRE_UCHAR16 unsigned short +#endif + +#ifndef PCRE_SPTR16 +#define PCRE_SPTR16 const PCRE_UCHAR16 * +#endif + /* When PCRE is compiled as a C++ library, the subject pointer type can be replaced with a custom type. For conventional use, the public interface is a const char *. */ @@ -232,8 +316,22 @@ const unsigned char *tables; /* Pointer to character tables */ unsigned long int match_limit_recursion; /* Max recursive calls to match() */ unsigned char **mark; /* For passing back a mark pointer */ + void *executable_jit; /* Contains a pointer to a compiled jit code */ } pcre_extra; +/* Same structure as above, but with 16 bit char pointers. */ + +typedef struct pcre16_extra { + unsigned long int flags; /* Bits for which fields are set */ + void *study_data; /* Opaque data from pcre_study() */ + unsigned long int match_limit; /* Maximum number of calls to match() */ + void *callout_data; /* Data passed back in callouts */ + const unsigned char *tables; /* Pointer to character tables */ + unsigned long int match_limit_recursion; /* Max recursive calls to match() */ + PCRE_UCHAR16 **mark; /* For passing back a mark pointer */ + void *executable_jit; /* Contains a pointer to a compiled jit code */ +} pcre16_extra; + /* The structure for passing out data via the pcre_callout_function. We use a structure so that new fields can be added on the end in future versions, without changing the API of the function, thereby allowing old clients to work @@ -254,9 +352,33 @@ /* ------------------- Added for Version 1 -------------------------- */ int pattern_position; /* Offset to next item in the pattern */ int next_item_length; /* Length of next item in the pattern */ + /* ------------------- Added for Version 2 -------------------------- */ + const unsigned char *mark; /* Pointer to current mark or NULL */ /* ------------------------------------------------------------------ */ } pcre_callout_block; +/* Same structure as above, but with 16 bit char pointers. */ + +typedef struct pcre16_callout_block { + int version; /* Identifies version of block */ + /* ------------------------ Version 0 ------------------------------- */ + int callout_number; /* Number compiled into pattern */ + int *offset_vector; /* The offset vector */ + PCRE_SPTR16 subject; /* The subject being matched */ + int subject_length; /* The length of the subject */ + int start_match; /* Offset to start of this match attempt */ + int current_position; /* Where we currently are in the subject */ + int capture_top; /* Max current capture */ + int capture_last; /* Most recently closed capture */ + void *callout_data; /* Data passed in with the call */ + /* ------------------- Added for Version 1 -------------------------- */ + int pattern_position; /* Offset to next item in the pattern */ + int next_item_length; /* Length of next item in the pattern */ + /* ------------------- Added for Version 2 -------------------------- */ + const PCRE_UCHAR16 *mark; /* Pointer to current mark or NULL */ + /* ------------------------------------------------------------------ */ +} pcre16_callout_block; + /* Indirection for store get and free functions. These can be set to alternative malloc/free functions if required. Special ones are used in the non-recursive case for "frames". There is also an optional callout function @@ -269,47 +391,114 @@ PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t); PCRE_EXP_DECL void (*pcre_stack_free)(void *); PCRE_EXP_DECL int (*pcre_callout)(pcre_callout_block *); + +PCRE_EXP_DECL void *(*pcre16_malloc)(size_t); +PCRE_EXP_DECL void (*pcre16_free)(void *); +PCRE_EXP_DECL void *(*pcre16_stack_malloc)(size_t); +PCRE_EXP_DECL void (*pcre16_stack_free)(void *); +PCRE_EXP_DECL int (*pcre16_callout)(pcre16_callout_block *); #else /* VPCOMPAT */ PCRE_EXP_DECL void *pcre_malloc(size_t); PCRE_EXP_DECL void pcre_free(void *); PCRE_EXP_DECL void *pcre_stack_malloc(size_t); PCRE_EXP_DECL void pcre_stack_free(void *); PCRE_EXP_DECL int pcre_callout(pcre_callout_block *); + +PCRE_EXP_DECL void *pcre16_malloc(size_t); +PCRE_EXP_DECL void pcre16_free(void *); +PCRE_EXP_DECL void *pcre16_stack_malloc(size_t); +PCRE_EXP_DECL void pcre16_stack_free(void *); +PCRE_EXP_DECL int pcre16_callout(pcre16_callout_block *); #endif /* VPCOMPAT */ +/* User defined callback which provides a stack just before the match starts. */ + +typedef pcre_jit_stack *(*pcre_jit_callback)(void *); +typedef pcre16_jit_stack *(*pcre16_jit_callback)(void *); + /* Exported PCRE functions */ PCRE_EXP_DECL pcre *pcre_compile(const char *, int, const char **, int *, const unsigned char *); +PCRE_EXP_DECL pcre16 *pcre16_compile(PCRE_SPTR16, int, const char **, int *, + const unsigned char *); PCRE_EXP_DECL pcre *pcre_compile2(const char *, int, int *, const char **, int *, const unsigned char *); +PCRE_EXP_DECL pcre16 *pcre16_compile2(PCRE_SPTR16, int, int *, const char **, + int *, const unsigned char *); PCRE_EXP_DECL int pcre_config(int, void *); +PCRE_EXP_DECL int pcre16_config(int, void *); PCRE_EXP_DECL int pcre_copy_named_substring(const pcre *, const char *, int *, int, const char *, char *, int); -PCRE_EXP_DECL int pcre_copy_substring(const char *, int *, int, int, char *, - int); +PCRE_EXP_DECL int pcre16_copy_named_substring(const pcre16 *, PCRE_SPTR16, + int *, int, PCRE_SPTR16, PCRE_UCHAR16 *, int); +PCRE_EXP_DECL int pcre_copy_substring(const char *, int *, int, int, + char *, int); +PCRE_EXP_DECL int pcre16_copy_substring(PCRE_SPTR16, int *, int, int, + PCRE_UCHAR16 *, int); PCRE_EXP_DECL int pcre_dfa_exec(const pcre *, const pcre_extra *, const char *, int, int, int, int *, int , int *, int); +PCRE_EXP_DECL int pcre16_dfa_exec(const pcre16 *, const pcre16_extra *, + PCRE_SPTR16, int, int, int, int *, int , int *, int); PCRE_EXP_DECL int pcre_exec(const pcre *, const pcre_extra *, PCRE_SPTR, int, int, int, int *, int); +PCRE_EXP_DECL int pcre16_exec(const pcre16 *, const pcre16_extra *, + PCRE_SPTR16, int, int, int, int *, int); PCRE_EXP_DECL void pcre_free_substring(const char *); +PCRE_EXP_DECL void pcre16_free_substring(PCRE_SPTR16); PCRE_EXP_DECL void pcre_free_substring_list(const char **); +PCRE_EXP_DECL void pcre16_free_substring_list(PCRE_SPTR16 *); PCRE_EXP_DECL int pcre_fullinfo(const pcre *, const pcre_extra *, int, void *); +PCRE_EXP_DECL int pcre16_fullinfo(const pcre16 *, const pcre16_extra *, int, + void *); PCRE_EXP_DECL int pcre_get_named_substring(const pcre *, const char *, int *, int, const char *, const char **); +PCRE_EXP_DECL int pcre16_get_named_substring(const pcre16 *, PCRE_SPTR16, + int *, int, PCRE_SPTR16, PCRE_SPTR16 *); PCRE_EXP_DECL int pcre_get_stringnumber(const pcre *, const char *); +PCRE_EXP_DECL int pcre16_get_stringnumber(const pcre16 *, PCRE_SPTR16); PCRE_EXP_DECL int pcre_get_stringtable_entries(const pcre *, const char *, char **, char **); +PCRE_EXP_DECL int pcre16_get_stringtable_entries(const pcre16 *, PCRE_SPTR16, + PCRE_UCHAR16 **, PCRE_UCHAR16 **); PCRE_EXP_DECL int pcre_get_substring(const char *, int *, int, int, const char **); +PCRE_EXP_DECL int pcre16_get_substring(PCRE_SPTR16, int *, int, int, + PCRE_SPTR16 *); PCRE_EXP_DECL int pcre_get_substring_list(const char *, int *, int, const char ***); -PCRE_EXP_DECL int pcre_info(const pcre *, int *, int *); +PCRE_EXP_DECL int pcre16_get_substring_list(PCRE_SPTR16, int *, int, + PCRE_SPTR16 **); PCRE_EXP_DECL const unsigned char *pcre_maketables(void); +PCRE_EXP_DECL const unsigned char *pcre16_maketables(void); PCRE_EXP_DECL int pcre_refcount(pcre *, int); +PCRE_EXP_DECL int pcre16_refcount(pcre16 *, int); PCRE_EXP_DECL pcre_extra *pcre_study(const pcre *, int, const char **); +PCRE_EXP_DECL pcre16_extra *pcre16_study(const pcre16 *, int, const char **); +PCRE_EXP_DECL void pcre_free_study(pcre_extra *); +PCRE_EXP_DECL void pcre16_free_study(pcre16_extra *); PCRE_EXP_DECL const char *pcre_version(void); +PCRE_EXP_DECL const char *pcre16_version(void); + +/* Utility functions for byte order swaps. */ +PCRE_EXP_DECL int pcre_pattern_to_host_byte_order(pcre *, pcre_extra *, + const unsigned char *); +PCRE_EXP_DECL int pcre16_pattern_to_host_byte_order(pcre16 *, pcre16_extra *, + const unsigned char *); +PCRE_EXP_DECL int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *, + PCRE_SPTR16, int, int *, int); + +/* JIT compiler related functions. */ + +PCRE_EXP_DECL pcre_jit_stack *pcre_jit_stack_alloc(int, int); +PCRE_EXP_DECL pcre16_jit_stack *pcre16_jit_stack_alloc(int, int); +PCRE_EXP_DECL void pcre_jit_stack_free(pcre_jit_stack *); +PCRE_EXP_DECL void pcre16_jit_stack_free(pcre16_jit_stack *); +PCRE_EXP_DECL void pcre_assign_jit_stack(pcre_extra *, + pcre_jit_callback, void *); +PCRE_EXP_DECL void pcre16_assign_jit_stack(pcre16_extra *, + pcre16_jit_callback, void *); #ifdef __cplusplus } /* extern "C" */ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_compile.c php5-5.4.9/ext/pcre/pcrelib/pcre_compile.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_compile.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_compile.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2010 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -51,12 +51,16 @@ #include "pcre_internal.h" -/* When PCRE_DEBUG is defined, we need the pcre_printint() function, which is -also used by pcretest. PCRE_DEBUG is not defined when building a production -library. */ +/* When PCRE_DEBUG is defined, we need the pcre(16)_printint() function, which +is also used by pcretest. PCRE_DEBUG is not defined when building a production +library. We do not need to select pcre16_printint.c specially, because the +COMPILE_PCREx macro will already be appropriately set. */ #ifdef PCRE_DEBUG -#include "pcre_printint.src" +/* pcre_printint.c should not include any headers */ +#define PCRE_INCLUDED +#include "pcre_printint.c" +#undef PCRE_INCLUDED #endif @@ -86,15 +90,30 @@ The same workspace is used during the second, actual compile phase for remembering forward references to groups so that they can be filled in at the end. Each entry in this list occupies LINK_SIZE bytes, so even when LINK_SIZE -is 4 there is plenty of room. */ +is 4 there is plenty of room for most patterns. However, the memory can get +filled up by repetitions of forward references, for example patterns like +/(?1){0,1999}(b)/, and one user did hit the limit. The code has been changed so +that the workspace is expanded using malloc() in this situation. The value +below is therefore a minimum, and we put a maximum on it for safety. The +minimum is now also defined in terms of LINK_SIZE so that the use of malloc() +kicks in at the same number of forward references in all cases. */ -#define COMPILE_WORK_SIZE (4096) +#define COMPILE_WORK_SIZE (2048*LINK_SIZE) +#define COMPILE_WORK_SIZE_MAX (100*COMPILE_WORK_SIZE) /* The overrun tests check for a slightly smaller size so that they detect the overrun before it actually does run off the end of the data block. */ -#define WORK_SIZE_CHECK (COMPILE_WORK_SIZE - 100) +#define WORK_SIZE_SAFETY_MARGIN (100) +/* Private flags added to firstchar and reqchar. */ + +#define REQ_CASELESS 0x10000000l /* Indicates caselessness */ +#define REQ_VARY 0x20000000l /* Reqchar followed non-literal item */ + +/* Repeated character flags. */ + +#define UTF_LENGTH 0x10000000l /* The char contains its length. */ /* Table for handling escaped characters in the range '0'-'z'. Positive returns are simple data values; negative values are for special things like \d and so @@ -229,7 +248,7 @@ STRING_graph0 STRING_print0 STRING_punct0 STRING_space0 STRING_word0 STRING_xdigit; -static const uschar posix_name_lengths[] = { +static const pcre_uint8 posix_name_lengths[] = { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 6, 0 }; /* Table of class bit maps for each POSIX class. Each class is formed from a @@ -264,47 +283,101 @@ both positive and negative cases. NULL means no substitute. */ #ifdef SUPPORT_UCP -static const uschar *substitutes[] = { - (uschar *)"\\P{Nd}", /* \D */ - (uschar *)"\\p{Nd}", /* \d */ - (uschar *)"\\P{Xsp}", /* \S */ /* NOTE: Xsp is Perl space */ - (uschar *)"\\p{Xsp}", /* \s */ - (uschar *)"\\P{Xwd}", /* \W */ - (uschar *)"\\p{Xwd}" /* \w */ +static const pcre_uchar string_PNd[] = { + CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET, + CHAR_N, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_pNd[] = { + CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET, + CHAR_N, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_PXsp[] = { + CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET, + CHAR_X, CHAR_s, CHAR_p, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_pXsp[] = { + CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET, + CHAR_X, CHAR_s, CHAR_p, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_PXwd[] = { + CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET, + CHAR_X, CHAR_w, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_pXwd[] = { + CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET, + CHAR_X, CHAR_w, CHAR_d, CHAR_RIGHT_CURLY_BRACKET, '\0' }; + +static const pcre_uchar *substitutes[] = { + string_PNd, /* \D */ + string_pNd, /* \d */ + string_PXsp, /* \S */ /* NOTE: Xsp is Perl space */ + string_pXsp, /* \s */ + string_PXwd, /* \W */ + string_pXwd /* \w */ }; -static const uschar *posix_substitutes[] = { - (uschar *)"\\p{L}", /* alpha */ - (uschar *)"\\p{Ll}", /* lower */ - (uschar *)"\\p{Lu}", /* upper */ - (uschar *)"\\p{Xan}", /* alnum */ - NULL, /* ascii */ - (uschar *)"\\h", /* blank */ - NULL, /* cntrl */ - (uschar *)"\\p{Nd}", /* digit */ - NULL, /* graph */ - NULL, /* print */ - NULL, /* punct */ - (uschar *)"\\p{Xps}", /* space */ /* NOTE: Xps is POSIX space */ - (uschar *)"\\p{Xwd}", /* word */ - NULL, /* xdigit */ +static const pcre_uchar string_pL[] = { + CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET, + CHAR_L, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_pLl[] = { + CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET, + CHAR_L, CHAR_l, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_pLu[] = { + CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET, + CHAR_L, CHAR_u, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_pXan[] = { + CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET, + CHAR_X, CHAR_a, CHAR_n, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_h[] = { + CHAR_BACKSLASH, CHAR_h, '\0' }; +static const pcre_uchar string_pXps[] = { + CHAR_BACKSLASH, CHAR_p, CHAR_LEFT_CURLY_BRACKET, + CHAR_X, CHAR_p, CHAR_s, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_PL[] = { + CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET, + CHAR_L, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_PLl[] = { + CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET, + CHAR_L, CHAR_l, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_PLu[] = { + CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET, + CHAR_L, CHAR_u, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_PXan[] = { + CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET, + CHAR_X, CHAR_a, CHAR_n, CHAR_RIGHT_CURLY_BRACKET, '\0' }; +static const pcre_uchar string_H[] = { + CHAR_BACKSLASH, CHAR_H, '\0' }; +static const pcre_uchar string_PXps[] = { + CHAR_BACKSLASH, CHAR_P, CHAR_LEFT_CURLY_BRACKET, + CHAR_X, CHAR_p, CHAR_s, CHAR_RIGHT_CURLY_BRACKET, '\0' }; + +static const pcre_uchar *posix_substitutes[] = { + string_pL, /* alpha */ + string_pLl, /* lower */ + string_pLu, /* upper */ + string_pXan, /* alnum */ + NULL, /* ascii */ + string_h, /* blank */ + NULL, /* cntrl */ + string_pNd, /* digit */ + NULL, /* graph */ + NULL, /* print */ + NULL, /* punct */ + string_pXps, /* space */ /* NOTE: Xps is POSIX space */ + string_pXwd, /* word */ + NULL, /* xdigit */ /* Negated cases */ - (uschar *)"\\P{L}", /* ^alpha */ - (uschar *)"\\P{Ll}", /* ^lower */ - (uschar *)"\\P{Lu}", /* ^upper */ - (uschar *)"\\P{Xan}", /* ^alnum */ - NULL, /* ^ascii */ - (uschar *)"\\H", /* ^blank */ - NULL, /* ^cntrl */ - (uschar *)"\\P{Nd}", /* ^digit */ - NULL, /* ^graph */ - NULL, /* ^print */ - NULL, /* ^punct */ - (uschar *)"\\P{Xps}", /* ^space */ /* NOTE: Xps is POSIX space */ - (uschar *)"\\P{Xwd}", /* ^word */ - NULL /* ^xdigit */ + string_PL, /* ^alpha */ + string_PLl, /* ^lower */ + string_PLu, /* ^upper */ + string_PXan, /* ^alnum */ + NULL, /* ^ascii */ + string_H, /* ^blank */ + NULL, /* ^cntrl */ + string_PNd, /* ^digit */ + NULL, /* ^graph */ + NULL, /* ^print */ + NULL, /* ^punct */ + string_PXps, /* ^space */ /* NOTE: Xps is POSIX space */ + string_PXwd, /* ^word */ + NULL /* ^xdigit */ }; -#define POSIX_SUBSIZE (sizeof(posix_substitutes)/sizeof(uschar *)) +#define POSIX_SUBSIZE (sizeof(posix_substitutes) / sizeof(pcre_uchar *)) #endif #define STRING(a) # a @@ -363,7 +436,7 @@ /* 30 */ "unknown POSIX class name\0" "POSIX collating elements are not supported\0" - "this version of PCRE is not compiled with PCRE_UTF8 support\0" + "this version of PCRE is compiled without UTF support\0" "spare error\0" /** DEAD **/ "character value in \\x{...} sequence is too large\0" /* 35 */ @@ -386,12 +459,12 @@ "too many named subpatterns (maximum " XSTRING(MAX_NAME_COUNT) ")\0" /* 50 */ "repeated subpattern is too long\0" /** DEAD **/ - "octal value is greater than \\377 (not in UTF-8 mode)\0" + "octal value is greater than \\377 in 8-bit non-UTF-8 mode\0" "internal error: overran compiling workspace\0" "internal error: previously-checked referenced subpattern not found\0" "DEFINE group contains more than one branch\0" /* 55 */ - "repeating a DEFINE group is not allowed\0" + "repeating a DEFINE group is not allowed\0" /** DEAD **/ "inconsistent NEWLINE options\0" "\\g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number\0" "a numbered reference must not be zero\0" @@ -405,8 +478,18 @@ /* 65 */ "different names for subpatterns of the same number are not allowed\0" "(*MARK) must have an argument\0" - "this version of PCRE is not compiled with PCRE_UCP support\0" + "this version of PCRE is not compiled with Unicode property support\0" "\\c must be followed by an ASCII character\0" + "\\k is not followed by a braced, angle-bracketed, or quoted name\0" + /* 70 */ + "internal error: unknown opcode in find_fixedlength()\0" + "\\N is not supported in a class\0" + "too many forward references\0" + "disallowed Unicode code point (>= 0xd800 && <= 0xdfff)\0" + "invalid UTF-16 string\0" + /* 75 */ + "name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)\0" + "character value in \\u.... sequence is too large\0" ; /* Table to identify digits and hex digits. This is used when compiling @@ -425,12 +508,18 @@ Then we can use ctype_digit and ctype_xdigit in the code. */ +/* Using a simple comparison for decimal numbers rather than a memory read +is much faster, and the resulting code is simpler (the compiler turns it +into a subtraction and unsigned comparison). */ + +#define IS_DIGIT(x) ((x) >= CHAR_0 && (x) <= CHAR_9) + #ifndef EBCDIC /* This is the "normal" case, for ASCII systems, and EBCDIC systems running in UTF-8 mode. */ -static const unsigned char digitab[] = +static const pcre_uint8 digitab[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */ @@ -469,7 +558,7 @@ /* This is the "abnormal" case, for EBCDIC systems not running in UTF-8 mode. */ -static const unsigned char digitab[] = +static const pcre_uint8 digitab[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 0 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 8- 15 */ @@ -504,7 +593,7 @@ 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /* 0 - 7 F0 */ 0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00};/* 8 -255 */ -static const unsigned char ebcdic_chartab[] = { /* chartable partial dup */ +static const pcre_uint8 ebcdic_chartab[] = { /* chartable partial dup */ 0x80,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 0- 7 */ 0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */ 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 16- 23 */ @@ -543,7 +632,7 @@ /* Definition to allow mutual recursion */ static BOOL - compile_regex(int, int, uschar **, const uschar **, int *, BOOL, BOOL, int, + compile_regex(int, pcre_uchar **, const pcre_uchar **, int *, BOOL, BOOL, int, int, int *, int *, branch_chain *, compile_data *, int *); @@ -575,6 +664,78 @@ /************************************************* +* Expand the workspace * +*************************************************/ + +/* This function is called during the second compiling phase, if the number of +forward references fills the existing workspace, which is originally a block on +the stack. A larger block is obtained from malloc() unless the ultimate limit +has been reached or the increase will be rather small. + +Argument: pointer to the compile data block +Returns: 0 if all went well, else an error number +*/ + +static int +expand_workspace(compile_data *cd) +{ +pcre_uchar *newspace; +int newsize = cd->workspace_size * 2; + +if (newsize > COMPILE_WORK_SIZE_MAX) newsize = COMPILE_WORK_SIZE_MAX; +if (cd->workspace_size >= COMPILE_WORK_SIZE_MAX || + newsize - cd->workspace_size < WORK_SIZE_SAFETY_MARGIN) + return ERR72; + +newspace = (PUBL(malloc))(IN_UCHARS(newsize)); +if (newspace == NULL) return ERR21; +memcpy(newspace, cd->start_workspace, cd->workspace_size * sizeof(pcre_uchar)); +cd->hwm = (pcre_uchar *)newspace + (cd->hwm - cd->start_workspace); +if (cd->workspace_size > COMPILE_WORK_SIZE) + (PUBL(free))((void *)cd->start_workspace); +cd->start_workspace = newspace; +cd->workspace_size = newsize; +return 0; +} + + + +/************************************************* +* Check for counted repeat * +*************************************************/ + +/* This function is called when a '{' is encountered in a place where it might +start a quantifier. It looks ahead to see if it really is a quantifier or not. +It is only a quantifier if it is one of the forms {ddd} {ddd,} or {ddd,ddd} +where the ddds are digits. + +Arguments: + p pointer to the first char after '{' + +Returns: TRUE or FALSE +*/ + +static BOOL +is_counted_repeat(const pcre_uchar *p) +{ +if (!IS_DIGIT(*p)) return FALSE; +p++; +while (IS_DIGIT(*p)) p++; +if (*p == CHAR_RIGHT_CURLY_BRACKET) return TRUE; + +if (*p++ != CHAR_COMMA) return FALSE; +if (*p == CHAR_RIGHT_CURLY_BRACKET) return TRUE; + +if (!IS_DIGIT(*p)) return FALSE; +p++; +while (IS_DIGIT(*p)) p++; + +return (*p == CHAR_RIGHT_CURLY_BRACKET); +} + + + +/************************************************* * Handle escapes * *************************************************/ @@ -599,12 +760,14 @@ */ static int -check_escape(const uschar **ptrptr, int *errorcodeptr, int bracount, +check_escape(const pcre_uchar **ptrptr, int *errorcodeptr, int bracount, int options, BOOL isclass) { -BOOL utf8 = (options & PCRE_UTF8) != 0; -const uschar *ptr = *ptrptr + 1; -int c, i; +/* PCRE_UTF16 has the same value as PCRE_UTF8. */ +BOOL utf = (options & PCRE_UTF8) != 0; +const pcre_uchar *ptr = *ptrptr + 1; +pcre_int32 c; +int i; GETCHARINCTEST(c, ptr); /* Get character value, increment pointer */ ptr--; /* Set pointer back to the last byte */ @@ -618,11 +781,13 @@ Otherwise further processing may be required. */ #ifndef EBCDIC /* ASCII/UTF-8 coding */ -else if (c < CHAR_0 || c > CHAR_z) {} /* Not alphanumeric */ +/* Not alphanumeric */ +else if (c < CHAR_0 || c > CHAR_z) {} else if ((i = escapes[c - CHAR_0]) != 0) c = i; #else /* EBCDIC coding */ -else if (c < 'a' || (ebcdic_chartab[c] & 0x0E) == 0) {} /* Not alphanumeric */ +/* Not alphanumeric */ +else if (c < 'a' || (!MAX_255(c) || (ebcdic_chartab[c] & 0x0E) == 0)) {} else if ((i = escapes[c - 0x48]) != 0) c = i; #endif @@ -630,7 +795,7 @@ else { - const uschar *oldptr; + const pcre_uchar *oldptr; BOOL braced, negated; switch (c) @@ -640,12 +805,56 @@ case CHAR_l: case CHAR_L: + *errorcodeptr = ERR37; + break; + case CHAR_u: + if ((options & PCRE_JAVASCRIPT_COMPAT) != 0) + { + /* In JavaScript, \u must be followed by four hexadecimal numbers. + Otherwise it is a lowercase u letter. */ + if (MAX_255(ptr[1]) && (digitab[ptr[1]] & ctype_xdigit) != 0 + && MAX_255(ptr[2]) && (digitab[ptr[2]] & ctype_xdigit) != 0 + && MAX_255(ptr[3]) && (digitab[ptr[3]] & ctype_xdigit) != 0 + && MAX_255(ptr[4]) && (digitab[ptr[4]] & ctype_xdigit) != 0) + { + c = 0; + for (i = 0; i < 4; ++i) + { + register int cc = *(++ptr); +#ifndef EBCDIC /* ASCII/UTF-8 coding */ + if (cc >= CHAR_a) cc -= 32; /* Convert to upper case */ + c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10)); +#else /* EBCDIC coding */ + if (cc >= CHAR_a && cc <= CHAR_z) cc += 64; /* Convert to upper case */ + c = (c << 4) + cc - ((cc >= CHAR_0)? CHAR_0 : (CHAR_A - 10)); +#endif + } + +#ifdef COMPILE_PCRE8 + if (c > (utf ? 0x10ffff : 0xff)) +#else +#ifdef COMPILE_PCRE16 + if (c > (utf ? 0x10ffff : 0xffff)) +#endif +#endif + { + *errorcodeptr = ERR76; + } + else if (utf && c >= 0xd800 && c <= 0xdfff) *errorcodeptr = ERR73; + } + } + else + *errorcodeptr = ERR37; + break; + case CHAR_U: - *errorcodeptr = ERR37; + /* In JavaScript, \U is an uppercase U letter. */ + if ((options & PCRE_JAVASCRIPT_COMPAT) == 0) *errorcodeptr = ERR37; break; - /* \g must be followed by one of a number of specific things: + /* In a character class, \g is just a literal "g". Outside a character + class, \g must be followed by one of a number of specific things: (1) A number, either plain or braced. If positive, it is an absolute backreference. If negative, it is a relative backreference. This is a Perl @@ -662,6 +871,7 @@ the -ESC_g code (cf \k). */ case CHAR_g: + if (isclass) break; if (ptr[1] == CHAR_LESS_THAN_SIGN || ptr[1] == CHAR_APOSTROPHE) { c = -ESC_g; @@ -672,9 +882,9 @@ if (ptr[1] == CHAR_LEFT_CURLY_BRACKET) { - const uschar *p; + const pcre_uchar *p; for (p = ptr+2; *p != 0 && *p != CHAR_RIGHT_CURLY_BRACKET; p++) - if (*p != CHAR_MINUS && (digitab[*p] & ctype_digit) == 0) break; + if (*p != CHAR_MINUS && !IS_DIGIT(*p)) break; if (*p != 0 && *p != CHAR_RIGHT_CURLY_BRACKET) { c = -ESC_k; @@ -692,12 +902,21 @@ } else negated = FALSE; + /* The integer range is limited by the machine's int representation. */ c = 0; - while ((digitab[ptr[1]] & ctype_digit) != 0) + while (IS_DIGIT(ptr[1])) + { + if (((unsigned int)c) > INT_MAX / 10) /* Integer overflow */ + { + c = -1; + break; + } c = c * 10 + *(++ptr) - CHAR_0; - - if (c < 0) /* Integer overflow */ + } + if (((unsigned int)c) > INT_MAX) /* Integer overflow */ { + while (IS_DIGIT(ptr[1])) + ptr++; *errorcodeptr = ERR61; break; } @@ -745,11 +964,21 @@ if (!isclass) { oldptr = ptr; + /* The integer range is limited by the machine's int representation. */ c -= CHAR_0; - while ((digitab[ptr[1]] & ctype_digit) != 0) + while (IS_DIGIT(ptr[1])) + { + if (((unsigned int)c) > INT_MAX / 10) /* Integer overflow */ + { + c = -1; + break; + } c = c * 10 + *(++ptr) - CHAR_0; - if (c < 0) /* Integer overflow */ + } + if (((unsigned int)c) > INT_MAX) /* Integer overflow */ { + while (IS_DIGIT(ptr[1])) + ptr++; *errorcodeptr = ERR61; break; } @@ -775,32 +1004,55 @@ /* \0 always starts an octal number, but we may drop through to here with a larger first octal digit. The original code used just to take the least significant 8 bits of octal numbers (I think this is what early Perls used - to do). Nowadays we allow for larger numbers in UTF-8 mode, but no more - than 3 octal digits. */ + to do). Nowadays we allow for larger numbers in UTF-8 mode and 16-bit mode, + but no more than 3 octal digits. */ case CHAR_0: c -= CHAR_0; while(i++ < 2 && ptr[1] >= CHAR_0 && ptr[1] <= CHAR_7) c = c * 8 + *(++ptr) - CHAR_0; - if (!utf8 && c > 255) *errorcodeptr = ERR51; +#ifdef COMPILE_PCRE8 + if (!utf && c > 0xff) *errorcodeptr = ERR51; +#endif break; /* \x is complicated. \x{ddd} is a character number which can be greater - than 0xff in utf8 mode, but only if the ddd are hex digits. If not, { is - treated as a data character. */ + than 0xff in utf or non-8bit mode, but only if the ddd are hex digits. + If not, { is treated as a data character. */ case CHAR_x: + if ((options & PCRE_JAVASCRIPT_COMPAT) != 0) + { + /* In JavaScript, \x must be followed by two hexadecimal numbers. + Otherwise it is a lowercase x letter. */ + if (MAX_255(ptr[1]) && (digitab[ptr[1]] & ctype_xdigit) != 0 + && MAX_255(ptr[2]) && (digitab[ptr[2]] & ctype_xdigit) != 0) + { + c = 0; + for (i = 0; i < 2; ++i) + { + register int cc = *(++ptr); +#ifndef EBCDIC /* ASCII/UTF-8 coding */ + if (cc >= CHAR_a) cc -= 32; /* Convert to upper case */ + c = (c << 4) + cc - ((cc < CHAR_A)? CHAR_0 : (CHAR_A - 10)); +#else /* EBCDIC coding */ + if (cc >= CHAR_a && cc <= CHAR_z) cc += 64; /* Convert to upper case */ + c = (c << 4) + cc - ((cc >= CHAR_0)? CHAR_0 : (CHAR_A - 10)); +#endif + } + } + break; + } + if (ptr[1] == CHAR_LEFT_CURLY_BRACKET) { - const uschar *pt = ptr + 2; - int count = 0; + const pcre_uchar *pt = ptr + 2; c = 0; - while ((digitab[*pt] & ctype_xdigit) != 0) + while (MAX_255(*pt) && (digitab[*pt] & ctype_xdigit) != 0) { register int cc = *pt++; if (c == 0 && cc == CHAR_0) continue; /* Leading zeroes */ - count++; #ifndef EBCDIC /* ASCII/UTF-8 coding */ if (cc >= CHAR_a) cc -= 32; /* Convert to upper case */ @@ -809,11 +1061,25 @@ if (cc >= CHAR_a && cc <= CHAR_z) cc += 64; /* Convert to upper case */ c = (c << 4) + cc - ((cc >= CHAR_0)? CHAR_0 : (CHAR_A - 10)); #endif + +#ifdef COMPILE_PCRE8 + if (c > (utf ? 0x10ffff : 0xff)) { c = -1; break; } +#else +#ifdef COMPILE_PCRE16 + if (c > (utf ? 0x10ffff : 0xffff)) { c = -1; break; } +#endif +#endif + } + + if (c < 0) + { + while (MAX_255(*pt) && (digitab[*pt] & ctype_xdigit) != 0) pt++; + *errorcodeptr = ERR34; } if (*pt == CHAR_RIGHT_CURLY_BRACKET) { - if (c < 0 || count > (utf8? 8 : 2)) *errorcodeptr = ERR34; + if (utf && c >= 0xd800 && c <= 0xdfff) *errorcodeptr = ERR73; ptr = pt; break; } @@ -825,7 +1091,7 @@ /* Read just a single-byte hex-defined char */ c = 0; - while (i++ < 2 && (digitab[ptr[1]] & ctype_xdigit) != 0) + while (i++ < 2 && MAX_255(ptr[1]) && (digitab[ptr[1]] & ctype_xdigit) != 0) { int cc; /* Some compilers don't like */ cc = *(++ptr); /* ++ in initializers */ @@ -883,9 +1149,11 @@ } /* Perl supports \N{name} for character names, as well as plain \N for "not -newline". PCRE does not support \N{name}. */ +newline". PCRE does not support \N{name}. However, it does support +quantification such as \N{2,3}. */ -if (c == -ESC_N && ptr[1] == CHAR_LEFT_CURLY_BRACKET) +if (c == -ESC_N && ptr[1] == CHAR_LEFT_CURLY_BRACKET && + !is_counted_repeat(ptr+2)) *errorcodeptr = ERR37; /* If PCRE_UCP is set, we change the values for \d etc. */ @@ -921,11 +1189,11 @@ */ static int -get_ucp(const uschar **ptrptr, BOOL *negptr, int *dptr, int *errorcodeptr) +get_ucp(const pcre_uchar **ptrptr, BOOL *negptr, int *dptr, int *errorcodeptr) { int c, i, bot, top; -const uschar *ptr = *ptrptr; -char name[32]; +const pcre_uchar *ptr = *ptrptr; +pcre_uchar name[32]; c = *(++ptr); if (c == 0) goto ERROR_RETURN; @@ -942,7 +1210,7 @@ *negptr = TRUE; ptr++; } - for (i = 0; i < (int)sizeof(name) - 1; i++) + for (i = 0; i < (int)(sizeof(name) / sizeof(pcre_uchar)) - 1; i++) { c = *(++ptr); if (c == 0) goto ERROR_RETURN; @@ -966,16 +1234,16 @@ /* Search for a recognized property name using binary chop */ bot = 0; -top = _pcre_utt_size; +top = PRIV(utt_size); while (bot < top) { i = (bot + top) >> 1; - c = strcmp(name, _pcre_utt_names + _pcre_utt[i].name_offset); + c = STRCMP_UC_C8(name, PRIV(utt_names) + PRIV(utt)[i].name_offset); if (c == 0) { - *dptr = _pcre_utt[i].value; - return _pcre_utt[i].type; + *dptr = PRIV(utt)[i].value; + return PRIV(utt)[i].type; } if (c > 0) bot = i + 1; else top = i; } @@ -995,39 +1263,6 @@ /************************************************* -* Check for counted repeat * -*************************************************/ - -/* This function is called when a '{' is encountered in a place where it might -start a quantifier. It looks ahead to see if it really is a quantifier or not. -It is only a quantifier if it is one of the forms {ddd} {ddd,} or {ddd,ddd} -where the ddds are digits. - -Arguments: - p pointer to the first char after '{' - -Returns: TRUE or FALSE -*/ - -static BOOL -is_counted_repeat(const uschar *p) -{ -if ((digitab[*p++] & ctype_digit) == 0) return FALSE; -while ((digitab[*p] & ctype_digit) != 0) p++; -if (*p == CHAR_RIGHT_CURLY_BRACKET) return TRUE; - -if (*p++ != CHAR_COMMA) return FALSE; -if (*p == CHAR_RIGHT_CURLY_BRACKET) return TRUE; - -if ((digitab[*p++] & ctype_digit) == 0) return FALSE; -while ((digitab[*p] & ctype_digit) != 0) p++; - -return (*p == CHAR_RIGHT_CURLY_BRACKET); -} - - - -/************************************************* * Read repeat counts * *************************************************/ @@ -1046,8 +1281,8 @@ current ptr on error, with errorcodeptr set non-zero */ -static const uschar * -read_repeat_counts(const uschar *p, int *minp, int *maxp, int *errorcodeptr) +static const pcre_uchar * +read_repeat_counts(const pcre_uchar *p, int *minp, int *maxp, int *errorcodeptr) { int min = 0; int max = -1; @@ -1055,7 +1290,7 @@ /* Read the minimum value and do a paranoid check: a negative value indicates an integer overflow. */ -while ((digitab[*p] & ctype_digit) != 0) min = min * 10 + *p++ - CHAR_0; +while (IS_DIGIT(*p)) min = min * 10 + *p++ - CHAR_0; if (min < 0 || min > 65535) { *errorcodeptr = ERR5; @@ -1070,7 +1305,7 @@ if (*(++p) != CHAR_RIGHT_CURLY_BRACKET) { max = 0; - while((digitab[*p] & ctype_digit) != 0) max = max * 10 + *p++ - CHAR_0; + while(IS_DIGIT(*p)) max = max * 10 + *p++ - CHAR_0; if (max < 0 || max > 65535) { *errorcodeptr = ERR5; @@ -1125,17 +1360,17 @@ name name to seek, or NULL if seeking a numbered subpattern lorn name length, or subpattern number if name is NULL xmode TRUE if we are in /x mode - utf8 TRUE if we are in UTF-8 mode + utf TRUE if we are in UTF-8 / UTF-16 mode count pointer to the current capturing subpattern number (updated) Returns: the number of the named subpattern, or -1 if not found */ static int -find_parens_sub(uschar **ptrptr, compile_data *cd, const uschar *name, int lorn, - BOOL xmode, BOOL utf8, int *count) +find_parens_sub(pcre_uchar **ptrptr, compile_data *cd, const pcre_uchar *name, int lorn, + BOOL xmode, BOOL utf, int *count) { -uschar *ptr = *ptrptr; +pcre_uchar *ptr = *ptrptr; int start_count = *count; int hwm_count = start_count; BOOL dup_parens = FALSE; @@ -1202,7 +1437,7 @@ ptr[1] != CHAR_EQUALS_SIGN) || *ptr == CHAR_APOSTROPHE) { int term; - const uschar *thisname; + const pcre_uchar *thisname; *count += 1; if (name == NULL && *count == lorn) return *count; term = *ptr++; @@ -1210,7 +1445,7 @@ thisname = ptr; while (*ptr != term) ptr++; if (name != NULL && lorn == ptr - thisname && - strncmp((const char *)name, (const char *)thisname, lorn) == 0) + STRNCMP_UC_UC(name, thisname, lorn) == 0) return *count; term++; } @@ -1253,7 +1488,7 @@ { if (ptr[2] == CHAR_E) ptr+= 2; - else if (strncmp((const char *)ptr+2, + else if (STRNCMP_UC_C8(ptr + 2, STR_Q STR_BACKSLASH STR_E, 3) == 0) ptr += 4; else @@ -1301,8 +1536,8 @@ { if (IS_NEWLINE(ptr)) { ptr += cd->nllen - 1; break; } ptr++; -#ifdef SUPPORT_UTF8 - if (utf8) while ((*ptr & 0xc0) == 0x80) ptr++; +#ifdef SUPPORT_UTF + if (utf) FORWARDCHAR(ptr); #endif } if (*ptr == 0) goto FAIL_EXIT; @@ -1313,7 +1548,7 @@ if (*ptr == CHAR_LEFT_PARENTHESIS) { - int rc = find_parens_sub(&ptr, cd, name, lorn, xmode, utf8, count); + int rc = find_parens_sub(&ptr, cd, name, lorn, xmode, utf, count); if (rc > 0) return rc; if (*ptr == 0) goto FAIL_EXIT; } @@ -1359,16 +1594,16 @@ name name to seek, or NULL if seeking a numbered subpattern lorn name length, or subpattern number if name is NULL xmode TRUE if we are in /x mode - utf8 TRUE if we are in UTF-8 mode + utf TRUE if we are in UTF-8 / UTF-16 mode Returns: the number of the found subpattern, or -1 if not found */ static int -find_parens(compile_data *cd, const uschar *name, int lorn, BOOL xmode, - BOOL utf8) +find_parens(compile_data *cd, const pcre_uchar *name, int lorn, BOOL xmode, + BOOL utf) { -uschar *ptr = (uschar *)cd->start_pattern; +pcre_uchar *ptr = (pcre_uchar *)cd->start_pattern; int count = 0; int rc; @@ -1379,7 +1614,7 @@ for (;;) { - rc = find_parens_sub(&ptr, cd, name, lorn, xmode, utf8, &count); + rc = find_parens_sub(&ptr, cd, name, lorn, xmode, utf, &count); if (rc > 0 || *ptr++ == 0) break; } @@ -1395,40 +1630,30 @@ /* This is called by several functions that scan a compiled expression looking for a fixed first character, or an anchoring op code etc. It skips over things -that do not influence this. For some calls, a change of option is important. -For some calls, it makes sense to skip negative forward and all backward -assertions, and also the \b assertion; for others it does not. +that do not influence this. For some calls, it makes sense to skip negative +forward and all backward assertions, and also the \b assertion; for others it +does not. Arguments: code pointer to the start of the group - options pointer to external options - optbit the option bit whose changing is significant, or - zero if none are skipassert TRUE if certain assertions are to be skipped Returns: pointer to the first significant opcode */ -static const uschar* -first_significant_code(const uschar *code, int *options, int optbit, - BOOL skipassert) +static const pcre_uchar* +first_significant_code(const pcre_uchar *code, BOOL skipassert) { for (;;) { switch ((int)*code) { - case OP_OPT: - if (optbit > 0 && ((int)code[1] & optbit) != (*options & optbit)) - *options = (int)code[1]; - code += 2; - break; - case OP_ASSERT_NOT: case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: if (!skipassert) return code; do code += GET(code, 1); while (*code == OP_ALT); - code += _pcre_OP_lengths[*code]; + code += PRIV(OP_lengths)[*code]; break; case OP_WORD_BOUNDARY: @@ -1442,7 +1667,7 @@ case OP_RREF: case OP_NRREF: case OP_DEF: - code += _pcre_OP_lengths[*code]; + code += PRIV(OP_lengths)[*code]; break; default: @@ -1472,23 +1697,24 @@ Arguments: code points to the start of the pattern (the bracket) - options the compiling options + utf TRUE in UTF-8 / UTF-16 mode atend TRUE if called when the pattern is complete cd the "compile data" structure Returns: the fixed length, or -1 if there is no fixed length, - or -2 if \C was encountered + or -2 if \C was encountered (in UTF-8 mode only) or -3 if an OP_RECURSE item was encountered and atend is FALSE + or -4 if an unknown opcode was encountered (internal error) */ static int -find_fixedlength(uschar *code, int options, BOOL atend, compile_data *cd) +find_fixedlength(pcre_uchar *code, BOOL utf, BOOL atend, compile_data *cd) { int length = -1; register int branchlength = 0; -register uschar *cc = code + 1 + LINK_SIZE; +register pcre_uchar *cc = code + 1 + LINK_SIZE; /* Scan along the opcodes for this branch. If we get to the end of the branch, check the length against that of the other branches. */ @@ -1496,30 +1722,39 @@ for (;;) { int d; - uschar *ce, *cs; + pcre_uchar *ce, *cs; register int op = *cc; + switch (op) { + /* We only need to continue for OP_CBRA (normal capturing bracket) and + OP_BRA (normal non-capturing bracket) because the other variants of these + opcodes are all concerned with unlimited repeated groups, which of course + are not of fixed length. */ + case OP_CBRA: case OP_BRA: case OP_ONCE: + case OP_ONCE_NC: case OP_COND: - d = find_fixedlength(cc + ((op == OP_CBRA)? 2:0), options, atend, cd); + d = find_fixedlength(cc + ((op == OP_CBRA)? IMM2_SIZE : 0), utf, atend, cd); if (d < 0) return d; branchlength += d; do cc += GET(cc, 1); while (*cc == OP_ALT); cc += 1 + LINK_SIZE; break; - /* Reached end of a branch; if it's a ket it is the end of a nested - call. If it's ALT it is an alternation in a nested call. If it is - END it's the end of the outer call. All can be handled by the same code. */ + /* Reached end of a branch; if it's a ket it is the end of a nested call. + If it's ALT it is an alternation in a nested call. An ACCEPT is effectively + an ALT. If it is END it's the end of the outer call. All can be handled by + the same code. Note that we must not include the OP_KETRxxx opcodes here, + because they all imply an unlimited repeat. */ case OP_ALT: case OP_KET: - case OP_KETRMAX: - case OP_KETRMIN: case OP_END: + case OP_ACCEPT: + case OP_ASSERT_ACCEPT: if (length < 0) length = branchlength; else if (length != branchlength) return -1; if (*cc != OP_ALT) return length; @@ -1533,10 +1768,10 @@ case OP_RECURSE: if (!atend) return -3; - cs = ce = (uschar *)cd->start_code + GET(cc, 1); /* Start subpattern */ - do ce += GET(ce, 1); while (*ce == OP_ALT); /* End subpattern */ - if (cc > cs && cc < ce) return -1; /* Recursion */ - d = find_fixedlength(cs + 2, options, atend, cd); + cs = ce = (pcre_uchar *)cd->start_code + GET(cc, 1); /* Start subpattern */ + do ce += GET(ce, 1); while (*ce == OP_ALT); /* End subpattern */ + if (cc > cs && cc < ce) return -1; /* Recursion */ + d = find_fixedlength(cs + IMM2_SIZE, utf, atend, cd); if (d < 0) return d; branchlength += d; cc += 1 + LINK_SIZE; @@ -1549,40 +1784,55 @@ case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: do cc += GET(cc, 1); while (*cc == OP_ALT); - /* Fall through */ + cc += PRIV(OP_lengths)[*cc]; + break; /* Skip over things that don't match chars */ - case OP_REVERSE: + case OP_MARK: + case OP_PRUNE_ARG: + case OP_SKIP_ARG: + case OP_THEN_ARG: + cc += cc[1] + PRIV(OP_lengths)[*cc]; + break; + + case OP_CALLOUT: + case OP_CIRC: + case OP_CIRCM: + case OP_CLOSE: + case OP_COMMIT: case OP_CREF: - case OP_NCREF: - case OP_RREF: - case OP_NRREF: case OP_DEF: - case OP_OPT: - case OP_CALLOUT: - case OP_SOD: - case OP_SOM: - case OP_SET_SOM: + case OP_DOLL: + case OP_DOLLM: case OP_EOD: case OP_EODN: - case OP_CIRC: - case OP_DOLL: + case OP_FAIL: + case OP_NCREF: + case OP_NRREF: case OP_NOT_WORD_BOUNDARY: + case OP_PRUNE: + case OP_REVERSE: + case OP_RREF: + case OP_SET_SOM: + case OP_SKIP: + case OP_SOD: + case OP_SOM: + case OP_THEN: case OP_WORD_BOUNDARY: - cc += _pcre_OP_lengths[*cc]; + cc += PRIV(OP_lengths)[*cc]; break; /* Handle literal characters */ case OP_CHAR: - case OP_CHARNC: + case OP_CHARI: case OP_NOT: + case OP_NOTI: branchlength++; cc += 2; -#ifdef SUPPORT_UTF8 - if ((options & PCRE_UTF8) != 0 && cc[-1] >= 0xc0) - cc += _pcre_utf8_table4[cc[-1] & 0x3f]; +#ifdef SUPPORT_UTF + if (utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); #endif break; @@ -1590,18 +1840,20 @@ need to skip over a multibyte character in UTF8 mode. */ case OP_EXACT: + case OP_EXACTI: + case OP_NOTEXACT: + case OP_NOTEXACTI: branchlength += GET2(cc,1); - cc += 4; -#ifdef SUPPORT_UTF8 - if ((options & PCRE_UTF8) != 0 && cc[-1] >= 0xc0) - cc += _pcre_utf8_table4[cc[-1] & 0x3f]; + cc += 2 + IMM2_SIZE; +#ifdef SUPPORT_UTF + if (utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); #endif break; case OP_TYPEEXACT: branchlength += GET2(cc,1); - if (cc[3] == OP_PROP || cc[3] == OP_NOTPROP) cc += 2; - cc += 4; + if (cc[1 + IMM2_SIZE] == OP_PROP || cc[1 + IMM2_SIZE] == OP_NOTPROP) cc += 2; + cc += 1 + IMM2_SIZE + 1; break; /* Handle single-char matchers */ @@ -1611,6 +1863,10 @@ cc += 2; /* Fall through */ + case OP_HSPACE: + case OP_VSPACE: + case OP_NOT_HSPACE: + case OP_NOT_VSPACE: case OP_NOT_DIGIT: case OP_DIGIT: case OP_NOT_WHITESPACE: @@ -1623,25 +1879,28 @@ cc++; break; - /* The single-byte matcher isn't allowed */ + /* The single-byte matcher isn't allowed. This only happens in UTF-8 mode; + otherwise \C is coded as OP_ALLANY. */ case OP_ANYBYTE: return -2; /* Check a class for variable quantification */ -#ifdef SUPPORT_UTF8 +#if defined SUPPORT_UTF || defined COMPILE_PCRE16 case OP_XCLASS: - cc += GET(cc, 1) - 33; + cc += GET(cc, 1) - PRIV(OP_lengths)[OP_CLASS]; /* Fall through */ #endif case OP_CLASS: case OP_NCLASS: - cc += 33; + cc += PRIV(OP_lengths)[OP_CLASS]; switch (*cc) { + case OP_CRPLUS: + case OP_CRMINPLUS: case OP_CRSTAR: case OP_CRMINSTAR: case OP_CRQUERY: @@ -1650,9 +1909,9 @@ case OP_CRRANGE: case OP_CRMINRANGE: - if (GET2(cc,1) != GET2(cc,3)) return -1; + if (GET2(cc,1) != GET2(cc,1+IMM2_SIZE)) return -1; branchlength += GET2(cc,1); - cc += 5; + cc += 1 + 2 * IMM2_SIZE; break; default: @@ -1662,8 +1921,91 @@ /* Anything else is variable length */ - default: + case OP_ANYNL: + case OP_BRAMINZERO: + case OP_BRAPOS: + case OP_BRAPOSZERO: + case OP_BRAZERO: + case OP_CBRAPOS: + case OP_EXTUNI: + case OP_KETRMAX: + case OP_KETRMIN: + case OP_KETRPOS: + case OP_MINPLUS: + case OP_MINPLUSI: + case OP_MINQUERY: + case OP_MINQUERYI: + case OP_MINSTAR: + case OP_MINSTARI: + case OP_MINUPTO: + case OP_MINUPTOI: + case OP_NOTMINPLUS: + case OP_NOTMINPLUSI: + case OP_NOTMINQUERY: + case OP_NOTMINQUERYI: + case OP_NOTMINSTAR: + case OP_NOTMINSTARI: + case OP_NOTMINUPTO: + case OP_NOTMINUPTOI: + case OP_NOTPLUS: + case OP_NOTPLUSI: + case OP_NOTPOSPLUS: + case OP_NOTPOSPLUSI: + case OP_NOTPOSQUERY: + case OP_NOTPOSQUERYI: + case OP_NOTPOSSTAR: + case OP_NOTPOSSTARI: + case OP_NOTPOSUPTO: + case OP_NOTPOSUPTOI: + case OP_NOTQUERY: + case OP_NOTQUERYI: + case OP_NOTSTAR: + case OP_NOTSTARI: + case OP_NOTUPTO: + case OP_NOTUPTOI: + case OP_PLUS: + case OP_PLUSI: + case OP_POSPLUS: + case OP_POSPLUSI: + case OP_POSQUERY: + case OP_POSQUERYI: + case OP_POSSTAR: + case OP_POSSTARI: + case OP_POSUPTO: + case OP_POSUPTOI: + case OP_QUERY: + case OP_QUERYI: + case OP_REF: + case OP_REFI: + case OP_SBRA: + case OP_SBRAPOS: + case OP_SCBRA: + case OP_SCBRAPOS: + case OP_SCOND: + case OP_SKIPZERO: + case OP_STAR: + case OP_STARI: + case OP_TYPEMINPLUS: + case OP_TYPEMINQUERY: + case OP_TYPEMINSTAR: + case OP_TYPEMINUPTO: + case OP_TYPEPLUS: + case OP_TYPEPOSPLUS: + case OP_TYPEPOSQUERY: + case OP_TYPEPOSSTAR: + case OP_TYPEPOSUPTO: + case OP_TYPEQUERY: + case OP_TYPESTAR: + case OP_TYPEUPTO: + case OP_UPTO: + case OP_UPTOI: return -1; + + /* Catch unrecognized opcodes so that when new ones are added they + are not forgotten, as has happened in the past. */ + + default: + return -4; } } /* Control never gets here */ @@ -1684,18 +2026,19 @@ Arguments: code points to start of expression - utf8 TRUE in UTF-8 mode + utf TRUE in UTF-8 / UTF-16 mode number the required bracket number or negative to find a lookbehind Returns: pointer to the opcode for the bracket, or NULL if not found */ -const uschar * -_pcre_find_bracket(const uschar *code, BOOL utf8, int number) +const pcre_uchar * +PRIV(find_bracket)(const pcre_uchar *code, BOOL utf, int number) { for (;;) { register int c = *code; + if (c == OP_END) return NULL; /* XCLASS is used for classes that cannot be represented just by a bit @@ -1708,17 +2051,18 @@ else if (c == OP_REVERSE) { - if (number < 0) return (uschar *)code; - code += _pcre_OP_lengths[c]; + if (number < 0) return (pcre_uchar *)code; + code += PRIV(OP_lengths)[c]; } /* Handle capturing bracket */ - else if (c == OP_CBRA) + else if (c == OP_CBRA || c == OP_SCBRA || + c == OP_CBRAPOS || c == OP_SCBRAPOS) { int n = GET2(code, 1+LINK_SIZE); - if (n == number) return (uschar *)code; - code += _pcre_OP_lengths[c]; + if (n == number) return (pcre_uchar *)code; + code += PRIV(OP_lengths)[c]; } /* Otherwise, we can get the item's length from the table, except that for @@ -1746,7 +2090,8 @@ case OP_TYPEMINUPTO: case OP_TYPEEXACT: case OP_TYPEPOSUPTO: - if (code[3] == OP_PROP || code[3] == OP_NOTPROP) code += 2; + if (code[1 + IMM2_SIZE] == OP_PROP + || code[1 + IMM2_SIZE] == OP_NOTPROP) code += 2; break; case OP_MARK: @@ -1756,41 +2101,54 @@ break; case OP_THEN_ARG: - code += code[1+LINK_SIZE]; + code += code[1]; break; } /* Add in the fixed length from the table */ - code += _pcre_OP_lengths[c]; + code += PRIV(OP_lengths)[c]; /* In UTF-8 mode, opcodes that are followed by a character may be followed by a multi-byte character. The length in the table is a minimum, so we have to arrange to skip the extra bytes. */ -#ifdef SUPPORT_UTF8 - if (utf8) switch(c) +#ifdef SUPPORT_UTF + if (utf) switch(c) { case OP_CHAR: - case OP_CHARNC: + case OP_CHARI: case OP_EXACT: + case OP_EXACTI: case OP_UPTO: + case OP_UPTOI: case OP_MINUPTO: + case OP_MINUPTOI: case OP_POSUPTO: + case OP_POSUPTOI: case OP_STAR: + case OP_STARI: case OP_MINSTAR: + case OP_MINSTARI: case OP_POSSTAR: + case OP_POSSTARI: case OP_PLUS: + case OP_PLUSI: case OP_MINPLUS: + case OP_MINPLUSI: case OP_POSPLUS: + case OP_POSPLUSI: case OP_QUERY: + case OP_QUERYI: case OP_MINQUERY: + case OP_MINQUERYI: case OP_POSQUERY: - if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f]; + case OP_POSQUERYI: + if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]); break; } #else - (void)(utf8); /* Keep compiler happy by referencing function argument */ + (void)(utf); /* Keep compiler happy by referencing function argument */ #endif } } @@ -1807,13 +2165,13 @@ Arguments: code points to start of expression - utf8 TRUE in UTF-8 mode + utf TRUE in UTF-8 / UTF-16 mode Returns: pointer to the opcode for OP_RECURSE, or NULL if not found */ -static const uschar * -find_recurse(const uschar *code, BOOL utf8) +static const pcre_uchar * +find_recurse(const pcre_uchar *code, BOOL utf) { for (;;) { @@ -1852,7 +2210,8 @@ case OP_TYPEUPTO: case OP_TYPEMINUPTO: case OP_TYPEEXACT: - if (code[3] == OP_PROP || code[3] == OP_NOTPROP) code += 2; + if (code[1 + IMM2_SIZE] == OP_PROP + || code[1 + IMM2_SIZE] == OP_NOTPROP) code += 2; break; case OP_MARK: @@ -1862,41 +2221,82 @@ break; case OP_THEN_ARG: - code += code[1+LINK_SIZE]; + code += code[1]; break; } /* Add in the fixed length from the table */ - code += _pcre_OP_lengths[c]; + code += PRIV(OP_lengths)[c]; /* In UTF-8 mode, opcodes that are followed by a character may be followed by a multi-byte character. The length in the table is a minimum, so we have to arrange to skip the extra bytes. */ -#ifdef SUPPORT_UTF8 - if (utf8) switch(c) +#ifdef SUPPORT_UTF + if (utf) switch(c) { case OP_CHAR: - case OP_CHARNC: + case OP_CHARI: + case OP_NOT: + case OP_NOTI: case OP_EXACT: + case OP_EXACTI: + case OP_NOTEXACT: + case OP_NOTEXACTI: case OP_UPTO: + case OP_UPTOI: + case OP_NOTUPTO: + case OP_NOTUPTOI: case OP_MINUPTO: + case OP_MINUPTOI: + case OP_NOTMINUPTO: + case OP_NOTMINUPTOI: case OP_POSUPTO: + case OP_POSUPTOI: + case OP_NOTPOSUPTO: + case OP_NOTPOSUPTOI: case OP_STAR: + case OP_STARI: + case OP_NOTSTAR: + case OP_NOTSTARI: case OP_MINSTAR: + case OP_MINSTARI: + case OP_NOTMINSTAR: + case OP_NOTMINSTARI: case OP_POSSTAR: + case OP_POSSTARI: + case OP_NOTPOSSTAR: + case OP_NOTPOSSTARI: case OP_PLUS: + case OP_PLUSI: + case OP_NOTPLUS: + case OP_NOTPLUSI: case OP_MINPLUS: + case OP_MINPLUSI: + case OP_NOTMINPLUS: + case OP_NOTMINPLUSI: case OP_POSPLUS: + case OP_POSPLUSI: + case OP_NOTPOSPLUS: + case OP_NOTPOSPLUSI: case OP_QUERY: + case OP_QUERYI: + case OP_NOTQUERY: + case OP_NOTQUERYI: case OP_MINQUERY: + case OP_MINQUERYI: + case OP_NOTMINQUERY: + case OP_NOTMINQUERYI: case OP_POSQUERY: - if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f]; + case OP_POSQUERYI: + case OP_NOTPOSQUERY: + case OP_NOTPOSQUERYI: + if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]); break; } #else - (void)(utf8); /* Keep compiler happy by referencing function argument */ + (void)(utf); /* Keep compiler happy by referencing function argument */ #endif } } @@ -1919,22 +2319,22 @@ Arguments: code points to start of search endcode points to where to stop - utf8 TRUE if in UTF8 mode + utf TRUE if in UTF-8 / UTF-16 mode cd contains pointers to tables etc. Returns: TRUE if what is matched could be empty */ static BOOL -could_be_empty_branch(const uschar *code, const uschar *endcode, BOOL utf8, - compile_data *cd) +could_be_empty_branch(const pcre_uchar *code, const pcre_uchar *endcode, + BOOL utf, compile_data *cd) { register int c; -for (code = first_significant_code(code + _pcre_OP_lengths[*code], NULL, 0, TRUE); +for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE); code < endcode; - code = first_significant_code(code + _pcre_OP_lengths[c], NULL, 0, TRUE)) + code = first_significant_code(code + PRIV(OP_lengths)[c], TRUE)) { - const uschar *ccode; + const pcre_uchar *ccode; c = *code; @@ -1948,27 +2348,34 @@ continue; } - /* Groups with zero repeats can of course be empty; skip them. */ - - if (c == OP_BRAZERO || c == OP_BRAMINZERO || c == OP_SKIPZERO) - { - code += _pcre_OP_lengths[c]; - do code += GET(code, 1); while (*code == OP_ALT); - c = *code; - continue; - } - /* For a recursion/subroutine call, if its end has been reached, which - implies a subroutine call, we can scan it. */ + implies a backward reference subroutine call, we can scan it. If it's a + forward reference subroutine call, we can't. To detect forward reference + we have to scan up the list that is kept in the workspace. This function is + called only when doing the real compile, not during the pre-compile that + measures the size of the compiled pattern. */ if (c == OP_RECURSE) { - BOOL empty_branch = FALSE; - const uschar *scode = cd->start_code + GET(code, 1); + const pcre_uchar *scode; + BOOL empty_branch; + + /* Test for forward reference */ + + for (scode = cd->start_workspace; scode < cd->hwm; scode += LINK_SIZE) + if (GET(scode, 0) == code + 1 - cd->start_code) return TRUE; + + /* Not a forward reference, test for completed backward reference */ + + empty_branch = FALSE; + scode = cd->start_code + GET(code, 1); if (GET(scode, 1) == 0) return TRUE; /* Unclosed */ + + /* Completed backwards reference */ + do { - if (could_be_empty_branch(scode, endcode, utf8, cd)) + if (could_be_empty_branch(scode, endcode, utf, cd)) { empty_branch = TRUE; break; @@ -1976,13 +2383,39 @@ scode += GET(scode, 1); } while (*scode == OP_ALT); + if (!empty_branch) return FALSE; /* All branches are non-empty */ continue; } + /* Groups with zero repeats can of course be empty; skip them. */ + + if (c == OP_BRAZERO || c == OP_BRAMINZERO || c == OP_SKIPZERO || + c == OP_BRAPOSZERO) + { + code += PRIV(OP_lengths)[c]; + do code += GET(code, 1); while (*code == OP_ALT); + c = *code; + continue; + } + + /* A nested group that is already marked as "could be empty" can just be + skipped. */ + + if (c == OP_SBRA || c == OP_SBRAPOS || + c == OP_SCBRA || c == OP_SCBRAPOS) + { + do code += GET(code, 1); while (*code == OP_ALT); + c = *code; + continue; + } + /* For other groups, scan the branches. */ - if (c == OP_BRA || c == OP_CBRA || c == OP_ONCE || c == OP_COND) + if (c == OP_BRA || c == OP_BRAPOS || + c == OP_CBRA || c == OP_CBRAPOS || + c == OP_ONCE || c == OP_ONCE_NC || + c == OP_COND) { BOOL empty_branch; if (GET(code, 1) == 0) return TRUE; /* Hit unclosed bracket */ @@ -1998,7 +2431,7 @@ empty_branch = FALSE; do { - if (!empty_branch && could_be_empty_branch(code, endcode, utf8, cd)) + if (!empty_branch && could_be_empty_branch(code, endcode, utf, cd)) empty_branch = TRUE; code += GET(code, 1); } @@ -2016,11 +2449,11 @@ { /* Check for quantifiers after a class. XCLASS is used for classes that cannot be represented just by a bit map. This includes negated single - high-valued characters. The length in _pcre_OP_lengths[] is zero; the + high-valued characters. The length in PRIV(OP_lengths)[] is zero; the actual length is stored in the compiled code, so we must update "code" here. */ -#ifdef SUPPORT_UTF8 +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 case OP_XCLASS: ccode = code += GET(code, 1); goto CHECK_CLASS_REPEAT; @@ -2028,9 +2461,9 @@ case OP_CLASS: case OP_NCLASS: - ccode = code + 33; + ccode = code + PRIV(OP_lengths)[OP_CLASS]; -#ifdef SUPPORT_UTF8 +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 CHECK_CLASS_REPEAT: #endif @@ -2069,8 +2502,9 @@ case OP_ALLANY: case OP_ANYBYTE: case OP_CHAR: - case OP_CHARNC: + case OP_CHARI: case OP_NOT: + case OP_NOTI: case OP_PLUS: case OP_MINPLUS: case OP_POSPLUS: @@ -2102,7 +2536,8 @@ case OP_TYPEUPTO: case OP_TYPEMINUPTO: case OP_TYPEPOSUPTO: - if (code[3] == OP_PROP || code[3] == OP_NOTPROP) code += 2; + if (code[1 + IMM2_SIZE] == OP_PROP + || code[1 + IMM2_SIZE] == OP_NOTPROP) code += 2; break; /* End of branch */ @@ -2110,26 +2545,36 @@ case OP_KET: case OP_KETRMAX: case OP_KETRMIN: + case OP_KETRPOS: case OP_ALT: return TRUE; /* In UTF-8 mode, STAR, MINSTAR, POSSTAR, QUERY, MINQUERY, POSQUERY, UPTO, MINUPTO, and POSUPTO may be followed by a multibyte character */ -#ifdef SUPPORT_UTF8 +#ifdef SUPPORT_UTF case OP_STAR: + case OP_STARI: case OP_MINSTAR: + case OP_MINSTARI: case OP_POSSTAR: + case OP_POSSTARI: case OP_QUERY: + case OP_QUERYI: case OP_MINQUERY: + case OP_MINQUERYI: case OP_POSQUERY: - if (utf8 && code[1] >= 0xc0) code += _pcre_utf8_table4[code[1] & 0x3f]; + case OP_POSQUERYI: + if (utf && HAS_EXTRALEN(code[1])) code += GET_EXTRALEN(code[1]); break; case OP_UPTO: + case OP_UPTOI: case OP_MINUPTO: + case OP_MINUPTOI: case OP_POSUPTO: - if (utf8 && code[3] >= 0xc0) code += _pcre_utf8_table4[code[3] & 0x3f]; + case OP_POSUPTOI: + if (utf && HAS_EXTRALEN(code[1 + IMM2_SIZE])) code += GET_EXTRALEN(code[1 + IMM2_SIZE]); break; #endif @@ -2143,7 +2588,7 @@ break; case OP_THEN_ARG: - code += code[1+LINK_SIZE]; + code += code[1]; break; /* None of the remaining opcodes are required to match a character. */ @@ -2166,24 +2611,26 @@ the current branch of the current pattern to see if it could match the empty string. If it could, we must look outwards for branches at other levels, stopping when we pass beyond the bracket which is the subject of the recursion. +This function is called only during the real compile, not during the +pre-compile. Arguments: code points to start of the recursion endcode points to where to stop (current RECURSE item) bcptr points to the chain of current (unclosed) branch starts - utf8 TRUE if in UTF-8 mode + utf TRUE if in UTF-8 / UTF-16 mode cd pointers to tables etc Returns: TRUE if what is matched could be empty */ static BOOL -could_be_empty(const uschar *code, const uschar *endcode, branch_chain *bcptr, - BOOL utf8, compile_data *cd) +could_be_empty(const pcre_uchar *code, const pcre_uchar *endcode, + branch_chain *bcptr, BOOL utf, compile_data *cd) { while (bcptr != NULL && bcptr->current_branch >= code) { - if (!could_be_empty_branch(bcptr->current_branch, endcode, utf8, cd)) + if (!could_be_empty_branch(bcptr->current_branch, endcode, utf, cd)) return FALSE; bcptr = bcptr->outer; } @@ -2216,6 +2663,17 @@ "l\ower". This is a lesser evil that not diagnosing bad classes when Perl does, I think. +A user pointed out that PCRE was rejecting [:a[:digit:]] whereas Perl was not. +It seems that the appearance of a nested POSIX class supersedes an apparent +external class. For example, [:a[:digit:]b:] matches "a", "b", ":", or +a digit. + +In Perl, unescaped square brackets may also appear as part of class names. For +example, [:a[:abc]b:] gives unknown POSIX class "[:abc]b:]". However, for +[:a[:abc]b][b:] it gives unknown POSIX class "[:abc]b][b:]", which does not +seem right at all. PCRE does not allow closing square brackets in POSIX class +names. + Arguments: ptr pointer to the initial [ endptr where to return the end pointer @@ -2224,20 +2682,27 @@ */ static BOOL -check_posix_syntax(const uschar *ptr, const uschar **endptr) +check_posix_syntax(const pcre_uchar *ptr, const pcre_uchar **endptr) { int terminator; /* Don't combine these lines; the Solaris cc */ terminator = *(++ptr); /* compiler warns about "non-constant" initializer. */ for (++ptr; *ptr != 0; ptr++) { - if (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET) ptr++; else + if (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET) + ptr++; + else if (*ptr == CHAR_RIGHT_SQUARE_BRACKET) return FALSE; + else { - if (*ptr == CHAR_RIGHT_SQUARE_BRACKET) return FALSE; if (*ptr == terminator && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET) { *endptr = ptr; return TRUE; } + if (*ptr == CHAR_LEFT_SQUARE_BRACKET && + (ptr[1] == CHAR_COLON || ptr[1] == CHAR_DOT || + ptr[1] == CHAR_EQUALS_SIGN) && + check_posix_syntax(ptr, endptr)) + return FALSE; } } return FALSE; @@ -2261,14 +2726,14 @@ */ static int -check_posix_name(const uschar *ptr, int len) +check_posix_name(const pcre_uchar *ptr, int len) { const char *pn = posix_names; register int yield = 0; while (posix_name_lengths[yield] != 0) { if (len == posix_name_lengths[yield] && - strncmp((const char *)ptr, pn, len) == 0) return yield; + STRNCMP_UC_C8(ptr, pn, len) == 0) return yield; pn += posix_name_lengths[yield] + 1; yield++; } @@ -2300,7 +2765,7 @@ Arguments: group points to the start of the group adjust the amount by which the group is to be moved - utf8 TRUE in UTF-8 mode + utf TRUE in UTF-8 / UTF-16 mode cd contains pointers to tables etc. save_hwm the hwm forward reference pointer at the start of the group @@ -2308,15 +2773,15 @@ */ static void -adjust_recurse(uschar *group, int adjust, BOOL utf8, compile_data *cd, - uschar *save_hwm) +adjust_recurse(pcre_uchar *group, int adjust, BOOL utf, compile_data *cd, + pcre_uchar *save_hwm) { -uschar *ptr = group; +pcre_uchar *ptr = group; -while ((ptr = (uschar *)find_recurse(ptr, utf8)) != NULL) +while ((ptr = (pcre_uchar *)find_recurse(ptr, utf)) != NULL) { int offset; - uschar *hc; + pcre_uchar *hc; /* See if this recursion is on the forward reference list. If so, adjust the reference. */ @@ -2361,14 +2826,14 @@ Returns: new code pointer */ -static uschar * -auto_callout(uschar *code, const uschar *ptr, compile_data *cd) +static pcre_uchar * +auto_callout(pcre_uchar *code, const pcre_uchar *ptr, compile_data *cd) { *code++ = OP_CALLOUT; *code++ = 255; PUT(code, 0, (int)(ptr - cd->start_pattern)); /* Pattern offset */ PUT(code, LINK_SIZE, 0); /* Default length */ -return code + 2*LINK_SIZE; +return code + 2 * LINK_SIZE; } @@ -2390,7 +2855,7 @@ */ static void -complete_callout(uschar *previous_callout, const uschar *ptr, compile_data *cd) +complete_callout(pcre_uchar *previous_callout, const pcre_uchar *ptr, compile_data *cd) { int length = (int)(ptr - cd->start_pattern - GET(previous_callout, 2)); PUT(previous_callout, 2 + LINK_SIZE, length); @@ -2473,7 +2938,7 @@ prop->chartype == ucp_Lt) == negated; case PT_GC: - return (pdata == _pcre_ucp_gentype[prop->chartype]) == negated; + return (pdata == PRIV(ucp_gentype)[prop->chartype]) == negated; case PT_PC: return (pdata == prop->chartype) == negated; @@ -2484,23 +2949,23 @@ /* These are specials */ case PT_ALNUM: - return (_pcre_ucp_gentype[prop->chartype] == ucp_L || - _pcre_ucp_gentype[prop->chartype] == ucp_N) == negated; + return (PRIV(ucp_gentype)[prop->chartype] == ucp_L || + PRIV(ucp_gentype)[prop->chartype] == ucp_N) == negated; case PT_SPACE: /* Perl space */ - return (_pcre_ucp_gentype[prop->chartype] == ucp_Z || + return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR) == negated; case PT_PXSPACE: /* POSIX space */ - return (_pcre_ucp_gentype[prop->chartype] == ucp_Z || + return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || c == CHAR_FF || c == CHAR_CR) == negated; case PT_WORD: - return (_pcre_ucp_gentype[prop->chartype] == ucp_L || - _pcre_ucp_gentype[prop->chartype] == ucp_N || + return (PRIV(ucp_gentype)[prop->chartype] == ucp_L || + PRIV(ucp_gentype)[prop->chartype] == ucp_N || c == CHAR_UNDERSCORE) == negated; } return FALSE; @@ -2519,7 +2984,7 @@ Arguments: previous pointer to the repeated opcode - utf8 TRUE in UTF-8 mode + utf TRUE in UTF-8 / UTF-16 mode ptr next character in pattern options options bits cd contains pointers to tables etc. @@ -2528,10 +2993,10 @@ */ static BOOL -check_auto_possessive(const uschar *previous, BOOL utf8, const uschar *ptr, - int options, compile_data *cd) +check_auto_possessive(const pcre_uchar *previous, BOOL utf, + const pcre_uchar *ptr, int options, compile_data *cd) { -int c, next; +pcre_int32 c, next; int op_code = *previous++; /* Skip whitespace and comments in extended mode */ @@ -2540,7 +3005,7 @@ { for (;;) { - while ((cd->ctypes[*ptr] & ctype_space) != 0) ptr++; + while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_space) != 0) ptr++; if (*ptr == CHAR_NUMBER_SIGN) { ptr++; @@ -2548,8 +3013,8 @@ { if (IS_NEWLINE(ptr)) { ptr += cd->nllen; break; } ptr++; -#ifdef SUPPORT_UTF8 - if (utf8) while ((*ptr & 0xc0) == 0x80) ptr++; +#ifdef SUPPORT_UTF + if (utf) FORWARDCHAR(ptr); #endif } } @@ -2567,15 +3032,13 @@ if (temperrorcode != 0) return FALSE; ptr++; /* Point after the escape sequence */ } - -else if ((cd->ctypes[*ptr] & ctype_meta) == 0) +else if (!MAX_255(*ptr) || (cd->ctypes[*ptr] & ctype_meta) == 0) { -#ifdef SUPPORT_UTF8 - if (utf8) { GETCHARINC(next, ptr); } else +#ifdef SUPPORT_UTF + if (utf) { GETCHARINC(next, ptr); } else #endif next = *ptr++; } - else return FALSE; /* Skip whitespace and comments in extended mode */ @@ -2584,7 +3047,7 @@ { for (;;) { - while ((cd->ctypes[*ptr] & ctype_space) != 0) ptr++; + while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_space) != 0) ptr++; if (*ptr == CHAR_NUMBER_SIGN) { ptr++; @@ -2592,8 +3055,8 @@ { if (IS_NEWLINE(ptr)) { ptr += cd->nllen; break; } ptr++; -#ifdef SUPPORT_UTF8 - if (utf8) while ((*ptr & 0xc0) == 0x80) ptr++; +#ifdef SUPPORT_UTF + if (utf) FORWARDCHAR(ptr); #endif } } @@ -2604,7 +3067,7 @@ /* If the next thing is itself optional, we have to give up. */ if (*ptr == CHAR_ASTERISK || *ptr == CHAR_QUESTION_MARK || - strncmp((char *)ptr, STR_LEFT_CURLY_BRACKET STR_0 STR_COMMA, 3) == 0) + STRNCMP_UC_C8(ptr, STR_LEFT_CURLY_BRACKET STR_0 STR_COMMA, 3) == 0) return FALSE; /* Now compare the next item with the previous opcode. First, handle cases when @@ -2613,26 +3076,26 @@ if (next >= 0) switch(op_code) { case OP_CHAR: -#ifdef SUPPORT_UTF8 +#ifdef SUPPORT_UTF GETCHARTEST(c, previous); #else c = *previous; #endif return c != next; - /* For CHARNC (caseless character) we must check the other case. If we have + /* For CHARI (caseless character) we must check the other case. If we have Unicode property support, we can use it to test the other case of high-valued characters. */ - case OP_CHARNC: -#ifdef SUPPORT_UTF8 + case OP_CHARI: +#ifdef SUPPORT_UTF GETCHARTEST(c, previous); #else c = *previous; #endif if (c == next) return FALSE; -#ifdef SUPPORT_UTF8 - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { unsigned int othercase; if (next < 128) othercase = cd->fcc[next]; else @@ -2644,50 +3107,60 @@ return (unsigned int)c != othercase; } else -#endif /* SUPPORT_UTF8 */ - return (c != cd->fcc[next]); /* Non-UTF-8 mode */ - - /* For OP_NOT, its data is always a single-byte character. */ +#endif /* SUPPORT_UTF */ + return (c != TABLE_GET((unsigned int)next, cd->fcc, next)); /* Non-UTF-8 mode */ case OP_NOT: - if ((c = *previous) == next) return TRUE; - if ((options & PCRE_CASELESS) == 0) return FALSE; -#ifdef SUPPORT_UTF8 - if (utf8) +#ifdef SUPPORT_UTF + GETCHARTEST(c, previous); +#else + c = *previous; +#endif + return c == next; + + case OP_NOTI: +#ifdef SUPPORT_UTF + GETCHARTEST(c, previous); +#else + c = *previous; +#endif + if (c == next) return TRUE; +#ifdef SUPPORT_UTF + if (utf) { unsigned int othercase; if (next < 128) othercase = cd->fcc[next]; else #ifdef SUPPORT_UCP - othercase = UCD_OTHERCASE(next); + othercase = UCD_OTHERCASE((unsigned int)next); #else othercase = NOTACHAR; #endif return (unsigned int)c == othercase; } else -#endif /* SUPPORT_UTF8 */ - return (c == cd->fcc[next]); /* Non-UTF-8 mode */ +#endif /* SUPPORT_UTF */ + return (c == TABLE_GET((unsigned int)next, cd->fcc, next)); /* Non-UTF-8 mode */ /* Note that OP_DIGIT etc. are generated only when PCRE_UCP is *not* set. When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */ case OP_DIGIT: - return next > 127 || (cd->ctypes[next] & ctype_digit) == 0; + return next > 255 || (cd->ctypes[next] & ctype_digit) == 0; case OP_NOT_DIGIT: - return next <= 127 && (cd->ctypes[next] & ctype_digit) != 0; + return next <= 255 && (cd->ctypes[next] & ctype_digit) != 0; case OP_WHITESPACE: - return next > 127 || (cd->ctypes[next] & ctype_space) == 0; + return next > 255 || (cd->ctypes[next] & ctype_space) == 0; case OP_NOT_WHITESPACE: - return next <= 127 && (cd->ctypes[next] & ctype_space) != 0; + return next <= 255 && (cd->ctypes[next] & ctype_space) != 0; case OP_WORDCHAR: - return next > 127 || (cd->ctypes[next] & ctype_word) == 0; + return next > 255 || (cd->ctypes[next] & ctype_word) == 0; case OP_NOT_WORDCHAR: - return next <= 127 && (cd->ctypes[next] & ctype_word) != 0; + return next <= 255 && (cd->ctypes[next] & ctype_word) != 0; case OP_HSPACE: case OP_NOT_HSPACE: @@ -2756,8 +3229,8 @@ switch(op_code) { case OP_CHAR: - case OP_CHARNC: -#ifdef SUPPORT_UTF8 + case OP_CHARI: +#ifdef SUPPORT_UTF GETCHARTEST(c, previous); #else c = *previous; @@ -2765,22 +3238,22 @@ switch(-next) { case ESC_d: - return c > 127 || (cd->ctypes[c] & ctype_digit) == 0; + return c > 255 || (cd->ctypes[c] & ctype_digit) == 0; case ESC_D: - return c <= 127 && (cd->ctypes[c] & ctype_digit) != 0; + return c <= 255 && (cd->ctypes[c] & ctype_digit) != 0; case ESC_s: - return c > 127 || (cd->ctypes[c] & ctype_space) == 0; + return c > 255 || (cd->ctypes[c] & ctype_space) == 0; case ESC_S: - return c <= 127 && (cd->ctypes[c] & ctype_space) != 0; + return c <= 255 && (cd->ctypes[c] & ctype_space) != 0; case ESC_w: - return c > 127 || (cd->ctypes[c] & ctype_word) == 0; + return c > 255 || (cd->ctypes[c] & ctype_word) == 0; case ESC_W: - return c <= 127 && (cd->ctypes[c] & ctype_word) != 0; + return c <= 255 && (cd->ctypes[c] & ctype_word) != 0; case ESC_h: case ESC_H: @@ -2862,7 +3335,7 @@ to the original \d etc. At this point, ptr will point to a zero byte. */ if (*ptr == CHAR_ASTERISK || *ptr == CHAR_QUESTION_MARK || - strncmp((char *)ptr, STR_LEFT_CURLY_BRACKET STR_0 STR_COMMA, 3) == 0) + STRNCMP_UC_C8(ptr, STR_LEFT_CURLY_BRACKET STR_0 STR_COMMA, 3) == 0) return FALSE; /* Do the property check. */ @@ -2889,10 +3362,10 @@ return next == -ESC_d; case OP_WHITESPACE: - return next == -ESC_S || next == -ESC_d || next == -ESC_w || next == -ESC_R; + return next == -ESC_S || next == -ESC_d || next == -ESC_w; case OP_NOT_WHITESPACE: - return next == -ESC_s || next == -ESC_h || next == -ESC_v; + return next == -ESC_s || next == -ESC_h || next == -ESC_v || next == -ESC_R; case OP_HSPACE: return next == -ESC_S || next == -ESC_H || next == -ESC_d || @@ -2940,9 +3413,10 @@ codeptr points to the pointer to the current code point ptrptr points to the current pattern pointer errorcodeptr points to error code variable - firstbyteptr set to initial literal character, or < 0 (REQ_UNSET, REQ_NONE) - reqbyteptr set to the last literal character required, else < 0 + firstcharptr set to initial literal character, or < 0 (REQ_UNSET, REQ_NONE) + reqcharptr set to the last literal character required, else < 0 bcptr points to current branch chain + cond_depth conditional nesting depth cd contains pointers to tables etc. lengthptr NULL during the real compile phase points to length accumulator during pre-compile phase @@ -2952,44 +3426,54 @@ */ static BOOL -compile_branch(int *optionsptr, uschar **codeptr, const uschar **ptrptr, - int *errorcodeptr, int *firstbyteptr, int *reqbyteptr, branch_chain *bcptr, +compile_branch(int *optionsptr, pcre_uchar **codeptr, + const pcre_uchar **ptrptr, int *errorcodeptr, pcre_int32 *firstcharptr, + pcre_int32 *reqcharptr, branch_chain *bcptr, int cond_depth, compile_data *cd, int *lengthptr) { int repeat_type, op_type; int repeat_min = 0, repeat_max = 0; /* To please picky compilers */ int bravalue = 0; int greedy_default, greedy_non_default; -int firstbyte, reqbyte; -int zeroreqbyte, zerofirstbyte; -int req_caseopt, reqvary, tempreqvary; -int options = *optionsptr; +pcre_int32 firstchar, reqchar; +pcre_int32 zeroreqchar, zerofirstchar; +pcre_int32 req_caseopt, reqvary, tempreqvary; +int options = *optionsptr; /* May change dynamically */ int after_manual_callout = 0; int length_prevgroup = 0; register int c; -register uschar *code = *codeptr; -uschar *last_code = code; -uschar *orig_code = code; -uschar *tempcode; +register pcre_uchar *code = *codeptr; +pcre_uchar *last_code = code; +pcre_uchar *orig_code = code; +pcre_uchar *tempcode; BOOL inescq = FALSE; -BOOL groupsetfirstbyte = FALSE; -const uschar *ptr = *ptrptr; -const uschar *tempptr; -const uschar *nestptr = NULL; -uschar *previous = NULL; -uschar *previous_callout = NULL; -uschar *save_hwm = NULL; -uschar classbits[32]; - -#ifdef SUPPORT_UTF8 -BOOL class_utf8; -BOOL utf8 = (options & PCRE_UTF8) != 0; -uschar *class_utf8data; -uschar *class_utf8data_base; -uschar utf8_char[6]; +BOOL groupsetfirstchar = FALSE; +const pcre_uchar *ptr = *ptrptr; +const pcre_uchar *tempptr; +const pcre_uchar *nestptr = NULL; +pcre_uchar *previous = NULL; +pcre_uchar *previous_callout = NULL; +pcre_uchar *save_hwm = NULL; +pcre_uint8 classbits[32]; + +/* We can fish out the UTF-8 setting once and for all into a BOOL, but we +must not do this for other options (e.g. PCRE_EXTENDED) because they may change +dynamically as we process the pattern. */ + +#ifdef SUPPORT_UTF +/* PCRE_UTF16 has the same value as PCRE_UTF8. */ +BOOL utf = (options & PCRE_UTF8) != 0; +pcre_uchar utf_chars[6]; #else -BOOL utf8 = FALSE; -uschar *utf8_char = NULL; +BOOL utf = FALSE; +#endif + +/* Helper variables for OP_XCLASS opcode (for characters > 255). */ + +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 +BOOL xclass; +pcre_uchar *class_uchardata; +pcre_uchar *class_uchardata_base; #endif #ifdef PCRE_DEBUG @@ -3003,22 +3487,23 @@ /* Initialize no first byte, no required byte. REQ_UNSET means "no char matching encountered yet". It gets changed to REQ_NONE if we hit something that -matches a non-fixed char first char; reqbyte just remains unset if we never +matches a non-fixed char first char; reqchar just remains unset if we never find one. When we hit a repeat whose minimum is zero, we may have to adjust these values to take the zero repeat into account. This is implemented by setting them to -zerofirstbyte and zeroreqbyte when such a repeat is encountered. The individual +zerofirstbyte and zeroreqchar when such a repeat is encountered. The individual item types that can be repeated set these backoff variables appropriately. */ -firstbyte = reqbyte = zerofirstbyte = zeroreqbyte = REQ_UNSET; +firstchar = reqchar = zerofirstchar = zeroreqchar = REQ_UNSET; -/* The variable req_caseopt contains either the REQ_CASELESS value or zero, -according to the current setting of the caseless flag. REQ_CASELESS is a bit -value > 255. It is added into the firstbyte or reqbyte variables to record the -case status of the value. This is used only for ASCII characters. */ +/* The variable req_caseopt contains either the REQ_CASELESS value +or zero, according to the current setting of the caseless flag. The +REQ_CASELESS leaves the lower 28 bit empty. It is added into the +firstchar or reqchar variables to record the case status of the +value. This is used only for ASCII characters. */ -req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0; +req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS:0; /* Switch on next character until the end of the branch */ @@ -3030,19 +3515,20 @@ BOOL is_quantifier; BOOL is_recurse; BOOL reset_bracount; - int class_charcount; - int class_lastchar; + int class_has_8bitchar; + int class_single_char; int newoptions; int recno; int refsign; int skipbytes; - int subreqbyte; - int subfirstbyte; + int subreqchar; + int subfirstchar; int terminator; int mclength; - uschar mcbuffer[8]; + int tempbracount; + pcre_uchar mcbuffer[8]; - /* Get next byte in the pattern */ + /* Get next character in the pattern */ c = *ptr; @@ -3064,7 +3550,8 @@ #ifdef PCRE_DEBUG if (code > cd->hwm) cd->hwm = code; /* High water info */ #endif - if (code > cd->start_workspace + WORK_SIZE_CHECK) /* Check for overrun */ + if (code > cd->start_workspace + cd->workspace_size - + WORK_SIZE_SAFETY_MARGIN) /* Check for overrun */ { *errorcodeptr = ERR52; goto FAILED; @@ -3087,7 +3574,8 @@ } *lengthptr += (int)(code - last_code); - DPRINTF(("length=%d added %d c=%c\n", *lengthptr, code - last_code, c)); + DPRINTF(("length=%d added %d c=%c (0x%x)\n", *lengthptr, + (int)(code - last_code), c, c)); /* If "previous" is set and it is not at the start of the work space, move it back to there, in order to avoid filling up the work space. Otherwise, @@ -3097,7 +3585,7 @@ { if (previous > orig_code) { - memmove(orig_code, previous, code - previous); + memmove(orig_code, previous, IN_UCHARS(code - previous)); code -= previous - orig_code; previous = orig_code; } @@ -3113,7 +3601,8 @@ /* In the real compile phase, just check the workspace used by the forward reference list. */ - else if (cd->hwm > cd->start_workspace + WORK_SIZE_CHECK) + else if (cd->hwm > cd->start_workspace + cd->workspace_size - + WORK_SIZE_SAFETY_MARGIN) { *errorcodeptr = ERR52; goto FAILED; @@ -3161,11 +3650,11 @@ previous_callout = NULL; } - /* In extended mode, skip white space and comments */ + /* In extended mode, skip white space and comments. */ if ((options & PCRE_EXTENDED) != 0) { - if ((cd->ctypes[c] & ctype_space) != 0) continue; + if (MAX_255(*ptr) && (cd->ctypes[c] & ctype_space) != 0) continue; if (c == CHAR_NUMBER_SIGN) { ptr++; @@ -3173,8 +3662,8 @@ { if (IS_NEWLINE(ptr)) { ptr += cd->nllen - 1; break; } ptr++; -#ifdef SUPPORT_UTF8 - if (utf8) while ((*ptr & 0xc0) == 0x80) ptr++; +#ifdef SUPPORT_UTF + if (utf) FORWARDCHAR(ptr); #endif } if (*ptr != 0) continue; @@ -3198,8 +3687,8 @@ case 0: /* The branch terminates at string end */ case CHAR_VERTICAL_LINE: /* or | or ) */ case CHAR_RIGHT_PARENTHESIS: - *firstbyteptr = firstbyte; - *reqbyteptr = reqbyte; + *firstcharptr = firstchar; + *reqcharptr = reqchar; *codeptr = code; *ptrptr = ptr; if (lengthptr != NULL) @@ -3220,26 +3709,27 @@ the setting of any following char as a first character. */ case CHAR_CIRCUMFLEX_ACCENT: + previous = NULL; if ((options & PCRE_MULTILINE) != 0) { - if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; + if (firstchar == REQ_UNSET) firstchar = REQ_NONE; + *code++ = OP_CIRCM; } - previous = NULL; - *code++ = OP_CIRC; + else *code++ = OP_CIRC; break; case CHAR_DOLLAR_SIGN: previous = NULL; - *code++ = OP_DOLL; + *code++ = ((options & PCRE_MULTILINE) != 0)? OP_DOLLM : OP_DOLL; break; /* There can never be a first char if '.' is first, whatever happens about - repeats. The value of reqbyte doesn't change either. */ + repeats. The value of reqchar doesn't change either. */ case CHAR_DOT: - if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; - zerofirstbyte = firstbyte; - zeroreqbyte = reqbyte; + if (firstchar == REQ_UNSET) firstchar = REQ_NONE; + zerofirstchar = firstchar; + zeroreqchar = reqchar; previous = code; *code++ = ((options & PCRE_DOTALL) != 0)? OP_ALLANY: OP_ANY; break; @@ -3294,8 +3784,7 @@ { if (ptr[1] == CHAR_E) ptr++; - else if (strncmp((const char *)ptr+1, - STR_Q STR_BACKSLASH STR_E, 3) == 0) + else if (STRNCMP_UC_C8(ptr + 1, STR_Q STR_BACKSLASH STR_E, 3) == 0) ptr += 3; else break; @@ -3314,8 +3803,8 @@ (cd->external_options & PCRE_JAVASCRIPT_COMPAT) != 0) { *code++ = negate_class? OP_ALLANY : OP_FAIL; - if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; - zerofirstbyte = firstbyte; + if (firstchar == REQ_UNSET) firstchar = REQ_NONE; + zerofirstchar = firstchar; break; } @@ -3325,24 +3814,25 @@ should_flip_negation = FALSE; - /* Keep a count of chars with values < 256 so that we can optimize the case - of just a single character (as long as it's < 256). However, For higher - valued UTF-8 characters, we don't yet do any optimization. */ + /* For optimization purposes, we track some properties of the class. + class_has_8bitchar will be non-zero, if the class contains at least one + < 256 character. class_single_char will be 1 if the class contains only + a single character. */ - class_charcount = 0; - class_lastchar = -1; + class_has_8bitchar = 0; + class_single_char = 0; /* Initialize the 32-char bit map to all zeros. We build the map in a temporary bit of memory, in case the class contains only 1 character (less than 256), because in that case the compiled code doesn't use the bit map. */ - memset(classbits, 0, 32 * sizeof(uschar)); + memset(classbits, 0, 32 * sizeof(pcre_uint8)); -#ifdef SUPPORT_UTF8 - class_utf8 = FALSE; /* No chars >= 256 */ - class_utf8data = code + LINK_SIZE + 2; /* For UTF-8 items */ - class_utf8data_base = class_utf8data; /* For resetting in pass 1 */ +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 + xclass = FALSE; /* No chars >= 256 */ + class_uchardata = code + LINK_SIZE + 2; /* For UTF-8 items */ + class_uchardata_base = class_uchardata; /* For resetting in pass 1 */ #endif /* Process characters until ] is reached. By writing this as a "do" it @@ -3351,25 +3841,26 @@ if (c != 0) do { - const uschar *oldptr; + const pcre_uchar *oldptr; -#ifdef SUPPORT_UTF8 - if (utf8 && c > 127) +#ifdef SUPPORT_UTF + if (utf && HAS_EXTRALEN(c)) { /* Braces are required because the */ GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */ } +#endif - /* In the pre-compile phase, accumulate the length of any UTF-8 extra +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 + /* In the pre-compile phase, accumulate the length of any extra data and reset the pointer. This is so that very large classes that - contain a zillion UTF-8 characters no longer overwrite the work space + contain a zillion > 255 characters no longer overwrite the work space (which is on the stack). */ if (lengthptr != NULL) { - *lengthptr += class_utf8data - class_utf8data_base; - class_utf8data = class_utf8data_base; + *lengthptr += class_uchardata - class_uchardata_base; + class_uchardata = class_uchardata_base; } - #endif /* Inside \Q...\E everything is literal except \E */ @@ -3397,8 +3888,8 @@ { BOOL local_negate = FALSE; int posix_class, taboffset, tabopt; - register const uschar *cbits = cd->cbits; - uschar pbits[32]; + register const pcre_uint8 *cbits = cd->cbits; + pcre_uint8 pbits[32]; if (ptr[1] != CHAR_COLON) { @@ -3453,7 +3944,7 @@ /* Copy in the first table (always present) */ memcpy(pbits, cbits + posix_class_maps[posix_class], - 32 * sizeof(uschar)); + 32 * sizeof(pcre_uint8)); /* If there is a second table, add or remove it as required. */ @@ -3484,16 +3975,20 @@ for (c = 0; c < 32; c++) classbits[c] |= pbits[c]; ptr = tempptr + 1; - class_charcount = 10; /* Set > 1; assumes more than 1 per class */ + /* Every class contains at least one < 256 characters. */ + class_has_8bitchar = 1; + /* Every class contains at least two characters. */ + class_single_char = 2; continue; /* End of POSIX syntax handling */ } /* Backslash may introduce a single character, or it may introduce one of the specials, which just set a flag. The sequence \b is a special case. Inside a class (and only there) it is treated as backspace. We - assume that other escapes have more than one character in them, so set - class_charcount bigger than one. Unrecognized escapes fall through and - are either treated as literal characters (by default), or are faulted if + assume that other escapes have more than one character in them, so + speculatively set both class_has_8bitchar and class_single_char bigger + than one. Unrecognized escapes fall through and are either treated + as literal characters (by default), or are faulted if PCRE_EXTRA is set. */ if (c == CHAR_BACKSLASH) @@ -3502,6 +3997,11 @@ if (*errorcodeptr != 0) goto FAILED; if (-c == ESC_b) c = CHAR_BS; /* \b is backspace in a class */ + else if (-c == ESC_N) /* \N is not supported in a class */ + { + *errorcodeptr = ERR71; + goto FAILED; + } else if (-c == ESC_Q) /* Handle start of quoted string */ { if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E) @@ -3515,8 +4015,11 @@ if (c < 0) { - register const uschar *cbits = cd->cbits; - class_charcount += 2; /* Greater than 1 is what matters */ + register const pcre_uint8 *cbits = cd->cbits; + /* Every class contains at least two < 256 characters. */ + class_has_8bitchar++; + /* Every class contains at least two characters. */ + class_single_char += 2; switch (-c) { @@ -3529,7 +4032,7 @@ case ESC_SU: nestptr = ptr; ptr = substitutes[-c - ESC_DU] - 1; /* Just before substitute */ - class_charcount -= 2; /* Undo! */ + class_has_8bitchar--; /* Undo! */ continue; #endif case ESC_d: @@ -3570,23 +4073,38 @@ SETBIT(classbits, 0x09); /* VT */ SETBIT(classbits, 0x20); /* SPACE */ SETBIT(classbits, 0xa0); /* NSBP */ -#ifdef SUPPORT_UTF8 - if (utf8) +#ifndef COMPILE_PCRE8 + xclass = TRUE; + *class_uchardata++ = XCL_SINGLE; + *class_uchardata++ = 0x1680; + *class_uchardata++ = XCL_SINGLE; + *class_uchardata++ = 0x180e; + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = 0x2000; + *class_uchardata++ = 0x200a; + *class_uchardata++ = XCL_SINGLE; + *class_uchardata++ = 0x202f; + *class_uchardata++ = XCL_SINGLE; + *class_uchardata++ = 0x205f; + *class_uchardata++ = XCL_SINGLE; + *class_uchardata++ = 0x3000; +#elif defined SUPPORT_UTF + if (utf) { - class_utf8 = TRUE; - *class_utf8data++ = XCL_SINGLE; - class_utf8data += _pcre_ord2utf8(0x1680, class_utf8data); - *class_utf8data++ = XCL_SINGLE; - class_utf8data += _pcre_ord2utf8(0x180e, class_utf8data); - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(0x2000, class_utf8data); - class_utf8data += _pcre_ord2utf8(0x200A, class_utf8data); - *class_utf8data++ = XCL_SINGLE; - class_utf8data += _pcre_ord2utf8(0x202f, class_utf8data); - *class_utf8data++ = XCL_SINGLE; - class_utf8data += _pcre_ord2utf8(0x205f, class_utf8data); - *class_utf8data++ = XCL_SINGLE; - class_utf8data += _pcre_ord2utf8(0x3000, class_utf8data); + xclass = TRUE; + *class_uchardata++ = XCL_SINGLE; + class_uchardata += PRIV(ord2utf)(0x1680, class_uchardata); + *class_uchardata++ = XCL_SINGLE; + class_uchardata += PRIV(ord2utf)(0x180e, class_uchardata); + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(0x2000, class_uchardata); + class_uchardata += PRIV(ord2utf)(0x200a, class_uchardata); + *class_uchardata++ = XCL_SINGLE; + class_uchardata += PRIV(ord2utf)(0x202f, class_uchardata); + *class_uchardata++ = XCL_SINGLE; + class_uchardata += PRIV(ord2utf)(0x205f, class_uchardata); + *class_uchardata++ = XCL_SINGLE; + class_uchardata += PRIV(ord2utf)(0x3000, class_uchardata); } #endif continue; @@ -3604,32 +4122,59 @@ } classbits[c] |= x; } - -#ifdef SUPPORT_UTF8 - if (utf8) +#ifndef COMPILE_PCRE8 + xclass = TRUE; + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = 0x0100; + *class_uchardata++ = 0x167f; + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = 0x1681; + *class_uchardata++ = 0x180d; + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = 0x180f; + *class_uchardata++ = 0x1fff; + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = 0x200b; + *class_uchardata++ = 0x202e; + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = 0x2030; + *class_uchardata++ = 0x205e; + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = 0x2060; + *class_uchardata++ = 0x2fff; + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = 0x3001; +#ifdef SUPPORT_UTF + if (utf) + class_uchardata += PRIV(ord2utf)(0x10ffff, class_uchardata); + else +#endif + *class_uchardata++ = 0xffff; +#elif defined SUPPORT_UTF + if (utf) { - class_utf8 = TRUE; - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(0x0100, class_utf8data); - class_utf8data += _pcre_ord2utf8(0x167f, class_utf8data); - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(0x1681, class_utf8data); - class_utf8data += _pcre_ord2utf8(0x180d, class_utf8data); - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(0x180f, class_utf8data); - class_utf8data += _pcre_ord2utf8(0x1fff, class_utf8data); - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(0x200B, class_utf8data); - class_utf8data += _pcre_ord2utf8(0x202e, class_utf8data); - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(0x2030, class_utf8data); - class_utf8data += _pcre_ord2utf8(0x205e, class_utf8data); - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(0x2060, class_utf8data); - class_utf8data += _pcre_ord2utf8(0x2fff, class_utf8data); - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(0x3001, class_utf8data); - class_utf8data += _pcre_ord2utf8(0x7fffffff, class_utf8data); + xclass = TRUE; + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(0x0100, class_uchardata); + class_uchardata += PRIV(ord2utf)(0x167f, class_uchardata); + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(0x1681, class_uchardata); + class_uchardata += PRIV(ord2utf)(0x180d, class_uchardata); + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(0x180f, class_uchardata); + class_uchardata += PRIV(ord2utf)(0x1fff, class_uchardata); + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(0x200b, class_uchardata); + class_uchardata += PRIV(ord2utf)(0x202e, class_uchardata); + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(0x2030, class_uchardata); + class_uchardata += PRIV(ord2utf)(0x205e, class_uchardata); + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(0x2060, class_uchardata); + class_uchardata += PRIV(ord2utf)(0x2fff, class_uchardata); + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(0x3001, class_uchardata); + class_uchardata += PRIV(ord2utf)(0x10ffff, class_uchardata); } #endif continue; @@ -3640,13 +4185,18 @@ SETBIT(classbits, 0x0c); /* FF */ SETBIT(classbits, 0x0d); /* CR */ SETBIT(classbits, 0x85); /* NEL */ -#ifdef SUPPORT_UTF8 - if (utf8) +#ifndef COMPILE_PCRE8 + xclass = TRUE; + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = 0x2028; + *class_uchardata++ = 0x2029; +#elif defined SUPPORT_UTF + if (utf) { - class_utf8 = TRUE; - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(0x2028, class_utf8data); - class_utf8data += _pcre_ord2utf8(0x2029, class_utf8data); + xclass = TRUE; + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(0x2028, class_uchardata); + class_uchardata += PRIV(ord2utf)(0x2029, class_uchardata); } #endif continue; @@ -3668,16 +4218,29 @@ classbits[c] |= x; } -#ifdef SUPPORT_UTF8 - if (utf8) +#ifndef COMPILE_PCRE8 + xclass = TRUE; + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = 0x0100; + *class_uchardata++ = 0x2027; + *class_uchardata++ = XCL_RANGE; + *class_uchardata++ = 0x202a; +#ifdef SUPPORT_UTF + if (utf) + class_uchardata += PRIV(ord2utf)(0x10ffff, class_uchardata); + else +#endif + *class_uchardata++ = 0xffff; +#elif defined SUPPORT_UTF + if (utf) { - class_utf8 = TRUE; - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(0x0100, class_utf8data); - class_utf8data += _pcre_ord2utf8(0x2027, class_utf8data); - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(0x2029, class_utf8data); - class_utf8data += _pcre_ord2utf8(0x7fffffff, class_utf8data); + xclass = TRUE; + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(0x0100, class_uchardata); + class_uchardata += PRIV(ord2utf)(0x2027, class_uchardata); + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(0x202a, class_uchardata); + class_uchardata += PRIV(ord2utf)(0x10ffff, class_uchardata); } #endif continue; @@ -3690,12 +4253,12 @@ int pdata; int ptype = get_ucp(&ptr, &negated, &pdata, errorcodeptr); if (ptype < 0) goto FAILED; - class_utf8 = TRUE; - *class_utf8data++ = ((-c == ESC_p) != negated)? + xclass = TRUE; + *class_uchardata++ = ((-c == ESC_p) != negated)? XCL_PROP : XCL_NOTPROP; - *class_utf8data++ = ptype; - *class_utf8data++ = pdata; - class_charcount -= 2; /* Not a < 256 character */ + *class_uchardata++ = ptype; + *class_uchardata++ = pdata; + class_has_8bitchar--; /* Undo! */ continue; } #endif @@ -3709,14 +4272,15 @@ *errorcodeptr = ERR7; goto FAILED; } - class_charcount -= 2; /* Undo the default count from above */ - c = *ptr; /* Get the final character and fall through */ + class_has_8bitchar--; /* Undo the speculative increase. */ + class_single_char -= 2; /* Undo the speculative increase. */ + c = *ptr; /* Get the final character and fall through */ break; } } /* Fall through if we have a single character (c >= 0). This may be - greater than 256 in UTF-8 mode. */ + greater than 256. */ } /* End of backslash handling */ @@ -3764,8 +4328,8 @@ goto LONE_SINGLE_CHARACTER; } -#ifdef SUPPORT_UTF8 - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { /* Braces are required because the */ GETCHARLEN(d, ptr, ptr); /* macro generates multiple statements */ } @@ -3809,22 +4373,36 @@ if (d == CHAR_CR || d == CHAR_NL) cd->external_flags |= PCRE_HASCRORLF; + /* Since we found a character range, single character optimizations + cannot be done anymore. */ + class_single_char = 2; + /* In UTF-8 mode, if the upper limit is > 255, or > 127 for caseless matching, we have to use an XCLASS with extra data items. Caseless matching for characters > 127 is available only if UCP support is available. */ -#ifdef SUPPORT_UTF8 - if (utf8 && (d > 255 || ((options & PCRE_CASELESS) != 0 && d > 127))) +#if defined SUPPORT_UTF && !(defined COMPILE_PCRE8) + if ((d > 255) || (utf && ((options & PCRE_CASELESS) != 0 && d > 127))) +#elif defined SUPPORT_UTF + if (utf && (d > 255 || ((options & PCRE_CASELESS) != 0 && d > 127))) +#elif !(defined COMPILE_PCRE8) + if (d > 255) +#endif +#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) { - class_utf8 = TRUE; + xclass = TRUE; /* With UCP support, we can find the other case equivalents of the relevant characters. There may be several ranges. Optimize how they fit with the basic range. */ #ifdef SUPPORT_UCP +#ifndef COMPILE_PCRE8 + if (utf && (options & PCRE_CASELESS) != 0) +#else if ((options & PCRE_CASELESS) != 0) +#endif { unsigned int occ, ocd; unsigned int cc = c; @@ -3850,14 +4428,14 @@ if (occ == ocd) { - *class_utf8data++ = XCL_SINGLE; + *class_uchardata++ = XCL_SINGLE; } else { - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(occ, class_utf8data); + *class_uchardata++ = XCL_RANGE; + class_uchardata += PRIV(ord2utf)(occ, class_uchardata); } - class_utf8data += _pcre_ord2utf8(ocd, class_utf8data); + class_uchardata += PRIV(ord2utf)(ocd, class_uchardata); } } #endif /* SUPPORT_UCP */ @@ -3865,33 +4443,69 @@ /* Now record the original range, possibly modified for UCP caseless overlapping ranges. */ - *class_utf8data++ = XCL_RANGE; - class_utf8data += _pcre_ord2utf8(c, class_utf8data); - class_utf8data += _pcre_ord2utf8(d, class_utf8data); + *class_uchardata++ = XCL_RANGE; +#ifdef SUPPORT_UTF +#ifndef COMPILE_PCRE8 + if (utf) + { + class_uchardata += PRIV(ord2utf)(c, class_uchardata); + class_uchardata += PRIV(ord2utf)(d, class_uchardata); + } + else + { + *class_uchardata++ = c; + *class_uchardata++ = d; + } +#else + class_uchardata += PRIV(ord2utf)(c, class_uchardata); + class_uchardata += PRIV(ord2utf)(d, class_uchardata); +#endif +#else /* SUPPORT_UTF */ + *class_uchardata++ = c; + *class_uchardata++ = d; +#endif /* SUPPORT_UTF */ /* With UCP support, we are done. Without UCP support, there is no - caseless matching for UTF-8 characters > 127; we can use the bit map - for the smaller ones. */ + caseless matching for UTF characters > 127; we can use the bit map + for the smaller ones. As for 16 bit characters without UTF, we + can still use */ #ifdef SUPPORT_UCP - continue; /* With next character in the class */ -#else - if ((options & PCRE_CASELESS) == 0 || c > 127) continue; +#ifndef COMPILE_PCRE8 + if (utf) +#endif + continue; /* With next character in the class */ +#endif /* SUPPORT_UCP */ +#if defined SUPPORT_UTF && !defined(SUPPORT_UCP) && !(defined COMPILE_PCRE8) + if (utf) + { + if ((options & PCRE_CASELESS) == 0 || c > 127) continue; + /* Adjust upper limit and fall through to set up the map */ + d = 127; + } + else + { + if (c > 255) continue; + /* Adjust upper limit and fall through to set up the map */ + d = 255; + } +#elif defined SUPPORT_UTF && !defined(SUPPORT_UCP) + if ((options & PCRE_CASELESS) == 0 || c > 127) continue; /* Adjust upper limit and fall through to set up the map */ - d = 127; - -#endif /* SUPPORT_UCP */ +#else + if (c > 255) continue; + /* Adjust upper limit and fall through to set up the map */ + d = 255; +#endif /* SUPPORT_UTF && !SUPPORT_UCP && !COMPILE_PCRE8 */ } -#endif /* SUPPORT_UTF8 */ +#endif /* SUPPORT_UTF || !COMPILE_PCRE8 */ - /* We use the bit map for all cases when not in UTF-8 mode; else - ranges that lie entirely within 0-127 when there is UCP support; else - for partial ranges without UCP support. */ + /* We use the bit map for 8 bit mode, or when the characters fall + partially or entirely to [0-255] ([0-127] for UCP) ranges. */ - class_charcount += d - c + 1; - class_lastchar = d; + class_has_8bitchar = 1; /* We can save a bit of time by skipping this in the pre-compile. */ @@ -3900,7 +4514,7 @@ classbits[c/8] |= (1 << (c&7)); if ((options & PCRE_CASELESS) != 0) { - int uc = cd->fcc[c]; /* flip case */ + int uc = cd->fcc[c]; /* flip case */ classbits[uc/8] |= (1 << (uc&7)); } } @@ -3914,41 +4528,110 @@ LONE_SINGLE_CHARACTER: - /* Handle a character that cannot go in the bit map */ + /* Only the value of 1 matters for class_single_char. */ + + if (class_single_char < 2) class_single_char++; + + /* If class_charcount is 1, we saw precisely one character. As long as + there was no use of \p or \P, in other words, no use of any XCLASS + features, we can optimize. + + The optimization throws away the bit map. We turn the item into a + 1-character OP_CHAR[I] if it's positive, or OP_NOT[I] if it's negative. + In the positive case, it can cause firstchar to be set. Otherwise, there + can be no first char if this item is first, whatever repeat count may + follow. In the case of reqchar, save the previous value for reinstating. */ -#ifdef SUPPORT_UTF8 - if (utf8 && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127))) + if (class_single_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET) { - class_utf8 = TRUE; - *class_utf8data++ = XCL_SINGLE; - class_utf8data += _pcre_ord2utf8(c, class_utf8data); + ptr++; + zeroreqchar = reqchar; + + if (negate_class) + { + if (firstchar == REQ_UNSET) firstchar = REQ_NONE; + zerofirstchar = firstchar; + *code++ = ((options & PCRE_CASELESS) != 0)? OP_NOTI: OP_NOT; +#ifdef SUPPORT_UTF + if (utf && c > MAX_VALUE_FOR_SINGLE_CHAR) + code += PRIV(ord2utf)(c, code); + else +#endif + *code++ = c; + goto NOT_CHAR; + } + + /* For a single, positive character, get the value into mcbuffer, and + then we can handle this with the normal one-character code. */ + +#ifdef SUPPORT_UTF + if (utf && c > MAX_VALUE_FOR_SINGLE_CHAR) + mclength = PRIV(ord2utf)(c, mcbuffer); + else +#endif + { + mcbuffer[0] = c; + mclength = 1; + } + goto ONE_CHAR; + } /* End of 1-char optimization */ + + /* Handle a character that cannot go in the bit map. */ + +#if defined SUPPORT_UTF && !(defined COMPILE_PCRE8) + if ((c > 255) || (utf && ((options & PCRE_CASELESS) != 0 && c > 127))) +#elif defined SUPPORT_UTF + if (utf && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127))) +#elif !(defined COMPILE_PCRE8) + if (c > 255) +#endif + +#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) + { + xclass = TRUE; + *class_uchardata++ = XCL_SINGLE; +#ifdef SUPPORT_UTF +#ifndef COMPILE_PCRE8 + /* In non 8 bit mode, we can get here even if we are not in UTF mode. */ + if (!utf) + *class_uchardata++ = c; + else +#endif + class_uchardata += PRIV(ord2utf)(c, class_uchardata); +#else /* SUPPORT_UTF */ + *class_uchardata++ = c; +#endif /* SUPPORT_UTF */ #ifdef SUPPORT_UCP +#ifdef COMPILE_PCRE8 if ((options & PCRE_CASELESS) != 0) +#else + /* In non 8 bit mode, we can get here even if we are not in UTF mode. */ + if (utf && (options & PCRE_CASELESS) != 0) +#endif { unsigned int othercase; - if ((othercase = UCD_OTHERCASE(c)) != c) + if ((int)(othercase = UCD_OTHERCASE(c)) != c) { - *class_utf8data++ = XCL_SINGLE; - class_utf8data += _pcre_ord2utf8(othercase, class_utf8data); + *class_uchardata++ = XCL_SINGLE; + class_uchardata += PRIV(ord2utf)(othercase, class_uchardata); } } #endif /* SUPPORT_UCP */ } else -#endif /* SUPPORT_UTF8 */ +#endif /* SUPPORT_UTF || COMPILE_PCRE16 */ /* Handle a single-byte character */ { + class_has_8bitchar = 1; classbits[c/8] |= (1 << (c&7)); if ((options & PCRE_CASELESS) != 0) { - c = cd->fcc[c]; /* flip case */ + c = cd->fcc[c]; /* flip case */ classbits[c/8] |= (1 << (c&7)); } - class_charcount++; - class_lastchar = c; } } @@ -3969,66 +4652,13 @@ goto FAILED; } - /* If class_charcount is 1, we saw precisely one character whose value is - less than 256. As long as there were no characters >= 128 and there was no - use of \p or \P, in other words, no use of any XCLASS features, we can - optimize. - - In UTF-8 mode, we can optimize the negative case only if there were no - characters >= 128 because OP_NOT and the related opcodes like OP_NOTSTAR - operate on single-bytes only. This is an historical hangover. Maybe one day - we can tidy these opcodes to handle multi-byte characters. - - The optimization throws away the bit map. We turn the item into a - 1-character OP_CHAR[NC] if it's positive, or OP_NOT if it's negative. Note - that OP_NOT does not support multibyte characters. In the positive case, it - can cause firstbyte to be set. Otherwise, there can be no first char if - this item is first, whatever repeat count may follow. In the case of - reqbyte, save the previous value for reinstating. */ - -#ifdef SUPPORT_UTF8 - if (class_charcount == 1 && !class_utf8 && - (!utf8 || !negate_class || class_lastchar < 128)) -#else - if (class_charcount == 1) -#endif - { - zeroreqbyte = reqbyte; - - /* The OP_NOT opcode works on one-byte characters only. */ - - if (negate_class) - { - if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; - zerofirstbyte = firstbyte; - *code++ = OP_NOT; - *code++ = class_lastchar; - break; - } - - /* For a single, positive character, get the value into mcbuffer, and - then we can handle this with the normal one-character code. */ - -#ifdef SUPPORT_UTF8 - if (utf8 && class_lastchar > 127) - mclength = _pcre_ord2utf8(class_lastchar, mcbuffer); - else -#endif - { - mcbuffer[0] = class_lastchar; - mclength = 1; - } - goto ONE_CHAR; - } /* End of 1-char optimization */ - - /* The general case - not the one-char optimization. If this is the first - thing in the branch, there can be no first char setting, whatever the - repeat count. Any reqbyte setting must remain unchanged after any kind of - repeat. */ - - if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; - zerofirstbyte = firstbyte; - zeroreqbyte = reqbyte; + /* If this is the first thing in the branch, there can be no first char + setting, whatever the repeat count. Any reqchar setting must remain + unchanged after any kind of repeat. */ + + if (firstchar == REQ_UNSET) firstchar = REQ_NONE; + zerofirstchar = firstchar; + zeroreqchar = reqchar; /* If there are characters with values > 255, we have to compile an extended class, with its own opcode, unless there was a negated special @@ -4038,29 +4668,34 @@ be listed) there are no characters < 256, we can omit the bitmap in the actual compiled code. */ -#ifdef SUPPORT_UTF8 - if (class_utf8 && (!should_flip_negation || (options & PCRE_UCP) != 0)) +#ifdef SUPPORT_UTF + if (xclass && (!should_flip_negation || (options & PCRE_UCP) != 0)) +#elif !defined COMPILE_PCRE8 + if (xclass && !should_flip_negation) +#endif +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 { - *class_utf8data++ = XCL_END; /* Marks the end of extra data */ + *class_uchardata++ = XCL_END; /* Marks the end of extra data */ *code++ = OP_XCLASS; code += LINK_SIZE; - *code = negate_class? XCL_NOT : 0; + *code = negate_class? XCL_NOT:0; /* If the map is required, move up the extra data to make room for it; otherwise just move the code pointer to the end of the extra data. */ - if (class_charcount > 0) + if (class_has_8bitchar > 0) { *code++ |= XCL_MAP; - memmove(code + 32, code, class_utf8data - code); + memmove(code + (32 / sizeof(pcre_uchar)), code, + IN_UCHARS(class_uchardata - code)); memcpy(code, classbits, 32); - code = class_utf8data + 32; + code = class_uchardata + (32 / sizeof(pcre_uchar)); } - else code = class_utf8data; + else code = class_uchardata; /* Now fill in the complete length of the item */ - PUT(previous, 1, code - previous); + PUT(previous, 1, (int)(code - previous)); break; /* End of class handling */ } #endif @@ -4072,16 +4707,14 @@ negating it if necessary. */ *code++ = (negate_class == should_flip_negation) ? OP_CLASS : OP_NCLASS; - if (negate_class) - { - if (lengthptr == NULL) /* Save time in the pre-compile phase */ - for (c = 0; c < 32; c++) code[c] = ~classbits[c]; - } - else + if (lengthptr == NULL) /* Save time in the pre-compile phase */ { + if (negate_class) + for (c = 0; c < 32; c++) classbits[c] = ~classbits[c]; memcpy(code, classbits, 32); } - code += 32; + code += 32 / sizeof(pcre_uchar); + NOT_CHAR: break; @@ -4118,8 +4751,8 @@ if (repeat_min == 0) { - firstbyte = zerofirstbyte; /* Adjust for zero repeat */ - reqbyte = zeroreqbyte; /* Ditto */ + firstchar = zerofirstchar; /* Adjust for zero repeat */ + reqchar = zeroreqchar; /* Ditto */ } /* Remember whether this is a variable length repeat */ @@ -4129,8 +4762,8 @@ op_type = 0; /* Default single-char op codes */ possessive_quantifier = FALSE; /* Default not possessive quantifier */ - /* Save start of previous item, in case we have to move it up to make space - for an inserted OP_ONCE for the additional '+' extension. */ + /* Save start of previous item, in case we have to move it up in order to + insert something before it. */ tempcode = previous; @@ -4153,37 +4786,76 @@ } else repeat_type = greedy_default; - /* If previous was a character match, abolish the item and generate a - repeat item instead. If a char item has a minumum of more than one, ensure - that it is set in reqbyte - it might not be if a sequence such as x{3} is - the first thing in a branch because the x will have gone into firstbyte - instead. */ + /* If previous was a recursion call, wrap it in atomic brackets so that + previous becomes the atomic group. All recursions were so wrapped in the + past, but it no longer happens for non-repeated recursions. In fact, the + repeated ones could be re-implemented independently so as not to need this, + but for the moment we rely on the code for repeating groups. */ - if (*previous == OP_CHAR || *previous == OP_CHARNC) + if (*previous == OP_RECURSE) { - /* Deal with UTF-8 characters that take up more than one byte. It's + memmove(previous + 1 + LINK_SIZE, previous, IN_UCHARS(1 + LINK_SIZE)); + *previous = OP_ONCE; + PUT(previous, 1, 2 + 2*LINK_SIZE); + previous[2 + 2*LINK_SIZE] = OP_KET; + PUT(previous, 3 + 2*LINK_SIZE, 2 + 2*LINK_SIZE); + code += 2 + 2 * LINK_SIZE; + length_prevgroup = 3 + 3*LINK_SIZE; + + /* When actually compiling, we need to check whether this was a forward + reference, and if so, adjust the offset. */ + + if (lengthptr == NULL && cd->hwm >= cd->start_workspace + LINK_SIZE) + { + int offset = GET(cd->hwm, -LINK_SIZE); + if (offset == previous + 1 - cd->start_code) + PUT(cd->hwm, -LINK_SIZE, offset + 1 + LINK_SIZE); + } + } + + /* Now handle repetition for the different types of item. */ + + /* If previous was a character or negated character match, abolish the item + and generate a repeat item instead. If a char item has a minimum of more + than one, ensure that it is set in reqchar - it might not be if a sequence + such as x{3} is the first thing in a branch because the x will have gone + into firstchar instead. */ + + if (*previous == OP_CHAR || *previous == OP_CHARI + || *previous == OP_NOT || *previous == OP_NOTI) + { + switch (*previous) + { + default: /* Make compiler happy. */ + case OP_CHAR: op_type = OP_STAR - OP_STAR; break; + case OP_CHARI: op_type = OP_STARI - OP_STAR; break; + case OP_NOT: op_type = OP_NOTSTAR - OP_STAR; break; + case OP_NOTI: op_type = OP_NOTSTARI - OP_STAR; break; + } + + /* Deal with UTF characters that take up more than one character. It's easier to write this out separately than try to macrify it. Use c to - hold the length of the character in bytes, plus 0x80 to flag that it's a - length rather than a small character. */ + hold the length of the character in bytes, plus UTF_LENGTH to flag that + it's a length rather than a small character. */ -#ifdef SUPPORT_UTF8 - if (utf8 && (code[-1] & 0x80) != 0) +#ifdef SUPPORT_UTF + if (utf && NOT_FIRSTCHAR(code[-1])) { - uschar *lastchar = code - 1; - while((*lastchar & 0xc0) == 0x80) lastchar--; - c = code - lastchar; /* Length of UTF-8 character */ - memcpy(utf8_char, lastchar, c); /* Save the char */ - c |= 0x80; /* Flag c as a length */ + pcre_uchar *lastchar = code - 1; + BACKCHAR(lastchar); + c = (int)(code - lastchar); /* Length of UTF-8 character */ + memcpy(utf_chars, lastchar, IN_UCHARS(c)); /* Save the char */ + c |= UTF_LENGTH; /* Flag c as a length */ } else -#endif - - /* Handle the case of a single byte - either with no UTF8 support, or - with UTF-8 disabled, or for a UTF-8 character < 128. */ +#endif /* SUPPORT_UTF */ + /* Handle the case of a single charater - either with no UTF support, or + with UTF disabled, or for a single character UTF character. */ { c = code[-1]; - if (repeat_min > 1) reqbyte = c | req_caseopt | cd->req_varyopt; + if (*previous <= OP_CHARI && repeat_min > 1) + reqchar = c | req_caseopt | cd->req_varyopt; } /* If the repetition is unlimited, it pays to see if the next thing on @@ -4193,7 +4865,7 @@ if (!possessive_quantifier && repeat_max < 0 && - check_auto_possessive(previous, utf8, ptr + 1, options, cd)) + check_auto_possessive(previous, utf, ptr + 1, options, cd)) { repeat_type = 0; /* Force greedy */ possessive_quantifier = TRUE; @@ -4202,26 +4874,6 @@ goto OUTPUT_SINGLE_REPEAT; /* Code shared with single character types */ } - /* If previous was a single negated character ([^a] or similar), we use - one of the special opcodes, replacing it. The code is shared with single- - character repeats by setting opt_type to add a suitable offset into - repeat_type. We can also test for auto-possessification. OP_NOT is - currently used only for single-byte chars. */ - - else if (*previous == OP_NOT) - { - op_type = OP_NOTSTAR - OP_STAR; /* Use "not" opcodes */ - c = previous[1]; - if (!possessive_quantifier && - repeat_max < 0 && - check_auto_possessive(previous, utf8, ptr + 1, options, cd)) - { - repeat_type = 0; /* Force greedy */ - possessive_quantifier = TRUE; - } - goto OUTPUT_SINGLE_REPEAT; - } - /* If previous was a character type match (\d or similar), abolish it and create a suitable repeat item. The code is shared with single-character repeats by setting op_type to add a suitable offset into repeat_type. Note @@ -4231,14 +4883,14 @@ else if (*previous < OP_EODN) { - uschar *oldcode; + pcre_uchar *oldcode; int prop_type, prop_value; op_type = OP_TYPESTAR - OP_STAR; /* Use type opcodes */ c = *previous; if (!possessive_quantifier && repeat_max < 0 && - check_auto_possessive(previous, utf8, ptr + 1, options, cd)) + check_auto_possessive(previous, utf, ptr + 1, options, cd)) { repeat_type = 0; /* Force greedy */ possessive_quantifier = TRUE; @@ -4318,14 +4970,14 @@ we have to insert the character for the previous code. For a repeated Unicode property match, there are two extra bytes that define the required property. In UTF-8 mode, long characters have their length in - c, with the 0x80 bit as a flag. */ + c, with the UTF_LENGTH bit as a flag. */ if (repeat_max < 0) { -#ifdef SUPPORT_UTF8 - if (utf8 && c >= 128) +#ifdef SUPPORT_UTF + if (utf && (c & UTF_LENGTH) != 0) { - memcpy(code, utf8_char, c & 7); + memcpy(code, utf_chars, IN_UCHARS(c & 7)); code += c & 7; } else @@ -4347,10 +4999,10 @@ else if (repeat_max != repeat_min) { -#ifdef SUPPORT_UTF8 - if (utf8 && c >= 128) +#ifdef SUPPORT_UTF + if (utf && (c & UTF_LENGTH) != 0) { - memcpy(code, utf8_char, c & 7); + memcpy(code, utf_chars, IN_UCHARS(c & 7)); code += c & 7; } else @@ -4377,10 +5029,10 @@ /* The character or character type itself comes last in all cases. */ -#ifdef SUPPORT_UTF8 - if (utf8 && c >= 128) +#ifdef SUPPORT_UTF + if (utf && (c & UTF_LENGTH) != 0) { - memcpy(code, utf8_char, c & 7); + memcpy(code, utf_chars, IN_UCHARS(c & 7)); code += c & 7; } else @@ -4404,10 +5056,11 @@ else if (*previous == OP_CLASS || *previous == OP_NCLASS || -#ifdef SUPPORT_UTF8 +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 *previous == OP_XCLASS || #endif - *previous == OP_REF) + *previous == OP_REF || + *previous == OP_REFI) { if (repeat_max == 0) { @@ -4441,35 +5094,35 @@ } /* If previous was a bracket group, we may have to replicate it in certain - cases. */ + cases. Note that at this point we can encounter only the "basic" bracket + opcodes such as BRA and CBRA, as this is the place where they get converted + into the more special varieties such as BRAPOS and SBRA. A test for >= + OP_ASSERT and <= OP_COND includes ASSERT, ASSERT_NOT, ASSERTBACK, + ASSERTBACK_NOT, ONCE, BRA, CBRA, and COND. Originally, PCRE did not allow + repetition of assertions, but now it does, for Perl compatibility. */ - else if (*previous == OP_BRA || *previous == OP_CBRA || - *previous == OP_ONCE || *previous == OP_COND) + else if (*previous >= OP_ASSERT && *previous <= OP_COND) { register int i; - int ketoffset = 0; int len = (int)(code - previous); - uschar *bralink = NULL; + pcre_uchar *bralink = NULL; + pcre_uchar *brazeroptr = NULL; - /* Repeating a DEFINE group is pointless */ + /* Repeating a DEFINE group is pointless, but Perl allows the syntax, so + we just ignore the repeat. */ if (*previous == OP_COND && previous[LINK_SIZE+1] == OP_DEF) - { - *errorcodeptr = ERR55; - goto FAILED; - } + goto END_REPEAT; + + /* There is no sense in actually repeating assertions. The only potential + use of repetition is in cases when the assertion is optional. Therefore, + if the minimum is greater than zero, just ignore the repeat. If the + maximum is not not zero or one, set it to 1. */ - /* If the maximum repeat count is unlimited, find the end of the bracket - by scanning through from the start, and compute the offset back to it - from the current code pointer. There may be an OP_OPT setting following - the final KET, so we can't find the end just by going back from the code - pointer. */ - - if (repeat_max == -1) - { - register uschar *ket = previous; - do ket += GET(ket, 1); while (*ket != OP_KET); - ketoffset = (int)(code - ket); + if (*previous < OP_ONCE) /* Assertion */ + { + if (repeat_min > 0) goto END_REPEAT; + if (repeat_max < 0 || repeat_max > 1) repeat_max = 1; } /* The case of a zero minimum is special because of the need to stick @@ -4490,10 +5143,11 @@ ** goto END_REPEAT; ** } - However, that fails when a group is referenced as a subroutine from - elsewhere in the pattern, so now we stick in OP_SKIPZERO in front of it - so that it is skipped on execution. As we don't have a list of which - groups are referenced, we cannot do this selectively. + However, that fails when a group or a subgroup within it is referenced + as a subroutine from elsewhere in the pattern, so now we stick in + OP_SKIPZERO in front of it so that it is skipped on execution. As we + don't have a list of which groups are referenced, we cannot do this + selectively. If the maximum is 1 or unlimited, we just have to stick in the BRAZERO and do no more at this point. However, we do need to adjust any @@ -4505,14 +5159,15 @@ if (repeat_max <= 1) /* Covers 0, 1, and unlimited */ { *code = OP_END; - adjust_recurse(previous, 1, utf8, cd, save_hwm); - memmove(previous+1, previous, len); + adjust_recurse(previous, 1, utf, cd, save_hwm); + memmove(previous + 1, previous, IN_UCHARS(len)); code++; if (repeat_max == 0) { *previous++ = OP_SKIPZERO; goto END_REPEAT; } + brazeroptr = previous; /* Save for possessive optimizing */ *previous++ = OP_BRAZERO + repeat_type; } @@ -4528,8 +5183,8 @@ { int offset; *code = OP_END; - adjust_recurse(previous, 2 + LINK_SIZE, utf8, cd, save_hwm); - memmove(previous + 2 + LINK_SIZE, previous, len); + adjust_recurse(previous, 2 + LINK_SIZE, utf, cd, save_hwm); + memmove(previous + 2 + LINK_SIZE, previous, IN_UCHARS(len)); code += 2 + LINK_SIZE; *previous++ = OP_BRAZERO + repeat_type; *previous++ = OP_BRA; @@ -4575,16 +5230,32 @@ *lengthptr += delta; } - /* This is compiling for real */ + /* This is compiling for real. If there is a set first byte for + the group, and we have not yet set a "required byte", set it. Make + sure there is enough workspace for copying forward references before + doing the copy. */ else { - if (groupsetfirstbyte && reqbyte < 0) reqbyte = firstbyte; + if (groupsetfirstchar && reqchar < 0) reqchar = firstchar; + for (i = 1; i < repeat_min; i++) { - uschar *hc; - uschar *this_hwm = cd->hwm; - memcpy(code, previous, len); + pcre_uchar *hc; + pcre_uchar *this_hwm = cd->hwm; + memcpy(code, previous, IN_UCHARS(len)); + + while (cd->hwm > cd->start_workspace + cd->workspace_size - + WORK_SIZE_SAFETY_MARGIN - (this_hwm - save_hwm)) + { + int save_offset = save_hwm - cd->start_workspace; + int this_offset = this_hwm - cd->start_workspace; + *errorcodeptr = expand_workspace(cd); + if (*errorcodeptr != 0) goto FAILED; + save_hwm = (pcre_uchar *)cd->start_workspace + save_offset; + this_hwm = (pcre_uchar *)cd->start_workspace + this_offset; + } + for (hc = save_hwm; hc < this_hwm; hc += LINK_SIZE) { PUT(cd->hwm, 0, GET(hc, 0) + len); @@ -4634,8 +5305,8 @@ else for (i = repeat_max - 1; i >= 0; i--) { - uschar *hc; - uschar *this_hwm = cd->hwm; + pcre_uchar *hc; + pcre_uchar *this_hwm = cd->hwm; *code++ = OP_BRAZERO + repeat_type; @@ -4651,7 +5322,22 @@ PUTINC(code, 0, offset); } - memcpy(code, previous, len); + memcpy(code, previous, IN_UCHARS(len)); + + /* Ensure there is enough workspace for forward references before + copying them. */ + + while (cd->hwm > cd->start_workspace + cd->workspace_size - + WORK_SIZE_SAFETY_MARGIN - (this_hwm - save_hwm)) + { + int save_offset = save_hwm - cd->start_workspace; + int this_offset = this_hwm - cd->start_workspace; + *errorcodeptr = expand_workspace(cd); + if (*errorcodeptr != 0) goto FAILED; + save_hwm = (pcre_uchar *)cd->start_workspace + save_offset; + this_hwm = (pcre_uchar *)cd->start_workspace + this_offset; + } + for (hc = save_hwm; hc < this_hwm; hc += LINK_SIZE) { PUT(cd->hwm, 0, GET(hc, 0) + len + ((i != 0)? 2+LINK_SIZE : 1)); @@ -4668,7 +5354,7 @@ { int oldlinkoffset; int offset = (int)(code - bralink + 1); - uschar *bra = code - offset; + pcre_uchar *bra = code - offset; oldlinkoffset = GET(bra, 1); bralink = (oldlinkoffset == 0)? NULL : bralink - oldlinkoffset; *code++ = OP_KET; @@ -4677,35 +5363,110 @@ } } - /* If the maximum is unlimited, set a repeater in the final copy. We - can't just offset backwards from the current code point, because we - don't know if there's been an options resetting after the ket. The - correct offset was computed above. + /* If the maximum is unlimited, set a repeater in the final copy. For + ONCE brackets, that's all we need to do. However, possessively repeated + ONCE brackets can be converted into non-capturing brackets, as the + behaviour of (?:xx)++ is the same as (?>xx)++ and this saves having to + deal with possessive ONCEs specially. - Then, when we are doing the actual compile phase, check to see whether - this group is a non-atomic one that could match an empty string. If so, + Otherwise, when we are doing the actual compile phase, check to see + whether this group is one that could match an empty string. If so, convert the initial operator to the S form (e.g. OP_BRA -> OP_SBRA) so - that runtime checking can be done. [This check is also applied to - atomic groups at runtime, but in a different way.] */ + that runtime checking can be done. [This check is also applied to ONCE + groups at runtime, but in a different way.] + + Then, if the quantifier was possessive and the bracket is not a + conditional, we convert the BRA code to the POS form, and the KET code to + KETRPOS. (It turns out to be convenient at runtime to detect this kind of + subpattern at both the start and at the end.) The use of special opcodes + makes it possible to reduce greatly the stack usage in pcre_exec(). If + the group is preceded by OP_BRAZERO, convert this to OP_BRAPOSZERO. + + Then, if the minimum number of matches is 1 or 0, cancel the possessive + flag so that the default action below, of wrapping everything inside + atomic brackets, does not happen. When the minimum is greater than 1, + there will be earlier copies of the group, and so we still have to wrap + the whole thing. */ else { - uschar *ketcode = code - ketoffset; - uschar *bracode = ketcode - GET(ketcode, 1); - *ketcode = OP_KETRMAX + repeat_type; - if (lengthptr == NULL && *bracode != OP_ONCE) + pcre_uchar *ketcode = code - 1 - LINK_SIZE; + pcre_uchar *bracode = ketcode - GET(ketcode, 1); + + /* Convert possessive ONCE brackets to non-capturing */ + + if ((*bracode == OP_ONCE || *bracode == OP_ONCE_NC) && + possessive_quantifier) *bracode = OP_BRA; + + /* For non-possessive ONCE brackets, all we need to do is to + set the KET. */ + + if (*bracode == OP_ONCE || *bracode == OP_ONCE_NC) + *ketcode = OP_KETRMAX + repeat_type; + + /* Handle non-ONCE brackets and possessive ONCEs (which have been + converted to non-capturing above). */ + + else { - uschar *scode = bracode; - do + /* In the compile phase, check for empty string matching. */ + + if (lengthptr == NULL) { - if (could_be_empty_branch(scode, ketcode, utf8, cd)) + pcre_uchar *scode = bracode; + do { - *bracode += OP_SBRA - OP_BRA; - break; + if (could_be_empty_branch(scode, ketcode, utf, cd)) + { + *bracode += OP_SBRA - OP_BRA; + break; + } + scode += GET(scode, 1); + } + while (*scode == OP_ALT); + } + + /* Handle possessive quantifiers. */ + + if (possessive_quantifier) + { + /* For COND brackets, we wrap the whole thing in a possessively + repeated non-capturing bracket, because we have not invented POS + versions of the COND opcodes. Because we are moving code along, we + must ensure that any pending recursive references are updated. */ + + if (*bracode == OP_COND || *bracode == OP_SCOND) + { + int nlen = (int)(code - bracode); + *code = OP_END; + adjust_recurse(bracode, 1 + LINK_SIZE, utf, cd, save_hwm); + memmove(bracode + 1 + LINK_SIZE, bracode, IN_UCHARS(nlen)); + code += 1 + LINK_SIZE; + nlen += 1 + LINK_SIZE; + *bracode = OP_BRAPOS; + *code++ = OP_KETRPOS; + PUTINC(code, 0, nlen); + PUT(bracode, 1, nlen); } - scode += GET(scode, 1); + + /* For non-COND brackets, we modify the BRA code and use KETRPOS. */ + + else + { + *bracode += 1; /* Switch to xxxPOS opcodes */ + *ketcode = OP_KETRPOS; + } + + /* If the minimum is zero, mark it as possessive, then unset the + possessive flag when the minimum is 0 or 1. */ + + if (brazeroptr != NULL) *brazeroptr = OP_BRAPOSZERO; + if (repeat_min < 2) possessive_quantifier = FALSE; } - while (*scode == OP_ALT); + + /* Non-possessive quantifier */ + + else *ketcode = OP_KETRMAX + repeat_type; } } } @@ -4726,13 +5487,18 @@ } /* If the character following a repeat is '+', or if certain optimization - tests above succeeded, possessive_quantifier is TRUE. For some of the - simpler opcodes, there is an special alternative opcode for this. For - anything else, we wrap the entire repeated item inside OP_ONCE brackets. - The '+' notation is just syntactic sugar, taken from Sun's Java package, - but the special opcodes can optimize it a bit. The repeated item starts at - tempcode, not at previous, which might be the first part of a string whose - (former) last char we repeated. + tests above succeeded, possessive_quantifier is TRUE. For some opcodes, + there are special alternative opcodes for this case. For anything else, we + wrap the entire repeated item inside OP_ONCE brackets. Logically, the '+' + notation is just syntactic sugar, taken from Sun's Java package, but the + special opcodes can optimize it. + + Some (but not all) possessively repeated subpatterns have already been + completely handled in the code just above. For them, possessive_quantifier + is always FALSE at this stage. + + Note that the repeated item starts at tempcode, not at previous, which + might be the first part of a string whose (former) last char we repeated. Possessifying an 'exact' quantifier has no effect, so we can ignore it. But an 'upto' may follow. We skip over an 'exact' item, and then test the @@ -4743,15 +5509,16 @@ int len; if (*tempcode == OP_TYPEEXACT) - tempcode += _pcre_OP_lengths[*tempcode] + - ((tempcode[3] == OP_PROP || tempcode[3] == OP_NOTPROP)? 2 : 0); + tempcode += PRIV(OP_lengths)[*tempcode] + + ((tempcode[1 + IMM2_SIZE] == OP_PROP + || tempcode[1 + IMM2_SIZE] == OP_NOTPROP)? 2 : 0); else if (*tempcode == OP_EXACT || *tempcode == OP_NOTEXACT) { - tempcode += _pcre_OP_lengths[*tempcode]; -#ifdef SUPPORT_UTF8 - if (utf8 && tempcode[-1] >= 0xc0) - tempcode += _pcre_utf8_table4[tempcode[-1] & 0x3f]; + tempcode += PRIV(OP_lengths)[*tempcode]; +#ifdef SUPPORT_UTF + if (utf && HAS_EXTRALEN(tempcode[-1])) + tempcode += GET_EXTRALEN(tempcode[-1]); #endif } @@ -4763,23 +5530,33 @@ case OP_QUERY: *tempcode = OP_POSQUERY; break; case OP_UPTO: *tempcode = OP_POSUPTO; break; - case OP_TYPESTAR: *tempcode = OP_TYPEPOSSTAR; break; - case OP_TYPEPLUS: *tempcode = OP_TYPEPOSPLUS; break; - case OP_TYPEQUERY: *tempcode = OP_TYPEPOSQUERY; break; - case OP_TYPEUPTO: *tempcode = OP_TYPEPOSUPTO; break; + case OP_STARI: *tempcode = OP_POSSTARI; break; + case OP_PLUSI: *tempcode = OP_POSPLUSI; break; + case OP_QUERYI: *tempcode = OP_POSQUERYI; break; + case OP_UPTOI: *tempcode = OP_POSUPTOI; break; case OP_NOTSTAR: *tempcode = OP_NOTPOSSTAR; break; case OP_NOTPLUS: *tempcode = OP_NOTPOSPLUS; break; case OP_NOTQUERY: *tempcode = OP_NOTPOSQUERY; break; case OP_NOTUPTO: *tempcode = OP_NOTPOSUPTO; break; + case OP_NOTSTARI: *tempcode = OP_NOTPOSSTARI; break; + case OP_NOTPLUSI: *tempcode = OP_NOTPOSPLUSI; break; + case OP_NOTQUERYI: *tempcode = OP_NOTPOSQUERYI; break; + case OP_NOTUPTOI: *tempcode = OP_NOTPOSUPTOI; break; + + case OP_TYPESTAR: *tempcode = OP_TYPEPOSSTAR; break; + case OP_TYPEPLUS: *tempcode = OP_TYPEPOSPLUS; break; + case OP_TYPEQUERY: *tempcode = OP_TYPEPOSQUERY; break; + case OP_TYPEUPTO: *tempcode = OP_TYPEPOSUPTO; break; + /* Because we are moving code along, we must ensure that any pending recursive references are updated. */ default: *code = OP_END; - adjust_recurse(tempcode, 1 + LINK_SIZE, utf8, cd, save_hwm); - memmove(tempcode + 1+LINK_SIZE, tempcode, len); + adjust_recurse(tempcode, 1 + LINK_SIZE, utf, cd, save_hwm); + memmove(tempcode + 1 + LINK_SIZE, tempcode, IN_UCHARS(len)); code += 1 + LINK_SIZE; len += 1 + LINK_SIZE; tempcode[0] = OP_ONCE; @@ -4791,7 +5568,7 @@ } /* In all case we no longer have a previous item. We also set the - "follows varying string" flag for subsequently encountered reqbytes if + "follows varying string" flag for subsequently encountered reqchars if it isn't already set and we have just passed a varying length item. */ END_REPEAT: @@ -4814,24 +5591,34 @@ /* First deal with various "verbs" that can be introduced by '*'. */ - if (*(++ptr) == CHAR_ASTERISK && - ((cd->ctypes[ptr[1]] & ctype_letter) != 0 || ptr[1] == ':')) + ptr++; + if (ptr[0] == CHAR_ASTERISK && (ptr[1] == ':' + || (MAX_255(ptr[1]) && ((cd->ctypes[ptr[1]] & ctype_letter) != 0)))) { int i, namelen; int arglen = 0; const char *vn = verbnames; - const uschar *name = ptr + 1; - const uschar *arg = NULL; + const pcre_uchar *name = ptr + 1; + const pcre_uchar *arg = NULL; previous = NULL; - while ((cd->ctypes[*++ptr] & ctype_letter) != 0) {}; + ptr++; + while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_letter) != 0) ptr++; namelen = (int)(ptr - name); + /* It appears that Perl allows any characters whatsoever, other than + a closing parenthesis, to appear in arguments, so we no longer insist on + letters, digits, and underscores. */ + if (*ptr == CHAR_COLON) { arg = ++ptr; - while ((cd->ctypes[*ptr] & (ctype_letter|ctype_digit)) != 0 - || *ptr == '_') ptr++; + while (*ptr != 0 && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++; arglen = (int)(ptr - arg); + if (arglen > (int)MAX_MARK) + { + *errorcodeptr = ERR75; + goto FAILED; + } } if (*ptr != CHAR_RIGHT_PARENTHESIS) @@ -4845,24 +5632,34 @@ for (i = 0; i < verbcount; i++) { if (namelen == verbs[i].len && - strncmp((char *)name, vn, namelen) == 0) + STRNCMP_UC_C8(name, vn, namelen) == 0) { - /* Check for open captures before ACCEPT */ + /* Check for open captures before ACCEPT and convert it to + ASSERT_ACCEPT if in an assertion. */ if (verbs[i].op == OP_ACCEPT) { open_capitem *oc; + if (arglen != 0) + { + *errorcodeptr = ERR59; + goto FAILED; + } cd->had_accept = TRUE; for (oc = cd->open_caps; oc != NULL; oc = oc->next) { *code++ = OP_CLOSE; PUT2INC(code, 0, oc->number); } + *code++ = (cd->assert_depth > 0)? OP_ASSERT_ACCEPT : OP_ACCEPT; + + /* Do not set firstchar after *ACCEPT */ + if (firstchar == REQ_UNSET) firstchar = REQ_NONE; } - /* Handle the cases with/without an argument */ + /* Handle other cases with/without an argument */ - if (arglen == 0) + else if (arglen == 0) { if (verbs[i].op < 0) /* Argument is mandatory */ { @@ -4870,11 +5667,7 @@ goto FAILED; } *code = verbs[i].op; - if (*code++ == OP_THEN) - { - PUT(code, 0, code - bcptr->current_branch - 1); - code += LINK_SIZE; - } + if (*code++ == OP_THEN) cd->external_flags |= PCRE_HASTHEN; } else @@ -4885,13 +5678,9 @@ goto FAILED; } *code = verbs[i].op_arg; - if (*code++ == OP_THEN_ARG) - { - PUT(code, 0, code - bcptr->current_branch - 1); - code += LINK_SIZE; - } + if (*code++ == OP_THEN_ARG) cd->external_flags |= PCRE_HASTHEN; *code++ = arglen; - memcpy(code, arg, arglen); + memcpy(code, arg, IN_UCHARS(arglen)); code += arglen; *code++ = 0; } @@ -4914,8 +5703,8 @@ { int i, set, unset, namelen; int *optset; - const uschar *name; - uschar *slot; + const pcre_uchar *name; + pcre_uchar *slot; switch (*(++ptr)) { @@ -4968,10 +5757,10 @@ break; /* Most other conditions use OP_CREF (a couple change to OP_RREF - below), and all need to skip 3 bytes at the start of the group. */ + below), and all need to skip 1+IMM2_SIZE bytes at the start of the group. */ code[1+LINK_SIZE] = OP_CREF; - skipbytes = 3; + skipbytes = 1+IMM2_SIZE; refsign = -1; /* Check for a test for recursion in a named group. */ @@ -5004,7 +5793,7 @@ /* We now expect to read a name; any thing else is an error */ - if ((cd->ctypes[ptr[1]] & ctype_word) == 0) + if (!MAX_255(ptr[1]) || (cd->ctypes[ptr[1]] & ctype_word) == 0) { ptr += 1; /* To get the right offset */ *errorcodeptr = ERR28; @@ -5015,11 +5804,10 @@ recno = 0; name = ++ptr; - while ((cd->ctypes[*ptr] & ctype_word) != 0) + while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_word) != 0) { if (recno >= 0) - recno = ((digitab[*ptr] & ctype_digit) != 0)? - recno * 10 + *ptr - CHAR_0 : -1; + recno = (IS_DIGIT(*ptr))? recno * 10 + *ptr - CHAR_0 : -1; ptr++; } namelen = (int)(ptr - name); @@ -5067,7 +5855,7 @@ slot = cd->name_table; for (i = 0; i < cd->names_found; i++) { - if (strncmp((char *)name, (char *)slot+2, namelen) == 0) break; + if (STRNCMP_UC_UC(name, slot+IMM2_SIZE, namelen) == 0) break; slot += cd->name_entry_size; } @@ -5083,7 +5871,7 @@ /* Search the pattern for a forward reference */ else if ((i = find_parens(cd, name, namelen, - (options & PCRE_EXTENDED) != 0, utf8)) > 0) + (options & PCRE_EXTENDED) != 0, utf)) > 0) { PUT2(code, 2+LINK_SIZE, i); code[1+LINK_SIZE]++; @@ -5109,7 +5897,7 @@ recno = 0; for (i = 1; i < namelen; i++) { - if ((digitab[name[i]] & ctype_digit) == 0) + if (!IS_DIGIT(name[i])) { *errorcodeptr = ERR15; goto FAILED; @@ -5124,7 +5912,7 @@ /* Similarly, check for the (?(DEFINE) "condition", which is always false. */ - else if (namelen == 6 && strncmp((char *)name, STRING_DEFINE, 6) == 0) + else if (namelen == 6 && STRNCMP_UC_C8(name, STRING_DEFINE, 6) == 0) { code[1+LINK_SIZE] = OP_DEF; skipbytes = 1; @@ -5151,6 +5939,7 @@ /* ------------------------------------------------------------ */ case CHAR_EQUALS_SIGN: /* Positive lookahead */ bravalue = OP_ASSERT; + cd->assert_depth += 1; ptr++; break; @@ -5165,6 +5954,7 @@ continue; } bravalue = OP_ASSERT_NOT; + cd->assert_depth += 1; break; @@ -5174,16 +5964,19 @@ { case CHAR_EQUALS_SIGN: /* Positive lookbehind */ bravalue = OP_ASSERTBACK; + cd->assert_depth += 1; ptr += 2; break; case CHAR_EXCLAMATION_MARK: /* Negative lookbehind */ bravalue = OP_ASSERTBACK_NOT; + cd->assert_depth += 1; ptr += 2; break; default: /* Could be name define, else bad */ - if ((cd->ctypes[ptr[1]] & ctype_word) != 0) goto DEFINE_NAME; + if (MAX_255(ptr[1]) && (cd->ctypes[ptr[1]] & ctype_word) != 0) + goto DEFINE_NAME; ptr++; /* Correct offset for error */ *errorcodeptr = ERR24; goto FAILED; @@ -5200,13 +5993,14 @@ /* ------------------------------------------------------------ */ case CHAR_C: /* Callout - may be followed by digits; */ - previous_callout = code; /* Save for later completion */ - after_manual_callout = 1; /* Skip one item before completing */ + previous_callout = code; /* Save for later completion */ + after_manual_callout = 1; /* Skip one item before completing */ *code++ = OP_CALLOUT; { int n = 0; - while ((digitab[*(++ptr)] & ctype_digit) != 0) - n = n * 10 + *ptr - CHAR_0; + ptr++; + while(IS_DIGIT(*ptr)) + n = n * 10 + *ptr++ - CHAR_0; if (*ptr != CHAR_RIGHT_PARENTHESIS) { *errorcodeptr = ERR39; @@ -5251,7 +6045,7 @@ CHAR_GREATER_THAN_SIGN : CHAR_APOSTROPHE; name = ++ptr; - while ((cd->ctypes[*ptr] & ctype_word) != 0) ptr++; + while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_word) != 0) ptr++; namelen = (int)(ptr - name); /* In the pre-compile phase, just do a syntax check. */ @@ -5268,9 +6062,9 @@ *errorcodeptr = ERR49; goto FAILED; } - if (namelen + 3 > cd->name_entry_size) + if (namelen + IMM2_SIZE + 1 > cd->name_entry_size) { - cd->name_entry_size = namelen + 3; + cd->name_entry_size = namelen + IMM2_SIZE + 1; if (namelen > MAX_NAME_SIZE) { *errorcodeptr = ERR48; @@ -5299,10 +6093,10 @@ for (i = 0; i < cd->names_found; i++) { - int crc = memcmp(name, slot+2, namelen); + int crc = memcmp(name, slot+IMM2_SIZE, IN_UCHARS(namelen)); if (crc == 0) { - if (slot[2+namelen] == 0) + if (slot[IMM2_SIZE+namelen] == 0) { if (GET2(slot, 0) != cd->bracount + 1 && (options & PCRE_DUPNAMES) == 0) @@ -5323,7 +6117,7 @@ if (crc < 0) { memmove(slot + cd->name_entry_size, slot, - (cd->names_found - i) * cd->name_entry_size); + IN_UCHARS((cd->names_found - i) * cd->name_entry_size)); break; } @@ -5337,7 +6131,7 @@ if (!dupname) { - uschar *cslot = cd->name_table; + pcre_uchar *cslot = cd->name_table; for (i = 0; i < cd->names_found; i++) { if (cslot != slot) @@ -5354,8 +6148,8 @@ } PUT2(slot, 0, cd->bracount + 1); - memcpy(slot + 2, name, namelen); - slot[2+namelen] = 0; + memcpy(slot + IMM2_SIZE, name, IN_UCHARS(namelen)); + slot[IMM2_SIZE + namelen] = 0; } } @@ -5381,7 +6175,7 @@ NAMED_REF_OR_RECURSE: name = ++ptr; - while ((cd->ctypes[*ptr] & ctype_word) != 0) ptr++; + while (MAX_255(*ptr) && (cd->ctypes[*ptr] & ctype_word) != 0) ptr++; namelen = (int)(ptr - name); /* In the pre-compile phase, do a syntax check. We used to just set @@ -5393,7 +6187,7 @@ if (lengthptr != NULL) { - const uschar *temp; + const pcre_uchar *temp; if (namelen == 0) { @@ -5423,7 +6217,7 @@ temp = cd->end_pattern; cd->end_pattern = ptr; recno = find_parens(cd, name, namelen, - (options & PCRE_EXTENDED) != 0, utf8); + (options & PCRE_EXTENDED) != 0, utf); cd->end_pattern = temp; if (recno < 0) recno = 0; /* Forward ref; set dummy number */ } @@ -5438,8 +6232,8 @@ slot = cd->name_table; for (i = 0; i < cd->names_found; i++) { - if (strncmp((char *)name, (char *)slot+2, namelen) == 0 && - slot[2+namelen] == 0) + if (STRNCMP_UC_UC(name, slot+IMM2_SIZE, namelen) == 0 && + slot[IMM2_SIZE+namelen] == 0) break; slot += cd->name_entry_size; } @@ -5450,7 +6244,7 @@ } else if ((recno = /* Forward back reference */ find_parens(cd, name, namelen, - (options & PCRE_EXTENDED) != 0, utf8)) <= 0) + (options & PCRE_EXTENDED) != 0, utf)) <= 0) { *errorcodeptr = ERR15; goto FAILED; @@ -5475,7 +6269,7 @@ case CHAR_0: case CHAR_1: case CHAR_2: case CHAR_3: case CHAR_4: case CHAR_5: case CHAR_6: case CHAR_7: case CHAR_8: case CHAR_9: { - const uschar *called; + const pcre_uchar *called; terminator = CHAR_RIGHT_PARENTHESIS; /* Come here from the \g<...> and \g'...' code (Oniguruma @@ -5489,7 +6283,7 @@ if ((refsign = *ptr) == CHAR_PLUS) { ptr++; - if ((digitab[*ptr] & ctype_digit) == 0) + if (!IS_DIGIT(*ptr)) { *errorcodeptr = ERR63; goto FAILED; @@ -5497,13 +6291,13 @@ } else if (refsign == CHAR_MINUS) { - if ((digitab[ptr[1]] & ctype_digit) == 0) + if (!IS_DIGIT(ptr[1])) goto OTHER_CHAR_AFTER_QUERY; ptr++; } recno = 0; - while((digitab[*ptr] & ctype_digit) != 0) + while(IS_DIGIT(*ptr)) recno = recno * 10 + *ptr++ - CHAR_0; if (*ptr != terminator) @@ -5554,14 +6348,14 @@ { *code = OP_END; if (recno != 0) - called = _pcre_find_bracket(cd->start_code, utf8, recno); + called = PRIV(find_bracket)(cd->start_code, utf, recno); /* Forward reference */ if (called == NULL) { if (find_parens(cd, NULL, recno, - (options & PCRE_EXTENDED) != 0, utf8) < 0) + (options & PCRE_EXTENDED) != 0, utf) < 0) { *errorcodeptr = ERR15; goto FAILED; @@ -5569,46 +6363,48 @@ /* Fudge the value of "called" so that when it is inserted as an offset below, what it actually inserted is the reference number - of the group. */ + of the group. Then remember the forward reference. */ called = cd->start_code + recno; - PUTINC(cd->hwm, 0, (int)(code + 2 + LINK_SIZE - cd->start_code)); + if (cd->hwm >= cd->start_workspace + cd->workspace_size - + WORK_SIZE_SAFETY_MARGIN) + { + *errorcodeptr = expand_workspace(cd); + if (*errorcodeptr != 0) goto FAILED; + } + PUTINC(cd->hwm, 0, (int)(code + 1 - cd->start_code)); } /* If not a forward reference, and the subpattern is still open, this is a recursive call. We check to see if this is a left - recursion that could loop for ever, and diagnose that case. */ + recursion that could loop for ever, and diagnose that case. We + must not, however, do this check if we are in a conditional + subpattern because the condition might be testing for recursion in + a pattern such as /(?(R)a+|(?R)b)/, which is perfectly valid. + Forever loops are also detected at runtime, so those that occur in + conditional subpatterns will be picked up then. */ - else if (GET(called, 1) == 0 && - could_be_empty(called, code, bcptr, utf8, cd)) + else if (GET(called, 1) == 0 && cond_depth <= 0 && + could_be_empty(called, code, bcptr, utf, cd)) { *errorcodeptr = ERR40; goto FAILED; } } - /* Insert the recursion/subroutine item, automatically wrapped inside - "once" brackets. Set up a "previous group" length so that a - subsequent quantifier will work. */ - - *code = OP_ONCE; - PUT(code, 1, 2 + 2*LINK_SIZE); - code += 1 + LINK_SIZE; + /* Insert the recursion/subroutine item. It does not have a set first + character (relevant if it is repeated, because it will then be + wrapped with ONCE brackets). */ *code = OP_RECURSE; PUT(code, 1, (int)(called - cd->start_code)); code += 1 + LINK_SIZE; - - *code = OP_KET; - PUT(code, 1, 2 + 2*LINK_SIZE); - code += 1 + LINK_SIZE; - - length_prevgroup = 3 + 3*LINK_SIZE; + groupsetfirstchar = FALSE; } /* Can't determine a first byte now */ - if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; + if (firstchar == REQ_UNSET) firstchar = REQ_NONE; continue; @@ -5664,9 +6460,8 @@ is necessary to ensure we correctly detect the start of the pattern in 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, and reset the - greedy defaults and the case value for firstbyte and reqbyte. */ + If we are not at the pattern start, reset the greedy defaults and the + case value for firstchar and reqchar. */ if (*ptr == CHAR_RIGHT_PARENTHESIS) { @@ -5677,20 +6472,13 @@ } else { - if ((options & PCRE_IMS) != (newoptions & PCRE_IMS)) - { - *code++ = OP_OPT; - *code++ = newoptions & PCRE_IMS; - } greedy_default = ((newoptions & PCRE_UNGREEDY) != 0); greedy_non_default = greedy_default ^ 1; - req_caseopt = ((newoptions & 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). */ + in subsequent branches. */ *optionsptr = options = newoptions; previous = NULL; /* This item can't be repeated */ @@ -5723,53 +6511,62 @@ NUMBERED_GROUP: cd->bracount += 1; PUT2(code, 1+LINK_SIZE, cd->bracount); - skipbytes = 2; + skipbytes = IMM2_SIZE; } - /* Process nested bracketed regex. Assertions may not be repeated, but - other kinds can be. All their opcodes are >= OP_ONCE. We copy code into a - non-register variable in order to be able to pass its address because some - compilers complain otherwise. Pass in a new setting for the ims options if - they have changed. */ + /* Process nested bracketed regex. Assertions used not to be repeatable, + but this was changed for Perl compatibility, so all kinds can now be + repeated. We copy code into a non-register variable (tempcode) in order to + be able to pass its address because some compilers complain otherwise. */ - previous = (bravalue >= OP_ONCE)? code : NULL; + previous = code; /* For handling repetition */ *code = bravalue; tempcode = code; - tempreqvary = cd->req_varyopt; /* Save value before bracket */ - length_prevgroup = 0; /* Initialize for pre-compile phase */ + tempreqvary = cd->req_varyopt; /* Save value before bracket */ + tempbracount = cd->bracount; /* Save value before bracket */ + length_prevgroup = 0; /* Initialize for pre-compile phase */ if (!compile_regex( - newoptions, /* The complete new option state */ - options & PCRE_IMS, /* The previous ims option state */ - &tempcode, /* Where to put code (updated) */ - &ptr, /* Input pointer (updated) */ - errorcodeptr, /* Where to put an error message */ + newoptions, /* The complete new option state */ + &tempcode, /* Where to put code (updated) */ + &ptr, /* Input pointer (updated) */ + errorcodeptr, /* Where to put an error message */ (bravalue == OP_ASSERTBACK || bravalue == OP_ASSERTBACK_NOT), /* TRUE if back assert */ - reset_bracount, /* True if (?| group */ - skipbytes, /* Skip over bracket number */ - &subfirstbyte, /* For possible first char */ - &subreqbyte, /* For possible last char */ - bcptr, /* Current branch chain */ - cd, /* Tables block */ - (lengthptr == NULL)? NULL : /* Actual compile phase */ - &length_prevgroup /* Pre-compile phase */ + reset_bracount, /* True if (?| group */ + skipbytes, /* Skip over bracket number */ + cond_depth + + ((bravalue == OP_COND)?1:0), /* Depth of condition subpatterns */ + &subfirstchar, /* For possible first char */ + &subreqchar, /* For possible last char */ + bcptr, /* Current branch chain */ + cd, /* Tables block */ + (lengthptr == NULL)? NULL : /* Actual compile phase */ + &length_prevgroup /* Pre-compile phase */ )) goto FAILED; + /* If this was an atomic group and there are no capturing groups within it, + generate OP_ONCE_NC instead of OP_ONCE. */ + + if (bravalue == OP_ONCE && cd->bracount <= tempbracount) + *code = OP_ONCE_NC; + + if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NOT) + cd->assert_depth -= 1; + /* At the end of compiling, code is still pointing to the start of the - group, while tempcode has been updated to point past the end of the group - and any option resetting that may follow it. The pattern pointer (ptr) - is on the bracket. */ + group, while tempcode has been updated to point past the end of the group. + The pattern pointer (ptr) is on the bracket. - /* If this is a conditional bracket, check that there are no more than + If this is a conditional bracket, check that there are no more than two branches in the group, or just one if it's a DEFINE group. We do this in the real compile phase, not in the pre-pass, where the whole group may not be available. */ if (bravalue == OP_COND && lengthptr == NULL) { - uschar *tc = code; + pcre_uchar *tc = code; int condcount = 0; do { @@ -5792,7 +6589,7 @@ } /* A "normal" conditional group. If there is just one branch, we must not - make use of its firstbyte or reqbyte, because this is equivalent to an + make use of its firstchar or reqchar, because this is equivalent to an empty second branch. */ else @@ -5802,7 +6599,7 @@ *errorcodeptr = ERR27; goto FAILED; } - if (condcount == 1) subfirstbyte = subreqbyte = REQ_NONE; + if (condcount == 1) subfirstchar = subreqchar = REQ_NONE; } } @@ -5827,7 +6624,7 @@ goto FAILED; } *lengthptr += length_prevgroup - 2 - 2*LINK_SIZE; - *code++ = OP_BRA; + code++; /* This already contains bravalue */ PUTINC(code, 0, 1 + LINK_SIZE); *code++ = OP_KET; PUTINC(code, 0, 1 + LINK_SIZE); @@ -5846,55 +6643,55 @@ /* Handle updating of the required and first characters for other types of group. Update for normal brackets of all kinds, and conditions with two branches (see code above). If the bracket is followed by a quantifier with - zero repeat, we have to back off. Hence the definition of zeroreqbyte and - zerofirstbyte outside the main loop so that they can be accessed for the + zero repeat, we have to back off. Hence the definition of zeroreqchar and + zerofirstchar outside the main loop so that they can be accessed for the back off. */ - zeroreqbyte = reqbyte; - zerofirstbyte = firstbyte; - groupsetfirstbyte = FALSE; + zeroreqchar = reqchar; + zerofirstchar = firstchar; + groupsetfirstchar = FALSE; if (bravalue >= OP_ONCE) { - /* If we have not yet set a firstbyte in this branch, take it from the + /* If we have not yet set a firstchar in this branch, take it from the subpattern, remembering that it was set here so that a repeat of more - than one can replicate it as reqbyte if necessary. If the subpattern has - no firstbyte, set "none" for the whole branch. In both cases, a zero - repeat forces firstbyte to "none". */ + than one can replicate it as reqchar if necessary. If the subpattern has + no firstchar, set "none" for the whole branch. In both cases, a zero + repeat forces firstchar to "none". */ - if (firstbyte == REQ_UNSET) + if (firstchar == REQ_UNSET) { - if (subfirstbyte >= 0) + if (subfirstchar >= 0) { - firstbyte = subfirstbyte; - groupsetfirstbyte = TRUE; + firstchar = subfirstchar; + groupsetfirstchar = TRUE; } - else firstbyte = REQ_NONE; - zerofirstbyte = REQ_NONE; + else firstchar = REQ_NONE; + zerofirstchar = REQ_NONE; } - /* If firstbyte was previously set, convert the subpattern's firstbyte - into reqbyte if there wasn't one, using the vary flag that was in + /* If firstchar was previously set, convert the subpattern's firstchar + into reqchar if there wasn't one, using the vary flag that was in existence beforehand. */ - else if (subfirstbyte >= 0 && subreqbyte < 0) - subreqbyte = subfirstbyte | tempreqvary; + else if (subfirstchar >= 0 && subreqchar < 0) + subreqchar = subfirstchar | tempreqvary; /* If the subpattern set a required byte (or set a first byte that isn't really the first byte - see above), set it. */ - if (subreqbyte >= 0) reqbyte = subreqbyte; + if (subreqchar >= 0) reqchar = subreqchar; } - /* For a forward assertion, we take the reqbyte, if set. This can be + /* For a forward assertion, we take the reqchar, if set. This can be helpful if the pattern that follows the assertion doesn't set a different - char. For example, it's useful for /(?=abcde).+/. We can't set firstbyte + char. For example, it's useful for /(?=abcde).+/. We can't set firstchar for an assertion, however because it leads to incorrect effect for patterns - such as /(?=a)a.+/ when the "real" "a" would then become a reqbyte instead - of a firstbyte. This is overcome by a scan at the end if there's no - firstbyte, looking for an asserted first char. */ + such as /(?=a)a.+/ when the "real" "a" would then become a reqchar instead + of a firstchar. This is overcome by a scan at the end if there's no + firstchar, looking for an asserted first char. */ - else if (bravalue == OP_ASSERT && subreqbyte >= 0) reqbyte = subreqbyte; + else if (bravalue == OP_ASSERT && subreqchar >= 0) reqchar = subreqchar; break; /* End of processing '(' */ @@ -5927,13 +6724,13 @@ /* For metasequences that actually match a character, we disable the setting of a first character if it hasn't already been set. */ - if (firstbyte == REQ_UNSET && -c > ESC_b && -c < ESC_Z) - firstbyte = REQ_NONE; + if (firstchar == REQ_UNSET && -c > ESC_b && -c < ESC_Z) + firstchar = REQ_NONE; /* Set values to reset to if this is followed by a zero repeat. */ - zerofirstbyte = firstbyte; - zeroreqbyte = reqbyte; + zerofirstchar = firstchar; + zeroreqchar = reqchar; /* \g or \g'name' is a subroutine call by name and \g or \g'n' is a subroutine call by number (Oniguruma syntax). In fact, the value @@ -5944,7 +6741,7 @@ if (-c == ESC_g) { - const uschar *p; + const pcre_uchar *p; save_hwm = cd->hwm; /* Normally this is set when '(' is read */ terminator = (*(++ptr) == CHAR_LESS_THAN_SIGN)? CHAR_GREATER_THAN_SIGN : CHAR_APOSTROPHE; @@ -5961,10 +6758,11 @@ if (ptr[1] != CHAR_PLUS && ptr[1] != CHAR_MINUS) { - BOOL isnumber = TRUE; + BOOL is_a_number = TRUE; for (p = ptr + 1; *p != 0 && *p != terminator; p++) { - if ((cd->ctypes[*p] & ctype_digit) == 0) isnumber = FALSE; + if (!MAX_255(*p)) { is_a_number = FALSE; break; } + if ((cd->ctypes[*p] & ctype_digit) == 0) is_a_number = FALSE; if ((cd->ctypes[*p] & ctype_word) == 0) break; } if (*p != terminator) @@ -5972,7 +6770,7 @@ *errorcodeptr = ERR57; break; } - if (isnumber) + if (is_a_number) { ptr++; goto HANDLE_NUMERICAL_RECURSION; @@ -5984,7 +6782,7 @@ /* Test a signed number in angle brackets or quotes. */ p = ptr + 2; - while ((digitab[*p] & ctype_digit) != 0) p++; + while (IS_DIGIT(*p)) p++; if (*p != terminator) { *errorcodeptr = ERR57; @@ -5995,11 +6793,16 @@ } /* \k or \k'name' is a back reference by name (Perl syntax). - We also support \k{name} (.NET syntax) */ + We also support \k{name} (.NET syntax). */ - if (-c == ESC_k && (ptr[1] == CHAR_LESS_THAN_SIGN || - ptr[1] == CHAR_APOSTROPHE || ptr[1] == CHAR_LEFT_CURLY_BRACKET)) + if (-c == ESC_k) { + if ((ptr[1] != CHAR_LESS_THAN_SIGN && + ptr[1] != CHAR_APOSTROPHE && ptr[1] != CHAR_LEFT_CURLY_BRACKET)) + { + *errorcodeptr = ERR69; + break; + } is_recurse = FALSE; terminator = (*(++ptr) == CHAR_LESS_THAN_SIGN)? CHAR_GREATER_THAN_SIGN : (*ptr == CHAR_APOSTROPHE)? @@ -6007,7 +6810,7 @@ goto NAMED_REF_OR_RECURSE; } - /* Back references are handled specially; must disable firstbyte if + /* Back references are handled specially; must disable firstchar if not set to cope with cases like (?=(\w+))\1: which would otherwise set ':' later. */ @@ -6017,9 +6820,9 @@ recno = -c - ESC_REF; HANDLE_REFERENCE: /* Come here from named backref handling */ - if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE; + if (firstchar == REQ_UNSET) firstchar = REQ_NONE; previous = code; - *code++ = OP_REF; + *code++ = ((options & PCRE_CASELESS) != 0)? OP_REFI : OP_REF; PUT2INC(code, 0, recno); cd->backref_map |= (recno < 32)? (1 << recno) : 1; if (recno > cd->top_backref) cd->top_backref = recno; @@ -6067,10 +6870,13 @@ /* For the rest (including \X when Unicode properties are supported), we can obtain the OP value by negating the escape value in the default situation when PCRE_UCP is not set. When it *is* set, we substitute - Unicode property tests. */ + Unicode property tests. Note that \b and \B do a one-character + lookbehind. */ else { + if ((-c == ESC_b || -c == ESC_B) && cd->max_lookbehind == 0) + cd->max_lookbehind = 1; #ifdef SUPPORT_UCP if (-c >= ESC_DU && -c <= ESC_wu) { @@ -6079,9 +6885,12 @@ } else #endif + /* In non-UTF-8 mode, we turn \C into OP_ALLANY instead of OP_ANYBYTE + so that it works in DFA mode and in lookbehinds. */ + { previous = (-c > ESC_b && -c < ESC_Z)? code : NULL; - *code++ = -c; + *code++ = (!utf && c == -ESC_C)? OP_ALLANY : -c; } } continue; @@ -6091,9 +6900,9 @@ a value > 127. We set its representation in the length/buffer, and then handle it as a data character. */ -#ifdef SUPPORT_UTF8 - if (utf8 && c > 127) - mclength = _pcre_ord2utf8(c, mcbuffer); +#ifdef SUPPORT_UTF + if (utf && c > MAX_VALUE_FOR_SINGLE_CHAR) + mclength = PRIV(ord2utf)(c, mcbuffer); else #endif @@ -6114,12 +6923,9 @@ mclength = 1; mcbuffer[0] = c; -#ifdef SUPPORT_UTF8 - if (utf8 && c >= 0xc0) - { - while ((ptr[1] & 0xc0) == 0x80) - mcbuffer[mclength++] = *(++ptr); - } +#ifdef SUPPORT_UTF + if (utf && HAS_EXTRALEN(c)) + ACROSSCHAR(TRUE, ptr[1], mcbuffer[mclength++] = *(++ptr)); #endif /* At this point we have the character's bytes in mcbuffer, and the length @@ -6127,7 +6933,7 @@ ONE_CHAR: previous = code; - *code++ = ((options & PCRE_CASELESS) != 0)? OP_CHARNC : OP_CHAR; + *code++ = ((options & PCRE_CASELESS) != 0)? OP_CHARI : OP_CHAR; for (c = 0; c < mclength; c++) *code++ = mcbuffer[c]; /* Remember if \r or \n were seen */ @@ -6137,34 +6943,34 @@ /* Set the first and required bytes appropriately. If no previous first byte, set it from this character, but revert to none on a zero repeat. - Otherwise, leave the firstbyte value alone, and don't change it on a zero + Otherwise, leave the firstchar value alone, and don't change it on a zero repeat. */ - if (firstbyte == REQ_UNSET) + if (firstchar == REQ_UNSET) { - zerofirstbyte = REQ_NONE; - zeroreqbyte = reqbyte; + zerofirstchar = REQ_NONE; + zeroreqchar = reqchar; - /* If the character is more than one byte long, we can set firstbyte + /* If the character is more than one byte long, we can set firstchar only if it is not to be matched caselessly. */ if (mclength == 1 || req_caseopt == 0) { - firstbyte = mcbuffer[0] | req_caseopt; - if (mclength != 1) reqbyte = code[-1] | cd->req_varyopt; + firstchar = mcbuffer[0] | req_caseopt; + if (mclength != 1) reqchar = code[-1] | cd->req_varyopt; } - else firstbyte = reqbyte = REQ_NONE; + else firstchar = reqchar = REQ_NONE; } - /* firstbyte was previously set; we can set reqbyte only the length is + /* firstchar was previously set; we can set reqchar only if the length is 1 or the matching is caseful. */ else { - zerofirstbyte = firstbyte; - zeroreqbyte = reqbyte; + zerofirstchar = firstchar; + zeroreqchar = reqchar; if (mclength == 1 || req_caseopt == 0) - reqbyte = code[-1] | req_caseopt | cd->req_varyopt; + reqchar = code[-1] | req_caseopt | cd->req_varyopt; } break; /* End of literal character handling */ @@ -6191,26 +6997,21 @@ /* On entry, ptr is pointing past the bracket character, but on return it points to the closing bracket, or vertical bar, or end of string. The code variable is pointing at the byte into which the BRA operator has been stored. -If the ims options are changed at the start (for a (?ims: group) or during any -branch, we need to insert an OP_OPT item at the start of every following branch -to ensure they get set correctly at run time, and also pass the new options -into every subsequent branch compile. - This function is used during the pre-compile phase when we are trying to find out the amount of memory needed, as well as during the real compile phase. The value of lengthptr distinguishes the two phases. Arguments: options option bits, including any changes for this subpattern - oldims previous settings of ims option bits codeptr -> the address of the current code pointer ptrptr -> the address of the current pattern pointer errorcodeptr -> pointer to error code variable lookbehind TRUE if this is a lookbehind assertion reset_bracount TRUE to reset the count for each branch skipbytes skip this many bytes at start (for brackets and OP_COND) - firstbyteptr place to put the first required character, or a negative number - reqbyteptr place to put the last required character, or a negative number + cond_depth depth of nesting for conditional subpatterns + firstcharptr place to put the first required character, or a negative number + reqcharptr place to put the last required character, or a negative number bcptr pointer to the chain of currently open branches cd points to the data block with tables pointers etc. lengthptr NULL during the real compile phase @@ -6220,30 +7021,29 @@ */ static BOOL -compile_regex(int options, int oldims, uschar **codeptr, const uschar **ptrptr, +compile_regex(int options, pcre_uchar **codeptr, const pcre_uchar **ptrptr, int *errorcodeptr, BOOL lookbehind, BOOL reset_bracount, int skipbytes, - int *firstbyteptr, int *reqbyteptr, branch_chain *bcptr, compile_data *cd, - int *lengthptr) + int cond_depth, pcre_int32 *firstcharptr, pcre_int32 *reqcharptr, + branch_chain *bcptr, compile_data *cd, int *lengthptr) { -const uschar *ptr = *ptrptr; -uschar *code = *codeptr; -uschar *last_branch = code; -uschar *start_bracket = code; -uschar *reverse_count = NULL; +const pcre_uchar *ptr = *ptrptr; +pcre_uchar *code = *codeptr; +pcre_uchar *last_branch = code; +pcre_uchar *start_bracket = code; +pcre_uchar *reverse_count = NULL; open_capitem capitem; int capnumber = 0; -int firstbyte, reqbyte; -int branchfirstbyte, branchreqbyte; +pcre_int32 firstchar, reqchar; +pcre_int32 branchfirstchar, branchreqchar; int length; int orig_bracount; int max_bracount; -int old_external_options = cd->external_options; branch_chain bc; bc.outer = bcptr; bc.current_branch = code; -firstbyte = reqbyte = REQ_UNSET; +firstchar = reqchar = REQ_UNSET; /* Accumulate the length for use in the pre-compile phase. Start with the length of the BRA and KET and any extra bytes that are required at the @@ -6261,7 +7061,9 @@ /* If this is a capturing subpattern, add to the chain of open capturing items so that we can detect them if (*ACCEPT) is encountered. This is also used to -detect groups that contain recursive back references to themselves. */ +detect groups that contain recursive back references to themselves. Note that +only OP_CBRA need be tested here; changing this opcode to one of its variants, +e.g. OP_SCBRAPOS, happens later, after the group has been compiled. */ if (*code == OP_CBRA) { @@ -6287,15 +7089,6 @@ if (reset_bracount) cd->bracount = orig_bracount; - /* Handle a change of ims options at the start of the branch */ - - if ((options & PCRE_IMS) != oldims) - { - *code++ = OP_OPT; - *code++ = options & PCRE_IMS; - length += 2; - } - /* Set up dummy OP_REVERSE if lookbehind assertion */ if (lookbehind) @@ -6309,22 +7102,14 @@ /* Now compile the branch; in the pre-compile phase its length gets added into the length. */ - if (!compile_branch(&options, &code, &ptr, errorcodeptr, &branchfirstbyte, - &branchreqbyte, &bc, cd, (lengthptr == NULL)? NULL : &length)) + if (!compile_branch(&options, &code, &ptr, errorcodeptr, &branchfirstchar, + &branchreqchar, &bc, cond_depth, cd, + (lengthptr == NULL)? NULL : &length)) { *ptrptr = ptr; return FALSE; } - /* If the external options have changed during this branch, it means that we - are at the top level, and a leading option setting has been encountered. We - need to re-set the original option values to take account of this so that, - during the pre-compile phase, we know to allow for a re-set at the start of - subsequent branches. */ - - if (old_external_options != cd->external_options) - oldims = cd->external_options & PCRE_IMS; - /* Keep the highest bracket count in case (?| was used and some branch has fewer than the rest. */ @@ -6334,43 +7119,43 @@ if (lengthptr == NULL) { - /* If this is the first branch, the firstbyte and reqbyte values for the + /* If this is the first branch, the firstchar and reqchar values for the branch become the values for the regex. */ if (*last_branch != OP_ALT) { - firstbyte = branchfirstbyte; - reqbyte = branchreqbyte; + firstchar = branchfirstchar; + reqchar = branchreqchar; } - /* If this is not the first branch, the first char and reqbyte have to + /* If this is not the first branch, the first char and reqchar have to match the values from all the previous branches, except that if the - previous value for reqbyte didn't have REQ_VARY set, it can still match, + previous value for reqchar didn't have REQ_VARY set, it can still match, and we set REQ_VARY for the regex. */ else { - /* If we previously had a firstbyte, but it doesn't match the new branch, - we have to abandon the firstbyte for the regex, but if there was - previously no reqbyte, it takes on the value of the old firstbyte. */ + /* If we previously had a firstchar, but it doesn't match the new branch, + we have to abandon the firstchar for the regex, but if there was + previously no reqchar, it takes on the value of the old firstchar. */ - if (firstbyte >= 0 && firstbyte != branchfirstbyte) + if (firstchar >= 0 && firstchar != branchfirstchar) { - if (reqbyte < 0) reqbyte = firstbyte; - firstbyte = REQ_NONE; + if (reqchar < 0) reqchar = firstchar; + firstchar = REQ_NONE; } - /* If we (now or from before) have no firstbyte, a firstbyte from the - branch becomes a reqbyte if there isn't a branch reqbyte. */ + /* If we (now or from before) have no firstchar, a firstchar from the + branch becomes a reqchar if there isn't a branch reqchar. */ - if (firstbyte < 0 && branchfirstbyte >= 0 && branchreqbyte < 0) - branchreqbyte = branchfirstbyte; + if (firstchar < 0 && branchfirstchar >= 0 && branchreqchar < 0) + branchreqchar = branchfirstchar; - /* Now ensure that the reqbytes match */ + /* Now ensure that the reqchars match */ - if ((reqbyte & ~REQ_VARY) != (branchreqbyte & ~REQ_VARY)) - reqbyte = REQ_NONE; - else reqbyte |= branchreqbyte; /* To "or" REQ_VARY */ + if ((reqchar & ~REQ_VARY) != (branchreqchar & ~REQ_VARY)) + reqchar = REQ_NONE; + else reqchar |= branchreqchar; /* To "or" REQ_VARY */ } /* If lookbehind, check that this branch matches a fixed-length string, and @@ -6385,7 +7170,8 @@ { int fixed_length; *code = OP_END; - fixed_length = find_fixedlength(last_branch, options, FALSE, cd); + fixed_length = find_fixedlength(last_branch, (options & PCRE_UTF8) != 0, + FALSE, cd); DPRINTF(("fixed length = %d\n", fixed_length)); if (fixed_length == -3) { @@ -6393,11 +7179,17 @@ } else if (fixed_length < 0) { - *errorcodeptr = (fixed_length == -2)? ERR36 : ERR25; + *errorcodeptr = (fixed_length == -2)? ERR36 : + (fixed_length == -4)? ERR70: ERR25; *ptrptr = ptr; return FALSE; } - else { PUT(reverse_count, 0, fixed_length); } + else + { + if (fixed_length > cd->max_lookbehind) + cd->max_lookbehind = fixed_length; + PUT(reverse_count, 0, fixed_length); + } } } @@ -6406,9 +7198,7 @@ of offsets, with the field in the BRA item now becoming an offset to the first alternative. If there are no alternatives, it points to the end of the group. The length in the terminating ket is always the length of the whole - bracketed item. If any of the ims options were changed inside the group, - compile a resetting op-code following, except at the very end of the pattern. - Return leaving the pointer at the terminating char. */ + bracketed item. Return leaving the pointer at the terminating char. */ if (*ptr != CHAR_VERTICAL_LINE) { @@ -6440,7 +7230,7 @@ if (cd->open_caps->flag) { memmove(start_bracket + 1 + LINK_SIZE, start_bracket, - code - start_bracket); + IN_UCHARS(code - start_bracket)); *start_bracket = OP_ONCE; code += 1 + LINK_SIZE; PUT(start_bracket, 1, (int)(code - start_bracket)); @@ -6452,15 +7242,6 @@ cd->open_caps = cd->open_caps->next; } - /* Reset options if needed. */ - - if ((options & PCRE_IMS) != oldims && *ptr == CHAR_RIGHT_PARENTHESIS) - { - *code++ = OP_OPT; - *code++ = oldims; - length += 2; - } - /* Retain the highest bracket number, in case resetting was used. */ cd->bracount = max_bracount; @@ -6469,8 +7250,8 @@ *codeptr = code; *ptrptr = ptr; - *firstbyteptr = firstbyte; - *reqbyteptr = reqbyte; + *firstcharptr = firstchar; + *reqcharptr = reqchar; if (lengthptr != NULL) { if (OFLOW_MAX - *lengthptr < length) @@ -6520,8 +7301,8 @@ /* Try to find out if this is an anchored regular expression. Consider each alternative branch. If they all start with OP_SOD or OP_CIRC, or with a bracket all of whose alternatives start with OP_SOD or OP_CIRC (recurse ad lib), then -it's anchored. However, if this is a multiline pattern, then only OP_SOD -counts, since OP_CIRC can match in the middle. +it's anchored. However, if this is a multiline pattern, then only OP_SOD will +be found, because ^ generates OP_CIRCM in that mode. We can also consider a regex to be anchored if OP_SOM starts all its branches. This is the code for \G, which means "match at start of match position, taking @@ -6542,7 +7323,6 @@ Arguments: code points to start of expression (the bracket) - options points to the options setting bracket_map a bitmap of which brackets we are inside while testing; this handles up to substring 31; after that we just have to take the less precise approach @@ -6552,35 +7332,38 @@ */ static BOOL -is_anchored(register const uschar *code, int *options, unsigned int bracket_map, +is_anchored(register const pcre_uchar *code, unsigned int bracket_map, unsigned int backref_map) { do { - const uschar *scode = first_significant_code(code + _pcre_OP_lengths[*code], - options, PCRE_MULTILINE, FALSE); + const pcre_uchar *scode = first_significant_code( + code + PRIV(OP_lengths)[*code], FALSE); register int op = *scode; /* Non-capturing brackets */ - if (op == OP_BRA) + if (op == OP_BRA || op == OP_BRAPOS || + op == OP_SBRA || op == OP_SBRAPOS) { - if (!is_anchored(scode, options, bracket_map, backref_map)) return FALSE; + if (!is_anchored(scode, bracket_map, backref_map)) return FALSE; } /* Capturing brackets */ - else if (op == OP_CBRA) + else if (op == OP_CBRA || op == OP_CBRAPOS || + op == OP_SCBRA || op == OP_SCBRAPOS) { int n = GET2(scode, 1+LINK_SIZE); int new_map = bracket_map | ((n < 32)? (1 << n) : 1); - if (!is_anchored(scode, options, new_map, backref_map)) return FALSE; + if (!is_anchored(scode, new_map, backref_map)) return FALSE; } /* Other brackets */ - else if (op == OP_ASSERT || op == OP_ONCE || op == OP_COND) + else if (op == OP_ASSERT || op == OP_ONCE || op == OP_ONCE_NC || + op == OP_COND) { - if (!is_anchored(scode, options, bracket_map, backref_map)) return FALSE; + if (!is_anchored(scode, bracket_map, backref_map)) return FALSE; } /* .* is not anchored unless DOTALL is set (which generates OP_ALLANY) and @@ -6595,9 +7378,7 @@ /* Check for explicit anchoring */ - else if (op != OP_SOD && op != OP_SOM && - ((*options & PCRE_MULTILINE) != 0 || op != OP_CIRC)) - return FALSE; + else if (op != OP_SOD && op != OP_SOM && op != OP_CIRC) return FALSE; code += GET(code, 1); } while (*code == OP_ALT); /* Loop for each alternative */ @@ -6628,12 +7409,12 @@ */ static BOOL -is_startline(const uschar *code, unsigned int bracket_map, +is_startline(const pcre_uchar *code, unsigned int bracket_map, unsigned int backref_map) { do { - const uschar *scode = first_significant_code(code + _pcre_OP_lengths[*code], - NULL, 0, FALSE); + const pcre_uchar *scode = first_significant_code( + code + PRIV(OP_lengths)[*code], FALSE); register int op = *scode; /* If we are at the start of a conditional assertion group, *both* the @@ -6644,7 +7425,7 @@ if (op == OP_COND) { scode += 1 + LINK_SIZE; - if (*scode == OP_CALLOUT) scode += _pcre_OP_lengths[OP_CALLOUT]; + if (*scode == OP_CALLOUT) scode += PRIV(OP_lengths)[OP_CALLOUT]; switch (*scode) { case OP_CREF: @@ -6660,20 +7441,22 @@ scode += 1 + LINK_SIZE; break; } - scode = first_significant_code(scode, NULL, 0, FALSE); + scode = first_significant_code(scode, FALSE); op = *scode; } /* Non-capturing brackets */ - if (op == OP_BRA) + if (op == OP_BRA || op == OP_BRAPOS || + op == OP_SBRA || op == OP_SBRAPOS) { if (!is_startline(scode, bracket_map, backref_map)) return FALSE; } /* Capturing brackets */ - else if (op == OP_CBRA) + else if (op == OP_CBRA || op == OP_CBRAPOS || + op == OP_SCBRA || op == OP_SCBRAPOS) { int n = GET2(scode, 1+LINK_SIZE); int new_map = bracket_map | ((n < 32)? (1 << n) : 1); @@ -6682,7 +7465,7 @@ /* Other brackets */ - else if (op == OP_ASSERT || op == OP_ONCE) + else if (op == OP_ASSERT || op == OP_ONCE || op == OP_ONCE_NC) { if (!is_startline(scode, bracket_map, backref_map)) return FALSE; } @@ -6697,7 +7480,7 @@ /* Check for explicit circumflex */ - else if (op != OP_CIRC) return FALSE; + else if (op != OP_CIRC && op != OP_CIRCM) return FALSE; /* Move on to the next alternative */ @@ -6723,20 +7506,21 @@ Arguments: code points to start of expression (the bracket) - options pointer to the options (used to check casing changes) inassert TRUE if in an assertion Returns: -1 or the fixed first char */ static int -find_firstassertedchar(const uschar *code, int *options, BOOL inassert) +find_firstassertedchar(const pcre_uchar *code, BOOL inassert) { register int c = -1; do { int d; - const uschar *scode = - first_significant_code(code + 1+LINK_SIZE, options, PCRE_CASELESS, TRUE); + int xl = (*code == OP_CBRA || *code == OP_SCBRA || + *code == OP_CBRAPOS || *code == OP_SCBRAPOS)? IMM2_SIZE:0; + const pcre_uchar *scode = first_significant_code(code + 1+LINK_SIZE + xl, + TRUE); register int op = *scode; switch(op) @@ -6745,30 +7529,44 @@ return -1; case OP_BRA: + case OP_BRAPOS: case OP_CBRA: + case OP_SCBRA: + case OP_CBRAPOS: + case OP_SCBRAPOS: case OP_ASSERT: case OP_ONCE: + case OP_ONCE_NC: case OP_COND: - if ((d = find_firstassertedchar(scode, options, op == OP_ASSERT)) < 0) + if ((d = find_firstassertedchar(scode, op == OP_ASSERT)) < 0) return -1; if (c < 0) c = d; else if (c != d) return -1; break; - case OP_EXACT: /* Fall through */ - scode += 2; + case OP_EXACT: + scode += IMM2_SIZE; + /* Fall through */ case OP_CHAR: - case OP_CHARNC: case OP_PLUS: case OP_MINPLUS: case OP_POSPLUS: if (!inassert) return -1; - if (c < 0) - { - c = scode[1]; - if ((*options & PCRE_CASELESS) != 0) c |= REQ_CASELESS; - } - else if (c != scode[1]) return -1; + if (c < 0) c = scode[1]; + else if (c != scode[1]) return -1; + break; + + case OP_EXACTI: + scode += IMM2_SIZE; + /* Fall through */ + + case OP_CHARI: + case OP_PLUSI: + case OP_MINPLUSI: + case OP_POSPLUSI: + if (!inassert) return -1; + if (c < 0) c = scode[1] | REQ_CASELESS; + else if (c != scode[1]) return -1; break; } @@ -6802,28 +7600,45 @@ with errorptr and erroroffset set */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION pcre_compile(const char *pattern, int options, const char **errorptr, int *erroroffset, const unsigned char *tables) +#else +PCRE_EXP_DEFN pcre16 * PCRE_CALL_CONVENTION +pcre16_compile(PCRE_SPTR16 pattern, int options, const char **errorptr, + int *erroroffset, const unsigned char *tables) +#endif { +#ifdef COMPILE_PCRE8 return pcre_compile2(pattern, options, NULL, errorptr, erroroffset, tables); +#else +return pcre16_compile2(pattern, options, NULL, errorptr, erroroffset, tables); +#endif } +#ifdef COMPILE_PCRE8 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) +#else +PCRE_EXP_DEFN pcre16 * PCRE_CALL_CONVENTION +pcre16_compile2(PCRE_SPTR16 pattern, int options, int *errorcodeptr, + const char **errorptr, int *erroroffset, const unsigned char *tables) +#endif { -real_pcre *re; +REAL_PCRE *re; int length = 1; /* For final END opcode */ -int firstbyte, reqbyte, newline; +pcre_int32 firstchar, reqchar; +int newline; int errorcode = 0; int skipatstart = 0; -BOOL utf8; +BOOL utf; size_t size; -uschar *code; -const uschar *codestart; -const uschar *ptr; +pcre_uchar *code; +const pcre_uchar *codestart; +const pcre_uchar *ptr; compile_data compile_block; compile_data *cd = &compile_block; @@ -6831,13 +7646,14 @@ computing the amount of memory that is needed. Compiled items are thrown away as soon as possible, so that a fairly large buffer should be sufficient for this purpose. The same space is used in the second phase for remembering where -to fill in forward references to subpatterns. */ +to fill in forward references to subpatterns. That may overflow, in which case +new memory is obtained from malloc(). */ -uschar cworkspace[COMPILE_WORK_SIZE]; +pcre_uchar cworkspace[COMPILE_WORK_SIZE]; /* Set this early so that early errors get offset 0. */ -ptr = (const uschar *)pattern; +ptr = (const pcre_uchar *)pattern; /* We can't pass back an error message if errorptr is NULL; I guess the best we can do is just return NULL, but we can set a code value if there is a code @@ -6864,7 +7680,7 @@ /* Set up pointers to the individual character tables */ -if (tables == NULL) tables = _pcre_default_tables; +if (tables == NULL) tables = PRIV(default_tables); cd->lcc = tables + lcc_offset; cd->fcc = tables + fcc_offset; cd->cbits = tables + cbits_offset; @@ -6887,27 +7703,33 @@ int newnl = 0; int newbsr = 0; - if (strncmp((char *)(ptr+skipatstart+2), STRING_UTF8_RIGHTPAR, 5) == 0) +#ifdef COMPILE_PCRE8 + if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF_RIGHTPAR, 5) == 0) { skipatstart += 7; options |= PCRE_UTF8; continue; } - else if (strncmp((char *)(ptr+skipatstart+2), STRING_UCP_RIGHTPAR, 4) == 0) +#endif +#ifdef COMPILE_PCRE16 + if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF_RIGHTPAR, 6) == 0) + { skipatstart += 8; options |= PCRE_UTF16; continue; } +#endif + else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UCP_RIGHTPAR, 4) == 0) { skipatstart += 6; options |= PCRE_UCP; continue; } - else if (strncmp((char *)(ptr+skipatstart+2), STRING_NO_START_OPT_RIGHTPAR, 13) == 0) + else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_NO_START_OPT_RIGHTPAR, 13) == 0) { skipatstart += 15; options |= PCRE_NO_START_OPTIMIZE; continue; } - if (strncmp((char *)(ptr+skipatstart+2), STRING_CR_RIGHTPAR, 3) == 0) + if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_CR_RIGHTPAR, 3) == 0) { skipatstart += 5; newnl = PCRE_NEWLINE_CR; } - else if (strncmp((char *)(ptr+skipatstart+2), STRING_LF_RIGHTPAR, 3) == 0) + else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_LF_RIGHTPAR, 3) == 0) { skipatstart += 5; newnl = PCRE_NEWLINE_LF; } - else if (strncmp((char *)(ptr+skipatstart+2), STRING_CRLF_RIGHTPAR, 5) == 0) + else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_CRLF_RIGHTPAR, 5) == 0) { skipatstart += 7; newnl = PCRE_NEWLINE_CR + PCRE_NEWLINE_LF; } - else if (strncmp((char *)(ptr+skipatstart+2), STRING_ANY_RIGHTPAR, 4) == 0) + else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_ANY_RIGHTPAR, 4) == 0) { skipatstart += 6; newnl = PCRE_NEWLINE_ANY; } - else if (strncmp((char *)(ptr+skipatstart+2), STRING_ANYCRLF_RIGHTPAR, 8) == 0) + else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_ANYCRLF_RIGHTPAR, 8) == 0) { skipatstart += 10; newnl = PCRE_NEWLINE_ANYCRLF; } - else if (strncmp((char *)(ptr+skipatstart+2), STRING_BSR_ANYCRLF_RIGHTPAR, 12) == 0) + else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_BSR_ANYCRLF_RIGHTPAR, 12) == 0) { skipatstart += 14; newbsr = PCRE_BSR_ANYCRLF; } - else if (strncmp((char *)(ptr+skipatstart+2), STRING_BSR_UNICODE_RIGHTPAR, 12) == 0) + else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_BSR_UNICODE_RIGHTPAR, 12) == 0) { skipatstart += 14; newbsr = PCRE_BSR_UNICODE; } if (newnl != 0) @@ -6917,19 +7739,27 @@ else break; } -utf8 = (options & PCRE_UTF8) != 0; - -/* Can't support UTF8 unless PCRE has been compiled to include the code. */ +/* PCRE_UTF16 has the same value as PCRE_UTF8. */ +utf = (options & PCRE_UTF8) != 0; -#ifdef SUPPORT_UTF8 -if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0 && - (*erroroffset = _pcre_valid_utf8((USPTR)pattern, -1)) >= 0) +/* Can't support UTF unless PCRE has been compiled to include the code. The +return of an error code from PRIV(valid_utf)() is a new feature, introduced in +release 8.13. It is passed back from pcre_[dfa_]exec(), but at the moment is +not used here. */ + +#ifdef SUPPORT_UTF +if (utf && (options & PCRE_NO_UTF8_CHECK) == 0 && + (errorcode = PRIV(valid_utf)((PCRE_PUCHAR)pattern, -1, erroroffset)) != 0) { +#ifdef COMPILE_PCRE8 errorcode = ERR44; +#else + errorcode = ERR74; +#endif goto PCRE_EARLY_ERROR_RETURN2; } #else -if (utf8) +if (utf) { errorcode = ERR32; goto PCRE_EARLY_ERROR_RETURN; @@ -6948,13 +7778,11 @@ /* Check validity of \R options. */ -switch (options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) +if ((options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) == + (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) { - case 0: - case PCRE_BSR_ANYCRLF: - case PCRE_BSR_UNICODE: - break; - default: errorcode = ERR56; goto PCRE_EARLY_ERROR_RETURN; + errorcode = ERR56; + goto PCRE_EARLY_ERROR_RETURN; } /* Handle different types of newline. The three bits give seven cases. The @@ -7007,7 +7835,10 @@ /* Reflect pattern for debugging output */ DPRINTF(("------------------------------------------------------------------\n")); -DPRINTF(("%s\n", pattern)); +#ifdef PCRE_DEBUG +print_puchar(stdout, (PCRE_PUCHAR)pattern); +#endif +DPRINTF(("\n")); /* Pretend to compile the pattern while actually just accumulating the length of memory required. This behaviour is triggered by passing a non-NULL final @@ -7020,12 +7851,15 @@ cd->names_found = 0; cd->name_entry_size = 0; cd->name_table = NULL; -cd->start_workspace = cworkspace; cd->start_code = cworkspace; cd->hwm = cworkspace; -cd->start_pattern = (const uschar *)pattern; -cd->end_pattern = (const uschar *)(pattern + strlen(pattern)); +cd->start_workspace = cworkspace; +cd->workspace_size = COMPILE_WORK_SIZE; +cd->start_pattern = (const pcre_uchar *)pattern; +cd->end_pattern = (const pcre_uchar *)(pattern + STRLEN_UC((const pcre_uchar *)pattern)); cd->req_varyopt = 0; +cd->assert_depth = 0; +cd->max_lookbehind = 0; cd->external_options = options; cd->external_flags = 0; cd->open_caps = NULL; @@ -7039,13 +7873,12 @@ ptr += skipatstart; code = cworkspace; *code = OP_BRA; -(void)compile_regex(cd->external_options, cd->external_options & PCRE_IMS, - &code, &ptr, &errorcode, FALSE, FALSE, 0, &firstbyte, &reqbyte, NULL, cd, - &length); +(void)compile_regex(cd->external_options, &code, &ptr, &errorcode, FALSE, + FALSE, 0, 0, &firstchar, &reqchar, NULL, cd, &length); if (errorcode != 0) goto PCRE_EARLY_ERROR_RETURN; DPRINTF(("end pre-compile: length=%d workspace=%d\n", length, - cd->hwm - cworkspace)); + (int)(cd->hwm - cworkspace))); if (length > MAX_PATTERN_SIZE) { @@ -7058,8 +7891,8 @@ because nowadays we limit the maximum value of cd->names_found and cd->name_entry_size. */ -size = length + sizeof(real_pcre) + cd->names_found * (cd->name_entry_size + 3); -re = (real_pcre *)(pcre_malloc)(size); +size = sizeof(REAL_PCRE) + (length + cd->names_found * cd->name_entry_size) * sizeof(pcre_uchar); +re = (REAL_PCRE *)(PUBL(malloc))(size); if (re == NULL) { @@ -7077,14 +7910,13 @@ re->size = (int)size; re->options = cd->external_options; re->flags = cd->external_flags; -re->dummy1 = 0; -re->first_byte = 0; -re->req_byte = 0; -re->name_table_offset = sizeof(real_pcre); +re->first_char = 0; +re->req_char = 0; +re->name_table_offset = sizeof(REAL_PCRE) / sizeof(pcre_uchar); re->name_entry_size = cd->name_entry_size; re->name_count = cd->names_found; re->ref_count = 0; -re->tables = (tables == _pcre_default_tables)? NULL : tables; +re->tables = (tables == PRIV(default_tables))? NULL : tables; re->nullpad = NULL; /* The starting points of the name/number translation table and of the code are @@ -7095,12 +7927,14 @@ */ cd->final_bracount = cd->bracount; /* Save for checking forward references */ +cd->assert_depth = 0; cd->bracount = 0; +cd->max_lookbehind = 0; cd->names_found = 0; -cd->name_table = (uschar *)re + re->name_table_offset; +cd->name_table = (pcre_uchar *)re + re->name_table_offset; codestart = cd->name_table + re->name_entry_size * re->name_count; cd->start_code = codestart; -cd->hwm = cworkspace; +cd->hwm = (pcre_uchar *)(cd->start_workspace); cd->req_varyopt = 0; cd->had_accept = FALSE; cd->check_lookbehind = FALSE; @@ -7110,16 +7944,17 @@ error, errorcode will be set non-zero, so we don't need to look at the result of the function here. */ -ptr = (const uschar *)pattern + skipatstart; -code = (uschar *)codestart; +ptr = (const pcre_uchar *)pattern + skipatstart; +code = (pcre_uchar *)codestart; *code = OP_BRA; -(void)compile_regex(re->options, re->options & PCRE_IMS, &code, &ptr, - &errorcode, FALSE, FALSE, 0, &firstbyte, &reqbyte, NULL, cd, NULL); +(void)compile_regex(re->options, &code, &ptr, &errorcode, FALSE, FALSE, 0, 0, + &firstchar, &reqchar, NULL, cd, NULL); re->top_bracket = cd->bracount; re->top_backref = cd->top_backref; -re->flags = cd->external_flags; +re->max_lookbehind = cd->max_lookbehind; +re->flags = cd->external_flags | PCRE_MODE; -if (cd->had_accept) reqbyte = -1; /* Must disable after (*ACCEPT) */ +if (cd->had_accept) reqchar = REQ_NONE; /* Must disable after (*ACCEPT) */ /* If not reached end of pattern on success, there's an excess bracket. */ @@ -7134,20 +7969,34 @@ if (code - codestart > length) errorcode = ERR23; #endif -/* Fill in any forward references that are required. */ +/* Fill in any forward references that are required. There may be repeated +references; optimize for them, as searching a large regex takes time. */ -while (errorcode == 0 && cd->hwm > cworkspace) +if (cd->hwm > cd->start_workspace) { - int offset, recno; - const uschar *groupptr; - cd->hwm -= LINK_SIZE; - offset = GET(cd->hwm, 0); - recno = GET(codestart, offset); - groupptr = _pcre_find_bracket(codestart, utf8, recno); - if (groupptr == NULL) errorcode = ERR53; - else PUT(((uschar *)codestart), offset, (int)(groupptr - codestart)); + int prev_recno = -1; + const pcre_uchar *groupptr = NULL; + while (errorcode == 0 && cd->hwm > cd->start_workspace) + { + int offset, recno; + cd->hwm -= LINK_SIZE; + offset = GET(cd->hwm, 0); + recno = GET(codestart, offset); + if (recno != prev_recno) + { + groupptr = PRIV(find_bracket)(codestart, utf, recno); + prev_recno = recno; + } + if (groupptr == NULL) errorcode = ERR53; + else PUT(((pcre_uchar *)codestart), offset, (int)(groupptr - codestart)); + } } +/* If the workspace had to be expanded, free the new memory. */ + +if (cd->workspace_size > COMPILE_WORK_SIZE) + (PUBL(free))((void *)cd->start_workspace); + /* Give an error if there's back reference to a non-existent capturing subpattern. */ @@ -7163,31 +8012,34 @@ if (cd->check_lookbehind) { - uschar *cc = (uschar *)codestart; + pcre_uchar *cc = (pcre_uchar *)codestart; /* Loop, searching for OP_REVERSE items, and process those that do not have their length set. (Actually, it will also re-process any that have a length of zero, but that is a pathological case, and it does no harm.) When we find one, we temporarily terminate the branch it is in while we scan it. */ - for (cc = (uschar *)_pcre_find_bracket(codestart, utf8, -1); + for (cc = (pcre_uchar *)PRIV(find_bracket)(codestart, utf, -1); cc != NULL; - cc = (uschar *)_pcre_find_bracket(cc, utf8, -1)) + cc = (pcre_uchar *)PRIV(find_bracket)(cc, utf, -1)) { if (GET(cc, 1) == 0) { int fixed_length; - uschar *be = cc - 1 - LINK_SIZE + GET(cc, -LINK_SIZE); + pcre_uchar *be = cc - 1 - LINK_SIZE + GET(cc, -LINK_SIZE); int end_op = *be; *be = OP_END; - fixed_length = find_fixedlength(cc, re->options, TRUE, cd); + fixed_length = find_fixedlength(cc, (re->options & PCRE_UTF8) != 0, TRUE, + cd); *be = end_op; DPRINTF(("fixed length = %d\n", fixed_length)); if (fixed_length < 0) { - errorcode = (fixed_length == -2)? ERR36 : ERR25; + errorcode = (fixed_length == -2)? ERR36 : + (fixed_length == -4)? ERR70 : ERR25; break; } + if (fixed_length > cd->max_lookbehind) cd->max_lookbehind = fixed_length; PUT(cc, 1, fixed_length); } cc += 1 + LINK_SIZE; @@ -7198,9 +8050,9 @@ if (errorcode != 0) { - (pcre_free)(re); + (PUBL(free))(re); PCRE_EARLY_ERROR_RETURN: - *erroroffset = (int)(ptr - (const uschar *)pattern); + *erroroffset = (int)(ptr - (const pcre_uchar *)pattern); PCRE_EARLY_ERROR_RETURN2: *errorptr = find_error_text(errorcode); if (errorcodeptr != NULL) *errorcodeptr = errorcode; @@ -7219,18 +8071,42 @@ if ((re->options & PCRE_ANCHORED) == 0) { - int temp_options = re->options; /* May get changed during these scans */ - if (is_anchored(codestart, &temp_options, 0, cd->backref_map)) + if (is_anchored(codestart, 0, cd->backref_map)) re->options |= PCRE_ANCHORED; else { - if (firstbyte < 0) - firstbyte = find_firstassertedchar(codestart, &temp_options, FALSE); - if (firstbyte >= 0) /* Remove caseless flag for non-caseable chars */ - { - int ch = firstbyte & 255; - re->first_byte = ((firstbyte & REQ_CASELESS) != 0 && - cd->fcc[ch] == ch)? ch : firstbyte; + if (firstchar < 0) + firstchar = find_firstassertedchar(codestart, FALSE); + if (firstchar >= 0) /* Remove caseless flag for non-caseable chars */ + { +#ifdef COMPILE_PCRE8 + re->first_char = firstchar & 0xff; +#else +#ifdef COMPILE_PCRE16 + re->first_char = firstchar & 0xffff; +#endif +#endif + if ((firstchar & REQ_CASELESS) != 0) + { +#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8) + /* We ignore non-ASCII first chars in 8 bit mode. */ + if (utf) + { + if (re->first_char < 128) + { + if (cd->fcc[re->first_char] != re->first_char) + re->flags |= PCRE_FCH_CASELESS; + } + else if (UCD_OTHERCASE(re->first_char) != re->first_char) + re->flags |= PCRE_FCH_CASELESS; + } + else +#endif + if (MAX_255(re->first_char) + && cd->fcc[re->first_char] != re->first_char) + re->flags |= PCRE_FCH_CASELESS; + } + re->flags |= PCRE_FIRSTSET; } else if (is_startline(codestart, 0, cd->backref_map)) @@ -7242,12 +8118,36 @@ variable length item in the regex. Remove the caseless flag for non-caseable bytes. */ -if (reqbyte >= 0 && - ((re->options & PCRE_ANCHORED) == 0 || (reqbyte & REQ_VARY) != 0)) +if (reqchar >= 0 && + ((re->options & PCRE_ANCHORED) == 0 || (reqchar & REQ_VARY) != 0)) { - int ch = reqbyte & 255; - re->req_byte = ((reqbyte & REQ_CASELESS) != 0 && - cd->fcc[ch] == ch)? (reqbyte & ~REQ_CASELESS) : reqbyte; +#ifdef COMPILE_PCRE8 + re->req_char = reqchar & 0xff; +#else +#ifdef COMPILE_PCRE16 + re->req_char = reqchar & 0xffff; +#endif +#endif + if ((reqchar & REQ_CASELESS) != 0) + { +#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8) + /* We ignore non-ASCII first chars in 8 bit mode. */ + if (utf) + { + if (re->req_char < 128) + { + if (cd->fcc[re->req_char] != re->req_char) + re->flags |= PCRE_RCH_CASELESS; + } + else if (UCD_OTHERCASE(re->req_char) != re->req_char) + re->flags |= PCRE_RCH_CASELESS; + } + else +#endif + if (MAX_255(re->req_char) && cd->fcc[re->req_char] != re->req_char) + re->flags |= PCRE_RCH_CASELESS; + } + re->flags |= PCRE_REQCHSET; } @@ -7262,38 +8162,46 @@ if ((re->flags & PCRE_FIRSTSET) != 0) { - int ch = re->first_byte & 255; - const char *caseless = ((re->first_byte & REQ_CASELESS) == 0)? - "" : " (caseless)"; - if (isprint(ch)) printf("First char = %c%s\n", ch, caseless); + pcre_uchar ch = re->first_char; + const char *caseless = + ((re->flags & PCRE_FCH_CASELESS) == 0)? "" : " (caseless)"; + if (PRINTABLE(ch)) printf("First char = %c%s\n", ch, caseless); else printf("First char = \\x%02x%s\n", ch, caseless); } if ((re->flags & PCRE_REQCHSET) != 0) { - int ch = re->req_byte & 255; - const char *caseless = ((re->req_byte & REQ_CASELESS) == 0)? - "" : " (caseless)"; - if (isprint(ch)) printf("Req char = %c%s\n", ch, caseless); + pcre_uchar ch = re->req_char; + const char *caseless = + ((re->flags & PCRE_RCH_CASELESS) == 0)? "" : " (caseless)"; + if (PRINTABLE(ch)) printf("Req char = %c%s\n", ch, caseless); else printf("Req char = \\x%02x%s\n", ch, caseless); } -pcre_printint(re, stdout, TRUE); +#ifdef COMPILE_PCRE8 +pcre_printint((pcre *)re, stdout, TRUE); +#else +pcre16_printint((pcre *)re, stdout, TRUE); +#endif /* This check is done here in the debugging case so that the code that was compiled can be seen. */ if (code - codestart > length) { - (pcre_free)(re); + (PUBL(free))(re); *errorptr = find_error_text(ERR23); - *erroroffset = ptr - (uschar *)pattern; + *erroroffset = ptr - (pcre_uchar *)pattern; if (errorcodeptr != NULL) *errorcodeptr = ERR23; return NULL; } #endif /* PCRE_DEBUG */ +#ifdef COMPILE_PCRE8 return (pcre *)re; +#else +return (pcre16 *)re; +#endif } /* End of pcre_compile.c */ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_config.c php5-5.4.9/ext/pcre/pcrelib/pcre_config.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_config.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_config.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2009 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -43,6 +43,9 @@ #include "config.h" +/* Keep the original link size. */ +static int real_link_size = LINK_SIZE; + #include "pcre_internal.h" @@ -60,18 +63,41 @@ Returns: 0 if data returned, negative on error */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_config(int what, void *where) +#else +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre16_config(int what, void *where) +#endif { switch (what) { case PCRE_CONFIG_UTF8: -#ifdef SUPPORT_UTF8 +#if defined COMPILE_PCRE16 + *((int *)where) = 0; + return PCRE_ERROR_BADOPTION; +#else +#if defined SUPPORT_UTF + *((int *)where) = 1; +#else + *((int *)where) = 0; +#endif + break; +#endif + + case PCRE_CONFIG_UTF16: +#if defined COMPILE_PCRE8 + *((int *)where) = 0; + return PCRE_ERROR_BADOPTION; +#else +#if defined SUPPORT_UTF *((int *)where) = 1; #else *((int *)where) = 0; #endif break; +#endif case PCRE_CONFIG_UNICODE_PROPERTIES: #ifdef SUPPORT_UCP @@ -81,6 +107,22 @@ #endif break; + case PCRE_CONFIG_JIT: +#ifdef SUPPORT_JIT + *((int *)where) = 1; +#else + *((int *)where) = 0; +#endif + break; + + case PCRE_CONFIG_JITTARGET: +#ifdef SUPPORT_JIT + *((const char **)where) = PRIV(jit_get_target)(); +#else + *((const char **)where) = NULL; +#endif + break; + case PCRE_CONFIG_NEWLINE: *((int *)where) = NEWLINE; break; @@ -94,7 +136,7 @@ break; case PCRE_CONFIG_LINK_SIZE: - *((int *)where) = LINK_SIZE; + *((int *)where) = real_link_size; break; case PCRE_CONFIG_POSIX_MALLOC_THRESHOLD: diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_exec.c php5-5.4.9/ext/pcre/pcrelib/pcre_exec.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_exec.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_exec.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2010 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -37,7 +37,6 @@ ----------------------------------------------------------------------------- */ - /* This module contains pcre_exec(), the externally visible function that does pattern matching using an NFA algorithm, trying to mimic Perl as closely as possible. There are also some static supporting functions. */ @@ -55,10 +54,12 @@ #undef min #undef max -/* Flag bits for the match() function */ +/* Values for setting in md->match_function_type to indicate two special types +of call to match(). We do it this way to save on using another stack variable, +as stack usage is to be discouraged. */ -#define match_condassert 0x01 /* Called to check a condition assertion */ -#define match_cbegroup 0x02 /* Could-be-empty unlimited repeat group */ +#define MATCH_CONDASSERT 1 /* Called to check a condition assertion */ +#define MATCH_CBEGROUP 2 /* Could-be-empty unlimited repeat group */ /* Non-error returns from the match() function. Error returns are externally defined PCRE_ERROR_xxx codes, which are all negative. */ @@ -71,18 +72,12 @@ #define MATCH_ACCEPT (-999) #define MATCH_COMMIT (-998) -#define MATCH_PRUNE (-997) -#define MATCH_SKIP (-996) -#define MATCH_SKIP_ARG (-995) -#define MATCH_THEN (-994) - -/* This is a convenience macro for code that occurs many times. */ - -#define MRRETURN(ra) \ - { \ - md->mark = markptr; \ - RRETURN(ra); \ - } +#define MATCH_KETRPOS (-997) +#define MATCH_ONCE (-996) +#define MATCH_PRUNE (-995) +#define MATCH_SKIP (-994) +#define MATCH_SKIP_ARG (-993) +#define MATCH_THEN (-992) /* Maximum number of ints of offset to save on the stack for recursive calls. If the offset vector is bigger, malloc is used. This should be a multiple of 3, @@ -115,7 +110,7 @@ */ static void -pchars(const uschar *p, int length, BOOL is_subject, match_data *md) +pchars(const pcre_uchar *p, int length, BOOL is_subject, match_data *md) { unsigned int c; if (is_subject && length > md->end_subject - p) length = md->end_subject - p; @@ -130,24 +125,29 @@ * Match a back-reference * *************************************************/ -/* If a back reference hasn't been set, the length that is passed is greater -than the number of characters left in the string, so the match fails. +/* Normally, if a back reference hasn't been set, the length that is passed is +negative, so the match always fails. However, in JavaScript compatibility mode, +the length passed is zero. Note that in caseless UTF-8 mode, the number of +subject bytes matched may be different to the number of reference bytes. Arguments: offset index into the offset vector - eptr points into the subject - length length to be matched + eptr pointer into the subject + length length of reference to be matched (number of bytes) md points to match data block - ims the ims flags + caseless TRUE if caseless -Returns: TRUE if matched +Returns: >= 0 the number of subject bytes matched + -1 no match + -2 partial match; always given if at end subject */ -static BOOL -match_ref(int offset, register USPTR eptr, int length, match_data *md, - unsigned long int ims) +static int +match_ref(int offset, register PCRE_PUCHAR eptr, int length, match_data *md, + BOOL caseless) { -USPTR p = md->start_subject + md->offset_vector[offset]; +PCRE_PUCHAR eptr_start = eptr; +register PCRE_PUCHAR p = md->start_subject + md->offset_vector[offset]; #ifdef PCRE_DEBUG if (eptr >= md->end_subject) @@ -162,27 +162,37 @@ printf("\n"); #endif -/* Always fail if not enough characters left */ +/* Always fail if reference not set (and not JavaScript compatible - in that +case the length is passed as zero). */ -if (length > md->end_subject - eptr) return FALSE; +if (length < 0) return -1; /* 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) +if (caseless) { -#ifdef SUPPORT_UTF8 +#ifdef SUPPORT_UTF #ifdef SUPPORT_UCP - if (md->utf8) + if (md->utf) { - USPTR endptr = eptr + length; - while (eptr < endptr) + /* Match characters up to the end of the reference. NOTE: the number of + bytes matched may differ, because there are some characters whose upper and + lower case versions code as different numbers of bytes. For example, U+023A + (2 bytes in UTF-8) is the upper case version of U+2C65 (3 bytes in UTF-8); + a sequence of 3 of the former uses 6 bytes, as does a sequence of two of + the latter. It is important, therefore, to check the length along the + reference, not along the subject (earlier code did this wrong). */ + + PCRE_PUCHAR endptr = p + length; + while (p < endptr) { int c, d; + if (eptr >= md->end_subject) return -2; /* Partial match */ GETCHARINC(c, eptr); GETCHARINC(d, p); - if (c != d && c != UCD_OTHERCASE(d)) return FALSE; + if (c != d && c != UCD_OTHERCASE(d)) return -1; } } else @@ -191,18 +201,30 @@ /* 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; } + { + while (length-- > 0) + { + if (eptr >= md->end_subject) return -2; /* Partial match */ + if (TABLE_GET(*p, md->lcc, *p) != TABLE_GET(*eptr, md->lcc, *eptr)) return -1; + p++; + eptr++; + } + } } /* 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; } + { + while (length-- > 0) + { + if (eptr >= md->end_subject) return -2; /* Partial match */ + if (*p++ != *eptr++) return -1; + } + } -return TRUE; +return (int)(eptr - eptr_start); } @@ -254,7 +276,7 @@ RM31, RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40, RM41, RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50, RM51, RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60, - RM61, RM62 }; + RM61, RM62, RM63, RM64, RM65, RM66 }; /* These versions of the macros use the stack, as normal. There are debugging versions and production versions. Note that the "rw" argument of RMATCH isn't @@ -264,10 +286,10 @@ #define REGISTER register #ifdef PCRE_DEBUG -#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw) \ +#define RMATCH(ra,rb,rc,rd,re,rw) \ { \ printf("match() called in line %d\n", __LINE__); \ - rrc = match(ra,rb,mstart,markptr,rc,rd,re,rf,rg,rdepth+1); \ + rrc = match(ra,rb,mstart,rc,rd,re,rdepth+1); \ printf("to line %d\n", __LINE__); \ } #define RRETURN(ra) \ @@ -276,8 +298,8 @@ return ra; \ } #else -#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw) \ - rrc = match(ra,rb,mstart,markptr,rc,rd,re,rf,rg,rdepth+1) +#define RMATCH(ra,rb,rc,rd,re,rw) \ + rrc = match(ra,rb,mstart,rc,rd,re,rdepth+1) #define RRETURN(ra) return ra #endif @@ -290,19 +312,22 @@ #define REGISTER -#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw)\ +#define RMATCH(ra,rb,rc,rd,re,rw)\ {\ - heapframe *newframe = (heapframe *)(pcre_stack_malloc)(sizeof(heapframe));\ - if (newframe == NULL) RRETURN(PCRE_ERROR_NOMEMORY);\ - frame->Xwhere = rw; \ + heapframe *newframe = frame->Xnextframe;\ + if (newframe == NULL)\ + {\ + newframe = (heapframe *)(PUBL(stack_malloc))(sizeof(heapframe));\ + if (newframe == NULL) RRETURN(PCRE_ERROR_NOMEMORY);\ + newframe->Xnextframe = NULL;\ + frame->Xnextframe = newframe;\ + }\ + frame->Xwhere = rw;\ newframe->Xeptr = ra;\ newframe->Xecode = rb;\ newframe->Xmstart = mstart;\ - newframe->Xmarkptr = markptr;\ newframe->Xoffset_top = rc;\ - newframe->Xims = re;\ - newframe->Xeptrb = rf;\ - newframe->Xflags = rg;\ + newframe->Xeptrb = re;\ newframe->Xrdepth = frame->Xrdepth + 1;\ newframe->Xprevframe = frame;\ frame = newframe;\ @@ -316,7 +341,6 @@ {\ heapframe *oldframe = frame;\ frame = oldframe->Xprevframe;\ - (pcre_stack_free)(oldframe);\ if (frame != NULL)\ {\ rrc = ra;\ @@ -330,30 +354,28 @@ typedef struct heapframe { struct heapframe *Xprevframe; + struct heapframe *Xnextframe; /* Function arguments that may change */ - USPTR Xeptr; - const uschar *Xecode; - USPTR Xmstart; - USPTR Xmarkptr; + PCRE_PUCHAR Xeptr; + const pcre_uchar *Xecode; + PCRE_PUCHAR Xmstart; int Xoffset_top; - long int Xims; eptrblock *Xeptrb; - int Xflags; unsigned int Xrdepth; /* Function local variables */ - USPTR Xcallpat; -#ifdef SUPPORT_UTF8 - USPTR Xcharptr; -#endif - USPTR Xdata; - USPTR Xnext; - USPTR Xpp; - USPTR Xprev; - USPTR Xsaved_eptr; + PCRE_PUCHAR Xcallpat; +#ifdef SUPPORT_UTF + PCRE_PUCHAR Xcharptr; +#endif + PCRE_PUCHAR Xdata; + PCRE_PUCHAR Xnext; + PCRE_PUCHAR Xpp; + PCRE_PUCHAR Xprev; + PCRE_PUCHAR Xsaved_eptr; recursion_info Xnew_recursive; @@ -361,17 +383,12 @@ BOOL Xcondition; BOOL Xprev_is_word; - unsigned long int Xoriginal_ims; - #ifdef SUPPORT_UCP int Xprop_type; int Xprop_value; int Xprop_fail_result; - int Xprop_category; - int Xprop_chartype; - int Xprop_script; int Xoclength; - uschar Xocchars[8]; + pcre_uchar Xocchars[6]; #endif int Xcodelink; @@ -413,7 +430,7 @@ same response. */ /* These macros pack up tests that are used for partial matching, and which -appears several times in the code. We set the "hit end" flag if the pointer is +appear several times in the code. We set the "hit end" flag if the pointer is at the end of the subject and also past the start of the subject (i.e. something has been matched). For hard partial matching, we then return immediately. The second one is used when we already know we are past the end of @@ -424,19 +441,19 @@ eptr > md->start_used_ptr) \ { \ md->hitend = TRUE; \ - if (md->partial > 1) MRRETURN(PCRE_ERROR_PARTIAL); \ + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); \ } #define SCHECK_PARTIAL()\ if (md->partial != 0 && eptr > md->start_used_ptr) \ { \ md->hitend = TRUE; \ - if (md->partial > 1) MRRETURN(PCRE_ERROR_PARTIAL); \ + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); \ } /* Performance note: It might be tempting to extract commonly used fields from -the md structure (e.g. utf8, end_subject) into individual variables to improve +the md structure (e.g. utf, end_subject) into individual variables to improve performance. Tests using gcc on a SPARC disproved this; in the first case, it made performance worse. @@ -445,16 +462,10 @@ ecode pointer to current position in compiled code mstart pointer to the current match start position (can be modified by encountering \K) - markptr pointer to the most recent MARK name, or NULL offset_top current top pointer md pointer to "static" info for the match - ims current /i, /m, and /s options eptrb pointer to chain of blocks containing eptr at start of brackets - for testing for empty matches - flags can contain - match_condassert - this is an assertion condition - match_cbegroup - this is the start of an unlimited repeat - group that can match an empty string rdepth the recursion depth Returns: MATCH_MATCH if matched ) these values are >= 0 @@ -465,9 +476,9 @@ */ static int -match(REGISTER USPTR eptr, REGISTER const uschar *ecode, USPTR mstart, - const uschar *markptr, int offset_top, match_data *md, unsigned long int ims, - eptrblock *eptrb, int flags, unsigned int rdepth) +match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode, + PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb, + unsigned int rdepth) { /* These variables do not need to be preserved over recursion in this function, so they can be ordinary variables in all cases. Mark some of them with @@ -476,31 +487,29 @@ register int rrc; /* Returns from recursive calls */ register int i; /* Used for loops not involving calls to RMATCH() */ register unsigned int c; /* Character values not kept over RMATCH() calls */ -register BOOL utf8; /* Local copy of UTF-8 flag for speed */ +register BOOL utf; /* Local copy of UTF flag for speed */ BOOL minimize, possessive; /* Quantifier options */ +BOOL caseless; int condcode; /* When recursion is not being used, all "local" variables that have to be -preserved over calls to RMATCH() are part of a "frame" which is obtained from -heap storage. Set up the top-level frame here; others are obtained from the -heap whenever RMATCH() does a "recursion". See the macro definitions above. */ +preserved over calls to RMATCH() are part of a "frame". We set up the top-level +frame on the stack here; subsequent instantiations are obtained from the heap +whenever RMATCH() does a "recursion". See the macro definitions above. Putting +the top-level on the stack rather than malloc-ing them all gives a performance +boost in many cases where there is not much "recursion". */ #ifdef NO_RECURSE -heapframe *frame = (heapframe *)(pcre_stack_malloc)(sizeof(heapframe)); -if (frame == NULL) RRETURN(PCRE_ERROR_NOMEMORY); -frame->Xprevframe = NULL; /* Marks the top level */ +heapframe *frame = (heapframe *)md->match_frames_base; /* Copy in the original argument variables */ frame->Xeptr = eptr; frame->Xecode = ecode; frame->Xmstart = mstart; -frame->Xmarkptr = markptr; frame->Xoffset_top = offset_top; -frame->Xims = ims; frame->Xeptrb = eptrb; -frame->Xflags = flags; frame->Xrdepth = rdepth; /* This is where control jumps back to to effect "recursion" */ @@ -512,16 +521,13 @@ #define eptr frame->Xeptr #define ecode frame->Xecode #define mstart frame->Xmstart -#define markptr frame->Xmarkptr #define offset_top frame->Xoffset_top -#define ims frame->Xims #define eptrb frame->Xeptrb -#define flags frame->Xflags #define rdepth frame->Xrdepth /* Ditto for the local variables */ -#ifdef SUPPORT_UTF8 +#ifdef SUPPORT_UTF #define charptr frame->Xcharptr #endif #define callpat frame->Xcallpat @@ -538,15 +544,10 @@ #define condition frame->Xcondition #define prev_is_word frame->Xprev_is_word -#define original_ims frame->Xoriginal_ims - #ifdef SUPPORT_UCP #define prop_type frame->Xprop_type #define prop_value frame->Xprop_value #define prop_fail_result frame->Xprop_fail_result -#define prop_category frame->Xprop_category -#define prop_chartype frame->Xprop_chartype -#define prop_script frame->Xprop_script #define oclength frame->Xoclength #define occhars frame->Xocchars #endif @@ -576,34 +577,36 @@ #define fi i #define fc c +/* Many of the following variables are used only in small blocks of the code. +My normal style of coding would have declared them within each of those blocks. +However, in order to accommodate the version of this code that uses an external +"stack" implemented on the heap, it is easier to declare them all here, so the +declarations can be cut out in a block. The only declarations within blocks +below are for variables that do not have to be preserved over a recursive call +to RMATCH(). */ + +#ifdef SUPPORT_UTF +const pcre_uchar *charptr; +#endif +const pcre_uchar *callpat; +const pcre_uchar *data; +const pcre_uchar *next; +PCRE_PUCHAR pp; +const pcre_uchar *prev; +PCRE_PUCHAR saved_eptr; + +recursion_info new_recursive; -#ifdef SUPPORT_UTF8 /* Many of these variables are used only */ -const uschar *charptr; /* in small blocks of the code. My normal */ -#endif /* style of coding would have declared */ -const uschar *callpat; /* them within each of those blocks. */ -const uschar *data; /* However, in order to accommodate the */ -const uschar *next; /* version of this code that uses an */ -USPTR pp; /* external "stack" implemented on the */ -const uschar *prev; /* heap, it is easier to declare them all */ -USPTR saved_eptr; /* here, so the declarations can be cut */ - /* out in a block. The only declarations */ -recursion_info new_recursive; /* within blocks below are for variables */ - /* that do not have to be preserved over */ -BOOL cur_is_word; /* a recursive call to RMATCH(). */ +BOOL cur_is_word; BOOL condition; BOOL prev_is_word; -unsigned long int original_ims; - #ifdef SUPPORT_UCP int prop_type; int prop_value; int prop_fail_result; -int prop_category; -int prop_chartype; -int prop_script; int oclength; -uschar occhars[8]; +pcre_uchar occhars[6]; #endif int codelink; @@ -619,8 +622,38 @@ int stacksave[REC_STACK_SAVE_MAX]; eptrblock newptrb; + +/* There is a special fudge for calling match() in a way that causes it to +measure the size of its basic stack frame when the stack is being used for +recursion. The second argument (ecode) being NULL triggers this behaviour. It +cannot normally ever be NULL. The return is the negated value of the frame +size. */ + +if (ecode == NULL) + { + if (rdepth == 0) + return match((PCRE_PUCHAR)&rdepth, NULL, NULL, 0, NULL, NULL, 1); + else + { + int len = (char *)&rdepth - (char *)eptr; + return (len > 0)? -len : len; + } + } #endif /* NO_RECURSE */ +/* To save space on the stack and in the heap frame, I have doubled up on some +of the local variables that are used only in localised parts of the code, but +still need to be preserved over recursive calls of match(). These macros define +the alternative names that are used. */ + +#define allow_zero cur_is_word +#define cbegroup condition +#define code_offset codelink +#define condassert condition +#define matched_once prev_is_word +#define foc number +#define save_mark data + /* These statements are here to stop the compiler complaining about unitialized variables. */ @@ -645,10 +678,10 @@ complicated macro. It has to be used in one particular way. This shouldn't, however, impact performance when true recursion is being used. */ -#ifdef SUPPORT_UTF8 -utf8 = md->utf8; /* Local copy of the flag */ +#ifdef SUPPORT_UTF +utf = md->utf; /* Local copy of the flag */ #else -utf8 = FALSE; +utf = FALSE; #endif /* First check that we haven't called match() too many times, or that we @@ -657,22 +690,24 @@ if (md->match_call_count++ >= md->match_limit) RRETURN(PCRE_ERROR_MATCHLIMIT); if (rdepth >= md->match_limit_recursion) RRETURN(PCRE_ERROR_RECURSIONLIMIT); -original_ims = ims; /* Save for resetting on ')' */ - /* At the start of a group with an unlimited repeat that may match an empty -string, the match_cbegroup flag is set. When this is the case, add the current -subject pointer to the chain of such remembered pointers, to be checked when we -hit the closing ket, in order to break infinite loops that match no characters. -When match() is called in other circumstances, don't add to the chain. The -match_cbegroup flag must NOT be used with tail recursion, because the memory -block that is used is on the stack, so a new one may be required for each -match(). */ +string, the variable md->match_function_type is set to MATCH_CBEGROUP. It is +done this way to save having to use another function argument, which would take +up space on the stack. See also MATCH_CONDASSERT below. + +When MATCH_CBEGROUP is set, add the current subject pointer to the chain of +such remembered pointers, to be checked when we hit the closing ket, in order +to break infinite loops that match no characters. When match() is called in +other circumstances, don't add to the chain. The MATCH_CBEGROUP feature must +NOT be used with tail recursion, because the memory block that is used is on +the stack, so a new one may be required for each match(). */ -if ((flags & match_cbegroup) != 0) +if (md->match_function_type == MATCH_CBEGROUP) { newptrb.epb_saved_eptr = eptr; newptrb.epb_prev = eptrb; eptrb = &newptrb; + md->match_function_type = 0; } /* Now start processing the opcodes. */ @@ -685,9 +720,12 @@ switch(op) { case OP_MARK: - markptr = ecode + 2; - RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, - ims, eptrb, flags, RM55); + md->nomatch_mark = ecode + 2; + md->mark = NULL; /* In case previously set by assertion */ + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md, + eptrb, RM55); + if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) && + md->mark == NULL) md->mark = ecode + 2; /* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an argument, and we must check whether that argument matches this MARK's @@ -696,98 +734,192 @@ position and return MATCH_SKIP. Otherwise, pass back the return code unaltered. */ - if (rrc == MATCH_SKIP_ARG && - strcmp((char *)markptr, (char *)(md->start_match_ptr)) == 0) + else if (rrc == MATCH_SKIP_ARG && + STRCMP_UC_UC(ecode + 2, md->start_match_ptr) == 0) { md->start_match_ptr = eptr; RRETURN(MATCH_SKIP); } - - if (md->mark == NULL) md->mark = markptr; RRETURN(rrc); case OP_FAIL: - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); /* COMMIT overrides PRUNE, SKIP, and THEN */ case OP_COMMIT: - RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, - ims, eptrb, flags, RM52); + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, + eptrb, RM52); if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_SKIP && rrc != MATCH_SKIP_ARG && rrc != MATCH_THEN) RRETURN(rrc); - MRRETURN(MATCH_COMMIT); + RRETURN(MATCH_COMMIT); /* PRUNE overrides THEN */ case OP_PRUNE: - RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, - ims, eptrb, flags, RM51); + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, + eptrb, RM51); if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); - MRRETURN(MATCH_PRUNE); + RRETURN(MATCH_PRUNE); case OP_PRUNE_ARG: - RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, - ims, eptrb, flags, RM56); + md->nomatch_mark = ecode + 2; + md->mark = NULL; /* In case previously set by assertion */ + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md, + eptrb, RM56); + if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) && + md->mark == NULL) md->mark = ecode + 2; if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); - md->mark = ecode + 2; RRETURN(MATCH_PRUNE); /* SKIP overrides PRUNE and THEN */ case OP_SKIP: - RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, - ims, eptrb, flags, RM53); + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, + eptrb, RM53); if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN) RRETURN(rrc); md->start_match_ptr = eptr; /* Pass back current position */ - MRRETURN(MATCH_SKIP); + RRETURN(MATCH_SKIP); + + /* Note that, for Perl compatibility, SKIP with an argument does NOT set + nomatch_mark. There is a flag that disables this opcode when re-matching a + pattern that ended with a SKIP for which there was not a matching MARK. */ case OP_SKIP_ARG: - RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, - ims, eptrb, flags, RM57); + if (md->ignore_skip_arg) + { + ecode += PRIV(OP_lengths)[*ecode] + ecode[1]; + break; + } + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md, + eptrb, RM57); if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN) RRETURN(rrc); /* Pass back the current skip name by overloading md->start_match_ptr and returning the special MATCH_SKIP_ARG return code. This will either be - caught by a matching MARK, or get to the top, where it is treated the same - as PRUNE. */ + caught by a matching MARK, or get to the top, where it causes a rematch + with the md->ignore_skip_arg flag set. */ md->start_match_ptr = ecode + 2; RRETURN(MATCH_SKIP_ARG); - /* For THEN (and THEN_ARG) we pass back the address of the bracket or - the alt that is at the start of the current branch. This makes it possible - to skip back past alternatives that precede the THEN within the current - branch. */ + /* For THEN (and THEN_ARG) we pass back the address of the opcode, so that + the branch in which it occurs can be determined. Overload the start of + match pointer to do this. */ case OP_THEN: - RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, - ims, eptrb, flags, RM54); + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, + eptrb, RM54); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - md->start_match_ptr = ecode - GET(ecode, 1); - MRRETURN(MATCH_THEN); + md->start_match_ptr = ecode; + RRETURN(MATCH_THEN); case OP_THEN_ARG: - RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1+LINK_SIZE], - offset_top, md, ims, eptrb, flags, RM58); + md->nomatch_mark = ecode + 2; + md->mark = NULL; /* In case previously set by assertion */ + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, + md, eptrb, RM58); + if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) && + md->mark == NULL) md->mark = ecode + 2; if (rrc != MATCH_NOMATCH) RRETURN(rrc); - md->start_match_ptr = ecode - GET(ecode, 1); - md->mark = ecode + LINK_SIZE + 2; + md->start_match_ptr = ecode; RRETURN(MATCH_THEN); - /* Handle a capturing bracket. If there is space in the offset vector, save - the current subject position in the working slot at the top of the vector. - We mustn't change the current values of the data slot, because they may be - set from a previous iteration of this group, and be referred to by a - reference inside the group. - - If the bracket fails to match, we need to restore this value and also the - values of the final offsets, in case they were set by a previous iteration - of the same bracket. + /* Handle an atomic group that does not contain any capturing parentheses. + This can be handled like an assertion. Prior to 8.13, all atomic groups + were handled this way. In 8.13, the code was changed as below for ONCE, so + that backups pass through the group and thereby reset captured values. + However, this uses a lot more stack, so in 8.20, atomic groups that do not + contain any captures generate OP_ONCE_NC, which can be handled in the old, + less stack intensive way. + + Check the alternative branches in turn - the matching won't pass the KET + for this kind of subpattern. If any one branch matches, we carry on as at + the end of a normal bracket, leaving the subject pointer, but resetting + the start-of-match value in case it was changed by \K. */ + + case OP_ONCE_NC: + prev = ecode; + saved_eptr = eptr; + save_mark = md->mark; + do + { + RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM64); + if (rrc == MATCH_MATCH) /* Note: _not_ MATCH_ACCEPT */ + { + mstart = md->start_match_ptr; + break; + } + if (rrc == MATCH_THEN) + { + next = ecode + GET(ecode,1); + if (md->start_match_ptr < next && + (*ecode == OP_ALT || *next == OP_ALT)) + rrc = MATCH_NOMATCH; + } + + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + ecode += GET(ecode,1); + md->mark = save_mark; + } + while (*ecode == OP_ALT); + + /* If hit the end of the group (which could be repeated), fail */ + + if (*ecode != OP_ONCE_NC && *ecode != OP_ALT) RRETURN(MATCH_NOMATCH); + + /* Continue as from after the group, updating the offsets high water + mark, since extracts may have been taken. */ + + do ecode += GET(ecode, 1); while (*ecode == OP_ALT); + + offset_top = md->end_offset_top; + eptr = md->end_match_ptr; + + /* For a non-repeating ket, just continue at this level. This also + happens for a repeating ket if no characters were matched in the group. + This is the forcible breaking of infinite loops as implemented in Perl + 5.005. */ + + if (*ecode == OP_KET || eptr == saved_eptr) + { + ecode += 1+LINK_SIZE; + break; + } + + /* The repeating kets try the rest of the pattern or restart from the + preceding bracket, in the appropriate order. The second "call" of match() + uses tail recursion, to avoid using another stack frame. */ + + if (*ecode == OP_KETRMIN) + { + RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM65); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + ecode = prev; + goto TAIL_RECURSE; + } + else /* OP_KETRMAX */ + { + RMATCH(eptr, prev, offset_top, md, eptrb, RM66); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + ecode += 1 + LINK_SIZE; + goto TAIL_RECURSE; + } + /* Control never gets here */ + + /* Handle a capturing bracket, other than those that are possessive with an + unlimited repeat. If there is space in the offset vector, save the current + subject position in the working slot at the top of the vector. We mustn't + change the current values of the data slot, because they may be set from a + previous iteration of this group, and be referred to by a reference inside + the group. A failure to match might occur after the group has succeeded, + if something later on doesn't match. For this reason, we need to restore + the working value and also the values of the final offsets, in case they + were set by a previous iteration of the same bracket. If there isn't enough space in the offset vector, treat this as if it were a non-capturing bracket. Don't worry about setting the flag for the error @@ -811,32 +943,55 @@ save_offset2 = md->offset_vector[offset+1]; save_offset3 = md->offset_vector[md->offset_end - number]; save_capture_last = md->capture_last; + save_mark = md->mark; DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3)); md->offset_vector[md->offset_end - number] = (int)(eptr - md->start_subject); - flags = (op == OP_SCBRA)? match_cbegroup : 0; - do + for (;;) { - RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, - ims, eptrb, flags, RM1); - if (rrc != MATCH_NOMATCH && - (rrc != MATCH_THEN || md->start_match_ptr != ecode)) - RRETURN(rrc); + if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP; + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, + eptrb, RM1); + if (rrc == MATCH_ONCE) break; /* Backing up through an atomic group */ + + /* If we backed up to a THEN, check whether it is within the current + branch by comparing the address of the THEN that is passed back with + the end of the branch. If it is within the current branch, and the + branch is one of two or more alternatives (it either starts or ends + with OP_ALT), we have reached the limit of THEN's action, so convert + the return code to NOMATCH, which will cause normal backtracking to + happen from now on. Otherwise, THEN is passed back to an outer + alternative. This implements Perl's treatment of parenthesized groups, + where a group not containing | does not affect the current alternative, + that is, (X) is NOT the same as (X|(*F)). */ + + if (rrc == MATCH_THEN) + { + next = ecode + GET(ecode,1); + if (md->start_match_ptr < next && + (*ecode == OP_ALT || *next == OP_ALT)) + rrc = MATCH_NOMATCH; + } + + /* Anything other than NOMATCH is passed back. */ + + if (rrc != MATCH_NOMATCH) RRETURN(rrc); md->capture_last = save_capture_last; ecode += GET(ecode, 1); + md->mark = save_mark; + if (*ecode != OP_ALT) break; } - while (*ecode == OP_ALT); DPRINTF(("bracket %d failed\n", number)); - md->offset_vector[offset] = save_offset1; md->offset_vector[offset+1] = save_offset2; md->offset_vector[md->offset_end - number] = save_offset3; - if (rrc != MATCH_THEN) md->mark = markptr; - RRETURN(MATCH_NOMATCH); + /* At this point, rrc will be one of MATCH_ONCE or MATCH_NOMATCH. */ + + RRETURN(rrc); } /* FALL THROUGH ... Insufficient room for saving captured contents. Treat @@ -850,69 +1005,266 @@ /* VVVVVVVVVVVVVVVVVVVVVVVVV */ /* VVVVVVVVVVVVVVVVVVVVVVVVV */ - /* Non-capturing bracket. Loop for all the alternatives. When we get to the - final alternative within the brackets, we would return the result of a - recursive call to match() whatever happened. We can reduce stack usage by - turning this into a tail recursion, except in the case when match_cbegroup - is set.*/ + /* Non-capturing or atomic group, except for possessive with unlimited + repeat and ONCE group with no captures. Loop for all the alternatives. + + When we get to the final alternative within the brackets, we used to return + the result of a recursive call to match() whatever happened so it was + possible to reduce stack usage by turning this into a tail recursion, + except in the case of a possibly empty group. However, now that there is + the possiblity of (*THEN) occurring in the final alternative, this + optimization is no longer always possible. + + We can optimize if we know there are no (*THEN)s in the pattern; at present + this is the best that can be done. + + MATCH_ONCE is returned when the end of an atomic group is successfully + reached, but subsequent matching fails. It passes back up the tree (causing + captured values to be reset) until the original atomic group level is + reached. This is tested by comparing md->once_target with the start of the + group. At this point, the return is converted into MATCH_NOMATCH so that + previous backup points can be taken. */ + case OP_ONCE: case OP_BRA: case OP_SBRA: DPRINTF(("start non-capturing bracket\n")); - flags = (op >= OP_SBRA)? match_cbegroup : 0; + for (;;) { - if (ecode[GET(ecode, 1)] != OP_ALT) /* Final alternative */ + if (op >= OP_SBRA || op == OP_ONCE) + md->match_function_type = MATCH_CBEGROUP; + + /* If this is not a possibly empty group, and there are no (*THEN)s in + the pattern, and this is the final alternative, optimize as described + above. */ + + else if (!md->hasthen && ecode[GET(ecode, 1)] != OP_ALT) + { + ecode += PRIV(OP_lengths)[*ecode]; + goto TAIL_RECURSE; + } + + /* In all other cases, we have to make another call to match(). */ + + save_mark = md->mark; + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, eptrb, + RM2); + + /* See comment in the code for capturing groups above about handling + THEN. */ + + if (rrc == MATCH_THEN) { - if (flags == 0) /* Not a possibly empty group */ + next = ecode + GET(ecode,1); + if (md->start_match_ptr < next && + (*ecode == OP_ALT || *next == OP_ALT)) + rrc = MATCH_NOMATCH; + } + + if (rrc != MATCH_NOMATCH) + { + if (rrc == MATCH_ONCE) { - ecode += _pcre_OP_lengths[*ecode]; - DPRINTF(("bracket 0 tail recursion\n")); - goto TAIL_RECURSE; + const pcre_uchar *scode = ecode; + if (*scode != OP_ONCE) /* If not at start, find it */ + { + while (*scode == OP_ALT) scode += GET(scode, 1); + scode -= GET(scode, 1); + } + if (md->once_target == scode) rrc = MATCH_NOMATCH; } + RRETURN(rrc); + } + ecode += GET(ecode, 1); + md->mark = save_mark; + if (*ecode != OP_ALT) break; + } - /* Possibly empty group; can't use tail recursion. */ + RRETURN(MATCH_NOMATCH); - RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, ims, - eptrb, flags, RM48); - if (rrc == MATCH_NOMATCH) md->mark = markptr; - RRETURN(rrc); + /* Handle possessive capturing brackets with an unlimited repeat. We come + here from BRAZERO with allow_zero set TRUE. The offset_vector values are + handled similarly to the normal case above. However, the matching is + different. The end of these brackets will always be OP_KETRPOS, which + returns MATCH_KETRPOS without going further in the pattern. By this means + we can handle the group by iteration rather than recursion, thereby + reducing the amount of stack needed. */ + + case OP_CBRAPOS: + case OP_SCBRAPOS: + allow_zero = FALSE; + + POSSESSIVE_CAPTURE: + number = GET2(ecode, 1+LINK_SIZE); + offset = number << 1; + +#ifdef PCRE_DEBUG + printf("start possessive bracket %d\n", number); + printf("subject="); + pchars(eptr, 16, TRUE, md); + printf("\n"); +#endif + + if (offset < md->offset_max) + { + matched_once = FALSE; + code_offset = (int)(ecode - md->start_code); + + save_offset1 = md->offset_vector[offset]; + save_offset2 = md->offset_vector[offset+1]; + save_offset3 = md->offset_vector[md->offset_end - number]; + save_capture_last = md->capture_last; + + DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3)); + + /* Each time round the loop, save the current subject position for use + when the group matches. For MATCH_MATCH, the group has matched, so we + restart it with a new subject starting position, remembering that we had + at least one match. For MATCH_NOMATCH, carry on with the alternatives, as + usual. If we haven't matched any alternatives in any iteration, check to + see if a previous iteration matched. If so, the group has matched; + continue from afterwards. Otherwise it has failed; restore the previous + capture values before returning NOMATCH. */ + + for (;;) + { + md->offset_vector[md->offset_end - number] = + (int)(eptr - md->start_subject); + if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP; + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, + eptrb, RM63); + if (rrc == MATCH_KETRPOS) + { + offset_top = md->end_offset_top; + eptr = md->end_match_ptr; + ecode = md->start_code + code_offset; + save_capture_last = md->capture_last; + matched_once = TRUE; + continue; + } + + /* See comment in the code for capturing groups above about handling + THEN. */ + + if (rrc == MATCH_THEN) + { + next = ecode + GET(ecode,1); + if (md->start_match_ptr < next && + (*ecode == OP_ALT || *next == OP_ALT)) + rrc = MATCH_NOMATCH; + } + + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + md->capture_last = save_capture_last; + ecode += GET(ecode, 1); + if (*ecode != OP_ALT) break; + } + + if (!matched_once) + { + md->offset_vector[offset] = save_offset1; + md->offset_vector[offset+1] = save_offset2; + md->offset_vector[md->offset_end - number] = save_offset3; } - /* For non-final alternatives, continue the loop for a NOMATCH result; - otherwise return. */ + if (allow_zero || matched_once) + { + ecode += 1 + LINK_SIZE; + break; + } - RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, ims, - eptrb, flags, RM2); - if (rrc != MATCH_NOMATCH && - (rrc != MATCH_THEN || md->start_match_ptr != ecode)) - RRETURN(rrc); + RRETURN(MATCH_NOMATCH); + } + + /* FALL THROUGH ... Insufficient room for saving captured contents. Treat + as a non-capturing bracket. */ + + /* VVVVVVVVVVVVVVVVVVVVVVVVV */ + /* VVVVVVVVVVVVVVVVVVVVVVVVV */ + + DPRINTF(("insufficient capture room: treat as non-capturing\n")); + + /* VVVVVVVVVVVVVVVVVVVVVVVVV */ + /* VVVVVVVVVVVVVVVVVVVVVVVVV */ + + /* Non-capturing possessive bracket with unlimited repeat. We come here + from BRAZERO with allow_zero = TRUE. The code is similar to the above, + without the capturing complication. It is written out separately for speed + and cleanliness. */ + + case OP_BRAPOS: + case OP_SBRAPOS: + allow_zero = FALSE; + + POSSESSIVE_NON_CAPTURE: + matched_once = FALSE; + code_offset = (int)(ecode - md->start_code); + + for (;;) + { + if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP; + RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, + eptrb, RM48); + if (rrc == MATCH_KETRPOS) + { + offset_top = md->end_offset_top; + eptr = md->end_match_ptr; + ecode = md->start_code + code_offset; + matched_once = TRUE; + continue; + } + + /* See comment in the code for capturing groups above about handling + THEN. */ + + if (rrc == MATCH_THEN) + { + next = ecode + GET(ecode,1); + if (md->start_match_ptr < next && + (*ecode == OP_ALT || *next == OP_ALT)) + rrc = MATCH_NOMATCH; + } + + if (rrc != MATCH_NOMATCH) RRETURN(rrc); ecode += GET(ecode, 1); + if (*ecode != OP_ALT) break; } + + if (matched_once || allow_zero) + { + ecode += 1 + LINK_SIZE; + break; + } + RRETURN(MATCH_NOMATCH); + /* Control never reaches here. */ /* Conditional group: compilation checked that there are no more than two branches. If the condition is false, skipping the first branch takes us past the end if there is only one branch, but that's OK because that is - exactly what going to the ket would do. As there is only one branch to be - obeyed, we can use tail recursion to avoid using another stack frame. */ + exactly what going to the ket would do. */ case OP_COND: case OP_SCOND: - codelink= GET(ecode, 1); + codelink = GET(ecode, 1); /* Because of the way auto-callout works during compile, a callout item is inserted between OP_COND and an assertion condition. */ if (ecode[LINK_SIZE+1] == OP_CALLOUT) { - if (pcre_callout != NULL) + if (PUBL(callout) != NULL) { - pcre_callout_block cb; - cb.version = 1; /* Version 1 of the callout block */ + PUBL(callout_block) cb; + cb.version = 2; /* Version 1 of the callout block */ cb.callout_number = ecode[LINK_SIZE+2]; cb.offset_vector = md->offset_vector; +#ifdef COMPILE_PCRE8 cb.subject = (PCRE_SPTR)md->start_subject; +#else + cb.subject = (PCRE_SPTR16)md->start_subject; +#endif cb.subject_length = (int)(md->end_subject - md->start_subject); cb.start_match = (int)(mstart - md->start_subject); cb.current_position = (int)(eptr - md->start_subject); @@ -921,10 +1273,11 @@ cb.capture_top = offset_top/2; cb.capture_last = md->capture_last; cb.callout_data = md->callout_data; - if ((rrc = (*pcre_callout)(&cb)) > 0) MRRETURN(MATCH_NOMATCH); + cb.mark = md->nomatch_mark; + if ((rrc = (*PUBL(callout))(&cb)) > 0) RRETURN(MATCH_NOMATCH); if (rrc < 0) RRETURN(rrc); } - ecode += _pcre_OP_lengths[OP_CALLOUT]; + ecode += PRIV(OP_lengths)[OP_CALLOUT]; } condcode = ecode[LINK_SIZE+1]; @@ -941,16 +1294,16 @@ else { int recno = GET2(ecode, LINK_SIZE + 2); /* Recursion group number*/ - condition = (recno == RREF_ANY || recno == md->recursive->group_num); + condition = (recno == RREF_ANY || recno == md->recursive->group_num); /* If the test is for recursion into a specific subpattern, and it is false, but the test was set up by name, scan the table to see if the name refers to any other numbers, and test them. The condition is true if any one is set. */ - if (!condition && condcode == OP_NRREF && recno != RREF_ANY) + if (!condition && condcode == OP_NRREF) { - uschar *slotA = md->name_table; + pcre_uchar *slotA = md->name_table; for (i = 0; i < md->name_count; i++) { if (GET2(slotA, 0) == recno) break; @@ -963,11 +1316,11 @@ if (i < md->name_count) { - uschar *slotB = slotA; + pcre_uchar *slotB = slotA; while (slotB > md->name_table) { slotB -= md->name_entry_size; - if (strcmp((char *)slotA + 2, (char *)slotB + 2) == 0) + if (STRCMP_UC_UC(slotA + IMM2_SIZE, slotB + IMM2_SIZE) == 0) { condition = GET2(slotB, 0) == md->recursive->group_num; if (condition) break; @@ -983,7 +1336,7 @@ for (i++; i < md->name_count; i++) { slotB += md->name_entry_size; - if (strcmp((char *)slotA + 2, (char *)slotB + 2) == 0) + if (STRCMP_UC_UC(slotA + IMM2_SIZE, slotB + IMM2_SIZE) == 0) { condition = GET2(slotB, 0) == md->recursive->group_num; if (condition) break; @@ -996,7 +1349,7 @@ /* Chose branch according to the condition */ - ecode += condition? 3 : GET(ecode, 1); + ecode += condition? 1 + IMM2_SIZE : GET(ecode, 1); } } @@ -1013,7 +1366,7 @@ if (!condition && condcode == OP_NCREF) { int refno = offset >> 1; - uschar *slotA = md->name_table; + pcre_uchar *slotA = md->name_table; for (i = 0; i < md->name_count; i++) { @@ -1027,11 +1380,11 @@ if (i < md->name_count) { - uschar *slotB = slotA; + pcre_uchar *slotB = slotA; while (slotB > md->name_table) { slotB -= md->name_entry_size; - if (strcmp((char *)slotA + 2, (char *)slotB + 2) == 0) + if (STRCMP_UC_UC(slotA + IMM2_SIZE, slotB + IMM2_SIZE) == 0) { offset = GET2(slotB, 0) << 1; condition = offset < offset_top && @@ -1049,7 +1402,7 @@ for (i++; i < md->name_count; i++) { slotB += md->name_entry_size; - if (strcmp((char *)slotA + 2, (char *)slotB + 2) == 0) + if (STRCMP_UC_UC(slotA + IMM2_SIZE, slotB + IMM2_SIZE) == 0) { offset = GET2(slotB, 0) << 1; condition = offset < offset_top && @@ -1064,7 +1417,7 @@ /* Chose branch according to the condition */ - ecode += condition? 3 : GET(ecode, 1); + ecode += condition? 1 + IMM2_SIZE : GET(ecode, 1); } else if (condcode == OP_DEF) /* DEFINE - always false */ @@ -1074,21 +1427,26 @@ } /* The condition is an assertion. Call match() to evaluate it - setting - the final argument match_condassert causes it to stop at the end of an - assertion. */ + md->match_function_type to MATCH_CONDASSERT causes it to stop at the end of + an assertion. */ else { - RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, - match_condassert, RM3); + md->match_function_type = MATCH_CONDASSERT; + RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, RM3); if (rrc == MATCH_MATCH) { + if (md->end_offset_top > offset_top) + offset_top = md->end_offset_top; /* Captures may have happened */ condition = TRUE; ecode += 1 + LINK_SIZE + GET(ecode, LINK_SIZE + 2); while (*ecode == OP_ALT) ecode += GET(ecode, 1); } - else if (rrc != MATCH_NOMATCH && - (rrc != MATCH_THEN || md->start_match_ptr != ecode)) + + /* PCRE doesn't allow the effect of (*THEN) to escape beyond an + assertion; it is therefore treated as NOMATCH. */ + + else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) { RRETURN(rrc); /* Need braces because of following else */ } @@ -1099,26 +1457,32 @@ } } - /* We are now at the branch that is to be obeyed. As there is only one, - we can use tail recursion to avoid using another stack frame, except when - match_cbegroup is required for an unlimited repeat of a possibly empty - group. If the second alternative doesn't exist, we can just plough on. */ + /* We are now at the branch that is to be obeyed. As there is only one, can + use tail recursion to avoid using another stack frame, except when there is + unlimited repeat of a possibly empty group. In the latter case, a recursive + call to match() is always required, unless the second alternative doesn't + exist, in which case we can just plough on. Note that, for compatibility + with Perl, the | in a conditional group is NOT treated as creating two + alternatives. If a THEN is encountered in the branch, it propagates out to + the enclosing alternative (unless nested in a deeper set of alternatives, + of course). */ if (condition || *ecode == OP_ALT) { - ecode += 1 + LINK_SIZE; - if (op == OP_SCOND) /* Possibly empty group */ + if (op != OP_SCOND) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, match_cbegroup, RM49); - RRETURN(rrc); - } - else /* Group must match something */ - { - flags = 0; + ecode += 1 + LINK_SIZE; goto TAIL_RECURSE; } + + md->match_function_type = MATCH_CBEGROUP; + RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM49); + RRETURN(rrc); } - else /* Condition false & no alternative */ + + /* Condition false & no alternative; continue after the group. */ + + else { ecode += 1 + LINK_SIZE; } @@ -1145,39 +1509,27 @@ md->offset_vector[offset+1] = (int)(eptr - md->start_subject); if (offset_top <= offset) offset_top = offset + 2; } - ecode += 3; + ecode += 1 + IMM2_SIZE; break; - /* End of the pattern, either real or forced. If we are in a top-level - recursion, we should restore the offsets appropriately and continue from - after the call. */ + /* End of the pattern, either real or forced. */ - case OP_ACCEPT: case OP_END: - if (md->recursive != NULL && md->recursive->group_num == 0) - { - recursion_info *rec = md->recursive; - DPRINTF(("End of pattern in a (?0) recursion\n")); - md->recursive = rec->prevrec; - memmove(md->offset_vector, rec->offset_save, - rec->saved_max * sizeof(int)); - offset_top = rec->save_offset_top; - ims = original_ims; - ecode = rec->after_call; - break; - } + case OP_ACCEPT: + case OP_ASSERT_ACCEPT: - /* Otherwise, if we have matched an empty string, fail if PCRE_NOTEMPTY is - set, or if PCRE_NOTEMPTY_ATSTART is set and we have matched at the start of - the subject. In both cases, backtracking will then try other alternatives, - if any. */ - - if (eptr == mstart && - (md->notempty || - (md->notempty_atstart && - mstart == md->start_subject + md->start_offset))) - MRRETURN(MATCH_NOMATCH); + /* If we have matched an empty string, fail if not in an assertion and not + in a recursion if either PCRE_NOTEMPTY is set, or if PCRE_NOTEMPTY_ATSTART + is set and we have matched at the start of the subject. In both cases, + backtracking will then try other alternatives, if any. */ + + if (eptr == mstart && op != OP_ASSERT_ACCEPT && + md->recursive == NULL && + (md->notempty || + (md->notempty_atstart && + mstart == md->start_subject + md->start_offset))) + RRETURN(MATCH_NOMATCH); /* Otherwise, we have a match. */ @@ -1186,47 +1538,60 @@ md->start_match_ptr = mstart; /* and the start (\K can modify) */ /* For some reason, the macros don't work properly if an expression is - given as the argument to MRRETURN when the heap is in use. */ + given as the argument to RRETURN when the heap is in use. */ rrc = (op == OP_END)? MATCH_MATCH : MATCH_ACCEPT; - MRRETURN(rrc); - - /* Change option settings */ - - case OP_OPT: - ims = ecode[1]; - ecode += 2; - DPRINTF(("ims set to %02lx\n", ims)); - break; + RRETURN(rrc); /* Assertion brackets. Check the alternative branches in turn - the matching won't pass the KET for an assertion. If any one branch matches, the assertion is true. Lookbehind assertions have an OP_REVERSE item at the start of each branch to move the current point backwards, so the code at - this level is identical to the lookahead case. */ + this level is identical to the lookahead case. When the assertion is part + of a condition, we want to return immediately afterwards. The caller of + this incarnation of the match() function will have set MATCH_CONDASSERT in + md->match_function type, and one of these opcodes will be the first opcode + that is processed. We use a local variable that is preserved over calls to + match() to remember this case. */ case OP_ASSERT: case OP_ASSERTBACK: + save_mark = md->mark; + if (md->match_function_type == MATCH_CONDASSERT) + { + condassert = TRUE; + md->match_function_type = 0; + } + else condassert = FALSE; + do { - RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, - RM4); + RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, RM4); if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) { mstart = md->start_match_ptr; /* In case \K reset it */ break; } - if (rrc != MATCH_NOMATCH && - (rrc != MATCH_THEN || md->start_match_ptr != ecode)) - RRETURN(rrc); + md->mark = save_mark; + + /* A COMMIT failure must fail the entire assertion, without trying any + subsequent branches. */ + + if (rrc == MATCH_COMMIT) RRETURN(MATCH_NOMATCH); + + /* PCRE does not allow THEN to escape beyond an assertion; it + is treated as NOMATCH. */ + + if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); ecode += GET(ecode, 1); } while (*ecode == OP_ALT); - if (*ecode == OP_KET) MRRETURN(MATCH_NOMATCH); + + if (*ecode == OP_KET) RRETURN(MATCH_NOMATCH); /* If checking an assertion for a condition, return MATCH_MATCH. */ - if ((flags & match_condassert) != 0) RRETURN(MATCH_MATCH); + if (condassert) RRETURN(MATCH_MATCH); /* Continue from after the assertion, updating the offsets high water mark, since extracts may have been taken during the assertion. */ @@ -1242,24 +1607,34 @@ case OP_ASSERT_NOT: case OP_ASSERTBACK_NOT: + save_mark = md->mark; + if (md->match_function_type == MATCH_CONDASSERT) + { + condassert = TRUE; + md->match_function_type = 0; + } + else condassert = FALSE; + do { - RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, - RM5); - if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) MRRETURN(MATCH_NOMATCH); + RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, RM5); + md->mark = save_mark; + if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) RRETURN(MATCH_NOMATCH); if (rrc == MATCH_SKIP || rrc == MATCH_PRUNE || rrc == MATCH_COMMIT) { do ecode += GET(ecode,1); while (*ecode == OP_ALT); break; } - if (rrc != MATCH_NOMATCH && - (rrc != MATCH_THEN || md->start_match_ptr != ecode)) - RRETURN(rrc); + + /* PCRE does not allow THEN to escape beyond an assertion; it is treated + as NOMATCH. */ + + if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); ecode += GET(ecode,1); } while (*ecode == OP_ALT); - if ((flags & match_condassert) != 0) RRETURN(MATCH_MATCH); + if (condassert) RRETURN(MATCH_MATCH); /* Condition assertion */ ecode += 1 + LINK_SIZE; continue; @@ -1270,14 +1645,14 @@ back a number of characters, not bytes. */ case OP_REVERSE: -#ifdef SUPPORT_UTF8 - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { i = GET(ecode, 1); while (i-- > 0) { eptr--; - if (eptr < md->start_subject) MRRETURN(MATCH_NOMATCH); + if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); BACKCHAR(eptr); } } @@ -1288,7 +1663,7 @@ { eptr -= GET(ecode, 1); - if (eptr < md->start_subject) MRRETURN(MATCH_NOMATCH); + if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); } /* Save the earliest consulted character, then skip to next op code */ @@ -1302,13 +1677,17 @@ function is able to force a failure. */ case OP_CALLOUT: - if (pcre_callout != NULL) + if (PUBL(callout) != NULL) { - pcre_callout_block cb; - cb.version = 1; /* Version 1 of the callout block */ + PUBL(callout_block) cb; + cb.version = 2; /* Version 1 of the callout block */ cb.callout_number = ecode[1]; cb.offset_vector = md->offset_vector; +#ifdef COMPILE_PCRE8 cb.subject = (PCRE_SPTR)md->start_subject; +#else + cb.subject = (PCRE_SPTR16)md->start_subject; +#endif cb.subject_length = (int)(md->end_subject - md->start_subject); cb.start_match = (int)(mstart - md->start_subject); cb.current_position = (int)(eptr - md->start_subject); @@ -1317,7 +1696,8 @@ cb.capture_top = offset_top/2; cb.capture_last = md->capture_last; cb.callout_data = md->callout_data; - if ((rrc = (*pcre_callout)(&cb)) > 0) MRRETURN(MATCH_NOMATCH); + cb.mark = md->nomatch_mark; + if ((rrc = (*PUBL(callout))(&cb)) > 0) RRETURN(MATCH_NOMATCH); if (rrc < 0) RRETURN(rrc); } ecode += 2 + 2*LINK_SIZE; @@ -1327,38 +1707,48 @@ offset data is the offset to the starting bracket from the start of the whole pattern. (This is so that it works from duplicated subpatterns.) - If there are any capturing brackets started but not finished, we have to - save their starting points and reinstate them after the recursion. However, - we don't know how many such there are (offset_top records the completed - total) so we just have to save all the potential data. There may be up to - 65535 such values, which is too large to put on the stack, but using malloc - for small numbers seems expensive. As a compromise, the stack is used when - there are no more than REC_STACK_SAVE_MAX values to store; otherwise malloc - is used. A problem is what to do if the malloc fails ... there is no way of - returning to the top level with an error. Save the top REC_STACK_SAVE_MAX - values on the stack, and accept that the rest may be wrong. + The state of the capturing groups is preserved over recursion, and + re-instated afterwards. We don't know how many are started and not yet + finished (offset_top records the completed total) so we just have to save + all the potential data. There may be up to 65535 such values, which is too + large to put on the stack, but using malloc for small numbers seems + expensive. As a compromise, the stack is used when there are no more than + REC_STACK_SAVE_MAX values to store; otherwise malloc is used. There are also other values that have to be saved. We use a chained sequence of blocks that actually live on the stack. Thanks to Robin Houston - for the original version of this logic. */ + for the original version of this logic. It has, however, been hacked around + a lot, so he is not to blame for the current way it works. */ case OP_RECURSE: { + recursion_info *ri; + int recno; + callpat = md->start_code + GET(ecode, 1); - new_recursive.group_num = (callpat == md->start_code)? 0 : + recno = (callpat == md->start_code)? 0 : GET2(callpat, 1 + LINK_SIZE); + /* Check for repeating a recursion without advancing the subject pointer. + This should catch convoluted mutual recursions. (Some simple cases are + caught at compile time.) */ + + for (ri = md->recursive; ri != NULL; ri = ri->prevrec) + if (recno == ri->group_num && eptr == ri->subject_position) + RRETURN(PCRE_ERROR_RECURSELOOP); + /* Add to "recursing stack" */ + new_recursive.group_num = recno; + new_recursive.subject_position = eptr; new_recursive.prevrec = md->recursive; md->recursive = &new_recursive; - /* Find where to continue from afterwards */ + /* Where to continue from afterwards */ ecode += 1 + LINK_SIZE; - new_recursive.after_call = ecode; - /* Now save the offset data. */ + /* Now save the offset data */ new_recursive.saved_max = md->offset_end; if (new_recursive.saved_max <= REC_STACK_SAVE_MAX) @@ -1366,43 +1756,54 @@ else { new_recursive.offset_save = - (int *)(pcre_malloc)(new_recursive.saved_max * sizeof(int)); + (int *)(PUBL(malloc))(new_recursive.saved_max * sizeof(int)); if (new_recursive.offset_save == NULL) RRETURN(PCRE_ERROR_NOMEMORY); } - memcpy(new_recursive.offset_save, md->offset_vector, new_recursive.saved_max * sizeof(int)); - new_recursive.save_offset_top = offset_top; - /* OK, now we can do the recursion. For each top-level alternative we - restore the offset and recursion data. */ + /* OK, now we can do the recursion. After processing each alternative, + restore the offset data. If there were nested recursions, md->recursive + might be changed, so reset it before looping. */ DPRINTF(("Recursing into group %d\n", new_recursive.group_num)); - flags = (*callpat >= OP_SBRA)? match_cbegroup : 0; + cbegroup = (*callpat >= OP_SBRA); do { - RMATCH(eptr, callpat + _pcre_OP_lengths[*callpat], offset_top, - md, ims, eptrb, flags, RM6); + if (cbegroup) md->match_function_type = MATCH_CBEGROUP; + RMATCH(eptr, callpat + PRIV(OP_lengths)[*callpat], offset_top, + md, eptrb, RM6); + memcpy(md->offset_vector, new_recursive.offset_save, + new_recursive.saved_max * sizeof(int)); + md->recursive = new_recursive.prevrec; if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) { DPRINTF(("Recursion matched\n")); - md->recursive = new_recursive.prevrec; if (new_recursive.offset_save != stacksave) - (pcre_free)(new_recursive.offset_save); - MRRETURN(MATCH_MATCH); + (PUBL(free))(new_recursive.offset_save); + + /* Set where we got to in the subject, and reset the start in case + it was changed by \K. This *is* propagated back out of a recursion, + for Perl compatibility. */ + + eptr = md->end_match_ptr; + mstart = md->start_match_ptr; + goto RECURSION_MATCHED; /* Exit loop; end processing */ } - else if (rrc != MATCH_NOMATCH && - (rrc != MATCH_THEN || md->start_match_ptr != ecode)) + + /* PCRE does not allow THEN or COMMIT to escape beyond a recursion; it + is treated as NOMATCH. */ + + else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN && + rrc != MATCH_COMMIT) { DPRINTF(("Recursion gave error %d\n", rrc)); if (new_recursive.offset_save != stacksave) - (pcre_free)(new_recursive.offset_save); + (PUBL(free))(new_recursive.offset_save); RRETURN(rrc); } md->recursive = &new_recursive; - memcpy(md->offset_vector, new_recursive.offset_save, - new_recursive.saved_max * sizeof(int)); callpat += GET(callpat, 1); } while (*callpat == OP_ALT); @@ -1410,91 +1811,12 @@ DPRINTF(("Recursion didn't match\n")); md->recursive = new_recursive.prevrec; if (new_recursive.offset_save != stacksave) - (pcre_free)(new_recursive.offset_save); - MRRETURN(MATCH_NOMATCH); - } - /* Control never reaches here */ - - /* "Once" brackets are like assertion brackets except that after a match, - the point in the subject string is not moved back. Thus there can never be - a move back into the brackets. Friedl calls these "atomic" subpatterns. - Check the alternative branches in turn - the matching won't pass the KET - for this kind of subpattern. If any one branch matches, we carry on as at - the end of a normal bracket, leaving the subject pointer, but resetting - the start-of-match value in case it was changed by \K. */ - - case OP_ONCE: - prev = ecode; - saved_eptr = eptr; - - do - { - RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM7); - if (rrc == MATCH_MATCH) /* Note: _not_ MATCH_ACCEPT */ - { - mstart = md->start_match_ptr; - break; - } - if (rrc != MATCH_NOMATCH && - (rrc != MATCH_THEN || md->start_match_ptr != ecode)) - RRETURN(rrc); - ecode += GET(ecode,1); - } - while (*ecode == OP_ALT); - - /* If hit the end of the group (which could be repeated), fail */ - - if (*ecode != OP_ONCE && *ecode != OP_ALT) RRETURN(MATCH_NOMATCH); - - /* Continue as from after the assertion, updating the offsets high water - mark, since extracts may have been taken. */ - - do ecode += GET(ecode, 1); while (*ecode == OP_ALT); - - offset_top = md->end_offset_top; - eptr = md->end_match_ptr; - - /* For a non-repeating ket, just continue at this level. This also - happens for a repeating ket if no characters were matched in the group. - This is the forcible breaking of infinite loops as implemented in Perl - 5.005. If there is an options reset, it will get obeyed in the normal - course of events. */ - - if (*ecode == OP_KET || eptr == saved_eptr) - { - ecode += 1+LINK_SIZE; - break; - } - - /* The repeating kets try the rest of the pattern or restart from the - preceding bracket, in the appropriate order. The second "call" of match() - uses tail recursion, to avoid using another stack frame. We need to reset - any options that changed within the bracket before re-running it, so - check the next opcode. */ - - if (ecode[1+LINK_SIZE] == OP_OPT) - { - ims = (ims & ~PCRE_IMS) | ecode[4]; - DPRINTF(("ims set to %02lx at group repeat\n", ims)); + (PUBL(free))(new_recursive.offset_save); + RRETURN(MATCH_NOMATCH); } - if (*ecode == OP_KETRMIN) - { - RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM8); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - ecode = prev; - flags = 0; - goto TAIL_RECURSE; - } - else /* OP_KETRMAX */ - { - RMATCH(eptr, prev, offset_top, md, ims, eptrb, match_cbegroup, RM9); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - ecode += 1 + LINK_SIZE; - flags = 0; - goto TAIL_RECURSE; - } - /* Control never gets here */ + RECURSION_MATCHED: + break; /* An alternation is the end of a branch; scan along to find the end of the bracketed group and go to there. */ @@ -1510,140 +1832,181 @@ optional ones preceded by BRAZERO or BRAMINZERO. */ case OP_BRAZERO: - { - next = ecode+1; - RMATCH(eptr, next, offset_top, md, ims, eptrb, 0, RM10); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - do next += GET(next,1); while (*next == OP_ALT); - ecode = next + 1 + LINK_SIZE; - } + next = ecode + 1; + RMATCH(eptr, next, offset_top, md, eptrb, RM10); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + do next += GET(next, 1); while (*next == OP_ALT); + ecode = next + 1 + LINK_SIZE; break; case OP_BRAMINZERO: - { - next = ecode+1; - do next += GET(next, 1); while (*next == OP_ALT); - RMATCH(eptr, next + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0, RM11); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - ecode++; - } + next = ecode + 1; + do next += GET(next, 1); while (*next == OP_ALT); + RMATCH(eptr, next + 1+LINK_SIZE, offset_top, md, eptrb, RM11); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + ecode++; break; case OP_SKIPZERO: - { - next = ecode+1; - do next += GET(next,1); while (*next == OP_ALT); - ecode = next + 1 + LINK_SIZE; - } + next = ecode+1; + do next += GET(next,1); while (*next == OP_ALT); + ecode = next + 1 + LINK_SIZE; break; + /* BRAPOSZERO occurs before a possessive bracket group. Don't do anything + here; just jump to the group, with allow_zero set TRUE. */ + + case OP_BRAPOSZERO: + op = *(++ecode); + allow_zero = TRUE; + if (op == OP_CBRAPOS || op == OP_SCBRAPOS) goto POSSESSIVE_CAPTURE; + goto POSSESSIVE_NON_CAPTURE; + /* End of a group, repeated or non-repeating. */ case OP_KET: case OP_KETRMIN: case OP_KETRMAX: + case OP_KETRPOS: prev = ecode - GET(ecode, 1); /* If this was a group that remembered the subject start, in order to break infinite repeats of empty string matches, retrieve the subject start from the chain. Otherwise, set it NULL. */ - if (*prev >= OP_SBRA) + if (*prev >= OP_SBRA || *prev == OP_ONCE) { saved_eptr = eptrb->epb_saved_eptr; /* Value at start of group */ eptrb = eptrb->epb_prev; /* Backup to previous group */ } else saved_eptr = NULL; - /* If we are at the end of an assertion group or an atomic group, stop - matching and return MATCH_MATCH, but record the current high water mark for - use by positive assertions. We also need to record the match start in case - it was changed by \K. */ - - if (*prev == OP_ASSERT || *prev == OP_ASSERT_NOT || - *prev == OP_ASSERTBACK || *prev == OP_ASSERTBACK_NOT || - *prev == OP_ONCE) + /* If we are at the end of an assertion group or a non-capturing atomic + group, stop matching and return MATCH_MATCH, but record the current high + water mark for use by positive assertions. We also need to record the match + start in case it was changed by \K. */ + + if ((*prev >= OP_ASSERT && *prev <= OP_ASSERTBACK_NOT) || + *prev == OP_ONCE_NC) { - md->end_match_ptr = eptr; /* For ONCE */ + md->end_match_ptr = eptr; /* For ONCE_NC */ md->end_offset_top = offset_top; md->start_match_ptr = mstart; - MRRETURN(MATCH_MATCH); + RRETURN(MATCH_MATCH); /* Sets md->mark */ } /* For capturing groups we have to check the group number back at the start and if necessary complete handling an extraction by setting the offsets and - bumping the high water mark. Note that whole-pattern recursion is coded as - a recurse into group 0, so it won't be picked up here. Instead, we catch it - when the OP_END is reached. Other recursion is handled here. */ + bumping the high water mark. Whole-pattern recursion is coded as a recurse + into group 0, so it won't be picked up here. Instead, we catch it when the + OP_END is reached. Other recursion is handled here. We just have to record + the current subject position and start match pointer and give a MATCH + return. */ - if (*prev == OP_CBRA || *prev == OP_SCBRA) + if (*prev == OP_CBRA || *prev == OP_SCBRA || + *prev == OP_CBRAPOS || *prev == OP_SCBRAPOS) { number = GET2(prev, 1+LINK_SIZE); offset = number << 1; -#ifdef PCRE_DEBUG - printf("end bracket %d", number); - printf("\n"); -#endif +#ifdef PCRE_DEBUG + printf("end bracket %d", number); + printf("\n"); +#endif + + /* Handle a recursively called group. */ + + if (md->recursive != NULL && md->recursive->group_num == number) + { + md->end_match_ptr = eptr; + md->start_match_ptr = mstart; + RRETURN(MATCH_MATCH); + } + + /* Deal with capturing */ md->capture_last = number; if (offset >= md->offset_max) md->offset_overflow = TRUE; else { + /* If offset is greater than offset_top, it means that we are + "skipping" a capturing group, and that group's offsets must be marked + unset. In earlier versions of PCRE, all the offsets were unset at the + start of matching, but this doesn't work because atomic groups and + assertions can cause a value to be set that should later be unset. + Example: matching /(?>(a))b|(a)c/ against "ac". This sets group 1 as + part of the atomic group, but this is not on the final matching path, + so must be unset when 2 is set. (If there is no group 2, there is no + problem, because offset_top will then be 2, indicating no capture.) */ + + if (offset > offset_top) + { + register int *iptr = md->offset_vector + offset_top; + register int *iend = md->offset_vector + offset; + while (iptr < iend) *iptr++ = -1; + } + + /* Now make the extraction */ + md->offset_vector[offset] = md->offset_vector[md->offset_end - number]; md->offset_vector[offset+1] = (int)(eptr - md->start_subject); if (offset_top <= offset) offset_top = offset + 2; } + } - /* Handle a recursively called group. Restore the offsets - appropriately and continue from after the call. */ + /* For an ordinary non-repeating ket, just continue at this level. This + also happens for a repeating ket if no characters were matched in the + group. This is the forcible breaking of infinite loops as implemented in + Perl 5.005. For a non-repeating atomic group that includes captures, + establish a backup point by processing the rest of the pattern at a lower + level. If this results in a NOMATCH return, pass MATCH_ONCE back to the + original OP_ONCE level, thereby bypassing intermediate backup points, but + resetting any captures that happened along the way. */ - if (md->recursive != NULL && md->recursive->group_num == number) + if (*ecode == OP_KET || eptr == saved_eptr) + { + if (*prev == OP_ONCE) { - recursion_info *rec = md->recursive; - DPRINTF(("Recursion (%d) succeeded - continuing\n", number)); - md->recursive = rec->prevrec; - memcpy(md->offset_vector, rec->offset_save, - rec->saved_max * sizeof(int)); - offset_top = rec->save_offset_top; - ecode = rec->after_call; - ims = original_ims; - break; + RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM12); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + md->once_target = prev; /* Level at which to change to MATCH_NOMATCH */ + RRETURN(MATCH_ONCE); } + ecode += 1 + LINK_SIZE; /* Carry on at this level */ + break; } - /* For both capturing and non-capturing groups, reset the value of the ims - flags, in case they got changed during the group. */ - - ims = original_ims; - DPRINTF(("ims reset to %02lx\n", ims)); - - /* For a non-repeating ket, just continue at this level. This also - happens for a repeating ket if no characters were matched in the group. - This is the forcible breaking of infinite loops as implemented in Perl - 5.005. If there is an options reset, it will get obeyed in the normal - course of events. */ + /* OP_KETRPOS is a possessive repeating ket. Remember the current position, + and return the MATCH_KETRPOS. This makes it possible to do the repeats one + at a time from the outer level, thus saving stack. */ - if (*ecode == OP_KET || eptr == saved_eptr) + if (*ecode == OP_KETRPOS) { - ecode += 1 + LINK_SIZE; - break; + md->end_match_ptr = eptr; + md->end_offset_top = offset_top; + RRETURN(MATCH_KETRPOS); } - /* The repeating kets try the rest of the pattern or restart from the - preceding bracket, in the appropriate order. In the second case, we can use - tail recursion to avoid using another stack frame, unless we have an - unlimited repeat of a group that can match an empty string. */ - - flags = (*prev >= OP_SBRA)? match_cbegroup : 0; + /* The normal repeating kets try the rest of the pattern or restart from + the preceding bracket, in the appropriate order. In the second case, we can + use tail recursion to avoid using another stack frame, unless we have an + an atomic group or an unlimited repeat of a group that can match an empty + string. */ if (*ecode == OP_KETRMIN) { - RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM12); + RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM7); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (flags != 0) /* Could match an empty string */ + if (*prev == OP_ONCE) + { + RMATCH(eptr, prev, offset_top, md, eptrb, RM8); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + md->once_target = prev; /* Level at which to change to MATCH_NOMATCH */ + RRETURN(MATCH_ONCE); + } + if (*prev >= OP_SBRA) /* Could match an empty string */ { - RMATCH(eptr, prev, offset_top, md, ims, eptrb, flags, RM50); + RMATCH(eptr, prev, offset_top, md, eptrb, RM50); RRETURN(rrc); } ecode = prev; @@ -1651,39 +2014,47 @@ } else /* OP_KETRMAX */ { - RMATCH(eptr, prev, offset_top, md, ims, eptrb, flags, RM13); + RMATCH(eptr, prev, offset_top, md, eptrb, RM13); + if (rrc == MATCH_ONCE && md->once_target == prev) rrc = MATCH_NOMATCH; if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (*prev == OP_ONCE) + { + RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM9); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + md->once_target = prev; + RRETURN(MATCH_ONCE); + } ecode += 1 + LINK_SIZE; - flags = 0; goto TAIL_RECURSE; } /* Control never gets here */ - /* Start of subject unless notbol, or after internal newline if multiline */ + /* Not multiline mode: start of subject assertion, unless notbol. */ case OP_CIRC: - if (md->notbol && eptr == md->start_subject) MRRETURN(MATCH_NOMATCH); - if ((ims & PCRE_MULTILINE) != 0) - { - if (eptr != md->start_subject && - (eptr == md->end_subject || !WAS_NEWLINE(eptr))) - MRRETURN(MATCH_NOMATCH); - ecode++; - break; - } - /* ... else fall through */ + if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH); /* Start of subject assertion */ case OP_SOD: - if (eptr != md->start_subject) MRRETURN(MATCH_NOMATCH); + if (eptr != md->start_subject) RRETURN(MATCH_NOMATCH); + ecode++; + break; + + /* Multiline mode: start of subject unless notbol, or after any newline. */ + + case OP_CIRCM: + if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH); + if (eptr != md->start_subject && + (eptr == md->end_subject || !WAS_NEWLINE(eptr))) + RRETURN(MATCH_NOMATCH); ecode++; break; /* Start of match assertion */ case OP_SOM: - if (eptr != md->start_subject + md->start_offset) MRRETURN(MATCH_NOMATCH); + if (eptr != md->start_subject + md->start_offset) RRETURN(MATCH_NOMATCH); ecode++; break; @@ -1694,34 +2065,47 @@ ecode++; break; - /* Assert before internal newline if multiline, or before a terminating - newline unless endonly is set, else end of subject unless noteol is set. */ + /* Multiline mode: assert before any newline, or before end of subject + unless noteol is set. */ - case OP_DOLL: - if ((ims & PCRE_MULTILINE) != 0) + case OP_DOLLM: + if (eptr < md->end_subject) { - if (eptr < md->end_subject) - { if (!IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); } - else + if (!IS_NEWLINE(eptr)) { - if (md->noteol) MRRETURN(MATCH_NOMATCH); - SCHECK_PARTIAL(); + if (md->partial != 0 && + eptr + 1 >= md->end_subject && + NLBLOCK->nltype == NLTYPE_FIXED && + NLBLOCK->nllen == 2 && + *eptr == NLBLOCK->nl[0]) + { + md->hitend = TRUE; + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); + } + RRETURN(MATCH_NOMATCH); } - ecode++; - break; } - else /* Not multiline */ + else { - if (md->noteol) MRRETURN(MATCH_NOMATCH); - if (!md->endonly) goto ASSERT_NL_OR_EOS; + if (md->noteol) RRETURN(MATCH_NOMATCH); + SCHECK_PARTIAL(); } + ecode++; + break; + + /* Not multiline mode: assert before a terminating newline or before end of + subject unless noteol is set. */ + + case OP_DOLL: + if (md->noteol) RRETURN(MATCH_NOMATCH); + if (!md->endonly) goto ASSERT_NL_OR_EOS; /* ... else fall through for endonly */ /* End of subject assertion (\z) */ case OP_EOD: - if (eptr < md->end_subject) MRRETURN(MATCH_NOMATCH); + if (eptr < md->end_subject) RRETURN(MATCH_NOMATCH); SCHECK_PARTIAL(); ecode++; break; @@ -1732,7 +2116,18 @@ ASSERT_NL_OR_EOS: if (eptr < md->end_subject && (!IS_NEWLINE(eptr) || eptr != md->end_subject - md->nllen)) - MRRETURN(MATCH_NOMATCH); + { + if (md->partial != 0 && + eptr + 1 >= md->end_subject && + NLBLOCK->nltype == NLTYPE_FIXED && + NLBLOCK->nllen == 2 && + *eptr == NLBLOCK->nl[0]) + { + md->hitend = TRUE; + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); + } + RRETURN(MATCH_NOMATCH); + } /* Either at end of string or \n before end. */ @@ -1751,15 +2146,15 @@ be "non-word" characters. Remember the earliest consulted character for partial matching. */ -#ifdef SUPPORT_UTF8 - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { /* Get status of previous character */ if (eptr == md->start_subject) prev_is_word = FALSE; else { - USPTR lastptr = eptr - 1; - while((*lastptr & 0xc0) == 0x80) lastptr--; + PCRE_PUCHAR lastptr = eptr - 1; + BACKCHAR(lastptr); if (lastptr < md->start_used_ptr) md->start_used_ptr = lastptr; GETCHAR(c, lastptr); #ifdef SUPPORT_UCP @@ -1824,7 +2219,8 @@ } else #endif - prev_is_word = ((md->ctypes[eptr[-1]] & ctype_word) != 0); + prev_is_word = MAX_255(eptr[-1]) + && ((md->ctypes[eptr[-1]] & ctype_word) != 0); } /* Get status of next character */ @@ -1847,30 +2243,47 @@ } else #endif - cur_is_word = ((md->ctypes[*eptr] & ctype_word) != 0); + cur_is_word = MAX_255(*eptr) + && ((md->ctypes[*eptr] & ctype_word) != 0); } /* Now see if the situation is what we want */ if ((*ecode++ == OP_WORD_BOUNDARY)? cur_is_word == prev_is_word : cur_is_word != prev_is_word) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } break; - /* Match a single character type; inline for speed */ + /* Match any single character type except newline; have to take care with + CRLF newlines and partial matching. */ case OP_ANY: - if (IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); + if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); + if (md->partial != 0 && + eptr + 1 >= md->end_subject && + NLBLOCK->nltype == NLTYPE_FIXED && + NLBLOCK->nllen == 2 && + *eptr == NLBLOCK->nl[0]) + { + md->hitend = TRUE; + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); + } + /* Fall through */ + /* Match any single character whatsoever. */ + case OP_ALLANY: - if (eptr++ >= md->end_subject) - { + if (eptr >= md->end_subject) /* DO NOT merge the eptr++ here; it must */ + { /* not be updated before SCHECK_PARTIAL. */ SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (utf8) while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + eptr++; +#ifdef SUPPORT_UTF + if (utf) ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); +#endif ecode++; break; @@ -1878,11 +2291,12 @@ any byte, even newline, independent of the setting of PCRE_DOTALL. */ case OP_ANYBYTE: - if (eptr++ >= md->end_subject) - { + if (eptr >= md->end_subject) /* DO NOT merge the eptr++ here; it must */ + { /* not be updated before SCHECK_PARTIAL. */ SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } + eptr++; ecode++; break; @@ -1890,16 +2304,16 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); if ( -#ifdef SUPPORT_UTF8 +#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) c < 256 && #endif (md->ctypes[c] & ctype_digit) != 0 ) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); ecode++; break; @@ -1907,16 +2321,16 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); if ( -#ifdef SUPPORT_UTF8 - c >= 256 || +#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) + c > 255 || #endif (md->ctypes[c] & ctype_digit) == 0 ) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); ecode++; break; @@ -1924,16 +2338,16 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); if ( -#ifdef SUPPORT_UTF8 +#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) c < 256 && #endif (md->ctypes[c] & ctype_space) != 0 ) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); ecode++; break; @@ -1941,16 +2355,16 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); if ( -#ifdef SUPPORT_UTF8 - c >= 256 || +#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) + c > 255 || #endif (md->ctypes[c] & ctype_space) == 0 ) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); ecode++; break; @@ -1958,16 +2372,16 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); if ( -#ifdef SUPPORT_UTF8 +#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) c < 256 && #endif (md->ctypes[c] & ctype_word) != 0 ) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); ecode++; break; @@ -1975,16 +2389,16 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); if ( -#ifdef SUPPORT_UTF8 - c >= 256 || +#if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) + c > 255 || #endif (md->ctypes[c] & ctype_word) == 0 ) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); ecode++; break; @@ -1992,14 +2406,19 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); + case 0x000d: - if (eptr < md->end_subject && *eptr == 0x0a) eptr++; + if (eptr >= md->end_subject) + { + SCHECK_PARTIAL(); + } + else if (*eptr == 0x0a) eptr++; break; case 0x000a: @@ -2010,7 +2429,7 @@ case 0x0085: case 0x2028: case 0x2029: - if (md->bsr_anycrlf) MRRETURN(MATCH_NOMATCH); + if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); break; } ecode++; @@ -2020,7 +2439,7 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); switch(c) @@ -2045,7 +2464,7 @@ case 0x202f: /* NARROW NO-BREAK SPACE */ case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ case 0x3000: /* IDEOGRAPHIC SPACE */ - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } ecode++; break; @@ -2054,12 +2473,12 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x09: /* HT */ case 0x20: /* SPACE */ case 0xa0: /* NBSP */ @@ -2088,7 +2507,7 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); switch(c) @@ -2101,7 +2520,7 @@ case 0x85: /* NEL */ case 0x2028: /* LINE SEPARATOR */ case 0x2029: /* PARAGRAPH SEPARATOR */ - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } ecode++; break; @@ -2110,12 +2529,12 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x0a: /* LF */ case 0x0b: /* VT */ case 0x0c: /* FF */ @@ -2137,7 +2556,7 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); { @@ -2146,59 +2565,59 @@ switch(ecode[1]) { case PT_ANY: - if (op == OP_NOTPROP) MRRETURN(MATCH_NOMATCH); + if (op == OP_NOTPROP) RRETURN(MATCH_NOMATCH); break; case PT_LAMP: if ((prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt) == (op == OP_NOTPROP)) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); break; case PT_GC: - if ((ecode[2] != _pcre_ucp_gentype[prop->chartype]) == (op == OP_PROP)) - MRRETURN(MATCH_NOMATCH); + if ((ecode[2] != PRIV(ucp_gentype)[prop->chartype]) == (op == OP_PROP)) + RRETURN(MATCH_NOMATCH); break; case PT_PC: if ((ecode[2] != prop->chartype) == (op == OP_PROP)) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); break; case PT_SC: if ((ecode[2] != prop->script) == (op == OP_PROP)) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); break; /* These are specials */ case PT_ALNUM: - if ((_pcre_ucp_gentype[prop->chartype] == ucp_L || - _pcre_ucp_gentype[prop->chartype] == ucp_N) == (op == OP_NOTPROP)) - MRRETURN(MATCH_NOMATCH); + if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L || + PRIV(ucp_gentype)[prop->chartype] == ucp_N) == (op == OP_NOTPROP)) + RRETURN(MATCH_NOMATCH); break; case PT_SPACE: /* Perl space */ - if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z || + if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR) == (op == OP_NOTPROP)) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); break; case PT_PXSPACE: /* POSIX space */ - if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z || + if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || c == CHAR_FF || c == CHAR_CR) == (op == OP_NOTPROP)) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); break; case PT_WORD: - if ((_pcre_ucp_gentype[prop->chartype] == ucp_L || - _pcre_ucp_gentype[prop->chartype] == ucp_N || + if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L || + PRIV(ucp_gentype)[prop->chartype] == ucp_N || c == CHAR_UNDERSCORE) == (op == OP_NOTPROP)) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); break; /* This should never occur */ @@ -2218,24 +2637,18 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); + if (UCD_CATEGORY(c) == ucp_M) RRETURN(MATCH_NOMATCH); + while (eptr < md->end_subject) { - int category = UCD_CATEGORY(c); - if (category == ucp_M) MRRETURN(MATCH_NOMATCH); - while (eptr < md->end_subject) - { - int len = 1; - if (!utf8) c = *eptr; else - { - GETCHARLEN(c, eptr, len); - } - category = UCD_CATEGORY(c); - if (category != ucp_M) break; - eptr += len; - } + int len = 1; + if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); } + if (UCD_CATEGORY(c) != ucp_M) break; + eptr += len; } + CHECK_PARTIAL(); ecode++; break; #endif @@ -2250,129 +2663,147 @@ loops). */ case OP_REF: - { - offset = GET2(ecode, 1) << 1; /* Doubled ref number */ - ecode += 3; + case OP_REFI: + caseless = op == OP_REFI; + offset = GET2(ecode, 1) << 1; /* Doubled ref number */ + ecode += 1 + IMM2_SIZE; - /* If the reference is unset, there are two possibilities: + /* If the reference is unset, there are two possibilities: - (a) In the default, Perl-compatible state, set the length to be longer - than the amount of subject left; this ensures that every attempt at a - match fails. We can't just fail here, because of the possibility of - quantifiers with zero minima. + (a) In the default, Perl-compatible state, set the length negative; + this ensures that every attempt at a match fails. We can't just fail + here, because of the possibility of quantifiers with zero minima. - (b) If the JavaScript compatibility flag is set, set the length to zero - so that the back reference matches an empty string. + (b) If the JavaScript compatibility flag is set, set the length to zero + so that the back reference matches an empty string. - Otherwise, set the length to the length of what was matched by the - referenced subpattern. */ + Otherwise, set the length to the length of what was matched by the + referenced subpattern. */ - if (offset >= offset_top || md->offset_vector[offset] < 0) - length = (md->jscript_compat)? 0 : (int)(md->end_subject - eptr + 1); - else - length = md->offset_vector[offset+1] - md->offset_vector[offset]; + if (offset >= offset_top || md->offset_vector[offset] < 0) + length = (md->jscript_compat)? 0 : -1; + else + length = md->offset_vector[offset+1] - md->offset_vector[offset]; - /* Set up for repetition, or handle the non-repeated case */ + /* Set up for repetition, or handle the non-repeated case */ - switch (*ecode) - { - case OP_CRSTAR: - case OP_CRMINSTAR: - case OP_CRPLUS: - case OP_CRMINPLUS: - case OP_CRQUERY: - case OP_CRMINQUERY: - c = *ecode++ - OP_CRSTAR; - minimize = (c & 1) != 0; - min = rep_min[c]; /* Pick up values from tables; */ - max = rep_max[c]; /* zero for max => infinity */ - if (max == 0) max = INT_MAX; - break; + switch (*ecode) + { + case OP_CRSTAR: + case OP_CRMINSTAR: + case OP_CRPLUS: + case OP_CRMINPLUS: + case OP_CRQUERY: + case OP_CRMINQUERY: + c = *ecode++ - OP_CRSTAR; + minimize = (c & 1) != 0; + min = rep_min[c]; /* Pick up values from tables; */ + max = rep_max[c]; /* zero for max => infinity */ + if (max == 0) max = INT_MAX; + break; - case OP_CRRANGE: - case OP_CRMINRANGE: - minimize = (*ecode == OP_CRMINRANGE); - min = GET2(ecode, 1); - max = GET2(ecode, 3); - if (max == 0) max = INT_MAX; - ecode += 5; - break; + case OP_CRRANGE: + case OP_CRMINRANGE: + minimize = (*ecode == OP_CRMINRANGE); + min = GET2(ecode, 1); + max = GET2(ecode, 1 + IMM2_SIZE); + if (max == 0) max = INT_MAX; + ecode += 1 + 2 * IMM2_SIZE; + break; - default: /* No repeat follows */ - if (!match_ref(offset, eptr, length, md, ims)) - { - CHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); - } - eptr += length; - continue; /* With the main loop */ + default: /* No repeat follows */ + if ((length = match_ref(offset, eptr, length, md, caseless)) < 0) + { + if (length == -2) eptr = md->end_subject; /* Partial match */ + CHECK_PARTIAL(); + RRETURN(MATCH_NOMATCH); } + eptr += length; + continue; /* With the main loop */ + } - /* If the length of the reference is zero, just continue with the - main loop. */ + /* Handle repeated back references. If the length of the reference is + zero, just continue with the main loop. If the length is negative, it + means the reference is unset in non-Java-compatible mode. If the minimum is + zero, we can continue at the same level without recursion. For any other + minimum, carrying on will result in NOMATCH. */ - if (length == 0) continue; + if (length == 0) continue; + if (length < 0 && min == 0) continue; - /* First, ensure the minimum number of matches are present. We get back - the length of the reference string explicitly rather than passing the - address of eptr, so that eptr can be a register variable. */ + /* First, ensure the minimum number of matches are present. We get back + the length of the reference string explicitly rather than passing the + address of eptr, so that eptr can be a register variable. */ - for (i = 1; i <= min; i++) + for (i = 1; i <= min; i++) + { + int slength; + if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0) { - if (!match_ref(offset, eptr, length, md, ims)) - { - CHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); - } - eptr += length; + if (slength == -2) eptr = md->end_subject; /* Partial match */ + CHECK_PARTIAL(); + RRETURN(MATCH_NOMATCH); } + eptr += slength; + } - /* If min = max, continue at the same level without recursion. - They are not both allowed to be zero. */ + /* If min = max, continue at the same level without recursion. + They are not both allowed to be zero. */ - if (min == max) continue; + if (min == max) continue; - /* If minimizing, keep trying and advancing the pointer */ + /* If minimizing, keep trying and advancing the pointer */ - if (minimize) + if (minimize) + { + for (fi = min;; fi++) { - for (fi = min;; fi++) + int slength; + RMATCH(eptr, ecode, offset_top, md, eptrb, RM14); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + if (fi >= max) RRETURN(MATCH_NOMATCH); + if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM14); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); - if (!match_ref(offset, eptr, length, md, ims)) - { - CHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); - } - eptr += length; + if (slength == -2) eptr = md->end_subject; /* Partial match */ + CHECK_PARTIAL(); + RRETURN(MATCH_NOMATCH); } - /* Control never gets here */ + eptr += slength; } + /* Control never gets here */ + } - /* If maximizing, find the longest string and work backwards */ + /* If maximizing, find the longest string and work backwards */ - else + else + { + pp = eptr; + for (i = min; i < max; i++) { - pp = eptr; - for (i = min; i < max; i++) + int slength; + if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0) { - if (!match_ref(offset, eptr, length, md, ims)) + /* Can't use CHECK_PARTIAL because we don't want to update eptr in + the soft partial matching case. */ + + if (slength == -2 && md->partial != 0 && + md->end_subject > md->start_used_ptr) { - CHECK_PARTIAL(); - break; + md->hitend = TRUE; + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); } - eptr += length; - } - while (eptr >= pp) - { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM15); - if (rrc != MATCH_NOMATCH) RRETURN(rrc); - eptr -= length; + break; } - MRRETURN(MATCH_NOMATCH); + eptr += slength; + } + + while (eptr >= pp) + { + RMATCH(eptr, ecode, offset_top, md, eptrb, RM15); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + eptr -= length; } + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ @@ -2390,8 +2821,11 @@ case OP_NCLASS: case OP_CLASS: { + /* The data variable is saved across frames, so the byte map needs to + be stored there. */ +#define BYTE_MAP ((pcre_uint8 *)data) data = ecode + 1; /* Save for matching */ - ecode += 33; /* Advance past the item */ + ecode += 1 + (32 / sizeof(pcre_uchar)); /* Advance past the item */ switch (*ecode) { @@ -2412,9 +2846,9 @@ case OP_CRMINRANGE: minimize = (*ecode == OP_CRMINRANGE); min = GET2(ecode, 1); - max = GET2(ecode, 3); + max = GET2(ecode, 1 + IMM2_SIZE); if (max == 0) max = INT_MAX; - ecode += 5; + ecode += 1 + 2 * IMM2_SIZE; break; default: /* No repeat follows */ @@ -2424,41 +2858,45 @@ /* First, ensure the minimum number of matches are present. */ -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { for (i = 1; i <= min; i++) { if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(c, eptr); if (c > 255) { - if (op == OP_CLASS) MRRETURN(MATCH_NOMATCH); + if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); } else - { - if ((data[c/8] & (1 << (c&7))) == 0) MRRETURN(MATCH_NOMATCH); - } + if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); } } else #endif - /* Not UTF-8 mode */ + /* Not UTF mode */ { for (i = 1; i <= min; i++) { if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } c = *eptr++; - if ((data[c/8] & (1 << (c&7))) == 0) MRRETURN(MATCH_NOMATCH); +#ifndef COMPILE_PCRE8 + if (c > 255) + { + if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); + } + else +#endif + if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); } } @@ -2472,47 +2910,51 @@ if (minimize) { -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM16); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM16); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(c, eptr); if (c > 255) { - if (op == OP_CLASS) MRRETURN(MATCH_NOMATCH); + if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); } else - { - if ((data[c/8] & (1 << (c&7))) == 0) MRRETURN(MATCH_NOMATCH); - } + if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); } } else #endif - /* Not UTF-8 mode */ + /* Not UTF mode */ { for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM17); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM17); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } c = *eptr++; - if ((data[c/8] & (1 << (c&7))) == 0) MRRETURN(MATCH_NOMATCH); +#ifndef COMPILE_PCRE8 + if (c > 255) + { + if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); + } + else +#endif + if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); } } /* Control never gets here */ @@ -2524,9 +2966,8 @@ { pp = eptr; -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { for (i = min; i < max; i++) { @@ -2542,14 +2983,12 @@ if (op == OP_CLASS) break; } else - { - if ((data[c/8] & (1 << (c&7))) == 0) break; - } + if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break; eptr += len; } for (;;) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM18); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM18); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (eptr-- == pp) break; /* Stop if tried at original pos */ BACKCHAR(eptr); @@ -2557,7 +2996,7 @@ } else #endif - /* Not UTF-8 mode */ + /* Not UTF mode */ { for (i = min; i < max; i++) { @@ -2567,19 +3006,27 @@ break; } c = *eptr; - if ((data[c/8] & (1 << (c&7))) == 0) break; +#ifndef COMPILE_PCRE8 + if (c > 255) + { + if (op == OP_CLASS) break; + } + else +#endif + if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break; eptr++; } while (eptr >= pp) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM19); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM19); if (rrc != MATCH_NOMATCH) RRETURN(rrc); eptr--; } } - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } +#undef BYTE_MAP } /* Control never gets here */ @@ -2588,7 +3035,7 @@ when UTF-8 mode mode is supported. Nevertheless, we may not be in UTF-8 mode, because Unicode properties are supported in non-UTF-8 mode. */ -#ifdef SUPPORT_UTF8 +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 case OP_XCLASS: { data = ecode + 1 + LINK_SIZE; /* Save for matching */ @@ -2613,9 +3060,9 @@ case OP_CRMINRANGE: minimize = (*ecode == OP_CRMINRANGE); min = GET2(ecode, 1); - max = GET2(ecode, 3); + max = GET2(ecode, 1 + IMM2_SIZE); if (max == 0) max = INT_MAX; - ecode += 5; + ecode += 1 + 2 * IMM2_SIZE; break; default: /* No repeat follows */ @@ -2630,10 +3077,10 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - if (!_pcre_xclass(c, data)) MRRETURN(MATCH_NOMATCH); + if (!PRIV(xclass)(c, data, utf)) RRETURN(MATCH_NOMATCH); } /* If max == min we can continue with the main loop without the @@ -2648,16 +3095,16 @@ { for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM20); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM20); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - if (!_pcre_xclass(c, data)) MRRETURN(MATCH_NOMATCH); + if (!PRIV(xclass)(c, data, utf)) RRETURN(MATCH_NOMATCH); } /* Control never gets here */ } @@ -2675,18 +3122,24 @@ SCHECK_PARTIAL(); break; } +#ifdef SUPPORT_UTF GETCHARLENTEST(c, eptr, len); - if (!_pcre_xclass(c, data)) break; +#else + c = *eptr; +#endif + if (!PRIV(xclass)(c, data, utf)) break; eptr += len; } for(;;) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM21); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM21); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (eptr-- == pp) break; /* Stop if tried at original pos */ - if (utf8) BACKCHAR(eptr); +#ifdef SUPPORT_UTF + if (utf) BACKCHAR(eptr); +#endif } - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ @@ -2696,8 +3149,8 @@ /* Match a single character, casefully */ case OP_CHAR: -#ifdef SUPPORT_UTF8 - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { length = 1; ecode++; @@ -2705,50 +3158,57 @@ if (length > md->end_subject - eptr) { CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */ - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - while (length-- > 0) if (*ecode++ != *eptr++) MRRETURN(MATCH_NOMATCH); + while (length-- > 0) if (*ecode++ != *eptr++) RRETURN(MATCH_NOMATCH); } else #endif - - /* Non-UTF-8 mode */ + /* Not UTF mode */ { if (md->end_subject - eptr < 1) { SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */ - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (ecode[1] != *eptr++) MRRETURN(MATCH_NOMATCH); + if (ecode[1] != *eptr++) RRETURN(MATCH_NOMATCH); ecode += 2; } break; - /* Match a single character, caselessly */ + /* Match a single character, caselessly. If we are at the end of the + subject, give up immediately. */ + + case OP_CHARI: + if (eptr >= md->end_subject) + { + SCHECK_PARTIAL(); + RRETURN(MATCH_NOMATCH); + } - case OP_CHARNC: -#ifdef SUPPORT_UTF8 - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { length = 1; ecode++; GETCHARLEN(fc, ecode, length); - if (length > md->end_subject - eptr) - { - CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */ - MRRETURN(MATCH_NOMATCH); - } - /* If the pattern character's value is < 128, we have only one byte, and - can use the fast lookup table. */ + we know that its other case must also be one byte long, so we can use the + fast lookup table. We know that there is at least one byte left in the + subject. */ if (fc < 128) { - if (md->lcc[*ecode++] != md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); + if (md->lcc[fc] + != TABLE_GET(*eptr, md->lcc, *eptr)) RRETURN(MATCH_NOMATCH); + ecode++; + eptr++; } - /* Otherwise we must pick up the subject character */ + /* Otherwise we must pick up the subject character. Note that we cannot + use the value of "length" to check for sufficient bytes left, because the + other case of the character may have more or fewer bytes. */ else { @@ -2764,21 +3224,18 @@ #ifdef SUPPORT_UCP if (dc != UCD_OTHERCASE(fc)) #endif - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } } } else -#endif /* SUPPORT_UTF8 */ +#endif /* SUPPORT_UTF */ - /* Non-UTF-8 mode */ + /* Not UTF mode */ { - if (md->end_subject - eptr < 1) - { - SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */ - MRRETURN(MATCH_NOMATCH); - } - if (md->lcc[ecode[1]] != md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); + if (TABLE_GET(ecode[1], md->lcc, ecode[1]) + != TABLE_GET(*eptr, md->lcc, *eptr)) RRETURN(MATCH_NOMATCH); + eptr++; ecode += 2; } break; @@ -2786,23 +3243,28 @@ /* Match a single character repeatedly. */ case OP_EXACT: + case OP_EXACTI: min = max = GET2(ecode, 1); - ecode += 3; + ecode += 1 + IMM2_SIZE; goto REPEATCHAR; case OP_POSUPTO: + case OP_POSUPTOI: possessive = TRUE; /* Fall through */ case OP_UPTO: + case OP_UPTOI: case OP_MINUPTO: + case OP_MINUPTOI: min = 0; max = GET2(ecode, 1); - minimize = *ecode == OP_MINUPTO; - ecode += 3; + minimize = *ecode == OP_MINUPTO || *ecode == OP_MINUPTOI; + ecode += 1 + IMM2_SIZE; goto REPEATCHAR; case OP_POSSTAR: + case OP_POSSTARI: possessive = TRUE; min = 0; max = INT_MAX; @@ -2810,6 +3272,7 @@ goto REPEATCHAR; case OP_POSPLUS: + case OP_POSPLUSI: possessive = TRUE; min = 1; max = INT_MAX; @@ -2817,6 +3280,7 @@ goto REPEATCHAR; case OP_POSQUERY: + case OP_POSQUERYI: possessive = TRUE; min = 0; max = 1; @@ -2824,14 +3288,19 @@ goto REPEATCHAR; case OP_STAR: + case OP_STARI: case OP_MINSTAR: + case OP_MINSTARI: case OP_PLUS: + case OP_PLUSI: case OP_MINPLUS: + case OP_MINPLUSI: case OP_QUERY: + case OP_QUERYI: case OP_MINQUERY: - c = *ecode++ - OP_STAR; + case OP_MINQUERYI: + c = *ecode++ - ((op < OP_STARI)? OP_STAR : OP_STARI); minimize = (c & 1) != 0; - min = rep_min[c]; /* Pick up values from tables; */ max = rep_max[c]; /* zero for max => infinity */ if (max == 0) max = INT_MAX; @@ -2839,8 +3308,8 @@ /* Common code for all repeated single-character matches. */ REPEATCHAR: -#ifdef SUPPORT_UTF8 - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { length = 1; charptr = ecode; @@ -2854,25 +3323,25 @@ { #ifdef SUPPORT_UCP unsigned int othercase; - if ((ims & PCRE_CASELESS) != 0 && + if (op >= OP_STARI && /* Caseless */ (othercase = UCD_OTHERCASE(fc)) != fc) - oclength = _pcre_ord2utf8(othercase, occhars); + oclength = PRIV(ord2utf)(othercase, occhars); else oclength = 0; #endif /* SUPPORT_UCP */ for (i = 1; i <= min; i++) { if (eptr <= md->end_subject - length && - memcmp(eptr, charptr, length) == 0) eptr += length; + memcmp(eptr, charptr, IN_UCHARS(length)) == 0) eptr += length; #ifdef SUPPORT_UCP else if (oclength > 0 && eptr <= md->end_subject - oclength && - memcmp(eptr, occhars, oclength) == 0) eptr += oclength; + memcmp(eptr, occhars, IN_UCHARS(oclength)) == 0) eptr += oclength; #endif /* SUPPORT_UCP */ else { CHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } } @@ -2882,20 +3351,20 @@ { for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM22); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM22); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr <= md->end_subject - length && - memcmp(eptr, charptr, length) == 0) eptr += length; + memcmp(eptr, charptr, IN_UCHARS(length)) == 0) eptr += length; #ifdef SUPPORT_UCP else if (oclength > 0 && eptr <= md->end_subject - oclength && - memcmp(eptr, occhars, oclength) == 0) eptr += oclength; + memcmp(eptr, occhars, IN_UCHARS(oclength)) == 0) eptr += oclength; #endif /* SUPPORT_UCP */ else { CHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } } /* Control never gets here */ @@ -2907,11 +3376,11 @@ for (i = min; i < max; i++) { if (eptr <= md->end_subject - length && - memcmp(eptr, charptr, length) == 0) eptr += length; + memcmp(eptr, charptr, IN_UCHARS(length)) == 0) eptr += length; #ifdef SUPPORT_UCP else if (oclength > 0 && eptr <= md->end_subject - oclength && - memcmp(eptr, occhars, oclength) == 0) eptr += oclength; + memcmp(eptr, occhars, IN_UCHARS(oclength)) == 0) eptr += oclength; #endif /* SUPPORT_UCP */ else { @@ -2924,9 +3393,9 @@ for(;;) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM23); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM23); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (eptr == pp) { MRRETURN(MATCH_NOMATCH); } + if (eptr == pp) { RRETURN(MATCH_NOMATCH); } #ifdef SUPPORT_UCP eptr--; BACKCHAR(eptr); @@ -2943,14 +3412,12 @@ value of fc will always be < 128. */ } else -#endif /* SUPPORT_UTF8 */ - - /* When not in UTF-8 mode, load a single-byte character. */ +#endif /* SUPPORT_UTF */ + /* When not in UTF-8 mode, load a single-byte character. */ + fc = *ecode++; - fc = *ecode++; - - /* The value of fc at this point is always less than 256, though we may or - may not be in UTF-8 mode. The code is duplicated for the caseless and + /* The value of fc at this point is always one character, though we may + or may not be in UTF mode. The code is duplicated for the caseless and caseful cases, for speed, since matching characters is likely to be quite common. First, ensure the minimum number of matches are present. If min = max, continue at the same level without recursing. Otherwise, if @@ -2959,34 +3426,52 @@ maximizing, find the maximum number of characters and work backwards. */ DPRINTF(("matching %c{%d,%d} against subject %.*s\n", fc, min, max, - max, eptr)); + max, (char *)eptr)); - if ((ims & PCRE_CASELESS) != 0) + if (op >= OP_STARI) /* Caseless */ { - fc = md->lcc[fc]; +#ifdef COMPILE_PCRE8 + /* fc must be < 128 if UTF is enabled. */ + foc = md->fcc[fc]; +#else +#ifdef SUPPORT_UTF +#ifdef SUPPORT_UCP + if (utf && fc > 127) + foc = UCD_OTHERCASE(fc); +#else + if (utf && fc > 127) + foc = fc; +#endif /* SUPPORT_UCP */ + else +#endif /* SUPPORT_UTF */ + foc = TABLE_GET(fc, md->fcc, fc); +#endif /* COMPILE_PCRE8 */ + for (i = 1; i <= min; i++) { if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (fc != md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); + if (fc != *eptr && foc != *eptr) RRETURN(MATCH_NOMATCH); + eptr++; } if (min == max) continue; if (minimize) { for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM24); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM24); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (fc != md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); + if (fc != *eptr && foc != *eptr) RRETURN(MATCH_NOMATCH); + eptr++; } /* Control never gets here */ } @@ -3000,7 +3485,7 @@ SCHECK_PARTIAL(); break; } - if (fc != md->lcc[*eptr]) break; + if (fc != *eptr && foc != *eptr) break; eptr++; } @@ -3008,11 +3493,11 @@ while (eptr >= pp) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM25); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM25); eptr--; if (rrc != MATCH_NOMATCH) RRETURN(rrc); } - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ } @@ -3026,9 +3511,9 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (fc != *eptr++) MRRETURN(MATCH_NOMATCH); + if (fc != *eptr++) RRETURN(MATCH_NOMATCH); } if (min == max) continue; @@ -3037,15 +3522,15 @@ { for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM26); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM26); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (fc != *eptr++) MRRETURN(MATCH_NOMATCH); + if (fc != *eptr++) RRETURN(MATCH_NOMATCH); } /* Control never gets here */ } @@ -3066,11 +3551,11 @@ while (eptr >= pp) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM27); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM27); eptr--; if (rrc != MATCH_NOMATCH) RRETURN(rrc); } - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } } /* Control never gets here */ @@ -3079,24 +3564,47 @@ checking can be multibyte. */ case OP_NOT: + case OP_NOTI: if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - ecode++; - GETCHARINCTEST(c, eptr); - if ((ims & PCRE_CASELESS) != 0) +#ifdef SUPPORT_UTF + if (utf) { -#ifdef SUPPORT_UTF8 - if (c < 256) -#endif - c = md->lcc[c]; - if (md->lcc[*ecode++] == c) MRRETURN(MATCH_NOMATCH); + register unsigned int ch, och; + + ecode++; + GETCHARINC(ch, ecode); + GETCHARINC(c, eptr); + + if (op == OP_NOT) + { + if (ch == c) RRETURN(MATCH_NOMATCH); + } + else + { +#ifdef SUPPORT_UCP + if (ch > 127) + och = UCD_OTHERCASE(ch); +#else + if (ch > 127) + och = ch; +#endif /* SUPPORT_UCP */ + else + och = TABLE_GET(ch, md->fcc, ch); + if (ch == c || och == c) RRETURN(MATCH_NOMATCH); + } } else +#endif { - if (*ecode++ == c) MRRETURN(MATCH_NOMATCH); + register unsigned int ch = ecode[1]; + c = *eptr++; + if (ch == c || (op == OP_NOTI && TABLE_GET(ch, md->fcc, ch) == c)) + RRETURN(MATCH_NOMATCH); + ecode += 2; } break; @@ -3108,19 +3616,23 @@ about... */ case OP_NOTEXACT: + case OP_NOTEXACTI: min = max = GET2(ecode, 1); - ecode += 3; + ecode += 1 + IMM2_SIZE; goto REPEATNOTCHAR; case OP_NOTUPTO: + case OP_NOTUPTOI: case OP_NOTMINUPTO: + case OP_NOTMINUPTOI: min = 0; max = GET2(ecode, 1); - minimize = *ecode == OP_NOTMINUPTO; - ecode += 3; + minimize = *ecode == OP_NOTMINUPTO || *ecode == OP_NOTMINUPTOI; + ecode += 1 + IMM2_SIZE; goto REPEATNOTCHAR; case OP_NOTPOSSTAR: + case OP_NOTPOSSTARI: possessive = TRUE; min = 0; max = INT_MAX; @@ -3128,6 +3640,7 @@ goto REPEATNOTCHAR; case OP_NOTPOSPLUS: + case OP_NOTPOSPLUSI: possessive = TRUE; min = 1; max = INT_MAX; @@ -3135,6 +3648,7 @@ goto REPEATNOTCHAR; case OP_NOTPOSQUERY: + case OP_NOTPOSQUERYI: possessive = TRUE; min = 0; max = 1; @@ -3142,19 +3656,26 @@ goto REPEATNOTCHAR; case OP_NOTPOSUPTO: + case OP_NOTPOSUPTOI: possessive = TRUE; min = 0; max = GET2(ecode, 1); - ecode += 3; + ecode += 1 + IMM2_SIZE; goto REPEATNOTCHAR; case OP_NOTSTAR: + case OP_NOTSTARI: case OP_NOTMINSTAR: + case OP_NOTMINSTARI: case OP_NOTPLUS: + case OP_NOTPLUSI: case OP_NOTMINPLUS: + case OP_NOTMINPLUSI: case OP_NOTQUERY: + case OP_NOTQUERYI: case OP_NOTMINQUERY: - c = *ecode++ - OP_NOTSTAR; + case OP_NOTMINQUERYI: + c = *ecode++ - ((op >= OP_NOTSTARI)? OP_NOTSTARI: OP_NOTSTAR); minimize = (c & 1) != 0; min = rep_min[c]; /* Pick up values from tables; */ max = rep_max[c]; /* zero for max => infinity */ @@ -3163,7 +3684,7 @@ /* Common code for all repeated single-byte matches. */ REPEATNOTCHAR: - fc = *ecode++; + GETCHARINCTEST(fc, ecode); /* The code is duplicated for the caseless and caseful cases, for speed, since matching characters is likely to be quite common. First, ensure the @@ -3174,15 +3695,24 @@ characters and work backwards. */ DPRINTF(("negative matching %c{%d,%d} against subject %.*s\n", fc, min, max, - max, eptr)); + max, (char *)eptr)); - if ((ims & PCRE_CASELESS) != 0) + if (op >= OP_NOTSTARI) /* Caseless */ { - fc = md->lcc[fc]; +#ifdef SUPPORT_UTF +#ifdef SUPPORT_UCP + if (utf && fc > 127) + foc = UCD_OTHERCASE(fc); +#else + if (utf && fc > 127) + foc = fc; +#endif /* SUPPORT_UCP */ + else +#endif /* SUPPORT_UTF */ + foc = TABLE_GET(fc, md->fcc, fc); -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { register unsigned int d; for (i = 1; i <= min; i++) @@ -3190,26 +3720,25 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(d, eptr); - if (d < 256) d = md->lcc[d]; - if (fc == d) MRRETURN(MATCH_NOMATCH); + if (fc == d || (unsigned int)foc == d) RRETURN(MATCH_NOMATCH); } } else #endif - - /* Not UTF-8 mode */ + /* Not UTF mode */ { for (i = 1; i <= min; i++) { if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (fc == md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); + if (fc == *eptr || foc == *eptr) RRETURN(MATCH_NOMATCH); + eptr++; } } @@ -3217,41 +3746,40 @@ if (minimize) { -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { register unsigned int d; for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM28); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(d, eptr); - if (d < 256) d = md->lcc[d]; - if (fc == d) MRRETURN(MATCH_NOMATCH); + if (fc == d || (unsigned int)foc == d) RRETURN(MATCH_NOMATCH); } } else #endif - /* Not UTF-8 mode */ + /* Not UTF mode */ { for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM29); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM29); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (fc == md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); + if (fc == *eptr || foc == *eptr) RRETURN(MATCH_NOMATCH); + eptr++; } } /* Control never gets here */ @@ -3263,9 +3791,8 @@ { pp = eptr; -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { register unsigned int d; for (i = min; i < max; i++) @@ -3277,14 +3804,13 @@ break; } GETCHARLEN(d, eptr, len); - if (d < 256) d = md->lcc[d]; - if (fc == d) break; + if (fc == d || (unsigned int)foc == d) break; eptr += len; } - if (possessive) continue; - for(;;) + if (possessive) continue; + for(;;) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM30); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM30); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (eptr-- == pp) break; /* Stop if tried at original pos */ BACKCHAR(eptr); @@ -3292,7 +3818,7 @@ } else #endif - /* Not UTF-8 mode */ + /* Not UTF mode */ { for (i = min; i < max; i++) { @@ -3301,19 +3827,19 @@ SCHECK_PARTIAL(); break; } - if (fc == md->lcc[*eptr]) break; + if (fc == *eptr || foc == *eptr) break; eptr++; } if (possessive) continue; while (eptr >= pp) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM31); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM31); if (rrc != MATCH_NOMATCH) RRETURN(rrc); eptr--; } } - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ } @@ -3322,9 +3848,8 @@ else { -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { register unsigned int d; for (i = 1; i <= min; i++) @@ -3332,24 +3857,24 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(d, eptr); - if (fc == d) MRRETURN(MATCH_NOMATCH); + if (fc == d) RRETURN(MATCH_NOMATCH); } } else #endif - /* Not UTF-8 mode */ + /* Not UTF mode */ { for (i = 1; i <= min; i++) { if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (fc == *eptr++) MRRETURN(MATCH_NOMATCH); + if (fc == *eptr++) RRETURN(MATCH_NOMATCH); } } @@ -3357,40 +3882,39 @@ if (minimize) { -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { register unsigned int d; for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM32); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(d, eptr); - if (fc == d) MRRETURN(MATCH_NOMATCH); + if (fc == d) RRETURN(MATCH_NOMATCH); } } else #endif - /* Not UTF-8 mode */ + /* Not UTF mode */ { for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM33); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM33); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (fc == *eptr++) MRRETURN(MATCH_NOMATCH); + if (fc == *eptr++) RRETURN(MATCH_NOMATCH); } } /* Control never gets here */ @@ -3402,9 +3926,8 @@ { pp = eptr; -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { register unsigned int d; for (i = min; i < max; i++) @@ -3422,7 +3945,7 @@ if (possessive) continue; for(;;) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM34); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM34); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (eptr-- == pp) break; /* Stop if tried at original pos */ BACKCHAR(eptr); @@ -3430,7 +3953,7 @@ } else #endif - /* Not UTF-8 mode */ + /* Not UTF mode */ { for (i = min; i < max; i++) { @@ -3445,13 +3968,13 @@ if (possessive) continue; while (eptr >= pp) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM35); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM35); if (rrc != MATCH_NOMATCH) RRETURN(rrc); eptr--; } } - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } } /* Control never gets here */ @@ -3463,7 +3986,7 @@ case OP_TYPEEXACT: min = max = GET2(ecode, 1); minimize = TRUE; - ecode += 3; + ecode += 1 + IMM2_SIZE; goto REPEATTYPE; case OP_TYPEUPTO: @@ -3471,7 +3994,7 @@ min = 0; max = GET2(ecode, 1); minimize = *ecode == OP_TYPEMINUPTO; - ecode += 3; + ecode += 1 + IMM2_SIZE; goto REPEATTYPE; case OP_TYPEPOSSTAR: @@ -3499,7 +4022,7 @@ possessive = TRUE; min = 0; max = GET2(ecode, 1); - ecode += 3; + ecode += 1 + IMM2_SIZE; goto REPEATTYPE; case OP_TYPESTAR: @@ -3545,13 +4068,13 @@ switch(prop_type) { case PT_ANY: - if (prop_fail_result) MRRETURN(MATCH_NOMATCH); + if (prop_fail_result) RRETURN(MATCH_NOMATCH); for (i = 1; i <= min; i++) { if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); } @@ -3560,17 +4083,18 @@ case PT_LAMP: for (i = 1; i <= min; i++) { + int chartype; if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_chartype = UCD_CHARTYPE(c); - if ((prop_chartype == ucp_Lu || - prop_chartype == ucp_Ll || - prop_chartype == ucp_Lt) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + chartype = UCD_CHARTYPE(c); + if ((chartype == ucp_Lu || + chartype == ucp_Ll || + chartype == ucp_Lt) == prop_fail_result) + RRETURN(MATCH_NOMATCH); } break; @@ -3580,12 +4104,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if ((prop_category == prop_value) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result) + RRETURN(MATCH_NOMATCH); } break; @@ -3595,12 +4118,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_chartype = UCD_CHARTYPE(c); - if ((prop_chartype == prop_value) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result) + RRETURN(MATCH_NOMATCH); } break; @@ -3610,28 +4132,27 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_script = UCD_SCRIPT(c); - if ((prop_script == prop_value) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result) + RRETURN(MATCH_NOMATCH); } break; case PT_ALNUM: for (i = 1; i <= min; i++) { + int category; if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_L || prop_category == ucp_N) - == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + category = UCD_CATEGORY(c); + if ((category == ucp_L || category == ucp_N) == prop_fail_result) + RRETURN(MATCH_NOMATCH); } break; @@ -3641,14 +4162,13 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL || + if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } break; @@ -3658,31 +4178,30 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL || + if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || c == CHAR_FF || c == CHAR_CR) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } break; case PT_WORD: for (i = 1; i <= min; i++) { + int category; if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_L || prop_category == ucp_N || - c == CHAR_UNDERSCORE) + category = UCD_CATEGORY(c); + if ((category == ucp_L || category == ucp_N || c == CHAR_UNDERSCORE) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } break; @@ -3703,20 +4222,18 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if (prop_category == ucp_M) MRRETURN(MATCH_NOMATCH); + if (UCD_CATEGORY(c) == ucp_M) RRETURN(MATCH_NOMATCH); while (eptr < md->end_subject) { int len = 1; - if (!utf8) c = *eptr; - else { GETCHARLEN(c, eptr, len); } - prop_category = UCD_CATEGORY(c); - if (prop_category != ucp_M) break; + if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); } + if (UCD_CATEGORY(c) != ucp_M) break; eptr += len; } + CHECK_PARTIAL(); } } @@ -3725,8 +4242,8 @@ /* Handle all other cases when the coding is UTF-8 */ -#ifdef SUPPORT_UTF8 - if (utf8) switch(ctype) +#ifdef SUPPORT_UTF + if (utf) switch(ctype) { case OP_ANY: for (i = 1; i <= min; i++) @@ -3734,11 +4251,20 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); + } + if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); + if (md->partial != 0 && + eptr + 1 >= md->end_subject && + NLBLOCK->nltype == NLTYPE_FIXED && + NLBLOCK->nllen == 2 && + *eptr == NLBLOCK->nl[0]) + { + md->hitend = TRUE; + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); } - if (IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); eptr++; - while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); } break; @@ -3748,15 +4274,15 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } eptr++; - while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); } break; case OP_ANYBYTE: - if (eptr > md->end_subject - min) MRRETURN(MATCH_NOMATCH); + if (eptr > md->end_subject - min) RRETURN(MATCH_NOMATCH); eptr += min; break; @@ -3766,12 +4292,13 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(c, eptr); switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); + case 0x000d: if (eptr < md->end_subject && *eptr == 0x0a) eptr++; break; @@ -3784,7 +4311,7 @@ case 0x0085: case 0x2028: case 0x2029: - if (md->bsr_anycrlf) MRRETURN(MATCH_NOMATCH); + if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); break; } } @@ -3796,7 +4323,7 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(c, eptr); switch(c) @@ -3821,7 +4348,7 @@ case 0x202f: /* NARROW NO-BREAK SPACE */ case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ case 0x3000: /* IDEOGRAPHIC SPACE */ - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } } break; @@ -3832,12 +4359,12 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(c, eptr); switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x09: /* HT */ case 0x20: /* SPACE */ case 0xa0: /* NBSP */ @@ -3868,7 +4395,7 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(c, eptr); switch(c) @@ -3881,7 +4408,7 @@ case 0x85: /* NEL */ case 0x2028: /* LINE SEPARATOR */ case 0x2029: /* PARAGRAPH SEPARATOR */ - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } } break; @@ -3892,12 +4419,12 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(c, eptr); switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x0a: /* LF */ case 0x0b: /* VT */ case 0x0c: /* FF */ @@ -3916,11 +4443,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINC(c, eptr); if (c < 128 && (md->ctypes[c] & ctype_digit) != 0) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } break; @@ -3930,10 +4457,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (*eptr >= 128 || (md->ctypes[*eptr++] & ctype_digit) == 0) - MRRETURN(MATCH_NOMATCH); + if (*eptr >= 128 || (md->ctypes[*eptr] & ctype_digit) == 0) + RRETURN(MATCH_NOMATCH); + eptr++; /* No need to skip more bytes - we know it's a 1-byte character */ } break; @@ -3944,11 +4472,12 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } if (*eptr < 128 && (md->ctypes[*eptr] & ctype_space) != 0) - MRRETURN(MATCH_NOMATCH); - while (++eptr < md->end_subject && (*eptr & 0xc0) == 0x80); + RRETURN(MATCH_NOMATCH); + eptr++; + ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); } break; @@ -3958,10 +4487,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (*eptr >= 128 || (md->ctypes[*eptr++] & ctype_space) == 0) - MRRETURN(MATCH_NOMATCH); + if (*eptr >= 128 || (md->ctypes[*eptr] & ctype_space) == 0) + RRETURN(MATCH_NOMATCH); + eptr++; /* No need to skip more bytes - we know it's a 1-byte character */ } break; @@ -3972,11 +4502,12 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } if (*eptr < 128 && (md->ctypes[*eptr] & ctype_word) != 0) - MRRETURN(MATCH_NOMATCH); - while (++eptr < md->end_subject && (*eptr & 0xc0) == 0x80); + RRETURN(MATCH_NOMATCH); + eptr++; + ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); } break; @@ -3986,10 +4517,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if (*eptr >= 128 || (md->ctypes[*eptr++] & ctype_word) == 0) - MRRETURN(MATCH_NOMATCH); + if (*eptr >= 128 || (md->ctypes[*eptr] & ctype_word) == 0) + RRETURN(MATCH_NOMATCH); + eptr++; /* No need to skip more bytes - we know it's a 1-byte character */ } break; @@ -3999,7 +4531,7 @@ } /* End switch(ctype) */ else -#endif /* SUPPORT_UTF8 */ +#endif /* SUPPORT_UTF */ /* Code for the non-UTF-8 case for minimum matching of operators other than OP_PROP and OP_NOTPROP. */ @@ -4011,10 +4543,19 @@ { if (eptr >= md->end_subject) { - SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + SCHECK_PARTIAL(); + RRETURN(MATCH_NOMATCH); + } + if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); + if (md->partial != 0 && + eptr + 1 >= md->end_subject && + NLBLOCK->nltype == NLTYPE_FIXED && + NLBLOCK->nllen == 2 && + *eptr == NLBLOCK->nl[0]) + { + md->hitend = TRUE; + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); } - if (IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); eptr++; } break; @@ -4023,7 +4564,7 @@ if (eptr > md->end_subject - min) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } eptr += min; break; @@ -4032,7 +4573,7 @@ if (eptr > md->end_subject - min) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } eptr += min; break; @@ -4043,21 +4584,27 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } switch(*eptr++) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); + case 0x000d: if (eptr < md->end_subject && *eptr == 0x0a) eptr++; break; + case 0x000a: break; case 0x000b: case 0x000c: case 0x0085: - if (md->bsr_anycrlf) MRRETURN(MATCH_NOMATCH); +#ifdef COMPILE_PCRE16 + case 0x2028: + case 0x2029: +#endif + if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); break; } } @@ -4069,7 +4616,7 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } switch(*eptr++) { @@ -4077,7 +4624,25 @@ case 0x09: /* HT */ case 0x20: /* SPACE */ case 0xa0: /* NBSP */ - MRRETURN(MATCH_NOMATCH); +#ifdef COMPILE_PCRE16 + case 0x1680: /* OGHAM SPACE MARK */ + case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ + case 0x2000: /* EN QUAD */ + case 0x2001: /* EM QUAD */ + case 0x2002: /* EN SPACE */ + case 0x2003: /* EM SPACE */ + case 0x2004: /* THREE-PER-EM SPACE */ + case 0x2005: /* FOUR-PER-EM SPACE */ + case 0x2006: /* SIX-PER-EM SPACE */ + case 0x2007: /* FIGURE SPACE */ + case 0x2008: /* PUNCTUATION SPACE */ + case 0x2009: /* THIN SPACE */ + case 0x200A: /* HAIR SPACE */ + case 0x202f: /* NARROW NO-BREAK SPACE */ + case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ + case 0x3000: /* IDEOGRAPHIC SPACE */ +#endif + RRETURN(MATCH_NOMATCH); } } break; @@ -4088,14 +4653,32 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } switch(*eptr++) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x09: /* HT */ case 0x20: /* SPACE */ case 0xa0: /* NBSP */ +#ifdef COMPILE_PCRE16 + case 0x1680: /* OGHAM SPACE MARK */ + case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ + case 0x2000: /* EN QUAD */ + case 0x2001: /* EM QUAD */ + case 0x2002: /* EN SPACE */ + case 0x2003: /* EM SPACE */ + case 0x2004: /* THREE-PER-EM SPACE */ + case 0x2005: /* FOUR-PER-EM SPACE */ + case 0x2006: /* SIX-PER-EM SPACE */ + case 0x2007: /* FIGURE SPACE */ + case 0x2008: /* PUNCTUATION SPACE */ + case 0x2009: /* THIN SPACE */ + case 0x200A: /* HAIR SPACE */ + case 0x202f: /* NARROW NO-BREAK SPACE */ + case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ + case 0x3000: /* IDEOGRAPHIC SPACE */ +#endif break; } } @@ -4107,7 +4690,7 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } switch(*eptr++) { @@ -4117,7 +4700,11 @@ case 0x0c: /* FF */ case 0x0d: /* CR */ case 0x85: /* NEL */ - MRRETURN(MATCH_NOMATCH); +#ifdef COMPILE_PCRE16 + case 0x2028: /* LINE SEPARATOR */ + case 0x2029: /* PARAGRAPH SEPARATOR */ +#endif + RRETURN(MATCH_NOMATCH); } } break; @@ -4128,16 +4715,20 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } switch(*eptr++) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x0a: /* LF */ case 0x0b: /* VT */ case 0x0c: /* FF */ case 0x0d: /* CR */ case 0x85: /* NEL */ +#ifdef COMPILE_PCRE16 + case 0x2028: /* LINE SEPARATOR */ + case 0x2029: /* PARAGRAPH SEPARATOR */ +#endif break; } } @@ -4149,9 +4740,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if ((md->ctypes[*eptr++] & ctype_digit) != 0) MRRETURN(MATCH_NOMATCH); + if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_digit) != 0) + RRETURN(MATCH_NOMATCH); + eptr++; } break; @@ -4161,9 +4754,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if ((md->ctypes[*eptr++] & ctype_digit) == 0) MRRETURN(MATCH_NOMATCH); + if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_digit) == 0) + RRETURN(MATCH_NOMATCH); + eptr++; } break; @@ -4173,9 +4768,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if ((md->ctypes[*eptr++] & ctype_space) != 0) MRRETURN(MATCH_NOMATCH); + if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_space) != 0) + RRETURN(MATCH_NOMATCH); + eptr++; } break; @@ -4185,9 +4782,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if ((md->ctypes[*eptr++] & ctype_space) == 0) MRRETURN(MATCH_NOMATCH); + if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_space) == 0) + RRETURN(MATCH_NOMATCH); + eptr++; } break; @@ -4197,10 +4796,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if ((md->ctypes[*eptr++] & ctype_word) != 0) - MRRETURN(MATCH_NOMATCH); + if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_word) != 0) + RRETURN(MATCH_NOMATCH); + eptr++; } break; @@ -4210,10 +4810,11 @@ if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } - if ((md->ctypes[*eptr++] & ctype_word) == 0) - MRRETURN(MATCH_NOMATCH); + if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_word) == 0) + RRETURN(MATCH_NOMATCH); + eptr++; } break; @@ -4240,170 +4841,167 @@ case PT_ANY: for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM36); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM36); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - if (prop_fail_result) MRRETURN(MATCH_NOMATCH); + if (prop_fail_result) RRETURN(MATCH_NOMATCH); } /* Control never gets here */ case PT_LAMP: for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM37); + int chartype; + RMATCH(eptr, ecode, offset_top, md, eptrb, RM37); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_chartype = UCD_CHARTYPE(c); - if ((prop_chartype == ucp_Lu || - prop_chartype == ucp_Ll || - prop_chartype == ucp_Lt) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + chartype = UCD_CHARTYPE(c); + if ((chartype == ucp_Lu || + chartype == ucp_Ll || + chartype == ucp_Lt) == prop_fail_result) + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ case PT_GC: for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM38); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM38); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if ((prop_category == prop_value) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result) + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ case PT_PC: for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM39); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM39); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_chartype = UCD_CHARTYPE(c); - if ((prop_chartype == prop_value) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result) + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ case PT_SC: for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM40); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM40); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_script = UCD_SCRIPT(c); - if ((prop_script == prop_value) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result) + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ case PT_ALNUM: for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM59); + int category; + RMATCH(eptr, ecode, offset_top, md, eptrb, RM59); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_L || prop_category == ucp_N) - == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + category = UCD_CATEGORY(c); + if ((category == ucp_L || category == ucp_N) == prop_fail_result) + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ case PT_SPACE: /* Perl space */ for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM60); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM60); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL || + if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ case PT_PXSPACE: /* POSIX space */ for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM61); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM61); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL || + if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || c == CHAR_FF || c == CHAR_CR) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ case PT_WORD: for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM62); + int category; + RMATCH(eptr, ecode, offset_top, md, eptrb, RM62); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_L || - prop_category == ucp_N || + category = UCD_CATEGORY(c); + if ((category == ucp_L || + category == ucp_N || c == CHAR_UNDERSCORE) == prop_fail_result) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ @@ -4421,52 +5019,59 @@ { for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM41); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM41); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if (prop_category == ucp_M) MRRETURN(MATCH_NOMATCH); + if (UCD_CATEGORY(c) == ucp_M) RRETURN(MATCH_NOMATCH); while (eptr < md->end_subject) { int len = 1; - if (!utf8) c = *eptr; - else { GETCHARLEN(c, eptr, len); } - prop_category = UCD_CATEGORY(c); - if (prop_category != ucp_M) break; + if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); } + if (UCD_CATEGORY(c) != ucp_M) break; eptr += len; } + CHECK_PARTIAL(); } } - else #endif /* SUPPORT_UCP */ -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM42); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM42); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } if (ctype == OP_ANY && IS_NEWLINE(eptr)) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); GETCHARINC(c, eptr); switch(ctype) { - case OP_ANY: /* This is the non-NL case */ + case OP_ANY: /* This is the non-NL case */ + if (md->partial != 0 && /* Take care with CRLF partial */ + eptr >= md->end_subject && + NLBLOCK->nltype == NLTYPE_FIXED && + NLBLOCK->nllen == 2 && + c == NLBLOCK->nl[0]) + { + md->hitend = TRUE; + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); + } + break; + case OP_ALLANY: case OP_ANYBYTE: break; @@ -4474,7 +5079,7 @@ case OP_ANYNL: switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x000d: if (eptr < md->end_subject && *eptr == 0x0a) eptr++; break; @@ -4486,7 +5091,7 @@ case 0x0085: case 0x2028: case 0x2029: - if (md->bsr_anycrlf) MRRETURN(MATCH_NOMATCH); + if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); break; } break; @@ -4514,14 +5119,14 @@ case 0x202f: /* NARROW NO-BREAK SPACE */ case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ case 0x3000: /* IDEOGRAPHIC SPACE */ - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } break; case OP_HSPACE: switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x09: /* HT */ case 0x20: /* SPACE */ case 0xa0: /* NBSP */ @@ -4556,14 +5161,14 @@ case 0x85: /* NEL */ case 0x2028: /* LINE SEPARATOR */ case 0x2029: /* PARAGRAPH SEPARATOR */ - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } break; case OP_VSPACE: switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x0a: /* LF */ case 0x0b: /* VT */ case 0x0c: /* FF */ @@ -4577,32 +5182,32 @@ case OP_NOT_DIGIT: if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); break; case OP_DIGIT: if (c >= 256 || (md->ctypes[c] & ctype_digit) == 0) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); break; case OP_NOT_WHITESPACE: if (c < 256 && (md->ctypes[c] & ctype_space) != 0) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); break; case OP_WHITESPACE: - if (c >= 256 || (md->ctypes[c] & ctype_space) == 0) - MRRETURN(MATCH_NOMATCH); + if (c >= 256 || (md->ctypes[c] & ctype_space) == 0) + RRETURN(MATCH_NOMATCH); break; case OP_NOT_WORDCHAR: if (c < 256 && (md->ctypes[c] & ctype_word) != 0) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); break; case OP_WORDCHAR: if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); break; default: @@ -4612,24 +5217,35 @@ } else #endif - /* Not UTF-8 mode */ + /* Not UTF mode */ { for (fi = min;; fi++) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM43); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM43); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (fi >= max) MRRETURN(MATCH_NOMATCH); + if (fi >= max) RRETURN(MATCH_NOMATCH); if (eptr >= md->end_subject) { SCHECK_PARTIAL(); - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } if (ctype == OP_ANY && IS_NEWLINE(eptr)) - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); c = *eptr++; switch(ctype) { - case OP_ANY: /* This is the non-NL case */ + case OP_ANY: /* This is the non-NL case */ + if (md->partial != 0 && /* Take care with CRLF partial */ + eptr >= md->end_subject && + NLBLOCK->nltype == NLTYPE_FIXED && + NLBLOCK->nllen == 2 && + c == NLBLOCK->nl[0]) + { + md->hitend = TRUE; + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); + } + break; + case OP_ALLANY: case OP_ANYBYTE: break; @@ -4637,7 +5253,7 @@ case OP_ANYNL: switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x000d: if (eptr < md->end_subject && *eptr == 0x0a) eptr++; break; @@ -4648,7 +5264,11 @@ case 0x000b: case 0x000c: case 0x0085: - if (md->bsr_anycrlf) MRRETURN(MATCH_NOMATCH); +#ifdef COMPILE_PCRE16 + case 0x2028: + case 0x2029: +#endif + if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); break; } break; @@ -4660,17 +5280,53 @@ case 0x09: /* HT */ case 0x20: /* SPACE */ case 0xa0: /* NBSP */ - MRRETURN(MATCH_NOMATCH); +#ifdef COMPILE_PCRE16 + case 0x1680: /* OGHAM SPACE MARK */ + case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ + case 0x2000: /* EN QUAD */ + case 0x2001: /* EM QUAD */ + case 0x2002: /* EN SPACE */ + case 0x2003: /* EM SPACE */ + case 0x2004: /* THREE-PER-EM SPACE */ + case 0x2005: /* FOUR-PER-EM SPACE */ + case 0x2006: /* SIX-PER-EM SPACE */ + case 0x2007: /* FIGURE SPACE */ + case 0x2008: /* PUNCTUATION SPACE */ + case 0x2009: /* THIN SPACE */ + case 0x200A: /* HAIR SPACE */ + case 0x202f: /* NARROW NO-BREAK SPACE */ + case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ + case 0x3000: /* IDEOGRAPHIC SPACE */ +#endif + RRETURN(MATCH_NOMATCH); } break; case OP_HSPACE: switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x09: /* HT */ case 0x20: /* SPACE */ case 0xa0: /* NBSP */ +#ifdef COMPILE_PCRE16 + case 0x1680: /* OGHAM SPACE MARK */ + case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ + case 0x2000: /* EN QUAD */ + case 0x2001: /* EM QUAD */ + case 0x2002: /* EN SPACE */ + case 0x2003: /* EM SPACE */ + case 0x2004: /* THREE-PER-EM SPACE */ + case 0x2005: /* FOUR-PER-EM SPACE */ + case 0x2006: /* SIX-PER-EM SPACE */ + case 0x2007: /* FIGURE SPACE */ + case 0x2008: /* PUNCTUATION SPACE */ + case 0x2009: /* THIN SPACE */ + case 0x200A: /* HAIR SPACE */ + case 0x202f: /* NARROW NO-BREAK SPACE */ + case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ + case 0x3000: /* IDEOGRAPHIC SPACE */ +#endif break; } break; @@ -4684,45 +5340,53 @@ case 0x0c: /* FF */ case 0x0d: /* CR */ case 0x85: /* NEL */ - MRRETURN(MATCH_NOMATCH); +#ifdef COMPILE_PCRE16 + case 0x2028: /* LINE SEPARATOR */ + case 0x2029: /* PARAGRAPH SEPARATOR */ +#endif + RRETURN(MATCH_NOMATCH); } break; case OP_VSPACE: switch(c) { - default: MRRETURN(MATCH_NOMATCH); + default: RRETURN(MATCH_NOMATCH); case 0x0a: /* LF */ case 0x0b: /* VT */ case 0x0c: /* FF */ case 0x0d: /* CR */ case 0x85: /* NEL */ +#ifdef COMPILE_PCRE16 + case 0x2028: /* LINE SEPARATOR */ + case 0x2029: /* PARAGRAPH SEPARATOR */ +#endif break; } break; case OP_NOT_DIGIT: - if ((md->ctypes[c] & ctype_digit) != 0) MRRETURN(MATCH_NOMATCH); + if (MAX_255(c) && (md->ctypes[c] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH); break; case OP_DIGIT: - if ((md->ctypes[c] & ctype_digit) == 0) MRRETURN(MATCH_NOMATCH); + if (!MAX_255(c) || (md->ctypes[c] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH); break; case OP_NOT_WHITESPACE: - if ((md->ctypes[c] & ctype_space) != 0) MRRETURN(MATCH_NOMATCH); + if (MAX_255(c) && (md->ctypes[c] & ctype_space) != 0) RRETURN(MATCH_NOMATCH); break; case OP_WHITESPACE: - if ((md->ctypes[c] & ctype_space) == 0) MRRETURN(MATCH_NOMATCH); + if (!MAX_255(c) || (md->ctypes[c] & ctype_space) == 0) RRETURN(MATCH_NOMATCH); break; case OP_NOT_WORDCHAR: - if ((md->ctypes[c] & ctype_word) != 0) MRRETURN(MATCH_NOMATCH); + if (MAX_255(c) && (md->ctypes[c] & ctype_word) != 0) RRETURN(MATCH_NOMATCH); break; case OP_WORDCHAR: - if ((md->ctypes[c] & ctype_word) == 0) MRRETURN(MATCH_NOMATCH); + if (!MAX_255(c) || (md->ctypes[c] & ctype_word) == 0) RRETURN(MATCH_NOMATCH); break; default: @@ -4764,6 +5428,7 @@ case PT_LAMP: for (i = min; i < max; i++) { + int chartype; int len = 1; if (eptr >= md->end_subject) { @@ -4771,10 +5436,10 @@ break; } GETCHARLENTEST(c, eptr, len); - prop_chartype = UCD_CHARTYPE(c); - if ((prop_chartype == ucp_Lu || - prop_chartype == ucp_Ll || - prop_chartype == ucp_Lt) == prop_fail_result) + chartype = UCD_CHARTYPE(c); + if ((chartype == ucp_Lu || + chartype == ucp_Ll || + chartype == ucp_Lt) == prop_fail_result) break; eptr+= len; } @@ -4790,9 +5455,7 @@ break; } GETCHARLENTEST(c, eptr, len); - prop_category = UCD_CATEGORY(c); - if ((prop_category == prop_value) == prop_fail_result) - break; + if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result) break; eptr+= len; } break; @@ -4807,9 +5470,7 @@ break; } GETCHARLENTEST(c, eptr, len); - prop_chartype = UCD_CHARTYPE(c); - if ((prop_chartype == prop_value) == prop_fail_result) - break; + if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result) break; eptr+= len; } break; @@ -4824,9 +5485,7 @@ break; } GETCHARLENTEST(c, eptr, len); - prop_script = UCD_SCRIPT(c); - if ((prop_script == prop_value) == prop_fail_result) - break; + if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result) break; eptr+= len; } break; @@ -4834,6 +5493,7 @@ case PT_ALNUM: for (i = min; i < max; i++) { + int category; int len = 1; if (eptr >= md->end_subject) { @@ -4841,9 +5501,8 @@ break; } GETCHARLENTEST(c, eptr, len); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_L || prop_category == ucp_N) - == prop_fail_result) + category = UCD_CATEGORY(c); + if ((category == ucp_L || category == ucp_N) == prop_fail_result) break; eptr+= len; } @@ -4859,8 +5518,7 @@ break; } GETCHARLENTEST(c, eptr, len); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL || + if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR) == prop_fail_result) break; @@ -4878,8 +5536,7 @@ break; } GETCHARLENTEST(c, eptr, len); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL || + if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || c == CHAR_FF || c == CHAR_CR) == prop_fail_result) break; @@ -4890,6 +5547,7 @@ case PT_WORD: for (i = min; i < max; i++) { + int category; int len = 1; if (eptr >= md->end_subject) { @@ -4897,8 +5555,8 @@ break; } GETCHARLENTEST(c, eptr, len); - prop_category = UCD_CATEGORY(c); - if ((prop_category == ucp_L || prop_category == ucp_N || + category = UCD_CATEGORY(c); + if ((category == ucp_L || category == ucp_N || c == CHAR_UNDERSCORE) == prop_fail_result) break; eptr+= len; @@ -4914,10 +5572,10 @@ if (possessive) continue; for(;;) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM44); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM44); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (eptr-- == pp) break; /* Stop if tried at original pos */ - if (utf8) BACKCHAR(eptr); + if (utf) BACKCHAR(eptr); } } @@ -4928,25 +5586,23 @@ { for (i = min; i < max; i++) { + int len = 1; if (eptr >= md->end_subject) { SCHECK_PARTIAL(); break; } - GETCHARINCTEST(c, eptr); - prop_category = UCD_CATEGORY(c); - if (prop_category == ucp_M) break; + if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); } + if (UCD_CATEGORY(c) == ucp_M) break; + eptr += len; while (eptr < md->end_subject) { - int len = 1; - if (!utf8) c = *eptr; else - { - GETCHARLEN(c, eptr, len); - } - prop_category = UCD_CATEGORY(c); - if (prop_category != ucp_M) break; + len = 1; + if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); } + if (UCD_CATEGORY(c) != ucp_M) break; eptr += len; } + CHECK_PARTIAL(); } /* eptr is now past the end of the maximum run */ @@ -4955,19 +5611,17 @@ for(;;) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM45); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM45); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (eptr-- == pp) break; /* Stop if tried at original pos */ for (;;) /* Move back over one extended */ { - int len = 1; - if (!utf8) c = *eptr; else + if (!utf) c = *eptr; else { BACKCHAR(eptr); - GETCHARLEN(c, eptr, len); + GETCHAR(c, eptr); } - prop_category = UCD_CATEGORY(c); - if (prop_category != ucp_M) break; + if (UCD_CATEGORY(c) != ucp_M) break; eptr--; } } @@ -4976,10 +5630,8 @@ else #endif /* SUPPORT_UCP */ -#ifdef SUPPORT_UTF8 - /* UTF-8 mode */ - - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { switch(ctype) { @@ -4994,8 +5646,17 @@ break; } if (IS_NEWLINE(eptr)) break; + if (md->partial != 0 && /* Take care with CRLF partial */ + eptr + 1 >= md->end_subject && + NLBLOCK->nltype == NLTYPE_FIXED && + NLBLOCK->nllen == 2 && + *eptr == NLBLOCK->nl[0]) + { + md->hitend = TRUE; + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); + } eptr++; - while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); } } @@ -5011,8 +5672,17 @@ break; } if (IS_NEWLINE(eptr)) break; + if (md->partial != 0 && /* Take care with CRLF partial */ + eptr + 1 >= md->end_subject && + NLBLOCK->nltype == NLTYPE_FIXED && + NLBLOCK->nllen == 2 && + *eptr == NLBLOCK->nl[0]) + { + md->hitend = TRUE; + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); + } eptr++; - while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); } } break; @@ -5028,10 +5698,14 @@ break; } eptr++; - while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; + ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); } } - else eptr = md->end_subject; /* Unlimited UTF-8 repeat */ + else + { + eptr = md->end_subject; /* Unlimited UTF-8 repeat */ + SCHECK_PARTIAL(); + } break; /* The byte case is the same as non-UTF8 */ @@ -5239,21 +5913,26 @@ RRETURN(PCRE_ERROR_INTERNAL); } - /* eptr is now past the end of the maximum run */ + /* eptr is now past the end of the maximum run. If possessive, we are + done (no backing up). Otherwise, match at this position; anything other + than no match is immediately returned. For nomatch, back up one + character, unless we are matching \R and the last thing matched was + \r\n, in which case, back up two bytes. */ if (possessive) continue; for(;;) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM46); + RMATCH(eptr, ecode, offset_top, md, eptrb, RM46); if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (eptr-- == pp) break; /* Stop if tried at original pos */ BACKCHAR(eptr); + if (ctype == OP_ANYNL && eptr > pp && *eptr == '\n' && + eptr[-1] == '\r') eptr--; } } else -#endif /* SUPPORT_UTF8 */ - - /* Not UTF-8 mode */ +#endif /* SUPPORT_UTF */ + /* Not UTF mode */ { switch(ctype) { @@ -5266,6 +5945,15 @@ break; } if (IS_NEWLINE(eptr)) break; + if (md->partial != 0 && /* Take care with CRLF partial */ + eptr + 1 >= md->end_subject && + NLBLOCK->nltype == NLTYPE_FIXED && + NLBLOCK->nllen == 2 && + *eptr == NLBLOCK->nl[0]) + { + md->hitend = TRUE; + if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); + } eptr++; } break; @@ -5297,10 +5985,12 @@ } else { - if (c != 0x000a && - (md->bsr_anycrlf || - (c != 0x000b && c != 0x000c && c != 0x0085))) - break; + if (c != 0x000a && (md->bsr_anycrlf || + (c != 0x000b && c != 0x000c && c != 0x0085 +#ifdef COMPILE_PCRE16 + && c != 0x2028 && c != 0x2029 +#endif + ))) break; eptr++; } } @@ -5315,7 +6005,12 @@ break; } c = *eptr; - if (c == 0x09 || c == 0x20 || c == 0xa0) break; + if (c == 0x09 || c == 0x20 || c == 0xa0 +#ifdef COMPILE_PCRE16 + || c == 0x1680 || c == 0x180e || (c >= 0x2000 && c <= 0x200A) + || c == 0x202f || c == 0x205f || c == 0x3000 +#endif + ) break; eptr++; } break; @@ -5329,7 +6024,12 @@ break; } c = *eptr; - if (c != 0x09 && c != 0x20 && c != 0xa0) break; + if (c != 0x09 && c != 0x20 && c != 0xa0 +#ifdef COMPILE_PCRE16 + && c != 0x1680 && c != 0x180e && (c < 0x2000 || c > 0x200A) + && c != 0x202f && c != 0x205f && c != 0x3000 +#endif + ) break; eptr++; } break; @@ -5343,8 +6043,11 @@ break; } c = *eptr; - if (c == 0x0a || c == 0x0b || c == 0x0c || c == 0x0d || c == 0x85) - break; + if (c == 0x0a || c == 0x0b || c == 0x0c || c == 0x0d || c == 0x85 +#ifdef COMPILE_PCRE16 + || c == 0x2028 || c == 0x2029 +#endif + ) break; eptr++; } break; @@ -5358,8 +6061,11 @@ break; } c = *eptr; - if (c != 0x0a && c != 0x0b && c != 0x0c && c != 0x0d && c != 0x85) - break; + if (c != 0x0a && c != 0x0b && c != 0x0c && c != 0x0d && c != 0x85 +#ifdef COMPILE_PCRE16 + && c != 0x2028 && c != 0x2029 +#endif + ) break; eptr++; } break; @@ -5372,7 +6078,7 @@ SCHECK_PARTIAL(); break; } - if ((md->ctypes[*eptr] & ctype_digit) != 0) break; + if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_digit) != 0) break; eptr++; } break; @@ -5385,7 +6091,7 @@ SCHECK_PARTIAL(); break; } - if ((md->ctypes[*eptr] & ctype_digit) == 0) break; + if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_digit) == 0) break; eptr++; } break; @@ -5398,7 +6104,7 @@ SCHECK_PARTIAL(); break; } - if ((md->ctypes[*eptr] & ctype_space) != 0) break; + if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_space) != 0) break; eptr++; } break; @@ -5411,7 +6117,7 @@ SCHECK_PARTIAL(); break; } - if ((md->ctypes[*eptr] & ctype_space) == 0) break; + if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_space) == 0) break; eptr++; } break; @@ -5424,7 +6130,7 @@ SCHECK_PARTIAL(); break; } - if ((md->ctypes[*eptr] & ctype_word) != 0) break; + if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_word) != 0) break; eptr++; } break; @@ -5437,7 +6143,7 @@ SCHECK_PARTIAL(); break; } - if ((md->ctypes[*eptr] & ctype_word) == 0) break; + if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_word) == 0) break; eptr++; } break; @@ -5446,20 +6152,26 @@ RRETURN(PCRE_ERROR_INTERNAL); } - /* eptr is now past the end of the maximum run */ + /* eptr is now past the end of the maximum run. If possessive, we are + done (no backing up). Otherwise, match at this position; anything other + than no match is immediately returned. For nomatch, back up one + character (byte), unless we are matching \R and the last thing matched + was \r\n, in which case, back up two bytes. */ if (possessive) continue; while (eptr >= pp) { - RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM47); - eptr--; + RMATCH(eptr, ecode, offset_top, md, eptrb, RM47); if (rrc != MATCH_NOMATCH) RRETURN(rrc); + eptr--; + if (ctype == OP_ANYNL && eptr > pp && *eptr == '\n' && + eptr[-1] == '\r') eptr--; } } /* Get here if we can't make it match with any permitted repetitions */ - MRRETURN(MATCH_NOMATCH); + RRETURN(MATCH_NOMATCH); } /* Control never gets here */ @@ -5492,17 +6204,25 @@ LBL( 9) LBL(10) LBL(11) LBL(12) LBL(13) LBL(14) LBL(15) LBL(17) LBL(19) LBL(24) LBL(25) LBL(26) LBL(27) LBL(29) LBL(31) LBL(33) LBL(35) LBL(43) LBL(47) LBL(48) LBL(49) LBL(50) LBL(51) LBL(52) - LBL(53) LBL(54) LBL(55) LBL(56) LBL(57) LBL(58) -#ifdef SUPPORT_UTF8 - LBL(16) LBL(18) LBL(20) LBL(21) LBL(22) LBL(23) LBL(28) LBL(30) + LBL(53) LBL(54) LBL(55) LBL(56) LBL(57) LBL(58) LBL(63) LBL(64) + LBL(65) LBL(66) +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 + LBL(21) +#endif +#ifdef SUPPORT_UTF + LBL(16) LBL(18) LBL(20) + LBL(22) LBL(23) LBL(28) LBL(30) LBL(32) LBL(34) LBL(42) LBL(46) #ifdef SUPPORT_UCP LBL(36) LBL(37) LBL(38) LBL(39) LBL(40) LBL(41) LBL(44) LBL(45) LBL(59) LBL(60) LBL(61) LBL(62) #endif /* SUPPORT_UCP */ -#endif /* SUPPORT_UTF8 */ +#endif /* SUPPORT_UTF */ default: DPRINTF(("jump error in pcre match: label %d non-existent\n", frame->Xwhere)); + +printf("+++jump error in pcre match: label %d non-existent\n", frame->Xwhere); + return PCRE_ERROR_INTERNAL; } #undef LBL @@ -5521,7 +6241,6 @@ #undef ecode #undef mstart #undef offset_top -#undef ims #undef eptrb #undef flags @@ -5539,8 +6258,6 @@ #undef condition #undef prev_is_word -#undef original_ims - #undef ctype #undef length #undef max @@ -5567,6 +6284,31 @@ ***************************************************************************/ +#ifdef NO_RECURSE +/************************************************* +* Release allocated heap frames * +*************************************************/ + +/* This function releases all the allocated frames. The base frame is on the +machine stack, and so must not be freed. + +Argument: the address of the base frame +Returns: nothing +*/ + +static void +release_match_heapframes (heapframe *frame_base) +{ +heapframe *nextframe = frame_base->Xnextframe; +while (nextframe != NULL) + { + heapframe *oldframe = nextframe; + nextframe = nextframe->Xnextframe; + (PUBL(stack_free))(oldframe); + } +} +#endif + /************************************************* * Execute a Regular Expression * @@ -5592,52 +6334,150 @@ < -1 => some kind of unexpected problem */ +#ifdef COMPILE_PCRE8 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) +#else +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre16_exec(const pcre16 *argument_re, const pcre16_extra *extra_data, + PCRE_SPTR16 subject, int length, int start_offset, int options, int *offsets, + int offsetcount) +#endif { -int rc, resetcount, ocount; -int first_byte = -1; -int req_byte = -1; -int req_byte2 = -1; +int rc, ocount, arg_offset_max; int newline; -unsigned long int ims; BOOL using_temporary_offsets = FALSE; BOOL anchored; BOOL startline; BOOL firstline; -BOOL first_byte_caseless = FALSE; -BOOL req_byte_caseless = FALSE; -BOOL utf8; +BOOL utf; +BOOL has_first_char = FALSE; +BOOL has_req_char = FALSE; +pcre_uchar first_char = 0; +pcre_uchar first_char2 = 0; +pcre_uchar req_char = 0; +pcre_uchar req_char2 = 0; match_data match_block; match_data *md = &match_block; -const uschar *tables; -const uschar *start_bits = NULL; -USPTR start_match = (USPTR)subject + start_offset; -USPTR end_subject; -USPTR start_partial = NULL; -USPTR req_byte_ptr = start_match - 1; +const pcre_uint8 *tables; +const pcre_uint8 *start_bits = NULL; +PCRE_PUCHAR start_match = (PCRE_PUCHAR)subject + start_offset; +PCRE_PUCHAR end_subject; +PCRE_PUCHAR start_partial = NULL; +PCRE_PUCHAR req_char_ptr = start_match - 1; -pcre_study_data internal_study; const pcre_study_data *study; +const REAL_PCRE *re = (const REAL_PCRE *)argument_re; + +#ifdef NO_RECURSE +heapframe frame_zero; +frame_zero.Xprevframe = NULL; /* Marks the top level */ +frame_zero.Xnextframe = NULL; /* None are allocated yet */ +md->match_frames_base = &frame_zero; +#endif + +/* Check for the special magic call that measures the size of the stack used +per recursive call of match(). Without the funny casting for sizeof, a Windows +compiler gave this error: "unary minus operator applied to unsigned type, +result still unsigned". Hopefully the cast fixes that. */ -real_pcre internal_re; -const real_pcre *external_re = (const real_pcre *)argument_re; -const real_pcre *re = external_re; +if (re == NULL && extra_data == NULL && subject == NULL && length == -999 && + start_offset == -999) +#ifdef NO_RECURSE + return -((int)sizeof(heapframe)); +#else + return match(NULL, NULL, NULL, 0, NULL, NULL, 0); +#endif /* Plausibility checks */ if ((options & ~PUBLIC_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION; -if (re == NULL || subject == NULL || - (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL; +if (re == NULL || subject == NULL || (offsets == NULL && offsetcount > 0)) + return PCRE_ERROR_NULL; if (offsetcount < 0) return PCRE_ERROR_BADCOUNT; if (start_offset < 0 || start_offset > length) return PCRE_ERROR_BADOFFSET; -/* This information is for finding all the numbers associated with a given -name, for condition testing. */ +/* Check that the first field in the block is the magic number. If it is not, +return with PCRE_ERROR_BADMAGIC. However, if the magic number is equal to +REVERSED_MAGIC_NUMBER we return with PCRE_ERROR_BADENDIANNESS, which +means that the pattern is likely compiled with different endianness. */ + +if (re->magic_number != MAGIC_NUMBER) + return re->magic_number == REVERSED_MAGIC_NUMBER? + PCRE_ERROR_BADENDIANNESS:PCRE_ERROR_BADMAGIC; +if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE; + +/* These two settings are used in the code for checking a UTF-8 string that +follows immediately afterwards. Other values in the md block are used only +during "normal" pcre_exec() processing, not when the JIT support is in use, +so they are set up later. */ + +/* PCRE_UTF16 has the same value as PCRE_UTF8. */ +utf = md->utf = (re->options & PCRE_UTF8) != 0; +md->partial = ((options & PCRE_PARTIAL_HARD) != 0)? 2 : + ((options & PCRE_PARTIAL_SOFT) != 0)? 1 : 0; + +/* Check a UTF-8 string if required. Pass back the character offset and error +code for an invalid string if a results vector is available. */ + +#ifdef SUPPORT_UTF +if (utf && (options & PCRE_NO_UTF8_CHECK) == 0) + { + int erroroffset; + int errorcode = PRIV(valid_utf)((PCRE_PUCHAR)subject, length, &erroroffset); + if (errorcode != 0) + { + if (offsetcount >= 2) + { + offsets[0] = erroroffset; + offsets[1] = errorcode; + } +#ifdef COMPILE_PCRE16 + return (errorcode <= PCRE_UTF16_ERR1 && md->partial > 1)? + PCRE_ERROR_SHORTUTF16 : PCRE_ERROR_BADUTF16; +#else + return (errorcode <= PCRE_UTF8_ERR5 && md->partial > 1)? + PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8; +#endif + } + + /* Check that a start_offset points to the start of a UTF character. */ + if (start_offset > 0 && start_offset < length && + NOT_FIRSTCHAR(((PCRE_PUCHAR)subject)[start_offset])) + return PCRE_ERROR_BADUTF8_OFFSET; + } +#endif + +/* If the pattern was successfully studied with JIT support, run the JIT +executable instead of the rest of this function. Most options must be set at +compile time for the JIT code to be usable. Fallback to the normal code path if +an unsupported flag is set. */ + +#ifdef SUPPORT_JIT +if (extra_data != NULL + && (extra_data->flags & (PCRE_EXTRA_EXECUTABLE_JIT | + PCRE_EXTRA_TABLES)) == PCRE_EXTRA_EXECUTABLE_JIT + && extra_data->executable_jit != NULL + && (options & ~(PCRE_NO_UTF8_CHECK | PCRE_NOTBOL | PCRE_NOTEOL | + PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | + PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD)) == 0) + { + rc = PRIV(jit_exec)(re, extra_data, (const pcre_uchar *)subject, length, + start_offset, options, offsets, offsetcount); + + /* PCRE_ERROR_NULL means that the selected normal or partial matching + mode is not compiled. In this case we simply fallback to interpreter. */ + + if (rc != PCRE_ERROR_NULL) return rc; + } +#endif -md->name_table = (uschar *)re + re->name_table_offset; +/* Carry on with non-JIT matching. This information is for finding all the +numbers associated with a given name, for condition testing. */ + +md->name_table = (pcre_uchar *)re + re->name_table_offset; md->name_count = re->name_count; md->name_entry_size = re->name_entry_size; @@ -5651,7 +6491,7 @@ /* The table pointer is always in native byte order. */ -tables = external_re->tables; +tables = re->tables; if (extra_data != NULL) { @@ -5671,19 +6511,7 @@ is a feature that makes it possible to save compiled regex and re-use them in other programs later. */ -if (tables == NULL) tables = _pcre_default_tables; - -/* Check that the first field in the block is the magic number. If it is not, -test for a regex that was compiled on a host of opposite endianness. If this is -the case, flipped values are put in internal_re and internal_study if there was -study data too. */ - -if (re->magic_number != MAGIC_NUMBER) - { - re = _pcre_try_flipped(re, &internal_re, study, &internal_study); - if (re == NULL) return PCRE_ERROR_BADMAGIC; - if (study != NULL) study = &internal_study; - } +if (tables == NULL) tables = PRIV(default_tables); /* Set up other data */ @@ -5693,31 +6521,35 @@ /* The code starts after the real_pcre block and the capture name table. */ -md->start_code = (const uschar *)external_re + re->name_table_offset + +md->start_code = (const pcre_uchar *)re + re->name_table_offset + re->name_count * re->name_entry_size; -md->start_subject = (USPTR)subject; +md->start_subject = (PCRE_PUCHAR)subject; md->start_offset = start_offset; md->end_subject = md->start_subject + length; end_subject = md->end_subject; md->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0; -utf8 = md->utf8 = (re->options & PCRE_UTF8) != 0; md->use_ucp = (re->options & PCRE_UCP) != 0; md->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0; +md->ignore_skip_arg = FALSE; + +/* Some options are unpacked into BOOL variables in the hope that testing +them will be faster than individual option bits. */ md->notbol = (options & PCRE_NOTBOL) != 0; md->noteol = (options & PCRE_NOTEOL) != 0; md->notempty = (options & PCRE_NOTEMPTY) != 0; md->notempty_atstart = (options & PCRE_NOTEMPTY_ATSTART) != 0; -md->partial = ((options & PCRE_PARTIAL_HARD) != 0)? 2 : - ((options & PCRE_PARTIAL_SOFT) != 0)? 1 : 0; + md->hitend = FALSE; -md->mark = NULL; /* In case never set */ +md->mark = md->nomatch_mark = NULL; /* In case never set */ md->recursive = NULL; /* No recursion at top level */ +md->hasthen = (re->flags & PCRE_HASTHEN) != 0; md->lcc = tables + lcc_offset; +md->fcc = tables + fcc_offset; md->ctypes = tables + ctypes_offset; /* Handle different \R options. */ @@ -5793,41 +6625,18 @@ if (md->partial && (re->flags & PCRE_NOPARTIAL) != 0) return PCRE_ERROR_BADPARTIAL; -/* Check a UTF-8 string if required. Unfortunately there's no way of passing -back the character offset. */ - -#ifdef SUPPORT_UTF8 -if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0) - { - int tb; - if ((tb = _pcre_valid_utf8((USPTR)subject, length)) >= 0) - return (tb == length && md->partial > 1)? - PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8; - if (start_offset > 0 && start_offset < length) - { - tb = ((USPTR)subject)[start_offset] & 0xc0; - if (tb == 0x80) return PCRE_ERROR_BADUTF8_OFFSET; - } - } -#endif - -/* The ims options can vary during the matching as a result of the presence -of (?ims) items in the pattern. They are kept in a local variable so that -restoring at the exit of a group is easy. */ - -ims = re->options & (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL); - /* If the expression has got more back references than the offsets supplied can hold, we get a temporary chunk of working store to use during the matching. Otherwise, we can use the vector supplied, rounding down its size to a multiple of 3. */ ocount = offsetcount - (offsetcount % 3); +arg_offset_max = (2*ocount)/3; if (re->top_backref > 0 && re->top_backref >= ocount/3) { ocount = re->top_backref * 3 + 3; - md->offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int)); + md->offset_vector = (int *)(PUBL(malloc))(ocount * sizeof(int)); if (md->offset_vector == NULL) return PCRE_ERROR_NOMEMORY; using_temporary_offsets = TRUE; DPRINTF(("Got memory to hold back references\n")); @@ -5839,25 +6648,22 @@ md->offset_overflow = FALSE; md->capture_last = -1; -/* Compute the minimum number of offsets that we need to reset each time. Doing -this makes a huge difference to execution time when there aren't many brackets -in the pattern. */ - -resetcount = 2 + re->top_bracket * 2; -if (resetcount > offsetcount) resetcount = ocount; - /* Reset the working variable associated with each extraction. These should never be used unless previously set, but they get saved and restored, and so we -initialize them to avoid reading uninitialized locations. */ +initialize them to avoid reading uninitialized locations. Also, unset the +offsets for the matched string. This is really just for tidiness with callouts, +in case they inspect these fields. */ if (md->offset_vector != NULL) { register int *iptr = md->offset_vector + ocount; - register int *iend = iptr - resetcount/2 + 1; + register int *iend = iptr - re->top_bracket; + if (iend < md->offset_vector + 2) iend = md->offset_vector + 2; while (--iptr >= iend) *iptr = -1; + md->offset_vector[0] = md->offset_vector[1] = -1; } -/* Set up the first character to match, if available. The first_byte value is +/* Set up the first character to match, if available. The first_char value is never set for an anchored regular expression, but the anchoring may be forced at run time, so we have to test for anchoring. The first char may be unset for an unanchored pattern, of course. If there's no first char and the pattern was @@ -5867,9 +6673,16 @@ { if ((re->flags & PCRE_FIRSTSET) != 0) { - first_byte = re->first_byte & 255; - if ((first_byte_caseless = ((re->first_byte & REQ_CASELESS) != 0)) == TRUE) - first_byte = md->lcc[first_byte]; + has_first_char = TRUE; + first_char = first_char2 = (pcre_uchar)(re->first_char); + if ((re->flags & PCRE_FCH_CASELESS) != 0) + { + first_char2 = TABLE_GET(first_char, md->fcc, first_char); +#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8) + if (utf && first_char > 127) + first_char2 = UCD_OTHERCASE(first_char); +#endif + } } else if (!startline && study != NULL && @@ -5882,9 +6695,16 @@ if ((re->flags & PCRE_REQCHSET) != 0) { - req_byte = re->req_byte & 255; - req_byte_caseless = (re->req_byte & REQ_CASELESS) != 0; - req_byte2 = (tables + fcc_offset)[req_byte]; /* case flipped */ + has_req_char = TRUE; + req_char = req_char2 = (pcre_uchar)(re->req_char); + if ((re->flags & PCRE_RCH_CASELESS) != 0) + { + req_char2 = TABLE_GET(req_char, md->fcc, req_char); +#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8) + if (utf && req_char > 127) + req_char2 = UCD_OTHERCASE(req_char); +#endif + } } @@ -5895,17 +6715,8 @@ for(;;) { - USPTR save_end_subject = end_subject; - USPTR new_start_match; - - /* Reset the maximum number of extractions we might see. */ - - if (md->offset_vector != NULL) - { - register int *iptr = md->offset_vector; - register int *iend = iptr + resetcount; - while (iptr < iend) *iptr++ = -1; - } + PCRE_PUCHAR save_end_subject = end_subject; + PCRE_PUCHAR new_start_match; /* If firstline is TRUE, the start of the match is constrained to the first line of a multiline string. That is, the match must be before or at the first @@ -5915,14 +6726,14 @@ if (firstline) { - USPTR t = start_match; -#ifdef SUPPORT_UTF8 - if (utf8) + PCRE_PUCHAR t = start_match; +#ifdef SUPPORT_UTF + if (utf) { while (t < md->end_subject && !IS_NEWLINE(t)) { t++; - while (t < end_subject && (*t & 0xc0) == 0x80) t++; + ACROSSCHAR(t < end_subject, *t, t++); } } else @@ -5939,15 +6750,16 @@ if (((options | re->options) & PCRE_NO_START_OPTIMIZE) == 0) { - /* Advance to a unique first byte if there is one. */ + /* Advance to a unique first char if there is one. */ - if (first_byte >= 0) + if (has_first_char) { - if (first_byte_caseless) - while (start_match < end_subject && md->lcc[*start_match] != first_byte) + if (first_char != first_char2) + while (start_match < end_subject && + *start_match != first_char && *start_match != first_char2) start_match++; else - while (start_match < end_subject && *start_match != first_byte) + while (start_match < end_subject && *start_match != first_char) start_match++; } @@ -5957,14 +6769,14 @@ { if (start_match > md->start_subject + start_offset) { -#ifdef SUPPORT_UTF8 - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { while (start_match < end_subject && !WAS_NEWLINE(start_match)) { start_match++; - while(start_match < end_subject && (*start_match & 0xc0) == 0x80) - start_match++; + ACROSSCHAR(start_match < end_subject, *start_match, + start_match++); } } else @@ -5991,13 +6803,18 @@ while (start_match < end_subject) { register unsigned int c = *start_match; +#ifndef COMPILE_PCRE8 + if (c > 255) c = 255; +#endif if ((start_bits[c/8] & (1 << (c&7))) == 0) { start_match++; -#ifdef SUPPORT_UTF8 - if (utf8) - while(start_match < end_subject && (*start_match & 0xc0) == 0x80) - start_match++; +#if defined SUPPORT_UTF && defined COMPILE_PCRE8 + /* In non 8-bit mode, the iteration will stop for + characters > 255 at the beginning or not stop at all. */ + if (utf) + ACROSSCHAR(start_match < end_subject, *start_match, + start_match++); #endif } else break; @@ -6012,7 +6829,7 @@ /* The following two optimizations are disabled for partial matching or if disabling is explicitly requested. */ - if ((options & PCRE_NO_START_OPTIMIZE) == 0 && !md->partial) + if (((options | re->options) & PCRE_NO_START_OPTIMIZE) == 0 && !md->partial) { /* If the pattern was studied, a minimum subject length may be set. This is a lower bound; no actual string of that length may actually match the @@ -6026,8 +6843,8 @@ break; } - /* If req_byte is set, we know that that character must appear in the - subject for the match to succeed. If the first character is set, req_byte + /* If req_char is set, we know that that character must appear in the + subject for the match to succeed. If the first character is set, req_char must be later in the subject; otherwise the test starts at the match point. This optimization can save a huge amount of backtracking in patterns with nested unlimited repeats that aren't going to match. Writing separate code @@ -6040,28 +6857,28 @@ 32-megabyte string... so we don't do this when the string is sufficiently long. */ - if (req_byte >= 0 && end_subject - start_match < REQ_BYTE_MAX) + if (has_req_char && end_subject - start_match < REQ_BYTE_MAX) { - register USPTR p = start_match + ((first_byte >= 0)? 1 : 0); + register PCRE_PUCHAR p = start_match + (has_first_char? 1:0); /* We don't need to repeat the search if we haven't yet reached the place we found it at last time. */ - if (p > req_byte_ptr) + if (p > req_char_ptr) { - if (req_byte_caseless) + if (req_char != req_char2) { while (p < end_subject) { register int pp = *p++; - if (pp == req_byte || pp == req_byte2) { p--; break; } + if (pp == req_char || pp == req_char2) { p--; break; } } } else { while (p < end_subject) { - if (*p++ == req_byte) { p--; break; } + if (*p++ == req_char) { p--; break; } } } @@ -6078,7 +6895,7 @@ found it, so that we don't search again next time round the loop if the start hasn't passed this character yet. */ - req_byte_ptr = p; + req_char_ptr = p; } } } @@ -6095,12 +6912,25 @@ md->start_match_ptr = start_match; md->start_used_ptr = start_match; md->match_call_count = 0; - rc = match(start_match, md->start_code, start_match, NULL, 2, md, ims, NULL, - 0, 0); + md->match_function_type = 0; + md->end_offset_top = 0; + rc = match(start_match, md->start_code, start_match, 2, md, NULL, 0); if (md->hitend && start_partial == NULL) start_partial = md->start_used_ptr; switch(rc) { + /* If MATCH_SKIP_ARG reaches this level it means that a MARK that matched + the SKIP's arg was not found. In this circumstance, Perl ignores the SKIP + entirely. The only way we can do that is to re-do the match at the same + point, with a flag to force SKIP with an argument to be ignored. Just + treating this case as NOMATCH does not work because it does not check other + alternatives in patterns such as A(*SKIP:A)B|AC when the subject is AC. */ + + case MATCH_SKIP_ARG: + new_start_match = start_match; + md->ignore_skip_arg = TRUE; + break; + /* SKIP passes back the next starting point explicitly, but if it is the same as the match we have just done, treat it as NOMATCH. */ @@ -6112,23 +6942,18 @@ } /* Fall through */ - /* If MATCH_SKIP_ARG reaches this level it means that a MARK that matched - the SKIP's arg was not found. We also treat this as NOMATCH. */ - - case MATCH_SKIP_ARG: - /* Fall through */ - /* NOMATCH and PRUNE advance by one character. THEN at this level acts - exactly like PRUNE. */ + exactly like PRUNE. Unset the ignore SKIP-with-argument flag. */ case MATCH_NOMATCH: case MATCH_PRUNE: case MATCH_THEN: + md->ignore_skip_arg = FALSE; new_start_match = start_match + 1; -#ifdef SUPPORT_UTF8 - if (utf8) - while(new_start_match < end_subject && (*new_start_match & 0xc0) == 0x80) - new_start_match++; +#ifdef SUPPORT_UTF + if (utf) + ACROSSCHAR(new_start_match < end_subject, *new_start_match, + new_start_match++); #endif break; @@ -6166,9 +6991,13 @@ /* If we have just passed a CR and we are now at a LF, and the pattern does not contain any explicit matches for \r or \n, and the newline option is CRLF - or ANY or ANYCRLF, advance the match position by one more character. */ + or ANY or ANYCRLF, advance the match position by one more character. In + normal matching start_match will aways be greater than the first position at + this stage, but a failed *SKIP can cause a return at the same point, which is + why the first test exists. */ - if (start_match[-1] == CHAR_CR && + if (start_match > (PCRE_PUCHAR)subject + start_offset && + start_match[-1] == CHAR_CR && start_match < end_subject && *start_match == CHAR_NL && (re->flags & PCRE_HASCRORLF) == 0 && @@ -6206,21 +7035,41 @@ { if (using_temporary_offsets) { - if (offsetcount >= 4) + if (arg_offset_max >= 4) { memcpy(offsets + 2, md->offset_vector + 2, - (offsetcount - 2) * sizeof(int)); + (arg_offset_max - 2) * sizeof(int)); DPRINTF(("Copied offsets from temporary memory\n")); } - if (md->end_offset_top > offsetcount) md->offset_overflow = TRUE; + if (md->end_offset_top > arg_offset_max) md->offset_overflow = TRUE; DPRINTF(("Freeing temporary memory\n")); - (pcre_free)(md->offset_vector); + (PUBL(free))(md->offset_vector); } - /* Set the return code to the number of captured strings, or 0 if there are + /* Set the return code to the number of captured strings, or 0 if there were too many to fit into the vector. */ - rc = md->offset_overflow? 0 : md->end_offset_top/2; + rc = (md->offset_overflow && md->end_offset_top >= arg_offset_max)? + 0 : md->end_offset_top/2; + + /* If there is space in the offset vector, set any unused pairs at the end of + the pattern to -1 for backwards compatibility. It is documented that this + happens. In earlier versions, the whole set of potential capturing offsets + was set to -1 each time round the loop, but this is handled differently now. + "Gaps" are set to -1 dynamically instead (this fixes a bug). Thus, it is only + those at the end that need unsetting here. We can't just unset them all at + the start of the whole thing because they may get set in one branch that is + not the final matching branch. */ + + if (md->end_offset_top/2 <= re->top_bracket && offsets != NULL) + { + register int *iptr, *iend; + int resetcount = 2 + re->top_bracket * 2; + if (resetcount > offsetcount) resetcount = offsetcount; + iptr = offsets + md->end_offset_top; + iend = offsets + resetcount; + while (iptr < iend) *iptr++ = -1; + } /* If there is space, set up the whole thing as substring 0. The value of md->start_match_ptr might be modified if \K was encountered on the success @@ -6232,8 +7081,15 @@ offsets[1] = (int)(md->end_match_ptr - md->start_subject); } + /* Return MARK data if requested */ + + if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_MARK) != 0) + *(extra_data->mark) = (pcre_uchar *)md->mark; DPRINTF((">>>> returning %d\n", rc)); - goto RETURN_MARK; +#ifdef NO_RECURSE + release_match_heapframes(&frame_zero); +#endif + return rc; } /* Control gets here if there has been an error, or if the overall match @@ -6242,7 +7098,7 @@ if (using_temporary_offsets) { DPRINTF(("Freeing temporary memory\n")); - (pcre_free)(md->offset_vector); + (PUBL(free))(md->offset_vector); } /* For anything other than nomatch or partial match, just return the code. */ @@ -6250,6 +7106,9 @@ if (rc != MATCH_NOMATCH && rc != PCRE_ERROR_PARTIAL) { DPRINTF((">>>> error: returning %d\n", rc)); +#ifdef NO_RECURSE + release_match_heapframes(&frame_zero); +#endif return rc; } @@ -6261,8 +7120,8 @@ md->mark = NULL; if (offsetcount > 1) { - offsets[0] = (int)(start_partial - (USPTR)subject); - offsets[1] = (int)(end_subject - (USPTR)subject); + offsets[0] = (int)(start_partial - (PCRE_PUCHAR)subject); + offsets[1] = (int)(end_subject - (PCRE_PUCHAR)subject); } rc = PCRE_ERROR_PARTIAL; } @@ -6277,10 +7136,11 @@ /* Return the MARK data if it has been requested. */ -RETURN_MARK: - if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_MARK) != 0) - *(extra_data->mark) = (unsigned char *)(md->mark); + *(extra_data->mark) = (pcre_uchar *)md->nomatch_mark; +#ifdef NO_RECURSE + release_match_heapframes(&frame_zero); +#endif return rc; } diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_fullinfo.c php5-5.4.9/ext/pcre/pcrelib/pcre_fullinfo.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_fullinfo.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_fullinfo.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2009 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -63,13 +63,17 @@ Returns: 0 if data returned, negative on error */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN int PCRE_CALL_CONVENTION -pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what, - void *where) +pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, + int what, void *where) +#else +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre16_fullinfo(const pcre16 *argument_re, const pcre16_extra *extra_data, + int what, void *where) +#endif { -real_pcre internal_re; -pcre_study_data internal_study; -const real_pcre *re = (const real_pcre *)argument_re; +const REAL_PCRE *re = (const REAL_PCRE *)argument_re; const pcre_study_data *study = NULL; if (re == NULL || where == NULL) return PCRE_ERROR_NULL; @@ -77,12 +81,18 @@ if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0) study = (const pcre_study_data *)extra_data->study_data; +/* Check that the first field in the block is the magic number. If it is not, +return with PCRE_ERROR_BADMAGIC. However, if the magic number is equal to +REVERSED_MAGIC_NUMBER we return with PCRE_ERROR_BADENDIANNESS, which +means that the pattern is likely compiled with different endianness. */ + if (re->magic_number != MAGIC_NUMBER) - { - re = _pcre_try_flipped(re, &internal_re, study, &internal_study); - if (re == NULL) return PCRE_ERROR_BADMAGIC; - if (study != NULL) study = &internal_study; - } + return re->magic_number == REVERSED_MAGIC_NUMBER? + PCRE_ERROR_BADENDIANNESS:PCRE_ERROR_BADMAGIC; + +/* Check that this pattern was compiled in the correct bit mode */ + +if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE; switch (what) { @@ -98,6 +108,18 @@ *((size_t *)where) = (study == NULL)? 0 : study->size; break; + case PCRE_INFO_JITSIZE: +#ifdef SUPPORT_JIT + *((size_t *)where) = + (extra_data != NULL && + (extra_data->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 && + extra_data->executable_jit != NULL)? + PRIV(jit_get_size)(extra_data->executable_jit) : 0; +#else + *((size_t *)where) = 0; +#endif + break; + case PCRE_INFO_CAPTURECOUNT: *((int *)where) = re->top_bracket; break; @@ -108,7 +130,7 @@ case PCRE_INFO_FIRSTBYTE: *((int *)where) = - ((re->flags & PCRE_FIRSTSET) != 0)? re->first_byte : + ((re->flags & PCRE_FIRSTSET) != 0)? re->first_char : ((re->flags & PCRE_STARTLINE) != 0)? -1 : -2; break; @@ -116,7 +138,7 @@ block, not the internal copy (with flipped integer fields). */ case PCRE_INFO_FIRSTTABLE: - *((const uschar **)where) = + *((const pcre_uint8 **)where) = (study != NULL && (study->flags & PCRE_STUDY_MAPPED) != 0)? ((const pcre_study_data *)extra_data->study_data)->start_bits : NULL; break; @@ -124,12 +146,18 @@ case PCRE_INFO_MINLENGTH: *((int *)where) = (study != NULL && (study->flags & PCRE_STUDY_MINLEN) != 0)? - study->minlength : -1; + (int)(study->minlength) : -1; + break; + + case PCRE_INFO_JIT: + *((int *)where) = extra_data != NULL && + (extra_data->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 && + extra_data->executable_jit != NULL; break; case PCRE_INFO_LASTLITERAL: *((int *)where) = - ((re->flags & PCRE_REQCHSET) != 0)? re->req_byte : -1; + ((re->flags & PCRE_REQCHSET) != 0)? re->req_char : -1; break; case PCRE_INFO_NAMEENTRYSIZE: @@ -141,11 +169,11 @@ break; case PCRE_INFO_NAMETABLE: - *((const uschar **)where) = (const uschar *)re + re->name_table_offset; + *((const pcre_uchar **)where) = (const pcre_uchar *)re + re->name_table_offset; break; case PCRE_INFO_DEFAULT_TABLES: - *((const uschar **)where) = (const uschar *)(_pcre_default_tables); + *((const pcre_uint8 **)where) = (const pcre_uint8 *)(PRIV(default_tables)); break; /* From release 8.00 this will always return TRUE because NOPARTIAL is @@ -163,6 +191,10 @@ *((int *)where) = (re->flags & PCRE_HASCRORLF) != 0; break; + case PCRE_INFO_MAXLOOKBEHIND: + *((int *)where) = re->max_lookbehind; + break; + default: return PCRE_ERROR_BADOPTION; } diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_get.c php5-5.4.9/ext/pcre/pcrelib/pcre_get.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_get.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_get.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2008 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -63,14 +63,20 @@ (PCRE_ERROR_NOSUBSTRING) if not found */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_stringnumber(const pcre *code, const char *stringname) +#else +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre16_get_stringnumber(const pcre16 *code, PCRE_SPTR16 stringname) +#endif { int rc; int entrysize; int top, bot; -uschar *nametable; +pcre_uchar *nametable; +#ifdef COMPILE_PCRE8 if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0) return rc; if (top <= 0) return PCRE_ERROR_NOSUBSTRING; @@ -79,14 +85,26 @@ return rc; if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMETABLE, &nametable)) != 0) return rc; +#endif +#ifdef COMPILE_PCRE16 +if ((rc = pcre16_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0) + return rc; +if (top <= 0) return PCRE_ERROR_NOSUBSTRING; + +if ((rc = pcre16_fullinfo(code, NULL, PCRE_INFO_NAMEENTRYSIZE, &entrysize)) != 0) + return rc; +if ((rc = pcre16_fullinfo(code, NULL, PCRE_INFO_NAMETABLE, &nametable)) != 0) + return rc; +#endif bot = 0; while (top > bot) { int mid = (top + bot) / 2; - uschar *entry = nametable + entrysize*mid; - int c = strcmp(stringname, (char *)(entry + 2)); - if (c == 0) return (entry[0] << 8) + entry[1]; + pcre_uchar *entry = nametable + entrysize*mid; + int c = STRCMP_UC_UC((pcre_uchar *)stringname, + (pcre_uchar *)(entry + IMM2_SIZE)); + if (c == 0) return GET2(entry, 0); if (c > 0) bot = mid + 1; else top = mid; } @@ -112,15 +130,22 @@ (PCRE_ERROR_NOSUBSTRING) if not found */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_stringtable_entries(const pcre *code, const char *stringname, char **firstptr, char **lastptr) +#else +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre16_get_stringtable_entries(const pcre16 *code, PCRE_SPTR16 stringname, + PCRE_UCHAR16 **firstptr, PCRE_UCHAR16 **lastptr) +#endif { int rc; int entrysize; int top, bot; -uschar *nametable, *lastentry; +pcre_uchar *nametable, *lastentry; +#ifdef COMPILE_PCRE8 if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0) return rc; if (top <= 0) return PCRE_ERROR_NOSUBSTRING; @@ -129,30 +154,49 @@ return rc; if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMETABLE, &nametable)) != 0) return rc; +#endif +#ifdef COMPILE_PCRE16 +if ((rc = pcre16_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0) + return rc; +if (top <= 0) return PCRE_ERROR_NOSUBSTRING; + +if ((rc = pcre16_fullinfo(code, NULL, PCRE_INFO_NAMEENTRYSIZE, &entrysize)) != 0) + return rc; +if ((rc = pcre16_fullinfo(code, NULL, PCRE_INFO_NAMETABLE, &nametable)) != 0) + return rc; +#endif lastentry = nametable + entrysize * (top - 1); bot = 0; while (top > bot) { int mid = (top + bot) / 2; - uschar *entry = nametable + entrysize*mid; - int c = strcmp(stringname, (char *)(entry + 2)); + pcre_uchar *entry = nametable + entrysize*mid; + int c = STRCMP_UC_UC((pcre_uchar *)stringname, + (pcre_uchar *)(entry + IMM2_SIZE)); if (c == 0) { - uschar *first = entry; - uschar *last = entry; + pcre_uchar *first = entry; + pcre_uchar *last = entry; while (first > nametable) { - if (strcmp(stringname, (char *)(first - entrysize + 2)) != 0) break; + if (STRCMP_UC_UC((pcre_uchar *)stringname, + (pcre_uchar *)(first - entrysize + IMM2_SIZE)) != 0) break; first -= entrysize; } while (last < lastentry) { - if (strcmp(stringname, (char *)(last + entrysize + 2)) != 0) break; + if (STRCMP_UC_UC((pcre_uchar *)stringname, + (pcre_uchar *)(last + entrysize + IMM2_SIZE)) != 0) break; last += entrysize; } +#ifdef COMPILE_PCRE8 *firstptr = (char *)first; *lastptr = (char *)last; +#else + *firstptr = (PCRE_UCHAR16 *)first; + *lastptr = (PCRE_UCHAR16 *)last; +#endif return entrysize; } if (c > 0) bot = mid + 1; else top = mid; @@ -180,23 +224,39 @@ or a negative number on error */ +#ifdef COMPILE_PCRE8 static int get_first_set(const pcre *code, const char *stringname, int *ovector) +#else +static int +get_first_set(const pcre16 *code, PCRE_SPTR16 stringname, int *ovector) +#endif { -const real_pcre *re = (const real_pcre *)code; +const REAL_PCRE *re = (const REAL_PCRE *)code; int entrysize; +pcre_uchar *entry; +#ifdef COMPILE_PCRE8 char *first, *last; -uschar *entry; +#else +PCRE_UCHAR16 *first, *last; +#endif + +#ifdef COMPILE_PCRE8 if ((re->options & PCRE_DUPNAMES) == 0 && (re->flags & PCRE_JCHANGED) == 0) return pcre_get_stringnumber(code, stringname); entrysize = pcre_get_stringtable_entries(code, stringname, &first, &last); +#else +if ((re->options & PCRE_DUPNAMES) == 0 && (re->flags & PCRE_JCHANGED) == 0) + return pcre16_get_stringnumber(code, stringname); +entrysize = pcre16_get_stringtable_entries(code, stringname, &first, &last); +#endif if (entrysize <= 0) return entrysize; -for (entry = (uschar *)first; entry <= (uschar *)last; entry += entrysize) +for (entry = (pcre_uchar *)first; entry <= (pcre_uchar *)last; entry += entrysize) { - int n = (entry[0] << 8) + entry[1]; + int n = GET2(entry, 0); if (ovector[n*2] >= 0) return n; } -return (first[0] << 8) + first[1]; +return GET2(entry, 0); } @@ -229,9 +289,15 @@ PCRE_ERROR_NOSUBSTRING (-7) no such captured substring */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int size) +#else +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre16_copy_substring(PCRE_SPTR16 subject, int *ovector, int stringcount, + int stringnumber, PCRE_UCHAR16 *buffer, int size) +#endif { int yield; if (stringnumber < 0 || stringnumber >= stringcount) @@ -239,7 +305,7 @@ stringnumber *= 2; yield = ovector[stringnumber+1] - ovector[stringnumber]; if (size < yield + 1) return PCRE_ERROR_NOMEMORY; -memcpy(buffer, subject + ovector[stringnumber], yield); +memcpy(buffer, subject + ovector[stringnumber], IN_UCHARS(yield)); buffer[yield] = 0; return yield; } @@ -274,13 +340,25 @@ PCRE_ERROR_NOSUBSTRING (-7) no such captured substring */ +#ifdef COMPILE_PCRE8 +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) +#else 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) +pcre16_copy_named_substring(const pcre16 *code, PCRE_SPTR16 subject, + int *ovector, int stringcount, PCRE_SPTR16 stringname, + PCRE_UCHAR16 *buffer, int size) +#endif { int n = get_first_set(code, stringname, ovector); if (n <= 0) return n; +#ifdef COMPILE_PCRE8 return pcre_copy_substring(subject, ovector, stringcount, n, buffer, size); +#else +return pcre16_copy_substring(subject, ovector, stringcount, n, buffer, size); +#endif } @@ -306,29 +384,39 @@ PCRE_ERROR_NOMEMORY (-6) failed to get store */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_substring_list(const char *subject, int *ovector, int stringcount, const char ***listptr) +#else +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre16_get_substring_list(PCRE_SPTR16 subject, int *ovector, int stringcount, + PCRE_SPTR16 **listptr) +#endif { int i; -int size = sizeof(char *); +int size = sizeof(pcre_uchar *); int double_count = stringcount * 2; -char **stringlist; -char *p; +pcre_uchar **stringlist; +pcre_uchar *p; for (i = 0; i < double_count; i += 2) - size += sizeof(char *) + ovector[i+1] - ovector[i] + 1; + size += sizeof(pcre_uchar *) + IN_UCHARS(ovector[i+1] - ovector[i] + 1); -stringlist = (char **)(pcre_malloc)(size); +stringlist = (pcre_uchar **)(PUBL(malloc))(size); if (stringlist == NULL) return PCRE_ERROR_NOMEMORY; +#ifdef COMPILE_PCRE8 *listptr = (const char **)stringlist; -p = (char *)(stringlist + stringcount + 1); +#else +*listptr = (PCRE_SPTR16 *)stringlist; +#endif +p = (pcre_uchar *)(stringlist + stringcount + 1); for (i = 0; i < double_count; i += 2) { int len = ovector[i+1] - ovector[i]; - memcpy(p, subject + ovector[i], len); + memcpy(p, subject + ovector[i], IN_UCHARS(len)); *stringlist++ = p; p += len; *p++ = 0; @@ -345,16 +433,22 @@ *************************************************/ /* This function exists for the benefit of people calling PCRE from non-C -programs that can call its functions, but not free() or (pcre_free)() directly. +programs that can call its functions, but not free() or (PUBL(free))() +directly. Argument: the result of a previous pcre_get_substring_list() Returns: nothing */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN void PCRE_CALL_CONVENTION pcre_free_substring_list(const char **pointer) +#else +PCRE_EXP_DEFN void PCRE_CALL_CONVENTION +pcre16_free_substring_list(PCRE_SPTR16 *pointer) +#endif { -(pcre_free)((void *)pointer); +(PUBL(free))((void *)pointer); } @@ -384,21 +478,31 @@ PCRE_ERROR_NOSUBSTRING (-7) substring not present */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_get_substring(const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr) +#else +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre16_get_substring(PCRE_SPTR16 subject, int *ovector, int stringcount, + int stringnumber, PCRE_SPTR16 *stringptr) +#endif { int yield; -char *substring; +pcre_uchar *substring; if (stringnumber < 0 || stringnumber >= stringcount) return PCRE_ERROR_NOSUBSTRING; stringnumber *= 2; yield = ovector[stringnumber+1] - ovector[stringnumber]; -substring = (char *)(pcre_malloc)(yield + 1); +substring = (pcre_uchar *)(PUBL(malloc))(IN_UCHARS(yield + 1)); if (substring == NULL) return PCRE_ERROR_NOMEMORY; -memcpy(substring, subject + ovector[stringnumber], yield); +memcpy(substring, subject + ovector[stringnumber], IN_UCHARS(yield)); substring[yield] = 0; -*stringptr = substring; +#ifdef COMPILE_PCRE8 +*stringptr = (const char *)substring; +#else +*stringptr = (PCRE_SPTR16)substring; +#endif return yield; } @@ -431,13 +535,25 @@ PCRE_ERROR_NOSUBSTRING (-7) no such captured substring */ +#ifdef COMPILE_PCRE8 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) +pcre_get_named_substring(const pcre *code, const char *subject, + int *ovector, int stringcount, const char *stringname, + const char **stringptr) +#else +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre16_get_named_substring(const pcre16 *code, PCRE_SPTR16 subject, + int *ovector, int stringcount, PCRE_SPTR16 stringname, + PCRE_SPTR16 *stringptr) +#endif { int n = get_first_set(code, stringname, ovector); if (n <= 0) return n; +#ifdef COMPILE_PCRE8 return pcre_get_substring(subject, ovector, stringcount, n, stringptr); +#else +return pcre16_get_substring(subject, ovector, stringcount, n, stringptr); +#endif } @@ -448,16 +564,22 @@ *************************************************/ /* This function exists for the benefit of people calling PCRE from non-C -programs that can call its functions, but not free() or (pcre_free)() directly. +programs that can call its functions, but not free() or (PUBL(free))() +directly. Argument: the result of a previous pcre_get_substring() Returns: nothing */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN void PCRE_CALL_CONVENTION pcre_free_substring(const char *pointer) +#else +PCRE_EXP_DEFN void PCRE_CALL_CONVENTION +pcre16_free_substring(PCRE_SPTR16 pointer) +#endif { -(pcre_free)((void *)pointer); +(PUBL(free))((void *)pointer); } /* End of pcre_get.c */ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_globals.c php5-5.4.9/ext/pcre/pcrelib/pcre_globals.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_globals.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_globals.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2008 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -65,18 +65,18 @@ { free(aPtr); } -PCRE_EXP_DATA_DEFN void *(*pcre_malloc)(size_t) = LocalPcreMalloc; -PCRE_EXP_DATA_DEFN void (*pcre_free)(void *) = LocalPcreFree; -PCRE_EXP_DATA_DEFN void *(*pcre_stack_malloc)(size_t) = LocalPcreMalloc; -PCRE_EXP_DATA_DEFN void (*pcre_stack_free)(void *) = LocalPcreFree; -PCRE_EXP_DATA_DEFN int (*pcre_callout)(pcre_callout_block *) = NULL; +PCRE_EXP_DATA_DEFN void *(*PUBL(malloc))(size_t) = LocalPcreMalloc; +PCRE_EXP_DATA_DEFN void (*PUBL(free))(void *) = LocalPcreFree; +PCRE_EXP_DATA_DEFN void *(*PUBL(stack_malloc))(size_t) = LocalPcreMalloc; +PCRE_EXP_DATA_DEFN void (*PUBL(stack_free))(void *) = LocalPcreFree; +PCRE_EXP_DATA_DEFN int (*PUBL(callout))(PUBL(callout_block) *) = NULL; #elif !defined VPCOMPAT -PCRE_EXP_DATA_DEFN void *(*pcre_malloc)(size_t) = malloc; -PCRE_EXP_DATA_DEFN void (*pcre_free)(void *) = free; -PCRE_EXP_DATA_DEFN void *(*pcre_stack_malloc)(size_t) = malloc; -PCRE_EXP_DATA_DEFN void (*pcre_stack_free)(void *) = free; -PCRE_EXP_DATA_DEFN int (*pcre_callout)(pcre_callout_block *) = NULL; +PCRE_EXP_DATA_DEFN void *(*PUBL(malloc))(size_t) = malloc; +PCRE_EXP_DATA_DEFN void (*PUBL(free))(void *) = free; +PCRE_EXP_DATA_DEFN void *(*PUBL(stack_malloc))(size_t) = malloc; +PCRE_EXP_DATA_DEFN void (*PUBL(stack_free))(void *) = free; +PCRE_EXP_DATA_DEFN int (*PUBL(callout))(PUBL(callout_block) *) = NULL; #endif /* End of pcre_globals.c */ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_info.c php5-5.4.9/ext/pcre/pcrelib/pcre_info.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_info.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_info.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2009 University of Cambridge - ------------------------------------------------------------------------------ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the University of Cambridge nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------ -*/ - - -/* This module contains the external function pcre_info(), which gives some -information about a compiled pattern. However, use of this function is now -deprecated, as it has been superseded by pcre_fullinfo(). */ - - -#include "config.h" - -#include "pcre_internal.h" - - -/************************************************* -* (Obsolete) Return info about compiled pattern * -*************************************************/ - -/* This is the original "info" function. It picks potentially useful data out -of the private structure, but its interface was too rigid. It remains for -backwards compatibility. The public options are passed back in an int - though -the re->options field has been expanded to a long int, all the public options -at the low end of it, and so even on 16-bit systems this will still be OK. -Therefore, I haven't changed the API for pcre_info(). - -Arguments: - argument_re points to compiled code - optptr where to pass back the options - first_byte where to pass back the first character, - or -1 if multiline and all branches start ^, - or -2 otherwise - -Returns: number of capturing subpatterns - or negative values on error -*/ - -PCRE_EXP_DEFN int PCRE_CALL_CONVENTION -pcre_info(const pcre *argument_re, int *optptr, int *first_byte) -{ -real_pcre internal_re; -const real_pcre *re = (const real_pcre *)argument_re; -if (re == NULL) return PCRE_ERROR_NULL; -if (re->magic_number != MAGIC_NUMBER) - { - re = _pcre_try_flipped(re, &internal_re, NULL, NULL); - if (re == NULL) return PCRE_ERROR_BADMAGIC; - } -if (optptr != NULL) *optptr = (int)(re->options & PUBLIC_COMPILE_OPTIONS); -if (first_byte != NULL) - *first_byte = ((re->flags & PCRE_FIRSTSET) != 0)? re->first_byte : - ((re->flags & PCRE_STARTLINE) != 0)? -1 : -2; -return re->top_bracket; -} - -/* End of pcre_info.c */ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_internal.h php5-5.4.9/ext/pcre/pcrelib/pcre_internal.h --- php5-5.4.4/ext/pcre/pcrelib/pcre_internal.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_internal.h 2012-11-21 05:12:20.000000000 +0000 @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2010 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -40,7 +40,8 @@ /* This header contains definitions that are shared between the different modules, but which are not relevant to the exported API. This includes some -functions whose names all begin with "_pcre_". */ +functions whose names all begin with "_pcre_" or "_pcre16_" depending on +the PRIV macro. */ #ifndef PCRE_INTERNAL_H #define PCRE_INTERNAL_H @@ -51,20 +52,39 @@ #define PCRE_DEBUG #endif -/* We do not support both EBCDIC and UTF-8 at the same time. The "configure" -script prevents both being selected, but not everybody uses "configure". */ - -#if defined EBCDIC && defined SUPPORT_UTF8 -#error The use of both EBCDIC and SUPPORT_UTF8 is not supported. +/* PCRE is compiled as an 8 bit library if it is not requested otherwise. */ +#ifndef COMPILE_PCRE16 +#define COMPILE_PCRE8 #endif -/* If SUPPORT_UCP is defined, SUPPORT_UTF8 must also be defined. The +/* If SUPPORT_UCP is defined, SUPPORT_UTF must also be defined. The "configure" script ensures this, but not everybody uses "configure". */ -#if defined SUPPORT_UCP && !defined SUPPORT_UTF8 +#if defined SUPPORT_UCP && !(defined SUPPORT_UTF) +#define SUPPORT_UTF 1 +#endif + +/* We define SUPPORT_UTF if SUPPORT_UTF8 is enabled for compatibility +reasons with existing code. */ + +#if defined SUPPORT_UTF8 && !(defined SUPPORT_UTF) +#define SUPPORT_UTF 1 +#endif + +/* Fixme: SUPPORT_UTF8 should be eventually disappear from the code. +Until then we define it if SUPPORT_UTF is defined. */ + +#if defined SUPPORT_UTF && !(defined SUPPORT_UTF8) #define SUPPORT_UTF8 1 #endif +/* We do not support both EBCDIC and UTF-8/16 at the same time. The "configure" +script prevents both being selected, but not everybody uses "configure". */ + +#if defined EBCDIC && defined SUPPORT_UTF +#error The use of both EBCDIC and SUPPORT_UTF8/16 is not supported. +#endif + /* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef inline, and there are *still* stupid compilers about that don't like indented pre-processor statements, or at least there were when I first wrote this. After @@ -158,12 +178,14 @@ #define PCRE_CALL_CONVENTION #endif -/* We need to have types that specify unsigned 16-bit and 32-bit integers. We +/* We need to have types that specify unsigned 8, 16 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 systems. Instead we make use of the maximum sizes that are available at preprocessor time in standard C environments. */ +typedef unsigned char pcre_uint8; + #if USHRT_MAX == 65535 typedef unsigned short pcre_uint16; typedef short pcre_int16; @@ -208,12 +230,47 @@ /* All character handling must be done as unsigned characters. Otherwise there are problems with top-bit-set characters and functions such as isspace(). -However, we leave the interface to the outside world as char *, because that -should make things easier for callers. We define a short type for unsigned char -to save lots of typing. I tried "uchar", but it causes problems on Digital -Unix, where it is defined in sys/types, so use "uschar" instead. */ +However, we leave the interface to the outside world as char * or short *, +because that should make things easier for callers. This character type is +called pcre_uchar. + +The IN_UCHARS macro multiply its argument with the byte size of the current +pcre_uchar type. Useful for memcpy and such operations, whose require the +byte size of their input/output buffers. + +The MAX_255 macro checks whether its pcre_uchar input is less than 256. + +The TABLE_GET macro is designed for accessing elements of tables whose contain +exactly 256 items. When the character is able to contain more than 256 +items, some check is needed before accessing these tables. +*/ + +#ifdef COMPILE_PCRE8 + +typedef unsigned char pcre_uchar; +#define IN_UCHARS(x) (x) +#define MAX_255(c) 1 +#define TABLE_GET(c, table, default) ((table)[c]) + +#else + +#ifdef COMPILE_PCRE16 +#if USHRT_MAX != 65535 +/* This is a warning message. Change PCRE_UCHAR16 to a 16 bit data type in +pcre.h(.in) and disable (comment out) this message. */ +#error Warning: PCRE_UCHAR16 is not a 16 bit data type. +#endif + +typedef pcre_uint16 pcre_uchar; +#define IN_UCHARS(x) ((x) << 1) +#define MAX_255(c) ((c) <= 255u) +#define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default)) -typedef unsigned char uschar; +#else +#error Unsupported compiling mode +#endif /* COMPILE_PCRE16 */ + +#endif /* COMPILE_PCRE8 */ /* This is an unsigned int value that no character can ever have. UTF-8 characters only go up to 0x7fffffff (though Unicode doesn't go beyond @@ -236,8 +293,8 @@ #define IS_NEWLINE(p) \ ((NLBLOCK->nltype != NLTYPE_FIXED)? \ ((p) < NLBLOCK->PSEND && \ - _pcre_is_newline((p), NLBLOCK->nltype, NLBLOCK->PSEND, &(NLBLOCK->nllen),\ - utf8)) \ + PRIV(is_newline)((p), NLBLOCK->nltype, NLBLOCK->PSEND, \ + &(NLBLOCK->nllen), utf)) \ : \ ((p) <= NLBLOCK->PSEND - NLBLOCK->nllen && \ (p)[0] == NLBLOCK->nl[0] && \ @@ -250,8 +307,8 @@ #define WAS_NEWLINE(p) \ ((NLBLOCK->nltype != NLTYPE_FIXED)? \ ((p) > NLBLOCK->PSSTART && \ - _pcre_was_newline((p), NLBLOCK->nltype, NLBLOCK->PSSTART, \ - &(NLBLOCK->nllen), utf8)) \ + PRIV(was_newline)((p), NLBLOCK->nltype, NLBLOCK->PSSTART, \ + &(NLBLOCK->nllen), utf)) \ : \ ((p) >= NLBLOCK->PSSTART + NLBLOCK->nllen && \ (p)[-NLBLOCK->nllen] == NLBLOCK->nl[0] && \ @@ -269,15 +326,11 @@ must begin with PCRE_. */ #ifdef CUSTOM_SUBJECT_PTR -#define PCRE_SPTR CUSTOM_SUBJECT_PTR -#define USPTR CUSTOM_SUBJECT_PTR +#define PCRE_PUCHAR CUSTOM_SUBJECT_PTR #else -#define PCRE_SPTR const char * -#define USPTR const unsigned char * +#define PCRE_PUCHAR const pcre_uchar * #endif - - /* Include the public PCRE header and the definitions of UCP character property values. */ @@ -345,6 +398,8 @@ the config.h file, but can be overridden by using -D on the command line. This is automated on Unix systems via the "configure" command. */ +#ifdef COMPILE_PCRE8 + #if LINK_SIZE == 2 #define PUT(a,n,d) \ @@ -381,13 +436,54 @@ #define GET(a,n) \ (((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3]) -#define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */ +/* Keep it positive */ +#define MAX_PATTERN_SIZE (1 << 30) + +#else +#error LINK_SIZE must be either 2, 3, or 4 +#endif + +#else /* COMPILE_PCRE8 */ + +#ifdef COMPILE_PCRE16 + +#if LINK_SIZE == 2 + +#undef LINK_SIZE +#define LINK_SIZE 1 + +#define PUT(a,n,d) \ + (a[n] = (d)) + +#define GET(a,n) \ + (a[n]) + +#define MAX_PATTERN_SIZE (1 << 16) + +#elif LINK_SIZE == 3 || LINK_SIZE == 4 +#undef LINK_SIZE +#define LINK_SIZE 2 + +#define PUT(a,n,d) \ + (a[n] = (d) >> 16), \ + (a[(n)+1] = (d) & 65535) + +#define GET(a,n) \ + (((a)[n] << 16) | (a)[(n)+1]) + +/* Keep it positive */ +#define MAX_PATTERN_SIZE (1 << 30) #else #error LINK_SIZE must be either 2, 3, or 4 #endif +#else +#error Unsupported compiling mode +#endif /* COMPILE_PCRE16 */ + +#endif /* COMPILE_PCRE8 */ /* Convenience macro defined in terms of the others */ @@ -398,6 +494,10 @@ offsets changes. There are used for repeat counts and for other things such as capturing parenthesis numbers in back references. */ +#ifdef COMPILE_PCRE8 + +#define IMM2_SIZE 2 + #define PUT2(a,n,d) \ a[n] = (d) >> 8; \ a[(n)+1] = (d) & 255 @@ -405,17 +505,44 @@ #define GET2(a,n) \ (((a)[n] << 8) | (a)[(n)+1]) -#define PUT2INC(a,n,d) PUT2(a,n,d), a += 2 +#else /* COMPILE_PCRE8 */ + +#ifdef COMPILE_PCRE16 + +#define IMM2_SIZE 1 + +#define PUT2(a,n,d) \ + a[n] = d + +#define GET2(a,n) \ + a[n] + +#else +#error Unsupported compiling mode +#endif /* COMPILE_PCRE16 */ + +#endif /* COMPILE_PCRE8 */ + +#define PUT2INC(a,n,d) PUT2(a,n,d), a += IMM2_SIZE + +/* The maximum length of a MARK name is currently one data unit; it may be +changed in future to be a fixed number of bytes or to depend on LINK_SIZE. */ + +#define MAX_MARK ((1 << (sizeof(pcre_uchar)*8)) - 1) +/* When UTF encoding is being used, a character is no longer just a single +character. The macros for character handling generate simple sequences when +used in character-mode, and more complicated ones for UTF characters. +GETCHARLENTEST and other macros are not used when UTF is not supported, +so they are not defined. To make sure they can never even appear when +UTF support is omitted, we don't even define them. */ -/* When UTF-8 encoding is being used, a character is no longer just a single -byte. The macros for character handling generate simple sequences when used in -byte-mode, and more complicated ones for UTF-8 characters. GETCHARLENTEST is -not used when UTF-8 is not supported, so it is not defined, and BACKCHAR should -never be called in byte mode. To make sure they can never even appear when -UTF-8 support is omitted, we don't even define them. */ +#ifndef SUPPORT_UTF -#ifndef SUPPORT_UTF8 +/* #define MAX_VALUE_FOR_SINGLE_CHAR */ +/* #define HAS_EXTRALEN(c) */ +/* #define GET_EXTRALEN(c) */ +/* #define NOT_FIRSTCHAR(c) */ #define GETCHAR(c, eptr) c = *eptr; #define GETCHARTEST(c, eptr) c = *eptr; #define GETCHARINC(c, eptr) c = *eptr++; @@ -423,14 +550,36 @@ #define GETCHARLEN(c, eptr, len) c = *eptr; /* #define GETCHARLENTEST(c, eptr, len) */ /* #define BACKCHAR(eptr) */ +/* #define FORWARDCHAR(eptr) */ +/* #define ACROSSCHAR(condition, eptr, action) */ -#else /* SUPPORT_UTF8 */ +#else /* SUPPORT_UTF */ + +#ifdef COMPILE_PCRE8 /* These macros were originally written in the form of loops that used data -from the tables whose names start with _pcre_utf8_table. They were rewritten by +from the tables whose names start with PRIV(utf8_table). They were rewritten by a user so as not to use loops, because in some environments this gives a significant performance advantage, and it seems never to do any harm. */ +/* Tells the biggest code point which can be encoded as a single character. */ + +#define MAX_VALUE_FOR_SINGLE_CHAR 127 + +/* Tests whether the code point needs extra characters to decode. */ + +#define HAS_EXTRALEN(c) ((c) >= 0xc0) + +/* Returns with the additional number of characters if IS_MULTICHAR(c) is TRUE. +Otherwise it has an undefined behaviour. */ + +#define GET_EXTRALEN(c) (PRIV(utf8_table4)[(c) & 0x3f]) + +/* Returns TRUE, if the given character is not the first character +of a UTF sequence. */ + +#define NOT_FIRSTCHAR(c) (((c) & 0xc0) == 0x80) + /* Base macro to pick up the remaining bytes of a UTF-8 character, not advancing the pointer. */ @@ -465,7 +614,7 @@ #define GETCHARTEST(c, eptr) \ c = *eptr; \ - if (utf8 && c >= 0xc0) GETUTF8(c, eptr); + if (utf && c >= 0xc0) GETUTF8(c, eptr); /* Base macro to pick up the remaining bytes of a UTF-8 character, advancing the pointer. */ @@ -513,7 +662,7 @@ #define GETCHARINCTEST(c, eptr) \ c = *eptr++; \ - if (utf8 && c >= 0xc0) GETUTF8INC(c, eptr); + if (utf && c >= 0xc0) GETUTF8INC(c, eptr); /* Base macro to pick up the remaining bytes of a UTF-8 character, not advancing the pointer, incrementing the length. */ @@ -565,7 +714,7 @@ #define GETCHARLENTEST(c, eptr, len) \ c = *eptr; \ - if (utf8 && c >= 0xc0) GETUTF8LEN(c, eptr, len); + if (utf && c >= 0xc0) GETUTF8LEN(c, eptr, len); /* If the pointer is not at the start of a character, move it back until it is. This is called only in UTF-8 mode - we don't put a test within the macro @@ -573,7 +722,116 @@ #define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr-- -#endif /* SUPPORT_UTF8 */ +/* Same as above, just in the other direction. */ +#define FORWARDCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr++ + +/* Same as above, but it allows a fully customizable form. */ +#define ACROSSCHAR(condition, eptr, action) \ + while((condition) && ((eptr) & 0xc0) == 0x80) action + +#else /* COMPILE_PCRE8 */ + +#ifdef COMPILE_PCRE16 + +/* Tells the biggest code point which can be encoded as a single character. */ + +#define MAX_VALUE_FOR_SINGLE_CHAR 65535 + +/* Tests whether the code point needs extra characters to decode. */ + +#define HAS_EXTRALEN(c) (((c) & 0xfc00) == 0xd800) + +/* Returns with the additional number of characters if IS_MULTICHAR(c) is TRUE. +Otherwise it has an undefined behaviour. */ + +#define GET_EXTRALEN(c) 1 + +/* Returns TRUE, if the given character is not the first character +of a UTF sequence. */ + +#define NOT_FIRSTCHAR(c) (((c) & 0xfc00) == 0xdc00) + +/* Base macro to pick up the low surrogate of a UTF-16 character, not +advancing the pointer. */ + +#define GETUTF16(c, eptr) \ + { c = (((c & 0x3ff) << 10) | (eptr[1] & 0x3ff)) + 0x10000; } + +/* Get the next UTF-16 character, not advancing the pointer. This is called when +we know we are in UTF-16 mode. */ + +#define GETCHAR(c, eptr) \ + c = *eptr; \ + if ((c & 0xfc00) == 0xd800) GETUTF16(c, eptr); + +/* Get the next UTF-16 character, testing for UTF-16 mode, and not advancing the +pointer. */ + +#define GETCHARTEST(c, eptr) \ + c = *eptr; \ + if (utf && (c & 0xfc00) == 0xd800) GETUTF16(c, eptr); + +/* Base macro to pick up the low surrogate of a UTF-16 character, advancing +the pointer. */ + +#define GETUTF16INC(c, eptr) \ + { c = (((c & 0x3ff) << 10) | (*eptr++ & 0x3ff)) + 0x10000; } + +/* Get the next UTF-16 character, advancing the pointer. This is called when we +know we are in UTF-16 mode. */ + +#define GETCHARINC(c, eptr) \ + c = *eptr++; \ + if ((c & 0xfc00) == 0xd800) GETUTF16INC(c, eptr); + +/* Get the next character, testing for UTF-16 mode, and advancing the pointer. +This is called when we don't know if we are in UTF-16 mode. */ + +#define GETCHARINCTEST(c, eptr) \ + c = *eptr++; \ + if (utf && (c & 0xfc00) == 0xd800) GETUTF16INC(c, eptr); + +/* Base macro to pick up the low surrogate of a UTF-16 character, not +advancing the pointer, incrementing the length. */ + +#define GETUTF16LEN(c, eptr, len) \ + { c = (((c & 0x3ff) << 10) | (eptr[1] & 0x3ff)) + 0x10000; len++; } + +/* Get the next UTF-16 character, not advancing the pointer, incrementing +length if there is a low surrogate. This is called when we know we are in +UTF-16 mode. */ + +#define GETCHARLEN(c, eptr, len) \ + c = *eptr; \ + if ((c & 0xfc00) == 0xd800) GETUTF16LEN(c, eptr, len); + +/* Get the next UTF-816character, testing for UTF-16 mode, not advancing the +pointer, incrementing length if there is a low surrogate. This is called when +we do not know if we are in UTF-16 mode. */ + +#define GETCHARLENTEST(c, eptr, len) \ + c = *eptr; \ + if (utf && (c & 0xfc00) == 0xd800) GETUTF16LEN(c, eptr, len); + +/* If the pointer is not at the start of a character, move it back until +it is. This is called only in UTF-16 mode - we don't put a test within the +macro because almost all calls are already within a block of UTF-16 only +code. */ + +#define BACKCHAR(eptr) if ((*eptr & 0xfc00) == 0xdc00) eptr-- + +/* Same as above, just in the other direction. */ +#define FORWARDCHAR(eptr) if ((*eptr & 0xfc00) == 0xdc00) eptr++ + +/* Same as above, but it allows a fully customizable form. */ +#define ACROSSCHAR(condition, eptr, action) \ + if ((condition) && ((eptr) & 0xfc00) == 0xdc00) action + +#endif + +#endif /* COMPILE_PCRE8 */ + +#endif /* SUPPORT_UTF */ /* In case there is no definition of offsetof() provided - though any proper @@ -584,27 +842,32 @@ #endif -/* These are the public options that can change during matching. */ - -#define PCRE_IMS (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL) - /* Private flags containing information about the compiled regex. They used to live at the top end of the options word, but that got almost full, so now they are in a 16-bit flags word. From release 8.00, PCRE_NOPARTIAL is unused, as the restrictions on partial matching have been lifted. It remains for backwards compatibility. */ -#define PCRE_NOPARTIAL 0x0001 /* can't use partial with this regex */ -#define PCRE_FIRSTSET 0x0002 /* first_byte is set */ -#define PCRE_REQCHSET 0x0004 /* req_byte is set */ -#define PCRE_STARTLINE 0x0008 /* start after \n for multiline */ -#define PCRE_JCHANGED 0x0010 /* j option used in regex */ -#define PCRE_HASCRORLF 0x0020 /* explicit \r or \n in pattern */ +#ifdef COMPILE_PCRE8 +#define PCRE_MODE 0x0001 /* compiled in 8 bit mode */ +#endif +#ifdef COMPILE_PCRE16 +#define PCRE_MODE 0x0002 /* compiled in 16 bit mode */ +#endif +#define PCRE_FIRSTSET 0x0010 /* first_char is set */ +#define PCRE_FCH_CASELESS 0x0020 /* caseless first char */ +#define PCRE_REQCHSET 0x0040 /* req_byte is set */ +#define PCRE_RCH_CASELESS 0x0080 /* caseless requested char */ +#define PCRE_STARTLINE 0x0100 /* start after \n for multiline */ +#define PCRE_NOPARTIAL 0x0200 /* can't use partial with this regex */ +#define PCRE_JCHANGED 0x0400 /* j option used in regex */ +#define PCRE_HASCRORLF 0x0800 /* explicit \r or \n in pattern */ +#define PCRE_HASTHEN 0x1000 /* pattern contains (*THEN) */ -/* Options for the "extra" block produced by pcre_study(). */ +/* Flags for the "extra" block produced by pcre_study(). */ -#define PCRE_STUDY_MAPPED 0x01 /* a map of starting chars exists */ -#define PCRE_STUDY_MINLEN 0x02 /* a minimum length field exists */ +#define PCRE_STUDY_MAPPED 0x0001 /* a map of starting chars exists */ +#define PCRE_STUDY_MINLEN 0x0002 /* a minimum length field exists */ /* Masks for identifying the public options that are permitted at compile time, run time, or study time, respectively. */ @@ -630,13 +893,19 @@ PCRE_DFA_RESTART|PCRE_NEWLINE_BITS|PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE| \ PCRE_NO_START_OPTIMIZE) -#define PUBLIC_STUDY_OPTIONS 0 /* None defined */ +#define PUBLIC_STUDY_OPTIONS \ + (PCRE_STUDY_JIT_COMPILE|PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE| \ + PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE) -/* Magic number to provide a small check against being handed junk. Also used -to detect whether a pattern was compiled on a host of different endianness. */ +/* Magic number to provide a small check against being handed junk. */ #define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */ +/* This variable is used to detect a loaded regular expression +in different endianness. */ + +#define REVERSED_MAGIC_NUMBER 0x45524350UL /* 'ERCP' */ + /* Negative values for the firstchar and reqchar variables */ #define REQ_UNSET (-2) @@ -647,12 +916,6 @@ #define REQ_BYTE_MAX 1000 -/* Flags added to firstbyte or reqbyte; a "non-literal" item is either a -variable-length repeat, or a anything other than literal characters. */ - -#define REQ_CASELESS 0x0100 /* indicates caselessness */ -#define REQ_VARY 0x0200 /* reqbyte followed non-literal item */ - /* Miscellaneous definitions. The #ifndef is to pacify compiler warnings in environments where these macros are defined elsewhere. Unfortunately, there is no way to do the same for the typedef. */ @@ -681,7 +944,7 @@ application that did need both could compile two versions of the library, using macros to give the functions distinct names. */ -#ifndef SUPPORT_UTF8 +#ifndef SUPPORT_UTF /* UTF-8 support is not enabled; use the platform-dependent character literals so that PCRE works on both ASCII and EBCDIC platforms, in non-UTF-mode only. */ @@ -941,11 +1204,16 @@ #define STRING_ANYCRLF_RIGHTPAR "ANYCRLF)" #define STRING_BSR_ANYCRLF_RIGHTPAR "BSR_ANYCRLF)" #define STRING_BSR_UNICODE_RIGHTPAR "BSR_UNICODE)" -#define STRING_UTF8_RIGHTPAR "UTF8)" +#ifdef COMPILE_PCRE8 +#define STRING_UTF_RIGHTPAR "UTF8)" +#endif +#ifdef COMPILE_PCRE16 +#define STRING_UTF_RIGHTPAR "UTF16)" +#endif #define STRING_UCP_RIGHTPAR "UCP)" #define STRING_NO_START_OPT_RIGHTPAR "NO_START_OPT)" -#else /* SUPPORT_UTF8 */ +#else /* SUPPORT_UTF */ /* UTF-8 support is enabled; always use UTF-8 (=ASCII) character codes. This works in both modes non-EBCDIC platforms, and on EBCDIC platforms in UTF-8 mode @@ -1196,11 +1464,16 @@ #define STRING_ANYCRLF_RIGHTPAR STR_A STR_N STR_Y STR_C STR_R STR_L STR_F STR_RIGHT_PARENTHESIS #define STRING_BSR_ANYCRLF_RIGHTPAR STR_B STR_S STR_R STR_UNDERSCORE STR_A STR_N STR_Y STR_C STR_R STR_L STR_F STR_RIGHT_PARENTHESIS #define STRING_BSR_UNICODE_RIGHTPAR STR_B STR_S STR_R STR_UNDERSCORE STR_U STR_N STR_I STR_C STR_O STR_D STR_E STR_RIGHT_PARENTHESIS -#define STRING_UTF8_RIGHTPAR STR_U STR_T STR_F STR_8 STR_RIGHT_PARENTHESIS +#ifdef COMPILE_PCRE8 +#define STRING_UTF_RIGHTPAR STR_U STR_T STR_F STR_8 STR_RIGHT_PARENTHESIS +#endif +#ifdef COMPILE_PCRE16 +#define STRING_UTF_RIGHTPAR STR_U STR_T STR_F STR_1 STR_6 STR_RIGHT_PARENTHESIS +#endif #define STRING_UCP_RIGHTPAR STR_U STR_C STR_P STR_RIGHT_PARENTHESIS #define STRING_NO_START_OPT_RIGHTPAR STR_N STR_O STR_UNDERSCORE STR_S STR_T STR_A STR_R STR_T STR_UNDERSCORE STR_O STR_P STR_T STR_RIGHT_PARENTHESIS -#endif /* SUPPORT_UTF8 */ +#endif /* SUPPORT_UTF */ /* Escape items that are just an encoding of a particular data value. */ @@ -1240,7 +1513,7 @@ #define PT_WORD 8 /* Word - L plus N plus underscore */ /* Flag bits and data types for the extended class (OP_XCLASS) for classes that -contain UTF-8 characters with values greater than 255. */ +contain characters with values greater than 255. */ #define XCL_NOT 0x01 /* Flag: this is a negative class */ #define XCL_MAP 0x02 /* Flag: a 32-byte map is present */ @@ -1256,8 +1529,8 @@ their negation. Also, they must appear in the same order as in the opcode definitions below, up to ESC_z. There's a dummy for OP_ALLANY because it corresponds to "." in DOTALL mode rather than an escape sequence. It is also -used for [^] in JavaScript compatibility mode. In non-DOTALL mode, "." behaves -like \N. +used for [^] in JavaScript compatibility mode, and for \C in non-utf mode. In +non-DOTALL mode, "." behaves like \N. The special values ESC_DU, ESC_du, etc. are used instead of ESC_D, ESC_d, etc. when PCRE_UCP is set, when replacement of \d etc by \p sequences is required. @@ -1301,6 +1574,7 @@ OP_WHITESPACE, /* 9 \s */ OP_NOT_WORDCHAR, /* 10 \W */ OP_WORDCHAR, /* 11 \w */ + OP_ANY, /* 12 Match any character except newline */ OP_ALLANY, /* 13 Match any character */ OP_ANYBYTE, /* 14 Match any byte (\C); different to OP_ANY for UTF-8 */ @@ -1315,141 +1589,205 @@ OP_EODN, /* 23 End of data or \n at end of data: \Z. */ OP_EOD, /* 24 End of data: \z */ - OP_OPT, /* 25 Set runtime options */ - OP_CIRC, /* 26 Start of line - varies with multiline switch */ - OP_DOLL, /* 27 End of line - varies with multiline switch */ - OP_CHAR, /* 28 Match one character, casefully */ - OP_CHARNC, /* 29 Match one character, caselessly */ - OP_NOT, /* 30 Match one character, not the following one */ - - OP_STAR, /* 31 The maximizing and minimizing versions of */ - OP_MINSTAR, /* 32 these six opcodes must come in pairs, with */ - OP_PLUS, /* 33 the minimizing one second. */ - OP_MINPLUS, /* 34 This first set applies to single characters.*/ - OP_QUERY, /* 35 */ - OP_MINQUERY, /* 36 */ - - OP_UPTO, /* 37 From 0 to n matches */ - OP_MINUPTO, /* 38 */ - OP_EXACT, /* 39 Exactly n matches */ - - OP_POSSTAR, /* 40 Possessified star */ - OP_POSPLUS, /* 41 Possessified plus */ - OP_POSQUERY, /* 42 Posesssified query */ - OP_POSUPTO, /* 43 Possessified upto */ - - OP_NOTSTAR, /* 44 The maximizing and minimizing versions of */ - OP_NOTMINSTAR, /* 45 these six opcodes must come in pairs, with */ - OP_NOTPLUS, /* 46 the minimizing one second. They must be in */ - OP_NOTMINPLUS, /* 47 exactly the same order as those above. */ - OP_NOTQUERY, /* 48 This set applies to "not" single characters. */ - OP_NOTMINQUERY, /* 49 */ - - OP_NOTUPTO, /* 50 From 0 to n matches */ - OP_NOTMINUPTO, /* 51 */ - OP_NOTEXACT, /* 52 Exactly n matches */ - - OP_NOTPOSSTAR, /* 53 Possessified versions */ - OP_NOTPOSPLUS, /* 54 */ - OP_NOTPOSQUERY, /* 55 */ - OP_NOTPOSUPTO, /* 56 */ - - OP_TYPESTAR, /* 57 The maximizing and minimizing versions of */ - OP_TYPEMINSTAR, /* 58 these six opcodes must come in pairs, with */ - OP_TYPEPLUS, /* 59 the minimizing one second. These codes must */ - OP_TYPEMINPLUS, /* 60 be in exactly the same order as those above. */ - OP_TYPEQUERY, /* 61 This set applies to character types such as \d */ - OP_TYPEMINQUERY, /* 62 */ - - OP_TYPEUPTO, /* 63 From 0 to n matches */ - OP_TYPEMINUPTO, /* 64 */ - OP_TYPEEXACT, /* 65 Exactly n matches */ - - OP_TYPEPOSSTAR, /* 66 Possessified versions */ - OP_TYPEPOSPLUS, /* 67 */ - OP_TYPEPOSQUERY, /* 68 */ - OP_TYPEPOSUPTO, /* 69 */ - - OP_CRSTAR, /* 70 The maximizing and minimizing versions of */ - OP_CRMINSTAR, /* 71 all these opcodes must come in pairs, with */ - OP_CRPLUS, /* 72 the minimizing one second. These codes must */ - OP_CRMINPLUS, /* 73 be in exactly the same order as those above. */ - OP_CRQUERY, /* 74 These are for character classes and back refs */ - OP_CRMINQUERY, /* 75 */ - OP_CRRANGE, /* 76 These are different to the three sets above. */ - OP_CRMINRANGE, /* 77 */ - - OP_CLASS, /* 78 Match a character class, chars < 256 only */ - OP_NCLASS, /* 79 Same, but the bitmap was created from a negative - class - the difference is relevant only when a UTF-8 - character > 255 is encountered. */ - - OP_XCLASS, /* 80 Extended class for handling UTF-8 chars within the - class. This does both positive and negative. */ - - OP_REF, /* 81 Match a back reference */ - OP_RECURSE, /* 82 Match a numbered subpattern (possibly recursive) */ - OP_CALLOUT, /* 83 Call out to external function if provided */ - - OP_ALT, /* 84 Start of alternation */ - OP_KET, /* 85 End of group that doesn't have an unbounded repeat */ - OP_KETRMAX, /* 86 These two must remain together and in this */ - OP_KETRMIN, /* 87 order. They are for groups the repeat for ever. */ - - /* The assertions must come before BRA, CBRA, ONCE, and COND.*/ - - OP_ASSERT, /* 88 Positive lookahead */ - OP_ASSERT_NOT, /* 89 Negative lookahead */ - OP_ASSERTBACK, /* 90 Positive lookbehind */ - OP_ASSERTBACK_NOT, /* 91 Negative lookbehind */ - OP_REVERSE, /* 92 Move pointer back - used in lookbehind assertions */ - - /* ONCE, BRA, CBRA, and COND must come after the assertions, with ONCE first, - as there's a test for >= ONCE for a subpattern that isn't an assertion. */ - - OP_ONCE, /* 93 Atomic group */ - OP_BRA, /* 94 Start of non-capturing bracket */ - OP_CBRA, /* 95 Start of capturing bracket */ - OP_COND, /* 96 Conditional group */ + OP_CIRC, /* 25 Start of line - not multiline */ + OP_CIRCM, /* 26 Start of line - multiline */ + OP_DOLL, /* 27 End of line - not multiline */ + OP_DOLLM, /* 28 End of line - multiline */ + OP_CHAR, /* 29 Match one character, casefully */ + OP_CHARI, /* 30 Match one character, caselessly */ + OP_NOT, /* 31 Match one character, not the given one, casefully */ + OP_NOTI, /* 32 Match one character, not the given one, caselessly */ + + /* The following sets of 13 opcodes must always be kept in step because + the offset from the first one is used to generate the others. */ + + /**** Single characters, caseful, must precede the caseless ones ****/ + + OP_STAR, /* 33 The maximizing and minimizing versions of */ + OP_MINSTAR, /* 34 these six opcodes must come in pairs, with */ + OP_PLUS, /* 35 the minimizing one second. */ + OP_MINPLUS, /* 36 */ + OP_QUERY, /* 37 */ + OP_MINQUERY, /* 38 */ + + OP_UPTO, /* 39 From 0 to n matches of one character, caseful*/ + OP_MINUPTO, /* 40 */ + OP_EXACT, /* 41 Exactly n matches */ + + OP_POSSTAR, /* 42 Possessified star, caseful */ + OP_POSPLUS, /* 43 Possessified plus, caseful */ + OP_POSQUERY, /* 44 Posesssified query, caseful */ + OP_POSUPTO, /* 45 Possessified upto, caseful */ + + /**** Single characters, caseless, must follow the caseful ones */ + + OP_STARI, /* 46 */ + OP_MINSTARI, /* 47 */ + OP_PLUSI, /* 48 */ + OP_MINPLUSI, /* 49 */ + OP_QUERYI, /* 50 */ + OP_MINQUERYI, /* 51 */ + + OP_UPTOI, /* 52 From 0 to n matches of one character, caseless */ + OP_MINUPTOI, /* 53 */ + OP_EXACTI, /* 54 */ + + OP_POSSTARI, /* 55 Possessified star, caseless */ + OP_POSPLUSI, /* 56 Possessified plus, caseless */ + OP_POSQUERYI, /* 57 Posesssified query, caseless */ + OP_POSUPTOI, /* 58 Possessified upto, caseless */ + + /**** The negated ones must follow the non-negated ones, and match them ****/ + /**** Negated single character, caseful; must precede the caseless ones ****/ + + OP_NOTSTAR, /* 59 The maximizing and minimizing versions of */ + OP_NOTMINSTAR, /* 60 these six opcodes must come in pairs, with */ + OP_NOTPLUS, /* 61 the minimizing one second. They must be in */ + OP_NOTMINPLUS, /* 62 exactly the same order as those above. */ + OP_NOTQUERY, /* 63 */ + OP_NOTMINQUERY, /* 64 */ + + OP_NOTUPTO, /* 65 From 0 to n matches, caseful */ + OP_NOTMINUPTO, /* 66 */ + OP_NOTEXACT, /* 67 Exactly n matches */ + + OP_NOTPOSSTAR, /* 68 Possessified versions, caseful */ + OP_NOTPOSPLUS, /* 69 */ + OP_NOTPOSQUERY, /* 70 */ + OP_NOTPOSUPTO, /* 71 */ + + /**** Negated single character, caseless; must follow the caseful ones ****/ + + OP_NOTSTARI, /* 72 */ + OP_NOTMINSTARI, /* 73 */ + OP_NOTPLUSI, /* 74 */ + OP_NOTMINPLUSI, /* 75 */ + OP_NOTQUERYI, /* 76 */ + OP_NOTMINQUERYI, /* 77 */ + + OP_NOTUPTOI, /* 78 From 0 to n matches, caseless */ + OP_NOTMINUPTOI, /* 79 */ + OP_NOTEXACTI, /* 80 Exactly n matches */ + + OP_NOTPOSSTARI, /* 81 Possessified versions, caseless */ + OP_NOTPOSPLUSI, /* 82 */ + OP_NOTPOSQUERYI, /* 83 */ + OP_NOTPOSUPTOI, /* 84 */ + + /**** Character types ****/ + + OP_TYPESTAR, /* 85 The maximizing and minimizing versions of */ + OP_TYPEMINSTAR, /* 86 these six opcodes must come in pairs, with */ + OP_TYPEPLUS, /* 87 the minimizing one second. These codes must */ + OP_TYPEMINPLUS, /* 88 be in exactly the same order as those above. */ + OP_TYPEQUERY, /* 89 */ + OP_TYPEMINQUERY, /* 90 */ + + OP_TYPEUPTO, /* 91 From 0 to n matches */ + OP_TYPEMINUPTO, /* 92 */ + OP_TYPEEXACT, /* 93 Exactly n matches */ + + OP_TYPEPOSSTAR, /* 94 Possessified versions */ + OP_TYPEPOSPLUS, /* 95 */ + OP_TYPEPOSQUERY, /* 96 */ + OP_TYPEPOSUPTO, /* 97 */ + + /* These are used for character classes and back references; only the + first six are the same as the sets above. */ + + OP_CRSTAR, /* 98 The maximizing and minimizing versions of */ + OP_CRMINSTAR, /* 99 all these opcodes must come in pairs, with */ + OP_CRPLUS, /* 100 the minimizing one second. These codes must */ + OP_CRMINPLUS, /* 101 be in exactly the same order as those above. */ + OP_CRQUERY, /* 102 */ + OP_CRMINQUERY, /* 103 */ + + OP_CRRANGE, /* 104 These are different to the three sets above. */ + OP_CRMINRANGE, /* 105 */ + + /* End of quantifier opcodes */ + + OP_CLASS, /* 106 Match a character class, chars < 256 only */ + OP_NCLASS, /* 107 Same, but the bitmap was created from a negative + class - the difference is relevant only when a + character > 255 is encountered. */ + OP_XCLASS, /* 108 Extended class for handling > 255 chars within the + class. This does both positive and negative. */ + OP_REF, /* 109 Match a back reference, casefully */ + OP_REFI, /* 110 Match a back reference, caselessly */ + OP_RECURSE, /* 111 Match a numbered subpattern (possibly recursive) */ + OP_CALLOUT, /* 112 Call out to external function if provided */ + + OP_ALT, /* 113 Start of alternation */ + OP_KET, /* 114 End of group that doesn't have an unbounded repeat */ + OP_KETRMAX, /* 115 These two must remain together and in this */ + OP_KETRMIN, /* 116 order. They are for groups the repeat for ever. */ + OP_KETRPOS, /* 117 Possessive unlimited repeat. */ + + /* The assertions must come before BRA, CBRA, ONCE, and COND, and the four + asserts must remain in order. */ + + OP_REVERSE, /* 118 Move pointer back - used in lookbehind assertions */ + OP_ASSERT, /* 119 Positive lookahead */ + OP_ASSERT_NOT, /* 120 Negative lookahead */ + OP_ASSERTBACK, /* 121 Positive lookbehind */ + OP_ASSERTBACK_NOT, /* 122 Negative lookbehind */ + + /* ONCE, ONCE_NC, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come immediately + after the assertions, with ONCE first, as there's a test for >= ONCE for a + subpattern that isn't an assertion. The POS versions must immediately follow + the non-POS versions in each case. */ + + OP_ONCE, /* 123 Atomic group, contains captures */ + OP_ONCE_NC, /* 124 Atomic group containing no captures */ + OP_BRA, /* 125 Start of non-capturing bracket */ + OP_BRAPOS, /* 126 Ditto, with unlimited, possessive repeat */ + OP_CBRA, /* 127 Start of capturing bracket */ + OP_CBRAPOS, /* 128 Ditto, with unlimited, possessive repeat */ + OP_COND, /* 129 Conditional group */ - /* These three must follow the previous three, in the same order. There's a + /* These five must follow the previous five, in the same order. There's a check for >= SBRA to distinguish the two sets. */ - OP_SBRA, /* 97 Start of non-capturing bracket, check empty */ - OP_SCBRA, /* 98 Start of capturing bracket, check empty */ - OP_SCOND, /* 99 Conditional group, check empty */ + OP_SBRA, /* 130 Start of non-capturing bracket, check empty */ + OP_SBRAPOS, /* 131 Ditto, with unlimited, possessive repeat */ + OP_SCBRA, /* 132 Start of capturing bracket, check empty */ + OP_SCBRAPOS, /* 133 Ditto, with unlimited, possessive repeat */ + OP_SCOND, /* 134 Conditional group, check empty */ /* The next two pairs must (respectively) be kept together. */ - OP_CREF, /* 100 Used to hold a capture number as condition */ - OP_NCREF, /* 101 Same, but generaged by a name reference*/ - OP_RREF, /* 102 Used to hold a recursion number as condition */ - OP_NRREF, /* 103 Same, but generaged by a name reference*/ - OP_DEF, /* 104 The DEFINE condition */ - - OP_BRAZERO, /* 105 These two must remain together and in this */ - OP_BRAMINZERO, /* 106 order. */ + OP_CREF, /* 135 Used to hold a capture number as condition */ + OP_NCREF, /* 136 Same, but generated by a name reference*/ + OP_RREF, /* 137 Used to hold a recursion number as condition */ + OP_NRREF, /* 138 Same, but generated by a name reference*/ + OP_DEF, /* 139 The DEFINE condition */ + + OP_BRAZERO, /* 140 These two must remain together and in this */ + OP_BRAMINZERO, /* 141 order. */ + OP_BRAPOSZERO, /* 142 */ /* These are backtracking control verbs */ - OP_MARK, /* 107 always has an argument */ - OP_PRUNE, /* 108 */ - OP_PRUNE_ARG, /* 109 same, but with argument */ - OP_SKIP, /* 110 */ - OP_SKIP_ARG, /* 111 same, but with argument */ - OP_THEN, /* 112 */ - OP_THEN_ARG, /* 113 same, but with argument */ - OP_COMMIT, /* 114 */ + OP_MARK, /* 143 always has an argument */ + OP_PRUNE, /* 144 */ + OP_PRUNE_ARG, /* 145 same, but with argument */ + OP_SKIP, /* 146 */ + OP_SKIP_ARG, /* 147 same, but with argument */ + OP_THEN, /* 148 */ + OP_THEN_ARG, /* 149 same, but with argument */ + OP_COMMIT, /* 150 */ /* These are forced failure and success verbs */ - OP_FAIL, /* 115 */ - OP_ACCEPT, /* 116 */ - OP_CLOSE, /* 117 Used before OP_ACCEPT to close open captures */ + OP_FAIL, /* 151 */ + OP_ACCEPT, /* 152 */ + OP_ASSERT_ACCEPT, /* 153 Used inside assertions */ + OP_CLOSE, /* 154 Used before OP_ACCEPT to close open captures */ /* This is used to skip a subpattern with a {0} quantifier */ - OP_SKIPZERO, /* 118 */ + OP_SKIPZERO, /* 155 */ /* This is not an opcode, but is used to check that tables indexed by opcode are the correct length, in order to catch updating errors - there have been @@ -1464,29 +1802,45 @@ /* This macro defines textual names for all the opcodes. These are used only -for debugging. The macro is referenced only in pcre_printint.c. */ +for debugging, and some of them are only partial names. The macro is referenced +only in pcre_printint.c, which fills out the full names in many cases (and in +some cases doesn't actually use these names at all). */ #define OP_NAME_LIST \ "End", "\\A", "\\G", "\\K", "\\B", "\\b", "\\D", "\\d", \ "\\S", "\\s", "\\W", "\\w", "Any", "AllAny", "Anybyte", \ "notprop", "prop", "\\R", "\\H", "\\h", "\\V", "\\v", \ "extuni", "\\Z", "\\z", \ - "Opt", "^", "$", "char", "charnc", "not", \ - "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ + "^", "^", "$", "$", "char", "chari", "not", "noti", \ + "*", "*?", "+", "+?", "?", "??", \ + "{", "{", "{", \ "*+","++", "?+", "{", \ - "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ + "*", "*?", "+", "+?", "?", "??", \ + "{", "{", "{", \ + "*+","++", "?+", "{", \ + "*", "*?", "+", "+?", "?", "??", \ + "{", "{", "{", \ + "*+","++", "?+", "{", \ + "*", "*?", "+", "+?", "?", "??", \ + "{", "{", "{", \ "*+","++", "?+", "{", \ "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ "*+","++", "?+", "{", \ "*", "*?", "+", "+?", "?", "??", "{", "{", \ - "class", "nclass", "xclass", "Ref", "Recurse", "Callout", \ - "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not", \ - "AssertB", "AssertB not", "Reverse", \ - "Once", "Bra", "CBra", "Cond", "SBra", "SCBra", "SCond", \ + "class", "nclass", "xclass", "Ref", "Refi", \ + "Recurse", "Callout", \ + "Alt", "Ket", "KetRmax", "KetRmin", "KetRpos", \ + "Reverse", "Assert", "Assert not", "AssertB", "AssertB not", \ + "Once", "Once_NC", \ + "Bra", "BraPos", "CBra", "CBraPos", \ + "Cond", \ + "SBra", "SBraPos", "SCBra", "SCBraPos", \ + "SCond", \ "Cond ref", "Cond nref", "Cond rec", "Cond nrec", "Cond def", \ - "Brazero", "Braminzero", \ + "Brazero", "Braminzero", "Braposzero", \ "*MARK", "*PRUNE", "*PRUNE", "*SKIP", "*SKIP", \ - "*THEN", "*THEN", "*COMMIT", "*FAIL", "*ACCEPT", \ + "*THEN", "*THEN", "*COMMIT", "*FAIL", \ + "*ACCEPT", "*ASSERT_ACCEPT", \ "Close", "Skip zero" @@ -1507,56 +1861,75 @@ 3, 3, /* \P, \p */ \ 1, 1, 1, 1, 1, /* \R, \H, \h, \V, \v */ \ 1, /* \X */ \ - 1, 1, 2, 1, 1, /* \Z, \z, Opt, ^, $ */ \ + 1, 1, 1, 1, 1, 1, /* \Z, \z, ^, ^M, $, $M */ \ 2, /* Char - the minimum length */ \ - 2, /* Charnc - the minimum length */ \ + 2, /* Chari - the minimum length */ \ 2, /* not */ \ - /* Positive single-char repeats ** These are */ \ - 2, 2, 2, 2, 2, 2, /* *, *?, +, +?, ?, ?? ** minima in */ \ - 4, 4, 4, /* upto, minupto, exact ** UTF-8 mode */ \ - 2, 2, 2, 4, /* *+, ++, ?+, upto+ */ \ + 2, /* noti */ \ + /* Positive single-char repeats ** These are */ \ + 2, 2, 2, 2, 2, 2, /* *, *?, +, +?, ?, ?? ** minima in */ \ + 2+IMM2_SIZE, 2+IMM2_SIZE, /* upto, minupto ** mode */ \ + 2+IMM2_SIZE, /* exact */ \ + 2, 2, 2, 2+IMM2_SIZE, /* *+, ++, ?+, upto+ */ \ + 2, 2, 2, 2, 2, 2, /* *I, *?I, +I, +?I, ?I, ??I ** UTF-8 */ \ + 2+IMM2_SIZE, 2+IMM2_SIZE, /* upto I, minupto I */ \ + 2+IMM2_SIZE, /* exact I */ \ + 2, 2, 2, 2+IMM2_SIZE, /* *+I, ++I, ?+I, upto+I */ \ /* Negative single-char repeats - only for chars < 256 */ \ 2, 2, 2, 2, 2, 2, /* NOT *, *?, +, +?, ?, ?? */ \ - 4, 4, 4, /* NOT upto, minupto, exact */ \ - 2, 2, 2, 4, /* Possessive *, +, ?, upto */ \ + 2+IMM2_SIZE, 2+IMM2_SIZE, /* NOT upto, minupto */ \ + 2+IMM2_SIZE, /* NOT exact */ \ + 2, 2, 2, 2+IMM2_SIZE, /* Possessive NOT *, +, ?, upto */ \ + 2, 2, 2, 2, 2, 2, /* NOT *I, *?I, +I, +?I, ?I, ??I */ \ + 2+IMM2_SIZE, 2+IMM2_SIZE, /* NOT upto I, minupto I */ \ + 2+IMM2_SIZE, /* NOT exact I */ \ + 2, 2, 2, 2+IMM2_SIZE, /* Possessive NOT *I, +I, ?I, upto I */ \ /* Positive type repeats */ \ 2, 2, 2, 2, 2, 2, /* Type *, *?, +, +?, ?, ?? */ \ - 4, 4, 4, /* Type upto, minupto, exact */ \ - 2, 2, 2, 4, /* Possessive *+, ++, ?+, upto+ */ \ + 2+IMM2_SIZE, 2+IMM2_SIZE, /* Type upto, minupto */ \ + 2+IMM2_SIZE, /* Type exact */ \ + 2, 2, 2, 2+IMM2_SIZE, /* Possessive *+, ++, ?+, upto+ */ \ /* Character class & ref repeats */ \ 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ \ - 5, 5, /* CRRANGE, CRMINRANGE */ \ - 33, /* CLASS */ \ - 33, /* NCLASS */ \ + 1+2*IMM2_SIZE, 1+2*IMM2_SIZE, /* CRRANGE, CRMINRANGE */ \ + 1+(32/sizeof(pcre_uchar)), /* CLASS */ \ + 1+(32/sizeof(pcre_uchar)), /* NCLASS */ \ 0, /* XCLASS - variable length */ \ - 3, /* REF */ \ + 1+IMM2_SIZE, /* REF */ \ + 1+IMM2_SIZE, /* REFI */ \ 1+LINK_SIZE, /* RECURSE */ \ 2+2*LINK_SIZE, /* CALLOUT */ \ 1+LINK_SIZE, /* Alt */ \ 1+LINK_SIZE, /* Ket */ \ 1+LINK_SIZE, /* KetRmax */ \ 1+LINK_SIZE, /* KetRmin */ \ + 1+LINK_SIZE, /* KetRpos */ \ + 1+LINK_SIZE, /* Reverse */ \ 1+LINK_SIZE, /* Assert */ \ 1+LINK_SIZE, /* Assert not */ \ 1+LINK_SIZE, /* Assert behind */ \ 1+LINK_SIZE, /* Assert behind not */ \ - 1+LINK_SIZE, /* Reverse */ \ 1+LINK_SIZE, /* ONCE */ \ + 1+LINK_SIZE, /* ONCE_NC */ \ 1+LINK_SIZE, /* BRA */ \ - 3+LINK_SIZE, /* CBRA */ \ + 1+LINK_SIZE, /* BRAPOS */ \ + 1+LINK_SIZE+IMM2_SIZE, /* CBRA */ \ + 1+LINK_SIZE+IMM2_SIZE, /* CBRAPOS */ \ 1+LINK_SIZE, /* COND */ \ 1+LINK_SIZE, /* SBRA */ \ - 3+LINK_SIZE, /* SCBRA */ \ + 1+LINK_SIZE, /* SBRAPOS */ \ + 1+LINK_SIZE+IMM2_SIZE, /* SCBRA */ \ + 1+LINK_SIZE+IMM2_SIZE, /* SCBRAPOS */ \ 1+LINK_SIZE, /* SCOND */ \ - 3, 3, /* CREF, NCREF */ \ - 3, 3, /* RREF, NRREF */ \ + 1+IMM2_SIZE, 1+IMM2_SIZE, /* CREF, NCREF */ \ + 1+IMM2_SIZE, 1+IMM2_SIZE, /* RREF, NRREF */ \ 1, /* DEF */ \ - 1, 1, /* BRAZERO, BRAMINZERO */ \ + 1, 1, 1, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ \ 3, 1, 3, /* MARK, PRUNE, PRUNE_ARG */ \ 1, 3, /* SKIP, SKIP_ARG */ \ - 1+LINK_SIZE, 3+LINK_SIZE, /* THEN, THEN_ARG */ \ - 1, 1, 1, 3, 1 /* COMMIT, FAIL, ACCEPT, CLOSE, SKIPZERO */ - + 1, 3, /* THEN, THEN_ARG */ \ + 1, 1, 1, 1, /* COMMIT, FAIL, ACCEPT, ASSERT_ACCEPT */ \ + 1+IMM2_SIZE, 1 /* CLOSE, SKIPZERO */ /* A magic value for OP_RREF and OP_NRREF to indicate the "any recursion" condition. */ @@ -1573,8 +1946,12 @@ ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39, ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49, ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59, - ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, - ERRCOUNT }; + ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69, + ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERRCOUNT }; + +/* JIT compiling modes. The function list is indexed by them. */ +enum { JIT_COMPILE, JIT_PARTIAL_SOFT_COMPILE, JIT_PARTIAL_HARD_COMPILE, + JIT_NUMBER_OF_COMPILE_MODES }; /* The real format of the start of the pcre block; the index of names and the code vector run on as long as necessary after the end. We store an explicit @@ -1593,24 +1970,29 @@ NOTE NOTE NOTE */ -typedef struct real_pcre { +#ifdef COMPILE_PCRE8 +#define REAL_PCRE real_pcre +#else +#define REAL_PCRE real_pcre16 +#endif + +typedef struct REAL_PCRE { pcre_uint32 magic_number; pcre_uint32 size; /* Total that was malloced */ pcre_uint32 options; /* Public options */ pcre_uint16 flags; /* Private flags */ - pcre_uint16 dummy1; /* For future use */ - pcre_uint16 top_bracket; - pcre_uint16 top_backref; - pcre_uint16 first_byte; - pcre_uint16 req_byte; + pcre_uint16 max_lookbehind; /* Longest lookbehind (characters) */ + pcre_uint16 top_bracket; /* Highest numbered group */ + pcre_uint16 top_backref; /* Highest numbered back reference */ + pcre_uint16 first_char; /* Starting character */ + pcre_uint16 req_char; /* This character must be seen */ pcre_uint16 name_table_offset; /* Offset to name table that follows */ pcre_uint16 name_entry_size; /* Size of any name items */ pcre_uint16 name_count; /* Number of name items */ pcre_uint16 ref_count; /* Reference count */ - - const unsigned char *tables; /* Pointer to tables or NULL for std */ - const unsigned char *nullpad; /* NULL padding */ -} real_pcre; + const pcre_uint8 *tables; /* Pointer to tables or NULL for std */ + const pcre_uint8 *nullpad; /* NULL padding */ +} REAL_PCRE; /* The format of the block used to store data from pcre_study(). The same remark (see NOTE above) about extending this structure applies. */ @@ -1618,7 +2000,7 @@ typedef struct pcre_study_data { pcre_uint32 size; /* Total that was malloced */ pcre_uint32 flags; /* Private flags */ - uschar start_bits[32]; /* Starting char bits */ + pcre_uint8 start_bits[32]; /* Starting char bits */ pcre_uint32 minlength; /* Minimum subject length */ } pcre_study_data; @@ -1637,60 +2019,71 @@ doing the compiling, so that they are thread-safe. */ typedef struct compile_data { - const uschar *lcc; /* Points to lower casing table */ - const uschar *fcc; /* Points to case-flipping table */ - const uschar *cbits; /* Points to character type table */ - const uschar *ctypes; /* Points to table of type maps */ - const uschar *start_workspace;/* The start of working space */ - const uschar *start_code; /* The start of the compiled code */ - const uschar *start_pattern; /* The start of the pattern */ - const uschar *end_pattern; /* The end of the pattern */ - open_capitem *open_caps; /* Chain of open capture items */ - uschar *hwm; /* High watermark of workspace */ - uschar *name_table; /* The name/number table */ - int names_found; /* Number of entries so far */ - int name_entry_size; /* Size of each entry */ - int bracount; /* Count of capturing parens as we compile */ - int final_bracount; /* Saved value after first pass */ - int top_backref; /* Maximum back reference */ - unsigned int backref_map; /* Bitmap of low back refs */ - int external_options; /* External (initial) options */ - int external_flags; /* External flag bits to be set */ - int req_varyopt; /* "After variable item" flag for reqbyte */ - BOOL had_accept; /* (*ACCEPT) encountered */ - BOOL check_lookbehind; /* Lookbehinds need later checking */ - int nltype; /* Newline type */ - int nllen; /* Newline string length */ - uschar nl[4]; /* Newline string when fixed length */ + const pcre_uint8 *lcc; /* Points to lower casing table */ + const pcre_uint8 *fcc; /* Points to case-flipping table */ + const pcre_uint8 *cbits; /* Points to character type table */ + const pcre_uint8 *ctypes; /* Points to table of type maps */ + const pcre_uchar *start_workspace;/* The start of working space */ + const pcre_uchar *start_code; /* The start of the compiled code */ + const pcre_uchar *start_pattern; /* The start of the pattern */ + const pcre_uchar *end_pattern; /* The end of the pattern */ + open_capitem *open_caps; /* Chain of open capture items */ + pcre_uchar *hwm; /* High watermark of workspace */ + pcre_uchar *name_table; /* The name/number table */ + int names_found; /* Number of entries so far */ + int name_entry_size; /* Size of each entry */ + int workspace_size; /* Size of workspace */ + int bracount; /* Count of capturing parens as we compile */ + int final_bracount; /* Saved value after first pass */ + int max_lookbehind; /* Maximum lookbehind (characters) */ + int top_backref; /* Maximum back reference */ + unsigned int backref_map; /* Bitmap of low back refs */ + int assert_depth; /* Depth of nested assertions */ + int external_options; /* External (initial) options */ + int external_flags; /* External flag bits to be set */ + int req_varyopt; /* "After variable item" flag for reqbyte */ + BOOL had_accept; /* (*ACCEPT) encountered */ + BOOL check_lookbehind; /* Lookbehinds need later checking */ + int nltype; /* Newline type */ + int nllen; /* Newline string length */ + pcre_uchar nl[4]; /* Newline string when fixed length */ } compile_data; /* Structure for maintaining a chain of pointers to the currently incomplete -branches, for testing for left recursion. */ +branches, for testing for left recursion while compiling. */ typedef struct branch_chain { struct branch_chain *outer; - uschar *current_branch; + pcre_uchar *current_branch; } branch_chain; /* Structure for items in a linked list that represents an explicit recursive -call within the pattern. */ +call within the pattern; used by pcre_exec(). */ typedef struct recursion_info { struct recursion_info *prevrec; /* Previous recursion record (or NULL) */ - int group_num; /* Number of group that was called */ - const uschar *after_call; /* "Return value": points after the call in the expr */ - int *offset_save; /* Pointer to start of saved offsets */ - int saved_max; /* Number of saved offsets */ - int save_offset_top; /* Current value of offset_top */ + int group_num; /* Number of group that was called */ + int *offset_save; /* Pointer to start of saved offsets */ + int saved_max; /* Number of saved offsets */ + PCRE_PUCHAR subject_position; /* Position at start of recursion */ } recursion_info; +/* A similar structure for pcre_dfa_exec(). */ + +typedef struct dfa_recursion_info { + struct dfa_recursion_info *prevrec; + int group_num; + PCRE_PUCHAR subject_position; +} dfa_recursion_info; + /* Structure for building a chain of data for holding the values of the subject pointer at the start of each subpattern, so as to detect when an empty string -has been matched by a subpattern - to break infinite loops. */ +has been matched by a subpattern - to break infinite loops; used by +pcre_exec(). */ typedef struct eptrblock { struct eptrblock *epb_prev; - USPTR epb_saved_eptr; + PCRE_PUCHAR epb_saved_eptr; } eptrblock; @@ -1701,61 +2094,71 @@ unsigned long int match_call_count; /* As it says */ unsigned long int match_limit; /* As it says */ unsigned long int match_limit_recursion; /* As it says */ - int *offset_vector; /* Offset vector */ - int offset_end; /* One past the end */ - int offset_max; /* The maximum usable for return data */ - int nltype; /* Newline type */ - int nllen; /* Newline string length */ - int name_count; /* Number of names in name table */ - int name_entry_size; /* Size of entry in names table */ - uschar *name_table; /* Table of names */ - uschar nl[4]; /* Newline string when fixed */ - const uschar *lcc; /* Points to lower casing table */ - const uschar *ctypes; /* Points to table of type maps */ - BOOL offset_overflow; /* Set if too many extractions */ - BOOL notbol; /* NOTBOL flag */ - BOOL noteol; /* NOTEOL flag */ - BOOL utf8; /* UTF8 flag */ - BOOL jscript_compat; /* JAVASCRIPT_COMPAT flag */ - BOOL use_ucp; /* PCRE_UCP flag */ - BOOL endonly; /* Dollar not before final \n */ - BOOL notempty; /* Empty string match not wanted */ - BOOL notempty_atstart; /* Empty string match at start not wanted */ - BOOL hitend; /* Hit the end of the subject at some point */ - BOOL bsr_anycrlf; /* \R is just any CRLF, not full Unicode */ - const uschar *start_code; /* For use when recursing */ - USPTR start_subject; /* Start of the subject string */ - USPTR end_subject; /* End of the subject string */ - USPTR start_match_ptr; /* Start of matched string */ - USPTR end_match_ptr; /* Subject position at end match */ - USPTR start_used_ptr; /* Earliest consulted character */ - int partial; /* PARTIAL options */ - int end_offset_top; /* Highwater mark at end of match */ - int capture_last; /* Most recent capture number */ - int start_offset; /* The start offset value */ - eptrblock *eptrchain; /* Chain of eptrblocks for tail recursions */ - int eptrn; /* Next free eptrblock */ - recursion_info *recursive; /* Linked list of recursion data */ - void *callout_data; /* To pass back to callouts */ - const uschar *mark; /* Mark pointer to pass back */ + int *offset_vector; /* Offset vector */ + int offset_end; /* One past the end */ + int offset_max; /* The maximum usable for return data */ + int nltype; /* Newline type */ + int nllen; /* Newline string length */ + int name_count; /* Number of names in name table */ + int name_entry_size; /* Size of entry in names table */ + pcre_uchar *name_table; /* Table of names */ + pcre_uchar nl[4]; /* Newline string when fixed */ + const pcre_uint8 *lcc; /* Points to lower casing table */ + const pcre_uint8 *fcc; /* Points to case-flipping table */ + const pcre_uint8 *ctypes; /* Points to table of type maps */ + BOOL offset_overflow; /* Set if too many extractions */ + BOOL notbol; /* NOTBOL flag */ + BOOL noteol; /* NOTEOL flag */ + BOOL utf; /* UTF-8 / UTF-16 flag */ + BOOL jscript_compat; /* JAVASCRIPT_COMPAT flag */ + BOOL use_ucp; /* PCRE_UCP flag */ + BOOL endonly; /* Dollar not before final \n */ + BOOL notempty; /* Empty string match not wanted */ + BOOL notempty_atstart; /* Empty string match at start not wanted */ + BOOL hitend; /* Hit the end of the subject at some point */ + BOOL bsr_anycrlf; /* \R is just any CRLF, not full Unicode */ + BOOL hasthen; /* Pattern contains (*THEN) */ + BOOL ignore_skip_arg; /* For re-run when SKIP name not found */ + const pcre_uchar *start_code; /* For use when recursing */ + PCRE_PUCHAR start_subject; /* Start of the subject string */ + PCRE_PUCHAR end_subject; /* End of the subject string */ + PCRE_PUCHAR start_match_ptr; /* Start of matched string */ + PCRE_PUCHAR end_match_ptr; /* Subject position at end match */ + PCRE_PUCHAR start_used_ptr; /* Earliest consulted character */ + int partial; /* PARTIAL options */ + int end_offset_top; /* Highwater mark at end of match */ + int capture_last; /* Most recent capture number */ + int start_offset; /* The start offset value */ + int match_function_type; /* Set for certain special calls of MATCH() */ + eptrblock *eptrchain; /* Chain of eptrblocks for tail recursions */ + int eptrn; /* Next free eptrblock */ + recursion_info *recursive; /* Linked list of recursion data */ + void *callout_data; /* To pass back to callouts */ + const pcre_uchar *mark; /* Mark pointer to pass back on success */ + const pcre_uchar *nomatch_mark;/* Mark pointer to pass back on failure */ + const pcre_uchar *once_target; /* Where to back up to for atomic groups */ +#ifdef NO_RECURSE + void *match_frames_base; /* For remembering malloc'd frames */ +#endif } match_data; /* A similar structure is used for the same purpose by the DFA matching functions. */ typedef struct dfa_match_data { - const uschar *start_code; /* Start of the compiled pattern */ - const uschar *start_subject; /* Start of the subject string */ - const uschar *end_subject; /* End of subject string */ - const uschar *start_used_ptr; /* Earliest consulted character */ - const uschar *tables; /* Character tables */ - int start_offset; /* The start offset value */ - int moptions; /* Match options */ - int poptions; /* Pattern options */ - int nltype; /* Newline type */ - int nllen; /* Newline string length */ - uschar nl[4]; /* Newline string when fixed */ - void *callout_data; /* To pass back to callouts */ + const pcre_uchar *start_code; /* Start of the compiled pattern */ + const pcre_uchar *start_subject ; /* Start of the subject string */ + const pcre_uchar *end_subject; /* End of subject string */ + const pcre_uchar *start_used_ptr; /* Earliest consulted character */ + const pcre_uint8 *tables; /* Character tables */ + int start_offset; /* The start offset value */ + int moptions; /* Match options */ + int poptions; /* Pattern options */ + int nltype; /* Newline type */ + int nllen; /* Newline string length */ + pcre_uchar nl[4]; /* Newline string when fixed */ + void *callout_data; /* To pass back to callouts */ + dfa_recursion_info *recursive; /* Linked list of recursion data */ } dfa_match_data; /* Bit definitions for entries in the pcre_ctypes table. */ @@ -1791,6 +2194,28 @@ #define ctypes_offset (cbits_offset + cbit_length) #define tables_length (ctypes_offset + 256) +/* Internal function and data prefixes. */ + +#ifdef COMPILE_PCRE8 +#ifndef PUBL +#define PUBL(name) pcre_##name +#endif +#ifndef PRIV +#define PRIV(name) _pcre_##name +#endif +#else /* COMPILE_PCRE8 */ +#ifdef COMPILE_PCRE16 +#ifndef PUBL +#define PUBL(name) pcre16_##name +#endif +#ifndef PRIV +#define PRIV(name) _pcre16_##name +#endif +#else +#error Unsupported compiling mode +#endif /* COMPILE_PCRE16 */ +#endif /* COMPILE_PCRE8 */ + /* Layout of the UCP type table that translates property names into types and codes. Each entry used to point directly to a name, but to reduce the number of relocations in shared libraries, it now has an offset into a single string @@ -1808,62 +2233,116 @@ but are not part of the PCRE public API. The data for these tables is in the pcre_tables.c module. */ -extern const int _pcre_utf8_table1[]; -extern const int _pcre_utf8_table2[]; -extern const int _pcre_utf8_table3[]; -extern const uschar _pcre_utf8_table4[]; +#ifdef COMPILE_PCRE8 + +extern const int PRIV(utf8_table1)[]; +extern const int PRIV(utf8_table1_size); +extern const int PRIV(utf8_table2)[]; +extern const int PRIV(utf8_table3)[]; +extern const pcre_uint8 PRIV(utf8_table4)[]; -extern const int _pcre_utf8_table1_size; +#endif /* COMPILE_PCRE8 */ -extern const char _pcre_utt_names[]; -extern const ucp_type_table _pcre_utt[]; -extern const int _pcre_utt_size; +extern const char PRIV(utt_names)[]; +extern const ucp_type_table PRIV(utt)[]; +extern const int PRIV(utt_size); -extern const uschar _pcre_default_tables[]; +extern const pcre_uint8 PRIV(default_tables)[]; -extern const uschar _pcre_OP_lengths[]; +extern const pcre_uint8 PRIV(OP_lengths)[]; /* Internal shared functions. These are functions that are used by more than one of the exported public functions. They have to be "external" in the C sense, but are not part of the PCRE public API. */ -extern const uschar *_pcre_find_bracket(const uschar *, BOOL, int); -extern BOOL _pcre_is_newline(USPTR, int, USPTR, int *, BOOL); -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_valid_utf8(USPTR, int); -extern BOOL _pcre_was_newline(USPTR, int, USPTR, int *, BOOL); -extern BOOL _pcre_xclass(int, const uschar *); +/* String comparison functions. */ +#ifdef COMPILE_PCRE8 + +#define STRCMP_UC_UC(str1, str2) \ + strcmp((char *)(str1), (char *)(str2)) +#define STRCMP_UC_C8(str1, str2) \ + strcmp((char *)(str1), (str2)) +#define STRNCMP_UC_UC(str1, str2, num) \ + strncmp((char *)(str1), (char *)(str2), (num)) +#define STRNCMP_UC_C8(str1, str2, num) \ + strncmp((char *)(str1), (str2), (num)) +#define STRLEN_UC(str) strlen((const char *)str) + +#else +extern int PRIV(strcmp_uc_uc)(const pcre_uchar *, + const pcre_uchar *); +extern int PRIV(strcmp_uc_c8)(const pcre_uchar *, + const char *); +extern int PRIV(strncmp_uc_uc)(const pcre_uchar *, + const pcre_uchar *, unsigned int num); +extern int PRIV(strncmp_uc_c8)(const pcre_uchar *, + const char *, unsigned int num); +extern unsigned int PRIV(strlen_uc)(const pcre_uchar *str); + +#define STRCMP_UC_UC(str1, str2) \ + PRIV(strcmp_uc_uc)((str1), (str2)) +#define STRCMP_UC_C8(str1, str2) \ + PRIV(strcmp_uc_c8)((str1), (str2)) +#define STRNCMP_UC_UC(str1, str2, num) \ + PRIV(strncmp_uc_uc)((str1), (str2), (num)) +#define STRNCMP_UC_C8(str1, str2, num) \ + PRIV(strncmp_uc_c8)((str1), (str2), (num)) +#define STRLEN_UC(str) PRIV(strlen_uc)(str) + +#endif /* COMPILE_PCRE8 */ + +extern const pcre_uchar *PRIV(find_bracket)(const pcre_uchar *, BOOL, int); +extern BOOL PRIV(is_newline)(PCRE_PUCHAR, int, PCRE_PUCHAR, + int *, BOOL); +extern int PRIV(ord2utf)(pcre_uint32, pcre_uchar *); +extern int PRIV(valid_utf)(PCRE_PUCHAR, int, int *); +extern BOOL PRIV(was_newline)(PCRE_PUCHAR, int, PCRE_PUCHAR, + int *, BOOL); +extern BOOL PRIV(xclass)(int, const pcre_uchar *, BOOL); + +#ifdef SUPPORT_JIT +extern void PRIV(jit_compile)(const REAL_PCRE *, + PUBL(extra) *, int); +extern int PRIV(jit_exec)(const REAL_PCRE *, const PUBL(extra) *, + const pcre_uchar *, int, int, int, int *, int); +extern void PRIV(jit_free)(void *); +extern int PRIV(jit_get_size)(void *); +extern const char* PRIV(jit_get_target)(void); +#endif /* Unicode character database (UCD) */ typedef struct { - uschar script; - uschar chartype; + pcre_uint8 script; + pcre_uint8 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[]; - +extern const ucd_record PRIV(ucd_records)[]; +extern const pcre_uint8 PRIV(ucd_stage1)[]; +extern const pcre_uint16 PRIV(ucd_stage2)[]; +extern const int PRIV(ucp_gentype)[]; +#ifdef SUPPORT_JIT +extern const int PRIV(ucp_typerange)[]; +#endif +#ifdef SUPPORT_UCP /* 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 GET_UCD(ch) (PRIV(ucd_records) + \ + PRIV(ucd_stage2)[PRIV(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_CATEGORY(ch) PRIV(ucp_gentype)[UCD_CHARTYPE(ch)] #define UCD_OTHERCASE(ch) (ch + GET_UCD(ch)->other_case) +#endif /* SUPPORT_UCP */ + #endif /* End of pcre_internal.h */ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_maketables.c php5-5.4.9/ext/pcre/pcrelib/pcre_maketables.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_maketables.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_maketables.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2008 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -57,21 +57,26 @@ /* This function builds a set of character tables for use by PCRE and returns a pointer to them. They are build using the ctype functions, and consequently their contents will depend upon the current locale setting. When compiled as -part of the library, the store is obtained via pcre_malloc(), but when compiled -inside dftables, use malloc(). +part of the library, the store is obtained via PUBL(malloc)(), but when +compiled inside dftables, use malloc(). Arguments: none Returns: pointer to the contiguous block of data */ +#ifdef COMPILE_PCRE8 const unsigned char * pcre_maketables(void) +#else +const unsigned char * +pcre16_maketables(void) +#endif { unsigned char *yield, *p; int i; #ifndef DFTABLES -yield = (unsigned char*)(pcre_malloc)(tables_length); +yield = (unsigned char*)(PUBL(malloc))(tables_length); #else yield = (unsigned char*)malloc(tables_length); #endif diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_newline.c php5-5.4.9/ext/pcre/pcrelib/pcre_newline.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_newline.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_newline.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2009 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -65,16 +65,25 @@ type the newline type endptr pointer to the end of the string lenptr where to return the length - utf8 TRUE if in utf8 mode + utf TRUE if in utf mode Returns: TRUE or FALSE */ BOOL -_pcre_is_newline(USPTR ptr, int type, USPTR endptr, int *lenptr, BOOL utf8) +PRIV(is_newline)(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR endptr, int *lenptr, + BOOL utf) { int c; -if (utf8) { GETCHAR(c, ptr); } else c = *ptr; +(void)utf; +#ifdef SUPPORT_UTF +if (utf) + { + GETCHAR(c, ptr); + } +else +#endif /* SUPPORT_UTF */ + c = *ptr; if (type == NLTYPE_ANYCRLF) switch(c) { @@ -93,9 +102,15 @@ case 0x000c: *lenptr = 1; return TRUE; /* FF */ case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1; return TRUE; /* CR */ - case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */ +#ifdef COMPILE_PCRE8 + case 0x0085: *lenptr = utf? 2 : 1; return TRUE; /* NEL */ case 0x2028: /* LS */ case 0x2029: *lenptr = 3; return TRUE; /* PS */ +#else + case 0x0085: /* NEL */ + case 0x2028: /* LS */ + case 0x2029: *lenptr = 1; return TRUE; /* PS */ +#endif /* COMPILE_PCRE8 */ default: return FALSE; } } @@ -114,26 +129,27 @@ type the newline type startptr pointer to the start of the string lenptr where to return the length - utf8 TRUE if in utf8 mode + utf TRUE if in utf mode Returns: TRUE or FALSE */ BOOL -_pcre_was_newline(USPTR ptr, int type, USPTR startptr, int *lenptr, BOOL utf8) +PRIV(was_newline)(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR startptr, int *lenptr, + BOOL utf) { int c; +(void)utf; ptr--; -#ifdef SUPPORT_UTF8 -if (utf8) +#ifdef SUPPORT_UTF +if (utf) { BACKCHAR(ptr); GETCHAR(c, ptr); } -else c = *ptr; -#else /* no UTF-8 support */ -c = *ptr; -#endif /* SUPPORT_UTF8 */ +else +#endif /* SUPPORT_UTF */ + c = *ptr; if (type == NLTYPE_ANYCRLF) switch(c) { @@ -150,9 +166,15 @@ case 0x000b: /* VT */ case 0x000c: /* FF */ case 0x000d: *lenptr = 1; return TRUE; /* CR */ - case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */ +#ifdef COMPILE_PCRE8 + case 0x0085: *lenptr = utf? 2 : 1; return TRUE; /* NEL */ case 0x2028: /* LS */ case 0x2029: *lenptr = 3; return TRUE; /* PS */ +#else + case 0x0085: /* NEL */ + case 0x2028: /* LS */ + case 0x2029: *lenptr = 1; return TRUE; /* PS */ +#endif /* COMPILE_PCRE8 */ default: return FALSE; } } diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_ord2utf8.c php5-5.4.9/ext/pcre/pcrelib/pcre_ord2utf8.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_ord2utf8.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_ord2utf8.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2008 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -50,35 +50,45 @@ * Convert character value to UTF-8 * *************************************************/ -/* This function takes an integer value in the range 0 - 0x7fffffff -and encodes it as a UTF-8 character in 0 to 6 bytes. +/* This function takes an integer value in the range 0 - 0x10ffff +and encodes it as a UTF-8 character in 1 to 6 pcre_uchars. Arguments: cvalue the character value - buffer pointer to buffer for result - at least 6 bytes long + buffer pointer to buffer for result - at least 6 pcre_uchars long Returns: number of characters placed in the buffer */ int -_pcre_ord2utf8(int cvalue, uschar *buffer) +PRIV(ord2utf)(pcre_uint32 cvalue, pcre_uchar *buffer) { -#ifdef SUPPORT_UTF8 +#ifdef SUPPORT_UTF + register int i, j; -for (i = 0; i < _pcre_utf8_table1_size; i++) - if (cvalue <= _pcre_utf8_table1[i]) break; + +/* Checking invalid cvalue character, encoded as invalid UTF-16 character. +Should never happen in practice. */ +if ((cvalue & 0xf800) == 0xd800 || cvalue >= 0x110000) + cvalue = 0xfffe; + +for (i = 0; i < PRIV(utf8_table1_size); i++) + if ((int)cvalue <= PRIV(utf8_table1)[i]) break; buffer += i; for (j = i; j > 0; j--) { *buffer-- = 0x80 | (cvalue & 0x3f); cvalue >>= 6; } -*buffer = _pcre_utf8_table2[i] | cvalue; +*buffer = PRIV(utf8_table2)[i] | cvalue; return i + 1; + #else + (void)(cvalue); /* Keep compiler happy; this function won't ever be */ -(void)(buffer); /* called when SUPPORT_UTF8 is not defined. */ +(void)(buffer); /* called when SUPPORT_UTF is not defined. */ return 0; + #endif } diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_refcount.c php5-5.4.9/ext/pcre/pcrelib/pcre_refcount.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_refcount.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_refcount.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2008 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -66,11 +66,18 @@ a negative error number */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_refcount(pcre *argument_re, int adjust) +#else +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre16_refcount(pcre16 *argument_re, int adjust) +#endif { -real_pcre *re = (real_pcre *)argument_re; +REAL_PCRE *re = (REAL_PCRE *)argument_re; if (re == NULL) return PCRE_ERROR_NULL; +if (re->magic_number != MAGIC_NUMBER) return PCRE_ERROR_BADMAGIC; +if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE; re->ref_count = (-adjust > re->ref_count)? 0 : (adjust + re->ref_count > 65535)? 65535 : re->ref_count + adjust; diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_study.c php5-5.4.9/ext/pcre/pcrelib/pcre_study.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_study.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_study.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2010 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ /* Returns from set_start_bits() */ -enum { SSB_FAIL, SSB_DONE, SSB_CONTINUE }; +enum { SSB_FAIL, SSB_DONE, SSB_CONTINUE, SSB_UNKNOWN }; @@ -64,25 +64,30 @@ rather than bytes. Arguments: - code pointer to start of group (the bracket) - startcode pointer to start of the whole pattern - options the compiling options + code pointer to start of group (the bracket) + startcode pointer to start of the whole pattern + options the compiling options + int RECURSE depth Returns: the minimum length - -1 if \C was encountered + -1 if \C in UTF-8 mode or (*ACCEPT) was encountered -2 internal error (missing capturing bracket) + -3 internal error (opcode not listed) */ static int -find_minlength(const uschar *code, const uschar *startcode, int options) +find_minlength(const pcre_uchar *code, const pcre_uchar *startcode, int options, + int recurse_depth) { int length = -1; -BOOL utf8 = (options & PCRE_UTF8) != 0; +/* PCRE_UTF16 has the same value as PCRE_UTF8. */ +BOOL utf = (options & PCRE_UTF8) != 0; BOOL had_recurse = FALSE; register int branchlength = 0; -register uschar *cc = (uschar *)code + 1 + LINK_SIZE; +register pcre_uchar *cc = (pcre_uchar *)code + 1 + LINK_SIZE; -if (*code == OP_CBRA || *code == OP_SCBRA) cc += 2; +if (*code == OP_CBRA || *code == OP_SCBRA || + *code == OP_CBRAPOS || *code == OP_SCBRAPOS) cc += IMM2_SIZE; /* Scan along the opcodes for this branch. If we get to the end of the branch, check the length against that of the other branches. */ @@ -90,7 +95,7 @@ for (;;) { int d, min; - uschar *cs, *ce; + pcre_uchar *cs, *ce; register int op = *cc; switch (op) @@ -116,26 +121,40 @@ case OP_SCBRA: case OP_BRA: case OP_SBRA: + case OP_CBRAPOS: + case OP_SCBRAPOS: + case OP_BRAPOS: + case OP_SBRAPOS: case OP_ONCE: - d = find_minlength(cc, startcode, options); + case OP_ONCE_NC: + d = find_minlength(cc, startcode, options, recurse_depth); if (d < 0) return d; branchlength += d; do cc += GET(cc, 1); while (*cc == OP_ALT); cc += 1 + LINK_SIZE; break; + /* ACCEPT makes things far too complicated; we have to give up. */ + + case OP_ACCEPT: + case OP_ASSERT_ACCEPT: + return -1; + /* Reached end of a branch; if it's a ket it is the end of a nested - call. If it's ALT it is an alternation in a nested call. If it is - END it's the end of the outer call. All can be handled by the same code. */ + call. If it's ALT it is an alternation in a nested call. If it is END it's + the end of the outer call. All can be handled by the same code. If an + ACCEPT was previously encountered, use the length that was in force at that + time, and pass back the shortest ACCEPT length. */ case OP_ALT: case OP_KET: case OP_KETRMAX: case OP_KETRMIN: + case OP_KETRPOS: case OP_END: if (length < 0 || (!had_recurse && branchlength < length)) length = branchlength; - if (*cc != OP_ALT) return length; + if (op != OP_ALT) return length; cc += 1 + LINK_SIZE; branchlength = 0; had_recurse = FALSE; @@ -158,25 +177,27 @@ case OP_RREF: case OP_NRREF: case OP_DEF: - case OP_OPT: case OP_CALLOUT: case OP_SOD: case OP_SOM: case OP_EOD: case OP_EODN: case OP_CIRC: + case OP_CIRCM: case OP_DOLL: + case OP_DOLLM: case OP_NOT_WORD_BOUNDARY: case OP_WORD_BOUNDARY: - cc += _pcre_OP_lengths[*cc]; + cc += PRIV(OP_lengths)[*cc]; break; /* Skip over a subpattern that has a {0} or {0,x} quantifier */ case OP_BRAZERO: case OP_BRAMINZERO: + case OP_BRAPOSZERO: case OP_SKIPZERO: - cc += _pcre_OP_lengths[*cc]; + cc += PRIV(OP_lengths)[*cc]; do cc += GET(cc, 1); while (*cc == OP_ALT); cc += 1 + LINK_SIZE; break; @@ -184,18 +205,25 @@ /* Handle literal characters and + repetitions */ case OP_CHAR: - case OP_CHARNC: + case OP_CHARI: case OP_NOT: + case OP_NOTI: case OP_PLUS: + case OP_PLUSI: case OP_MINPLUS: + case OP_MINPLUSI: case OP_POSPLUS: + case OP_POSPLUSI: case OP_NOTPLUS: + case OP_NOTPLUSI: case OP_NOTMINPLUS: + case OP_NOTMINPLUSI: case OP_NOTPOSPLUS: + case OP_NOTPOSPLUSI: branchlength++; cc += 2; -#ifdef SUPPORT_UTF8 - if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f]; +#ifdef SUPPORT_UTF + if (utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); #endif break; @@ -210,17 +238,20 @@ need to skip over a multibyte character in UTF8 mode. */ case OP_EXACT: + case OP_EXACTI: case OP_NOTEXACT: + case OP_NOTEXACTI: branchlength += GET2(cc,1); - cc += 4; -#ifdef SUPPORT_UTF8 - if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f]; + cc += 2 + IMM2_SIZE; +#ifdef SUPPORT_UTF + if (utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); #endif break; case OP_TYPEEXACT: branchlength += GET2(cc,1); - cc += (cc[3] == OP_PROP || cc[3] == OP_NOTPROP)? 6 : 4; + cc += 2 + IMM2_SIZE + ((cc[1 + IMM2_SIZE] == OP_PROP + || cc[1 + IMM2_SIZE] == OP_NOTPROP)? 2 : 0); break; /* Handle single-char non-literal matchers */ @@ -247,18 +278,21 @@ cc++; break; - /* "Any newline" might match two characters */ + /* "Any newline" might match two characters, but it also might match just + one. */ case OP_ANYNL: - branchlength += 2; + branchlength += 1; cc++; break; - /* The single-byte matcher means we can't proceed in UTF-8 mode */ + /* The single-byte matcher means we can't proceed in UTF-8 mode. (In + non-UTF-8 mode \C will actually be turned into OP_ALLANY, so won't ever + appear, but leave the code, just in case.) */ case OP_ANYBYTE: -#ifdef SUPPORT_UTF8 - if (utf8) return -1; +#ifdef SUPPORT_UTF + if (utf) return -1; #endif branchlength++; cc++; @@ -274,27 +308,28 @@ case OP_TYPEPOSSTAR: case OP_TYPEPOSQUERY: if (cc[1] == OP_PROP || cc[1] == OP_NOTPROP) cc += 2; - cc += _pcre_OP_lengths[op]; + cc += PRIV(OP_lengths)[op]; break; case OP_TYPEUPTO: case OP_TYPEMINUPTO: case OP_TYPEPOSUPTO: - if (cc[3] == OP_PROP || cc[3] == OP_NOTPROP) cc += 2; - cc += _pcre_OP_lengths[op]; + if (cc[1 + IMM2_SIZE] == OP_PROP + || cc[1 + IMM2_SIZE] == OP_NOTPROP) cc += 2; + cc += PRIV(OP_lengths)[op]; break; /* Check a class for variable quantification */ -#ifdef SUPPORT_UTF8 +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 case OP_XCLASS: - cc += GET(cc, 1) - 33; + cc += GET(cc, 1) - PRIV(OP_lengths)[OP_CLASS]; /* Fall through */ #endif case OP_CLASS: case OP_NCLASS: - cc += 33; + cc += PRIV(OP_lengths)[OP_CLASS]; switch (*cc) { @@ -313,7 +348,7 @@ case OP_CRRANGE: case OP_CRMINRANGE: branchlength += GET2(cc,1); - cc += 5; + cc += 1 + 2 * IMM2_SIZE; break; default: @@ -335,9 +370,10 @@ that case we must set the minimum length to zero. */ case OP_REF: + case OP_REFI: if ((options & PCRE_JAVASCRIPT_COMPAT) == 0) { - ce = cs = (uschar *)_pcre_find_bracket(startcode, utf8, GET2(cc, 1)); + ce = cs = (pcre_uchar *)PRIV(find_bracket)(startcode, utf, GET2(cc, 1)); if (cs == NULL) return -2; do ce += GET(ce, 1); while (*ce == OP_ALT); if (cc > cs && cc < ce) @@ -345,10 +381,13 @@ d = 0; had_recurse = TRUE; } - else d = find_minlength(cs, startcode, options); + else + { + d = find_minlength(cs, startcode, options, recurse_depth); + } } else d = 0; - cc += 3; + cc += 1 + IMM2_SIZE; /* Handle repeated back references */ @@ -362,10 +401,16 @@ cc++; break; + case OP_CRPLUS: + case OP_CRMINPLUS: + min = 1; + cc++; + break; + case OP_CRRANGE: case OP_CRMINRANGE: min = GET2(cc, 1); - cc += 5; + cc += 1 + 2 * IMM2_SIZE; break; default: @@ -376,39 +421,71 @@ branchlength += min * d; break; + /* We can easily detect direct recursion, but not mutual recursion. This is + caught by a recursion depth count. */ + case OP_RECURSE: - cs = ce = (uschar *)startcode + GET(cc, 1); - if (cs == NULL) return -2; + cs = ce = (pcre_uchar *)startcode + GET(cc, 1); do ce += GET(ce, 1); while (*ce == OP_ALT); - if (cc > cs && cc < ce) + if ((cc > cs && cc < ce) || recurse_depth > 10) had_recurse = TRUE; else - branchlength += find_minlength(cs, startcode, options); + { + branchlength += find_minlength(cs, startcode, options, recurse_depth + 1); + } cc += 1 + LINK_SIZE; break; /* Anything else does not or need not match a character. We can get the item's length from the table, but for those that can match zero occurrences - of a character, we must take special action for UTF-8 characters. */ + of a character, we must take special action for UTF-8 characters. As it + happens, the "NOT" versions of these opcodes are used at present only for + ASCII characters, so they could be omitted from this list. However, in + future that may change, so we include them here so as not to leave a + gotcha for a future maintainer. */ case OP_UPTO: + case OP_UPTOI: case OP_NOTUPTO: + case OP_NOTUPTOI: case OP_MINUPTO: + case OP_MINUPTOI: case OP_NOTMINUPTO: + case OP_NOTMINUPTOI: case OP_POSUPTO: + case OP_POSUPTOI: + case OP_NOTPOSUPTO: + case OP_NOTPOSUPTOI: + case OP_STAR: + case OP_STARI: + case OP_NOTSTAR: + case OP_NOTSTARI: case OP_MINSTAR: + case OP_MINSTARI: case OP_NOTMINSTAR: + case OP_NOTMINSTARI: case OP_POSSTAR: + case OP_POSSTARI: case OP_NOTPOSSTAR: + case OP_NOTPOSSTARI: + case OP_QUERY: + case OP_QUERYI: + case OP_NOTQUERY: + case OP_NOTQUERYI: case OP_MINQUERY: + case OP_MINQUERYI: case OP_NOTMINQUERY: + case OP_NOTMINQUERYI: case OP_POSQUERY: + case OP_POSQUERYI: case OP_NOTPOSQUERY: - cc += _pcre_OP_lengths[op]; -#ifdef SUPPORT_UTF8 - if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f]; + case OP_NOTPOSQUERYI: + + cc += PRIV(OP_lengths)[op]; +#ifdef SUPPORT_UTF + if (utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); #endif break; @@ -417,20 +494,27 @@ case OP_MARK: case OP_PRUNE_ARG: case OP_SKIP_ARG: - cc += _pcre_OP_lengths[op] + cc[1]; + case OP_THEN_ARG: + cc += PRIV(OP_lengths)[op] + cc[1]; break; - case OP_THEN_ARG: - cc += _pcre_OP_lengths[op] + cc[1+LINK_SIZE]; + /* The remaining opcodes are just skipped over. */ + + case OP_CLOSE: + case OP_COMMIT: + case OP_FAIL: + case OP_PRUNE: + case OP_SET_SOM: + case OP_SKIP: + case OP_THEN: + cc += PRIV(OP_lengths)[op]; break; - /* For the record, these are the opcodes that are matched by "default": - OP_ACCEPT, OP_CLOSE, OP_COMMIT, OP_FAIL, OP_PRUNE, OP_SET_SOM, OP_SKIP, - OP_THEN. */ + /* This should not occur: we list all opcodes explicitly so that when + new ones get added they are properly considered. */ default: - cc += _pcre_OP_lengths[op]; - break; + return -3; } } /* Control never gets here */ @@ -452,29 +536,30 @@ p points to the character caseless the caseless flag cd the block with char table pointers - utf8 TRUE for UTF-8 mode + utf TRUE for UTF-8 / UTF-16 mode Returns: pointer after the character */ -static const uschar * -set_table_bit(uschar *start_bits, const uschar *p, BOOL caseless, - compile_data *cd, BOOL utf8) +static const pcre_uchar * +set_table_bit(pcre_uint8 *start_bits, const pcre_uchar *p, BOOL caseless, + compile_data *cd, BOOL utf) { unsigned int c = *p; +#ifdef COMPILE_PCRE8 SET_BIT(c); -#ifdef SUPPORT_UTF8 -if (utf8 && c > 127) +#ifdef SUPPORT_UTF +if (utf && c > 127) { GETCHARINC(c, p); #ifdef SUPPORT_UCP if (caseless) { - uschar buff[8]; + pcre_uchar buff[6]; c = UCD_OTHERCASE(c); - (void)_pcre_ord2utf8(c, buff); + (void)PRIV(ord2utf)(c, buff); SET_BIT(buff[0]); } #endif @@ -486,6 +571,36 @@ if (caseless && (cd->ctypes[c] & ctype_letter) != 0) SET_BIT(cd->fcc[c]); return p + 1; +#endif + +#ifdef COMPILE_PCRE16 +if (c > 0xff) + { + c = 0xff; + caseless = FALSE; + } +SET_BIT(c); + +#ifdef SUPPORT_UTF +if (utf && c > 127) + { + GETCHARINC(c, p); +#ifdef SUPPORT_UCP + if (caseless) + { + c = UCD_OTHERCASE(c); + if (c > 0xff) + c = 0xff; + SET_BIT(c); + } +#endif + return p; + } +#endif + +if (caseless && (cd->ctypes[c] & ctype_letter) != 0) SET_BIT(cd->fcc[c]); +return p + 1; +#endif } @@ -511,21 +626,23 @@ */ static void -set_type_bits(uschar *start_bits, int cbit_type, int table_limit, +set_type_bits(pcre_uint8 *start_bits, int cbit_type, int table_limit, compile_data *cd) { register int c; for (c = 0; c < table_limit; c++) start_bits[c] |= cd->cbits[c+cbit_type]; +#if defined SUPPORT_UTF && defined COMPILE_PCRE8 if (table_limit == 32) return; for (c = 128; c < 256; c++) { if ((cd->cbits[c/8] & (1 << (c&7))) != 0) { - uschar buff[8]; - (void)_pcre_ord2utf8(c, buff); + pcre_uchar buff[6]; + (void)PRIV(ord2utf)(c, buff); SET_BIT(buff[0]); } } +#endif } @@ -551,12 +668,14 @@ */ static void -set_nottype_bits(uschar *start_bits, int cbit_type, int table_limit, +set_nottype_bits(pcre_uint8 *start_bits, int cbit_type, int table_limit, compile_data *cd) { register int c; for (c = 0; c < table_limit; c++) start_bits[c] |= ~cd->cbits[c+cbit_type]; +#if defined SUPPORT_UTF && defined COMPILE_PCRE8 if (table_limit != 32) for (c = 24; c < 32; c++) start_bits[c] = 0xff; +#endif } @@ -576,22 +695,26 @@ Arguments: code points to an expression start_bits points to a 32-byte table, initialized to 0 - caseless the current state of the caseless flag - utf8 TRUE if in UTF-8 mode + utf TRUE if in UTF-8 / UTF-16 mode cd the block with char table pointers Returns: SSB_FAIL => Failed to find any starting bytes SSB_DONE => Found mandatory starting bytes SSB_CONTINUE => Found optional starting bytes + SSB_UNKNOWN => Hit an unrecognized opcode */ static int -set_start_bits(const uschar *code, uschar *start_bits, BOOL caseless, - BOOL utf8, compile_data *cd) +set_start_bits(const pcre_uchar *code, pcre_uint8 *start_bits, BOOL utf, + compile_data *cd) { register int c; int yield = SSB_DONE; -int table_limit = utf8? 16:32; +#if defined SUPPORT_UTF && defined COMPILE_PCRE8 +int table_limit = utf? 16:32; +#else +int table_limit = 32; +#endif #if 0 /* ========================================================================= */ @@ -612,19 +735,108 @@ do { - const uschar *tcode = code + (((int)*code == OP_CBRA)? 3:1) + LINK_SIZE; BOOL try_next = TRUE; + const pcre_uchar *tcode = code + 1 + LINK_SIZE; + + if (*code == OP_CBRA || *code == OP_SCBRA || + *code == OP_CBRAPOS || *code == OP_SCBRAPOS) tcode += IMM2_SIZE; while (try_next) /* Loop for items in this branch */ { int rc; + switch(*tcode) { - /* Fail if we reach something we don't understand */ + /* If we reach something we don't understand, it means a new opcode has + been created that hasn't been added to this code. Hopefully this problem + will be discovered during testing. */ default: + return SSB_UNKNOWN; + + /* Fail for a valid opcode that implies no starting bits. */ + + case OP_ACCEPT: + case OP_ASSERT_ACCEPT: + case OP_ALLANY: + case OP_ANY: + case OP_ANYBYTE: + case OP_CIRC: + case OP_CIRCM: + case OP_CLOSE: + case OP_COMMIT: + case OP_COND: + case OP_CREF: + case OP_DEF: + case OP_DOLL: + case OP_DOLLM: + case OP_END: + case OP_EOD: + case OP_EODN: + case OP_EXTUNI: + case OP_FAIL: + case OP_MARK: + case OP_NCREF: + case OP_NOT: + case OP_NOTEXACT: + case OP_NOTEXACTI: + case OP_NOTI: + case OP_NOTMINPLUS: + case OP_NOTMINPLUSI: + case OP_NOTMINQUERY: + case OP_NOTMINQUERYI: + case OP_NOTMINSTAR: + case OP_NOTMINSTARI: + case OP_NOTMINUPTO: + case OP_NOTMINUPTOI: + case OP_NOTPLUS: + case OP_NOTPLUSI: + case OP_NOTPOSPLUS: + case OP_NOTPOSPLUSI: + case OP_NOTPOSQUERY: + case OP_NOTPOSQUERYI: + case OP_NOTPOSSTAR: + case OP_NOTPOSSTARI: + case OP_NOTPOSUPTO: + case OP_NOTPOSUPTOI: + case OP_NOTPROP: + case OP_NOTQUERY: + case OP_NOTQUERYI: + case OP_NOTSTAR: + case OP_NOTSTARI: + case OP_NOTUPTO: + case OP_NOTUPTOI: + case OP_NOT_HSPACE: + case OP_NOT_VSPACE: + case OP_NRREF: + case OP_PROP: + case OP_PRUNE: + case OP_PRUNE_ARG: + case OP_RECURSE: + case OP_REF: + case OP_REFI: + case OP_REVERSE: + case OP_RREF: + case OP_SCOND: + case OP_SET_SOM: + case OP_SKIP: + case OP_SKIP_ARG: + case OP_SOD: + case OP_SOM: + case OP_THEN: + case OP_THEN_ARG: +#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 + case OP_XCLASS: +#endif return SSB_FAIL; + /* We can ignore word boundary tests. */ + + case OP_WORD_BOUNDARY: + case OP_NOT_WORD_BOUNDARY: + tcode++; + break; + /* If we hit a bracket or a positive lookahead assertion, recurse to set bits from within the subpattern. If it can't find anything, we have to give up. If it finds some mandatory character(s), we are done for this @@ -634,10 +846,15 @@ case OP_SBRA: case OP_CBRA: case OP_SCBRA: + case OP_BRAPOS: + case OP_SBRAPOS: + case OP_CBRAPOS: + case OP_SCBRAPOS: case OP_ONCE: + case OP_ONCE_NC: case OP_ASSERT: - rc = set_start_bits(tcode, start_bits, caseless, utf8, cd); - if (rc == SSB_FAIL) return SSB_FAIL; + rc = set_start_bits(tcode, start_bits, utf, cd); + if (rc == SSB_FAIL || rc == SSB_UNKNOWN) return rc; if (rc == SSB_DONE) try_next = FALSE; else { do tcode += GET(tcode, 1); while (*tcode == OP_ALT); @@ -660,6 +877,7 @@ case OP_KET: case OP_KETRMAX: case OP_KETRMIN: + case OP_KETRPOS: return SSB_CONTINUE; /* Skip over callout */ @@ -677,19 +895,13 @@ tcode += 1 + LINK_SIZE; break; - /* Skip over an option setting, changing the caseless flag */ - - case OP_OPT: - caseless = (tcode[1] & PCRE_CASELESS) != 0; - tcode += 2; - break; - /* BRAZERO does the bracket, but carries on. */ case OP_BRAZERO: case OP_BRAMINZERO: - if (set_start_bits(++tcode, start_bits, caseless, utf8, cd) == SSB_FAIL) - return SSB_FAIL; + case OP_BRAPOSZERO: + rc = set_start_bits(++tcode, start_bits, utf, cd); + if (rc == SSB_FAIL || rc == SSB_UNKNOWN) return rc; /* ========================================================================= See the comment at the head of this function concerning the next line, which was an old fudge for the benefit of OS/2. @@ -715,7 +927,16 @@ case OP_QUERY: case OP_MINQUERY: case OP_POSQUERY: - tcode = set_table_bit(start_bits, tcode + 1, caseless, cd, utf8); + tcode = set_table_bit(start_bits, tcode + 1, FALSE, cd, utf); + break; + + case OP_STARI: + case OP_MINSTARI: + case OP_POSSTARI: + case OP_QUERYI: + case OP_MINQUERYI: + case OP_POSQUERYI: + tcode = set_table_bit(start_bits, tcode + 1, TRUE, cd, utf); break; /* Single-char upto sets the bit and tries the next */ @@ -723,20 +944,36 @@ case OP_UPTO: case OP_MINUPTO: case OP_POSUPTO: - tcode = set_table_bit(start_bits, tcode + 3, caseless, cd, utf8); + tcode = set_table_bit(start_bits, tcode + 1 + IMM2_SIZE, FALSE, cd, utf); break; - /* At least one single char sets the bit and stops */ + case OP_UPTOI: + case OP_MINUPTOI: + case OP_POSUPTOI: + tcode = set_table_bit(start_bits, tcode + 1 + IMM2_SIZE, TRUE, cd, utf); + break; - case OP_EXACT: /* Fall through */ - tcode += 2; + /* At least one single char sets the bit and stops */ + case OP_EXACT: + tcode += IMM2_SIZE; + /* Fall through */ case OP_CHAR: - case OP_CHARNC: case OP_PLUS: case OP_MINPLUS: case OP_POSPLUS: - (void)set_table_bit(start_bits, tcode + 1, caseless, cd, utf8); + (void)set_table_bit(start_bits, tcode + 1, FALSE, cd, utf); + try_next = FALSE; + break; + + case OP_EXACTI: + tcode += IMM2_SIZE; + /* Fall through */ + case OP_CHARI: + case OP_PLUSI: + case OP_MINPLUSI: + case OP_POSPLUSI: + (void)set_table_bit(start_bits, tcode + 1, TRUE, cd, utf); try_next = FALSE; break; @@ -749,14 +986,28 @@ case OP_HSPACE: SET_BIT(0x09); SET_BIT(0x20); - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { +#ifdef COMPILE_PCRE8 SET_BIT(0xC2); /* For U+00A0 */ SET_BIT(0xE1); /* For U+1680, U+180E */ SET_BIT(0xE2); /* For U+2000 - U+200A, U+202F, U+205F */ SET_BIT(0xE3); /* For U+3000 */ +#endif +#ifdef COMPILE_PCRE16 + SET_BIT(0xA0); + SET_BIT(0xFF); /* For characters > 255 */ +#endif + } + else +#endif /* SUPPORT_UTF */ + { + SET_BIT(0xA0); +#ifdef COMPILE_PCRE16 + SET_BIT(0xFF); /* For characters > 255 */ +#endif } - else SET_BIT(0xA0); try_next = FALSE; break; @@ -766,12 +1017,26 @@ SET_BIT(0x0B); SET_BIT(0x0C); SET_BIT(0x0D); - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { +#ifdef COMPILE_PCRE8 SET_BIT(0xC2); /* For U+0085 */ SET_BIT(0xE2); /* For U+2028, U+2029 */ +#endif +#ifdef COMPILE_PCRE16 + SET_BIT(0x85); + SET_BIT(0xFF); /* For characters > 255 */ +#endif + } + else +#endif /* SUPPORT_UTF */ + { + SET_BIT(0x85); +#ifdef COMPILE_PCRE16 + SET_BIT(0xFF); /* For characters > 255 */ +#endif } - else SET_BIT(0x85); try_next = FALSE; break; @@ -829,7 +1094,7 @@ break; case OP_TYPEEXACT: - tcode += 3; + tcode += 1 + IMM2_SIZE; break; /* Zero or more repeats of character types set the bits and then @@ -838,7 +1103,7 @@ case OP_TYPEUPTO: case OP_TYPEMINUPTO: case OP_TYPEPOSUPTO: - tcode += 2; /* Fall through */ + tcode += IMM2_SIZE; /* Fall through */ case OP_TYPESTAR: case OP_TYPEMINSTAR: @@ -856,14 +1121,23 @@ case OP_HSPACE: SET_BIT(0x09); SET_BIT(0x20); - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { +#ifdef COMPILE_PCRE8 SET_BIT(0xC2); /* For U+00A0 */ SET_BIT(0xE1); /* For U+1680, U+180E */ SET_BIT(0xE2); /* For U+2000 - U+200A, U+202F, U+205F */ SET_BIT(0xE3); /* For U+3000 */ +#endif +#ifdef COMPILE_PCRE16 + SET_BIT(0xA0); + SET_BIT(0xFF); /* For characters > 255 */ +#endif } - else SET_BIT(0xA0); + else +#endif /* SUPPORT_UTF */ + SET_BIT(0xA0); break; case OP_ANYNL: @@ -872,12 +1146,21 @@ SET_BIT(0x0B); SET_BIT(0x0C); SET_BIT(0x0D); - if (utf8) +#ifdef SUPPORT_UTF + if (utf) { +#ifdef COMPILE_PCRE8 SET_BIT(0xC2); /* For U+0085 */ SET_BIT(0xE2); /* For U+2028, U+2029 */ +#endif +#ifdef COMPILE_PCRE16 + SET_BIT(0x85); + SET_BIT(0xFF); /* For characters > 255 */ +#endif } - else SET_BIT(0x85); + else +#endif /* SUPPORT_UTF */ + SET_BIT(0x85); break; case OP_NOT_DIGIT: @@ -924,18 +1207,23 @@ character with a value > 255. */ case OP_NCLASS: -#ifdef SUPPORT_UTF8 - if (utf8) +#if defined SUPPORT_UTF && defined COMPILE_PCRE8 + if (utf) { start_bits[24] |= 0xf0; /* Bits for 0xc4 - 0xc8 */ memset(start_bits+25, 0xff, 7); /* Bits for 0xc9 - 0xff */ } #endif +#ifdef COMPILE_PCRE16 + SET_BIT(0xFF); /* For characters > 255 */ +#endif /* Fall through */ case OP_CLASS: { + pcre_uint8 *map; tcode++; + map = (pcre_uint8 *)tcode; /* In UTF-8 mode, the bits in a bit map correspond to character values, not to byte values. However, the bit map we are constructing is @@ -943,13 +1231,13 @@ value is > 127. In fact, there are only two possible starting bytes for characters in the range 128 - 255. */ -#ifdef SUPPORT_UTF8 - if (utf8) +#if defined SUPPORT_UTF && defined COMPILE_PCRE8 + if (utf) { - for (c = 0; c < 16; c++) start_bits[c] |= tcode[c]; + for (c = 0; c < 16; c++) start_bits[c] |= map[c]; for (c = 128; c < 256; c++) { - if ((tcode[c/8] && (1 << (c&7))) != 0) + if ((map[c/8] && (1 << (c&7))) != 0) { int d = (c >> 6) | 0xc0; /* Set bit for this starter */ start_bits[d/8] |= (1 << (d&7)); /* and then skip on to the */ @@ -957,18 +1245,17 @@ } } } - - /* In non-UTF-8 mode, the two bit maps are completely compatible. */ - else #endif { - for (c = 0; c < 32; c++) start_bits[c] |= tcode[c]; + /* In non-UTF-8 mode, the two bit maps are completely compatible. */ + for (c = 0; c < 32; c++) start_bits[c] |= map[c]; } - /* Advance past the bit map, and act on what follows */ + /* Advance past the bit map, and act on what follows. For a zero + minimum repeat, continue; otherwise stop processing. */ - tcode += 32; + tcode += 32 / sizeof(pcre_uchar); switch (*tcode) { case OP_CRSTAR: @@ -980,7 +1267,7 @@ case OP_CRRANGE: case OP_CRMINRANGE: - if (((tcode[1] << 8) + tcode[2]) == 0) tcode += 5; + if (GET2(tcode, 1) == 0) tcode += 1 + 2 * IMM2_SIZE; else try_next = FALSE; break; @@ -1002,12 +1289,14 @@ + + /************************************************* * Study a compiled expression * *************************************************/ /* This function is handed a compiled expression that it must study to produce -information that will speed up the matching. It returns a pcre_extra block +information that will speed up the matching. It returns a pcre[16]_extra block which then gets handed back to pcre_exec(). Arguments: @@ -1016,23 +1305,28 @@ errorptr points to where to place error messages; set NULL unless error -Returns: pointer to a pcre_extra block, with study_data filled in and the - appropriate flags set; +Returns: pointer to a pcre[16]_extra block, with study_data filled in and + the appropriate flags set; NULL on error or if no optimization possible */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN pcre_extra * PCRE_CALL_CONVENTION pcre_study(const pcre *external_re, int options, const char **errorptr) +#else +PCRE_EXP_DEFN pcre16_extra * PCRE_CALL_CONVENTION +pcre16_study(const pcre16 *external_re, int options, const char **errorptr) +#endif { int min; BOOL bits_set = FALSE; -uschar start_bits[32]; -pcre_extra *extra; +pcre_uint8 start_bits[32]; +PUBL(extra) *extra = NULL; pcre_study_data *study; -const uschar *tables; -uschar *code; +const pcre_uint8 *tables; +pcre_uchar *code; compile_data compile_block; -const real_pcre *re = (const real_pcre *)external_re; +const REAL_PCRE *re = (const REAL_PCRE *)external_re; *errorptr = NULL; @@ -1042,13 +1336,23 @@ return NULL; } +if ((re->flags & PCRE_MODE) == 0) + { +#ifdef COMPILE_PCRE8 + *errorptr = "argument is compiled in 16 bit mode"; +#else + *errorptr = "argument is compiled in 8 bit mode"; +#endif + return NULL; + } + if ((options & ~PUBLIC_STUDY_OPTIONS) != 0) { *errorptr = "unknown or incorrect option bit(s) set"; return NULL; } -code = (uschar *)re + re->name_table_offset + +code = (pcre_uchar *)re + re->name_table_offset + (re->name_count * re->name_entry_size); /* For an anchored pattern, or an unanchored pattern that has a first char, or @@ -1058,12 +1362,21 @@ if ((re->options & PCRE_ANCHORED) == 0 && (re->flags & (PCRE_FIRSTSET|PCRE_STARTLINE)) == 0) { + int rc; + /* Set the character tables in the block that is passed around */ tables = re->tables; + +#ifdef COMPILE_PCRE8 if (tables == NULL) (void)pcre_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES, (void *)(&tables)); +#else + if (tables == NULL) + (void)pcre16_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES, + (void *)(&tables)); +#endif compile_block.lcc = tables + lcc_offset; compile_block.fcc = tables + fcc_offset; @@ -1072,56 +1385,148 @@ /* See if we can find a fixed set of initial characters for the pattern. */ - memset(start_bits, 0, 32 * sizeof(uschar)); - bits_set = set_start_bits(code, start_bits, - (re->options & PCRE_CASELESS) != 0, (re->options & PCRE_UTF8) != 0, - &compile_block) == SSB_DONE; + memset(start_bits, 0, 32 * sizeof(pcre_uint8)); + rc = set_start_bits(code, start_bits, (re->options & PCRE_UTF8) != 0, + &compile_block); + bits_set = rc == SSB_DONE; + if (rc == SSB_UNKNOWN) + { + *errorptr = "internal error: opcode not recognized"; + return NULL; + } } /* Find the minimum length of subject string. */ -min = find_minlength(code, code, re->options); +switch(min = find_minlength(code, code, re->options, 0)) + { + case -2: *errorptr = "internal error: missing capturing bracket"; return NULL; + case -3: *errorptr = "internal error: opcode not recognized"; return NULL; + default: break; + } -/* Return NULL if no optimization is possible. */ +/* If a set of starting bytes has been identified, or if the minimum length is +greater than zero, or if JIT optimization has been requested, get a +pcre[16]_extra block and a pcre_study_data block. The study data is put in the +latter, which is pointed to by the former, which may also get additional data +set later by the calling program. At the moment, the size of pcre_study_data +is fixed. We nevertheless save it in a field for returning via the +pcre_fullinfo() function so that if it becomes variable in the future, +we don't have to change that code. */ + +if (bits_set || min > 0 +#ifdef SUPPORT_JIT + || (options & (PCRE_STUDY_JIT_COMPILE | PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE + | PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE)) != 0 +#endif + ) + { + extra = (PUBL(extra) *)(PUBL(malloc)) + (sizeof(PUBL(extra)) + sizeof(pcre_study_data)); + if (extra == NULL) + { + *errorptr = "failed to get memory"; + return NULL; + } -if (!bits_set && min < 0) return NULL; + study = (pcre_study_data *)((char *)extra + sizeof(PUBL(extra))); + extra->flags = PCRE_EXTRA_STUDY_DATA; + extra->study_data = study; + + study->size = sizeof(pcre_study_data); + study->flags = 0; + + /* Set the start bits always, to avoid unset memory errors if the + study data is written to a file, but set the flag only if any of the bits + are set, to save time looking when none are. */ -/* Get a pcre_extra block and a pcre_study_data block. The study data is put in -the latter, which is pointed to by the former, which may also get additional -data set later by the calling program. At the moment, the size of -pcre_study_data is fixed. We nevertheless save it in a field for returning via -the pcre_fullinfo() function so that if it becomes variable in the future, we -don't have to change that code. */ + if (bits_set) + { + study->flags |= PCRE_STUDY_MAPPED; + memcpy(study->start_bits, start_bits, sizeof(start_bits)); + } + else memset(study->start_bits, 0, 32 * sizeof(pcre_uint8)); -extra = (pcre_extra *)(pcre_malloc) - (sizeof(pcre_extra) + sizeof(pcre_study_data)); +#ifdef PCRE_DEBUG + if (bits_set) + { + pcre_uint8 *ptr = start_bits; + int i; -if (extra == NULL) - { - *errorptr = "failed to get memory"; - return NULL; - } + printf("Start bits:\n"); + for (i = 0; i < 32; i++) + printf("%3d: %02x%s", i * 8, *ptr++, ((i + 1) & 0x7) != 0? " " : "\n"); + } +#endif -study = (pcre_study_data *)((char *)extra + sizeof(pcre_extra)); -extra->flags = PCRE_EXTRA_STUDY_DATA; -extra->study_data = study; + /* Always set the minlength value in the block, because the JIT compiler + makes use of it. However, don't set the bit unless the length is greater than + zero - the interpretive pcre_exec() and pcre_dfa_exec() needn't waste time + checking the zero case. */ -study->size = sizeof(pcre_study_data); -study->flags = 0; + if (min > 0) + { + study->flags |= PCRE_STUDY_MINLEN; + study->minlength = min; + } + else study->minlength = 0; -if (bits_set) - { - study->flags |= PCRE_STUDY_MAPPED; - memcpy(study->start_bits, start_bits, sizeof(start_bits)); - } + /* If JIT support was compiled and requested, attempt the JIT compilation. + If no starting bytes were found, and the minimum length is zero, and JIT + compilation fails, abandon the extra block and return NULL. */ + +#ifdef SUPPORT_JIT + extra->executable_jit = NULL; + if ((options & PCRE_STUDY_JIT_COMPILE) != 0) + PRIV(jit_compile)(re, extra, JIT_COMPILE); + if ((options & PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE) != 0) + PRIV(jit_compile)(re, extra, JIT_PARTIAL_SOFT_COMPILE); + if ((options & PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE) != 0) + PRIV(jit_compile)(re, extra, JIT_PARTIAL_HARD_COMPILE); -if (min >= 0) - { - study->flags |= PCRE_STUDY_MINLEN; - study->minlength = min; + if (study->flags == 0 && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) == 0) + { +#ifdef COMPILE_PCRE8 + pcre_free_study(extra); +#endif +#ifdef COMPILE_PCRE16 + pcre16_free_study(extra); +#endif + extra = NULL; + } +#endif } return extra; } + +/************************************************* +* Free the study data * +*************************************************/ + +/* This function frees the memory that was obtained by pcre_study(). + +Argument: a pointer to the pcre[16]_extra block +Returns: nothing +*/ + +#ifdef COMPILE_PCRE8 +PCRE_EXP_DEFN void +pcre_free_study(pcre_extra *extra) +#else +PCRE_EXP_DEFN void +pcre16_free_study(pcre16_extra *extra) +#endif +{ +if (extra == NULL) + return; +#ifdef SUPPORT_JIT +if ((extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 && + extra->executable_jit != NULL) + PRIV(jit_free)(extra->executable_jit); +#endif +PUBL(free)(extra); +} + /* End of pcre_study.c */ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_tables.c php5-5.4.9/ext/pcre/pcrelib/pcre_tables.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_tables.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_tables.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2009 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ ----------------------------------------------------------------------------- */ +#ifndef PCRE_INCLUDED /* This module contains some fixed tables that are used by more than one of the PCRE code modules. The tables are also #included by the pcretest program, which @@ -48,11 +49,12 @@ #include "pcre_internal.h" +#endif /* PCRE_INCLUDED */ /* Table of sizes for the fixed-length opcodes. It's defined in a macro so that the definition is next to the definition of the opcodes in pcre_internal.h. */ -const uschar _pcre_OP_lengths[] = { OP_LENGTHS }; +const pcre_uint8 PRIV(OP_lengths)[] = { OP_LENGTHS }; @@ -63,31 +65,38 @@ /* These are the breakpoints for different numbers of bytes in a UTF-8 character. */ -#ifdef SUPPORT_UTF8 +#if (defined SUPPORT_UTF && defined COMPILE_PCRE8) \ + || (defined PCRE_INCLUDED && defined SUPPORT_PCRE16) -const int _pcre_utf8_table1[] = +/* These tables are also required by pcretest in 16 bit mode. */ + +const int PRIV(utf8_table1)[] = { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff}; -const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int); +const int PRIV(utf8_table1_size) = sizeof(PRIV(utf8_table1)) / sizeof(int); /* These are the indicator bits and the mask for the data bits to set in the first byte of a character, indexed by the number of additional bytes. */ -const int _pcre_utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; -const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01}; +const int PRIV(utf8_table2)[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; +const int PRIV(utf8_table3)[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01}; /* Table of the number of extra bytes, indexed by the first byte masked with 0x3f. The highest number for a valid UTF-8 first byte is in fact 0x3d. */ -const uschar _pcre_utf8_table4[] = { +const pcre_uint8 PRIV(utf8_table4)[] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 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 }; +#endif /* (SUPPORT_UTF && COMPILE_PCRE8) || (PCRE_INCLUDED && SUPPORT_PCRE16)*/ + +#ifdef SUPPORT_UTF + /* Table to translate from particular type value to the general value. */ -const int _pcre_ucp_gentype[] = { +const int PRIV(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 */ @@ -98,6 +107,21 @@ ucp_Z, ucp_Z, ucp_Z /* Zl, Zp, Zs */ }; +#ifdef SUPPORT_JIT +/* This table reverses PRIV(ucp_gentype). We can save the cost +of a memory load. */ + +const int PRIV(ucp_typerange)[] = { + ucp_Cc, ucp_Cs, + ucp_Ll, ucp_Lu, + ucp_Mc, ucp_Mn, + ucp_Nd, ucp_No, + ucp_Pc, ucp_Ps, + ucp_Sc, ucp_So, + ucp_Zl, ucp_Zs, +}; +#endif /* SUPPORT_JIT */ + /* 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 @@ -108,7 +132,7 @@ data are unlikely. July 2008: There is now a script called maint/GenerateUtt.py that can be used -to generate this data instead of maintaining it entirely by hand. +to generate this data automatically instead of maintaining it by hand. The script was updated in March 2009 to generate a new EBCDIC-compliant version. Like all other character and string literals that are compared against @@ -121,8 +145,10 @@ #define STRING_Avestan0 STR_A STR_v STR_e STR_s STR_t STR_a STR_n "\0" #define STRING_Balinese0 STR_B STR_a STR_l STR_i STR_n STR_e STR_s STR_e "\0" #define STRING_Bamum0 STR_B STR_a STR_m STR_u STR_m "\0" +#define STRING_Batak0 STR_B STR_a STR_t STR_a STR_k "\0" #define STRING_Bengali0 STR_B STR_e STR_n STR_g STR_a STR_l STR_i "\0" #define STRING_Bopomofo0 STR_B STR_o STR_p STR_o STR_m STR_o STR_f STR_o "\0" +#define STRING_Brahmi0 STR_B STR_r STR_a STR_h STR_m STR_i "\0" #define STRING_Braille0 STR_B STR_r STR_a STR_i STR_l STR_l STR_e "\0" #define STRING_Buginese0 STR_B STR_u STR_g STR_i STR_n STR_e STR_s STR_e "\0" #define STRING_Buhid0 STR_B STR_u STR_h STR_i STR_d "\0" @@ -131,6 +157,7 @@ #define STRING_Carian0 STR_C STR_a STR_r STR_i STR_a STR_n "\0" #define STRING_Cc0 STR_C STR_c "\0" #define STRING_Cf0 STR_C STR_f "\0" +#define STRING_Chakma0 STR_C STR_h STR_a STR_k STR_m STR_a "\0" #define STRING_Cham0 STR_C STR_h STR_a STR_m "\0" #define STRING_Cherokee0 STR_C STR_h STR_e STR_r STR_o STR_k STR_e STR_e "\0" #define STRING_Cn0 STR_C STR_n "\0" @@ -184,9 +211,13 @@ #define STRING_Lydian0 STR_L STR_y STR_d STR_i STR_a STR_n "\0" #define STRING_M0 STR_M "\0" #define STRING_Malayalam0 STR_M STR_a STR_l STR_a STR_y STR_a STR_l STR_a STR_m "\0" +#define STRING_Mandaic0 STR_M STR_a STR_n STR_d STR_a STR_i STR_c "\0" #define STRING_Mc0 STR_M STR_c "\0" #define STRING_Me0 STR_M STR_e "\0" #define STRING_Meetei_Mayek0 STR_M STR_e STR_e STR_t STR_e STR_i STR_UNDERSCORE STR_M STR_a STR_y STR_e STR_k "\0" +#define STRING_Meroitic_Cursive0 STR_M STR_e STR_r STR_o STR_i STR_t STR_i STR_c STR_UNDERSCORE STR_C STR_u STR_r STR_s STR_i STR_v STR_e "\0" +#define STRING_Meroitic_Hieroglyphs0 STR_M STR_e STR_r STR_o STR_i STR_t STR_i STR_c STR_UNDERSCORE STR_H STR_i STR_e STR_r STR_o STR_g STR_l STR_y STR_p STR_h STR_s "\0" +#define STRING_Miao0 STR_M STR_i STR_a STR_o "\0" #define STRING_Mn0 STR_M STR_n "\0" #define STRING_Mongolian0 STR_M STR_o STR_n STR_g STR_o STR_l STR_i STR_a STR_n "\0" #define STRING_Myanmar0 STR_M STR_y STR_a STR_n STR_m STR_a STR_r "\0" @@ -220,11 +251,13 @@ #define STRING_Samaritan0 STR_S STR_a STR_m STR_a STR_r STR_i STR_t STR_a STR_n "\0" #define STRING_Saurashtra0 STR_S STR_a STR_u STR_r STR_a STR_s STR_h STR_t STR_r STR_a "\0" #define STRING_Sc0 STR_S STR_c "\0" +#define STRING_Sharada0 STR_S STR_h STR_a STR_r STR_a STR_d STR_a "\0" #define STRING_Shavian0 STR_S STR_h STR_a STR_v STR_i STR_a STR_n "\0" #define STRING_Sinhala0 STR_S STR_i STR_n STR_h STR_a STR_l STR_a "\0" #define STRING_Sk0 STR_S STR_k "\0" #define STRING_Sm0 STR_S STR_m "\0" #define STRING_So0 STR_S STR_o "\0" +#define STRING_Sora_Sompeng0 STR_S STR_o STR_r STR_a STR_UNDERSCORE STR_S STR_o STR_m STR_p STR_e STR_n STR_g "\0" #define STRING_Sundanese0 STR_S STR_u STR_n STR_d STR_a STR_n STR_e STR_s STR_e "\0" #define STRING_Syloti_Nagri0 STR_S STR_y STR_l STR_o STR_t STR_i STR_UNDERSCORE STR_N STR_a STR_g STR_r STR_i "\0" #define STRING_Syriac0 STR_S STR_y STR_r STR_i STR_a STR_c "\0" @@ -233,6 +266,7 @@ #define STRING_Tai_Le0 STR_T STR_a STR_i STR_UNDERSCORE STR_L STR_e "\0" #define STRING_Tai_Tham0 STR_T STR_a STR_i STR_UNDERSCORE STR_T STR_h STR_a STR_m "\0" #define STRING_Tai_Viet0 STR_T STR_a STR_i STR_UNDERSCORE STR_V STR_i STR_e STR_t "\0" +#define STRING_Takri0 STR_T STR_a STR_k STR_r STR_i "\0" #define STRING_Tamil0 STR_T STR_a STR_m STR_i STR_l "\0" #define STRING_Telugu0 STR_T STR_e STR_l STR_u STR_g STR_u "\0" #define STRING_Thaana0 STR_T STR_h STR_a STR_a STR_n STR_a "\0" @@ -251,15 +285,17 @@ #define STRING_Zp0 STR_Z STR_p "\0" #define STRING_Zs0 STR_Z STR_s "\0" -const char _pcre_utt_names[] = +const char PRIV(utt_names)[] = STRING_Any0 STRING_Arabic0 STRING_Armenian0 STRING_Avestan0 STRING_Balinese0 STRING_Bamum0 + STRING_Batak0 STRING_Bengali0 STRING_Bopomofo0 + STRING_Brahmi0 STRING_Braille0 STRING_Buginese0 STRING_Buhid0 @@ -268,6 +304,7 @@ STRING_Carian0 STRING_Cc0 STRING_Cf0 + STRING_Chakma0 STRING_Cham0 STRING_Cherokee0 STRING_Cn0 @@ -321,9 +358,13 @@ STRING_Lydian0 STRING_M0 STRING_Malayalam0 + STRING_Mandaic0 STRING_Mc0 STRING_Me0 STRING_Meetei_Mayek0 + STRING_Meroitic_Cursive0 + STRING_Meroitic_Hieroglyphs0 + STRING_Miao0 STRING_Mn0 STRING_Mongolian0 STRING_Myanmar0 @@ -357,11 +398,13 @@ STRING_Samaritan0 STRING_Saurashtra0 STRING_Sc0 + STRING_Sharada0 STRING_Shavian0 STRING_Sinhala0 STRING_Sk0 STRING_Sm0 STRING_So0 + STRING_Sora_Sompeng0 STRING_Sundanese0 STRING_Syloti_Nagri0 STRING_Syriac0 @@ -370,6 +413,7 @@ STRING_Tai_Le0 STRING_Tai_Tham0 STRING_Tai_Viet0 + STRING_Takri0 STRING_Tamil0 STRING_Telugu0 STRING_Thaana0 @@ -388,146 +432,156 @@ STRING_Zp0 STRING_Zs0; -const ucp_type_table _pcre_utt[] = { +const ucp_type_table PRIV(utt)[] = { { 0, PT_ANY, 0 }, { 4, PT_SC, ucp_Arabic }, { 11, PT_SC, ucp_Armenian }, { 20, PT_SC, ucp_Avestan }, { 28, PT_SC, ucp_Balinese }, { 37, PT_SC, ucp_Bamum }, - { 43, PT_SC, ucp_Bengali }, - { 51, PT_SC, ucp_Bopomofo }, - { 60, PT_SC, ucp_Braille }, - { 68, PT_SC, ucp_Buginese }, - { 77, PT_SC, ucp_Buhid }, - { 83, PT_GC, ucp_C }, - { 85, PT_SC, ucp_Canadian_Aboriginal }, - { 105, PT_SC, ucp_Carian }, - { 112, PT_PC, ucp_Cc }, - { 115, PT_PC, ucp_Cf }, - { 118, PT_SC, ucp_Cham }, - { 123, PT_SC, ucp_Cherokee }, - { 132, PT_PC, ucp_Cn }, - { 135, PT_PC, ucp_Co }, - { 138, PT_SC, ucp_Common }, - { 145, PT_SC, ucp_Coptic }, - { 152, PT_PC, ucp_Cs }, - { 155, PT_SC, ucp_Cuneiform }, - { 165, PT_SC, ucp_Cypriot }, - { 173, PT_SC, ucp_Cyrillic }, - { 182, PT_SC, ucp_Deseret }, - { 190, PT_SC, ucp_Devanagari }, - { 201, PT_SC, ucp_Egyptian_Hieroglyphs }, - { 222, PT_SC, ucp_Ethiopic }, - { 231, PT_SC, ucp_Georgian }, - { 240, PT_SC, ucp_Glagolitic }, - { 251, PT_SC, ucp_Gothic }, - { 258, PT_SC, ucp_Greek }, - { 264, PT_SC, ucp_Gujarati }, - { 273, PT_SC, ucp_Gurmukhi }, - { 282, PT_SC, ucp_Han }, - { 286, PT_SC, ucp_Hangul }, - { 293, PT_SC, ucp_Hanunoo }, - { 301, PT_SC, ucp_Hebrew }, - { 308, PT_SC, ucp_Hiragana }, - { 317, PT_SC, ucp_Imperial_Aramaic }, - { 334, PT_SC, ucp_Inherited }, - { 344, PT_SC, ucp_Inscriptional_Pahlavi }, - { 366, PT_SC, ucp_Inscriptional_Parthian }, - { 389, PT_SC, ucp_Javanese }, - { 398, PT_SC, ucp_Kaithi }, - { 405, PT_SC, ucp_Kannada }, - { 413, PT_SC, ucp_Katakana }, - { 422, PT_SC, ucp_Kayah_Li }, - { 431, PT_SC, ucp_Kharoshthi }, - { 442, PT_SC, ucp_Khmer }, - { 448, PT_GC, ucp_L }, - { 450, PT_LAMP, 0 }, - { 453, PT_SC, ucp_Lao }, - { 457, PT_SC, ucp_Latin }, - { 463, PT_SC, ucp_Lepcha }, - { 470, PT_SC, ucp_Limbu }, - { 476, PT_SC, ucp_Linear_B }, - { 485, PT_SC, ucp_Lisu }, - { 490, PT_PC, ucp_Ll }, - { 493, PT_PC, ucp_Lm }, - { 496, PT_PC, ucp_Lo }, - { 499, PT_PC, ucp_Lt }, - { 502, PT_PC, ucp_Lu }, - { 505, PT_SC, ucp_Lycian }, - { 512, PT_SC, ucp_Lydian }, - { 519, PT_GC, ucp_M }, - { 521, PT_SC, ucp_Malayalam }, - { 531, PT_PC, ucp_Mc }, - { 534, PT_PC, ucp_Me }, - { 537, PT_SC, ucp_Meetei_Mayek }, - { 550, PT_PC, ucp_Mn }, - { 553, PT_SC, ucp_Mongolian }, - { 563, PT_SC, ucp_Myanmar }, - { 571, PT_GC, ucp_N }, - { 573, PT_PC, ucp_Nd }, - { 576, PT_SC, ucp_New_Tai_Lue }, - { 588, PT_SC, ucp_Nko }, - { 592, PT_PC, ucp_Nl }, - { 595, PT_PC, ucp_No }, - { 598, PT_SC, ucp_Ogham }, - { 604, PT_SC, ucp_Ol_Chiki }, - { 613, PT_SC, ucp_Old_Italic }, - { 624, PT_SC, ucp_Old_Persian }, - { 636, PT_SC, ucp_Old_South_Arabian }, - { 654, PT_SC, ucp_Old_Turkic }, - { 665, PT_SC, ucp_Oriya }, - { 671, PT_SC, ucp_Osmanya }, - { 679, PT_GC, ucp_P }, - { 681, PT_PC, ucp_Pc }, - { 684, PT_PC, ucp_Pd }, - { 687, PT_PC, ucp_Pe }, - { 690, PT_PC, ucp_Pf }, - { 693, PT_SC, ucp_Phags_Pa }, - { 702, PT_SC, ucp_Phoenician }, - { 713, PT_PC, ucp_Pi }, - { 716, PT_PC, ucp_Po }, - { 719, PT_PC, ucp_Ps }, - { 722, PT_SC, ucp_Rejang }, - { 729, PT_SC, ucp_Runic }, - { 735, PT_GC, ucp_S }, - { 737, PT_SC, ucp_Samaritan }, - { 747, PT_SC, ucp_Saurashtra }, - { 758, PT_PC, ucp_Sc }, - { 761, PT_SC, ucp_Shavian }, - { 769, PT_SC, ucp_Sinhala }, - { 777, PT_PC, ucp_Sk }, - { 780, PT_PC, ucp_Sm }, - { 783, PT_PC, ucp_So }, - { 786, PT_SC, ucp_Sundanese }, - { 796, PT_SC, ucp_Syloti_Nagri }, - { 809, PT_SC, ucp_Syriac }, - { 816, PT_SC, ucp_Tagalog }, - { 824, PT_SC, ucp_Tagbanwa }, - { 833, PT_SC, ucp_Tai_Le }, - { 840, PT_SC, ucp_Tai_Tham }, - { 849, PT_SC, ucp_Tai_Viet }, - { 858, PT_SC, ucp_Tamil }, - { 864, PT_SC, ucp_Telugu }, - { 871, PT_SC, ucp_Thaana }, - { 878, PT_SC, ucp_Thai }, - { 883, PT_SC, ucp_Tibetan }, - { 891, PT_SC, ucp_Tifinagh }, - { 900, PT_SC, ucp_Ugaritic }, - { 909, PT_SC, ucp_Vai }, - { 913, PT_ALNUM, 0 }, - { 917, PT_PXSPACE, 0 }, - { 921, PT_SPACE, 0 }, - { 925, PT_WORD, 0 }, - { 929, PT_SC, ucp_Yi }, - { 932, PT_GC, ucp_Z }, - { 934, PT_PC, ucp_Zl }, - { 937, PT_PC, ucp_Zp }, - { 940, PT_PC, ucp_Zs } + { 43, PT_SC, ucp_Batak }, + { 49, PT_SC, ucp_Bengali }, + { 57, PT_SC, ucp_Bopomofo }, + { 66, PT_SC, ucp_Brahmi }, + { 73, PT_SC, ucp_Braille }, + { 81, PT_SC, ucp_Buginese }, + { 90, PT_SC, ucp_Buhid }, + { 96, PT_GC, ucp_C }, + { 98, PT_SC, ucp_Canadian_Aboriginal }, + { 118, PT_SC, ucp_Carian }, + { 125, PT_PC, ucp_Cc }, + { 128, PT_PC, ucp_Cf }, + { 131, PT_SC, ucp_Chakma }, + { 138, PT_SC, ucp_Cham }, + { 143, PT_SC, ucp_Cherokee }, + { 152, PT_PC, ucp_Cn }, + { 155, PT_PC, ucp_Co }, + { 158, PT_SC, ucp_Common }, + { 165, PT_SC, ucp_Coptic }, + { 172, PT_PC, ucp_Cs }, + { 175, PT_SC, ucp_Cuneiform }, + { 185, PT_SC, ucp_Cypriot }, + { 193, PT_SC, ucp_Cyrillic }, + { 202, PT_SC, ucp_Deseret }, + { 210, PT_SC, ucp_Devanagari }, + { 221, PT_SC, ucp_Egyptian_Hieroglyphs }, + { 242, PT_SC, ucp_Ethiopic }, + { 251, PT_SC, ucp_Georgian }, + { 260, PT_SC, ucp_Glagolitic }, + { 271, PT_SC, ucp_Gothic }, + { 278, PT_SC, ucp_Greek }, + { 284, PT_SC, ucp_Gujarati }, + { 293, PT_SC, ucp_Gurmukhi }, + { 302, PT_SC, ucp_Han }, + { 306, PT_SC, ucp_Hangul }, + { 313, PT_SC, ucp_Hanunoo }, + { 321, PT_SC, ucp_Hebrew }, + { 328, PT_SC, ucp_Hiragana }, + { 337, PT_SC, ucp_Imperial_Aramaic }, + { 354, PT_SC, ucp_Inherited }, + { 364, PT_SC, ucp_Inscriptional_Pahlavi }, + { 386, PT_SC, ucp_Inscriptional_Parthian }, + { 409, PT_SC, ucp_Javanese }, + { 418, PT_SC, ucp_Kaithi }, + { 425, PT_SC, ucp_Kannada }, + { 433, PT_SC, ucp_Katakana }, + { 442, PT_SC, ucp_Kayah_Li }, + { 451, PT_SC, ucp_Kharoshthi }, + { 462, PT_SC, ucp_Khmer }, + { 468, PT_GC, ucp_L }, + { 470, PT_LAMP, 0 }, + { 473, PT_SC, ucp_Lao }, + { 477, PT_SC, ucp_Latin }, + { 483, PT_SC, ucp_Lepcha }, + { 490, PT_SC, ucp_Limbu }, + { 496, PT_SC, ucp_Linear_B }, + { 505, PT_SC, ucp_Lisu }, + { 510, PT_PC, ucp_Ll }, + { 513, PT_PC, ucp_Lm }, + { 516, PT_PC, ucp_Lo }, + { 519, PT_PC, ucp_Lt }, + { 522, PT_PC, ucp_Lu }, + { 525, PT_SC, ucp_Lycian }, + { 532, PT_SC, ucp_Lydian }, + { 539, PT_GC, ucp_M }, + { 541, PT_SC, ucp_Malayalam }, + { 551, PT_SC, ucp_Mandaic }, + { 559, PT_PC, ucp_Mc }, + { 562, PT_PC, ucp_Me }, + { 565, PT_SC, ucp_Meetei_Mayek }, + { 578, PT_SC, ucp_Meroitic_Cursive }, + { 595, PT_SC, ucp_Meroitic_Hieroglyphs }, + { 616, PT_SC, ucp_Miao }, + { 621, PT_PC, ucp_Mn }, + { 624, PT_SC, ucp_Mongolian }, + { 634, PT_SC, ucp_Myanmar }, + { 642, PT_GC, ucp_N }, + { 644, PT_PC, ucp_Nd }, + { 647, PT_SC, ucp_New_Tai_Lue }, + { 659, PT_SC, ucp_Nko }, + { 663, PT_PC, ucp_Nl }, + { 666, PT_PC, ucp_No }, + { 669, PT_SC, ucp_Ogham }, + { 675, PT_SC, ucp_Ol_Chiki }, + { 684, PT_SC, ucp_Old_Italic }, + { 695, PT_SC, ucp_Old_Persian }, + { 707, PT_SC, ucp_Old_South_Arabian }, + { 725, PT_SC, ucp_Old_Turkic }, + { 736, PT_SC, ucp_Oriya }, + { 742, PT_SC, ucp_Osmanya }, + { 750, PT_GC, ucp_P }, + { 752, PT_PC, ucp_Pc }, + { 755, PT_PC, ucp_Pd }, + { 758, PT_PC, ucp_Pe }, + { 761, PT_PC, ucp_Pf }, + { 764, PT_SC, ucp_Phags_Pa }, + { 773, PT_SC, ucp_Phoenician }, + { 784, PT_PC, ucp_Pi }, + { 787, PT_PC, ucp_Po }, + { 790, PT_PC, ucp_Ps }, + { 793, PT_SC, ucp_Rejang }, + { 800, PT_SC, ucp_Runic }, + { 806, PT_GC, ucp_S }, + { 808, PT_SC, ucp_Samaritan }, + { 818, PT_SC, ucp_Saurashtra }, + { 829, PT_PC, ucp_Sc }, + { 832, PT_SC, ucp_Sharada }, + { 840, PT_SC, ucp_Shavian }, + { 848, PT_SC, ucp_Sinhala }, + { 856, PT_PC, ucp_Sk }, + { 859, PT_PC, ucp_Sm }, + { 862, PT_PC, ucp_So }, + { 865, PT_SC, ucp_Sora_Sompeng }, + { 878, PT_SC, ucp_Sundanese }, + { 888, PT_SC, ucp_Syloti_Nagri }, + { 901, PT_SC, ucp_Syriac }, + { 908, PT_SC, ucp_Tagalog }, + { 916, PT_SC, ucp_Tagbanwa }, + { 925, PT_SC, ucp_Tai_Le }, + { 932, PT_SC, ucp_Tai_Tham }, + { 941, PT_SC, ucp_Tai_Viet }, + { 950, PT_SC, ucp_Takri }, + { 956, PT_SC, ucp_Tamil }, + { 962, PT_SC, ucp_Telugu }, + { 969, PT_SC, ucp_Thaana }, + { 976, PT_SC, ucp_Thai }, + { 981, PT_SC, ucp_Tibetan }, + { 989, PT_SC, ucp_Tifinagh }, + { 998, PT_SC, ucp_Ugaritic }, + { 1007, PT_SC, ucp_Vai }, + { 1011, PT_ALNUM, 0 }, + { 1015, PT_PXSPACE, 0 }, + { 1019, PT_SPACE, 0 }, + { 1023, PT_WORD, 0 }, + { 1027, PT_SC, ucp_Yi }, + { 1030, PT_GC, ucp_Z }, + { 1032, PT_PC, ucp_Zl }, + { 1035, PT_PC, ucp_Zp }, + { 1038, PT_PC, ucp_Zs } }; -const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table); +const int PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table); -#endif /* SUPPORT_UTF8 */ +#endif /* SUPPORT_UTF */ /* End of pcre_tables.c */ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_try_flipped.c php5-5.4.9/ext/pcre/pcrelib/pcre_try_flipped.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_try_flipped.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_try_flipped.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ -/************************************************* -* Perl-Compatible Regular Expressions * -*************************************************/ - -/* PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - - Written by Philip Hazel - Copyright (c) 1997-2009 University of Cambridge - ------------------------------------------------------------------------------ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the University of Cambridge nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------ -*/ - - -/* This module contains an internal function that tests a compiled pattern to -see if it was compiled with the opposite endianness. If so, it uses an -auxiliary local function to flip the appropriate bytes. */ - - -#include "config.h" - -#include "pcre_internal.h" - - -/************************************************* -* Flip bytes in an integer * -*************************************************/ - -/* This function is called when the magic number in a regex doesn't match, in -order to flip its bytes to see if we are dealing with a pattern that was -compiled on a host of different endianness. If so, this function is used to -flip other byte values. - -Arguments: - value the number to flip - n the number of bytes to flip (assumed to be 2 or 4) - -Returns: the flipped value -*/ - -static unsigned long int -byteflip(unsigned long int value, int n) -{ -if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8); -return ((value & 0x000000ff) << 24) | - ((value & 0x0000ff00) << 8) | - ((value & 0x00ff0000) >> 8) | - ((value & 0xff000000) >> 24); -} - - - -/************************************************* -* Test for a byte-flipped compiled regex * -*************************************************/ - -/* This function is called from pcre_exec(), pcre_dfa_exec(), and also from -pcre_fullinfo(). Its job is to test whether the regex is byte-flipped - that -is, it was compiled on a system of opposite endianness. The function is called -only when the native MAGIC_NUMBER test fails. If the regex is indeed flipped, -we flip all the relevant values into a different data block, and return it. - -Arguments: - re points to the regex - study points to study data, or NULL - internal_re points to a new regex block - internal_study points to a new study block - -Returns: the new block if is is indeed a byte-flipped regex - NULL if it is not -*/ - -real_pcre * -_pcre_try_flipped(const real_pcre *re, real_pcre *internal_re, - const pcre_study_data *study, pcre_study_data *internal_study) -{ -if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER) - return NULL; - -*internal_re = *re; /* To copy other fields */ -internal_re->size = byteflip(re->size, sizeof(re->size)); -internal_re->options = byteflip(re->options, sizeof(re->options)); -internal_re->flags = (pcre_uint16)byteflip(re->flags, sizeof(re->flags)); -internal_re->top_bracket = - (pcre_uint16)byteflip(re->top_bracket, sizeof(re->top_bracket)); -internal_re->top_backref = - (pcre_uint16)byteflip(re->top_backref, sizeof(re->top_backref)); -internal_re->first_byte = - (pcre_uint16)byteflip(re->first_byte, sizeof(re->first_byte)); -internal_re->req_byte = - (pcre_uint16)byteflip(re->req_byte, sizeof(re->req_byte)); -internal_re->name_table_offset = - (pcre_uint16)byteflip(re->name_table_offset, sizeof(re->name_table_offset)); -internal_re->name_entry_size = - (pcre_uint16)byteflip(re->name_entry_size, sizeof(re->name_entry_size)); -internal_re->name_count = - (pcre_uint16)byteflip(re->name_count, sizeof(re->name_count)); - -if (study != NULL) - { - *internal_study = *study; /* To copy other fields */ - internal_study->size = byteflip(study->size, sizeof(study->size)); - internal_study->flags = byteflip(study->flags, sizeof(study->flags)); - internal_study->minlength = byteflip(study->minlength, - sizeof(study->minlength)); - } - -return internal_re; -} - -/* End of pcre_tryflipped.c */ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_ucd.c php5-5.4.9/ext/pcre/pcrelib/pcre_ucd.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_ucd.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_ucd.c 2012-11-21 05:12:20.000000000 +0000 @@ -4,7 +4,7 @@ /* Unicode character database. */ /* This file was autogenerated by the MultiStage2.py script. */ -/* Total size: 56880 bytes, block size: 128. */ +/* Total size: 62904 bytes, block size: 128. */ /* The tables herein are needed only when UCP support is built */ /* into PCRE. This module should not be referenced otherwise, so */ @@ -16,21 +16,21 @@ /* Instead, just supply small dummy tables. */ #ifndef SUPPORT_UCP -const ucd_record _pcre_ucd_records[] = {{0,0,0 }}; -const uschar _pcre_ucd_stage1[] = {0}; -const pcre_uint16 _pcre_ucd_stage2[] = {0}; +const ucd_record PRIV(ucd_records)[] = {{0,0,0 }}; +const pcre_uint8 PRIV(ucd_stage1)[] = {0}; +const pcre_uint16 PRIV(ucd_stage2)[] = {0}; #else /* When recompiling tables with a new Unicode version, please check types in the structure definition from pcre_internal.h: typedef struct { -uschar property_0; -uschar property_1; +pcre_uint8 property_0; +pcre_uint8 property_1; pcre_int32 property_2; } ucd_record; */ -const ucd_record _pcre_ucd_records[] = { /* 4144 bytes, record size 8 */ +const ucd_record PRIV(ucd_records)[] = { /* 4536 bytes, record size 8 */ { 9, 0, 0, }, /* 0 */ { 9, 29, 0, }, /* 1 */ { 9, 21, 0, }, /* 2 */ @@ -45,38 +45,38 @@ { 9, 16, 0, }, /* 11 */ { 33, 5, -32, }, /* 12 */ { 9, 26, 0, }, /* 13 */ - { 33, 5, 0, }, /* 14 */ + { 33, 7, 0, }, /* 14 */ { 9, 20, 0, }, /* 15 */ { 9, 1, 0, }, /* 16 */ { 9, 15, 0, }, /* 17 */ { 9, 5, 743, }, /* 18 */ { 9, 19, 0, }, /* 19 */ - { 33, 5, 121, }, /* 20 */ - { 33, 9, 1, }, /* 21 */ - { 33, 5, -1, }, /* 22 */ - { 33, 9, -199, }, /* 23 */ - { 33, 5, -232, }, /* 24 */ - { 33, 9, -121, }, /* 25 */ - { 33, 5, -300, }, /* 26 */ - { 33, 5, 195, }, /* 27 */ - { 33, 9, 210, }, /* 28 */ - { 33, 9, 206, }, /* 29 */ - { 33, 9, 205, }, /* 30 */ - { 33, 9, 79, }, /* 31 */ - { 33, 9, 202, }, /* 32 */ - { 33, 9, 203, }, /* 33 */ - { 33, 9, 207, }, /* 34 */ - { 33, 5, 97, }, /* 35 */ - { 33, 9, 211, }, /* 36 */ - { 33, 9, 209, }, /* 37 */ - { 33, 5, 163, }, /* 38 */ - { 33, 9, 213, }, /* 39 */ - { 33, 5, 130, }, /* 40 */ - { 33, 9, 214, }, /* 41 */ - { 33, 9, 218, }, /* 42 */ - { 33, 9, 217, }, /* 43 */ - { 33, 9, 219, }, /* 44 */ - { 33, 7, 0, }, /* 45 */ + { 33, 5, 0, }, /* 20 */ + { 33, 5, 121, }, /* 21 */ + { 33, 9, 1, }, /* 22 */ + { 33, 5, -1, }, /* 23 */ + { 33, 9, -199, }, /* 24 */ + { 33, 5, -232, }, /* 25 */ + { 33, 9, -121, }, /* 26 */ + { 33, 5, -300, }, /* 27 */ + { 33, 5, 195, }, /* 28 */ + { 33, 9, 210, }, /* 29 */ + { 33, 9, 206, }, /* 30 */ + { 33, 9, 205, }, /* 31 */ + { 33, 9, 79, }, /* 32 */ + { 33, 9, 202, }, /* 33 */ + { 33, 9, 203, }, /* 34 */ + { 33, 9, 207, }, /* 35 */ + { 33, 5, 97, }, /* 36 */ + { 33, 9, 211, }, /* 37 */ + { 33, 9, 209, }, /* 38 */ + { 33, 5, 163, }, /* 39 */ + { 33, 9, 213, }, /* 40 */ + { 33, 5, 130, }, /* 41 */ + { 33, 9, 214, }, /* 42 */ + { 33, 9, 218, }, /* 43 */ + { 33, 9, 217, }, /* 44 */ + { 33, 9, 219, }, /* 45 */ { 33, 5, 56, }, /* 46 */ { 33, 9, 2, }, /* 47 */ { 33, 8, -1, }, /* 48 */ @@ -101,463 +101,512 @@ { 33, 5, -202, }, /* 67 */ { 33, 5, -203, }, /* 68 */ { 33, 5, -207, }, /* 69 */ - { 33, 5, -209, }, /* 70 */ - { 33, 5, -211, }, /* 71 */ - { 33, 5, 10743, }, /* 72 */ - { 33, 5, 10749, }, /* 73 */ - { 33, 5, -213, }, /* 74 */ - { 33, 5, -214, }, /* 75 */ - { 33, 5, 10727, }, /* 76 */ - { 33, 5, -218, }, /* 77 */ - { 33, 5, -69, }, /* 78 */ - { 33, 5, -217, }, /* 79 */ - { 33, 5, -71, }, /* 80 */ - { 33, 5, -219, }, /* 81 */ - { 33, 6, 0, }, /* 82 */ - { 9, 6, 0, }, /* 83 */ - { 27, 12, 0, }, /* 84 */ - { 27, 12, 84, }, /* 85 */ - { 19, 9, 1, }, /* 86 */ - { 19, 5, -1, }, /* 87 */ - { 19, 24, 0, }, /* 88 */ - { 9, 2, 0, }, /* 89 */ - { 19, 6, 0, }, /* 90 */ - { 19, 5, 130, }, /* 91 */ - { 19, 9, 38, }, /* 92 */ - { 19, 9, 37, }, /* 93 */ - { 19, 9, 64, }, /* 94 */ - { 19, 9, 63, }, /* 95 */ - { 19, 5, 0, }, /* 96 */ - { 19, 9, 32, }, /* 97 */ - { 19, 5, -38, }, /* 98 */ - { 19, 5, -37, }, /* 99 */ - { 19, 5, -32, }, /* 100 */ - { 19, 5, -31, }, /* 101 */ - { 19, 5, -64, }, /* 102 */ - { 19, 5, -63, }, /* 103 */ - { 19, 9, 8, }, /* 104 */ - { 19, 5, -62, }, /* 105 */ - { 19, 5, -57, }, /* 106 */ - { 19, 9, 0, }, /* 107 */ - { 19, 5, -47, }, /* 108 */ - { 19, 5, -54, }, /* 109 */ - { 19, 5, -8, }, /* 110 */ - { 10, 9, 1, }, /* 111 */ - { 10, 5, -1, }, /* 112 */ - { 19, 5, -86, }, /* 113 */ - { 19, 5, -80, }, /* 114 */ - { 19, 5, 7, }, /* 115 */ - { 19, 9, -60, }, /* 116 */ - { 19, 5, -96, }, /* 117 */ - { 19, 25, 0, }, /* 118 */ - { 19, 9, -7, }, /* 119 */ - { 19, 9, -130, }, /* 120 */ - { 12, 9, 80, }, /* 121 */ - { 12, 9, 32, }, /* 122 */ - { 12, 5, -32, }, /* 123 */ - { 12, 5, -80, }, /* 124 */ - { 12, 9, 1, }, /* 125 */ - { 12, 5, -1, }, /* 126 */ - { 12, 26, 0, }, /* 127 */ - { 12, 12, 0, }, /* 128 */ - { 12, 11, 0, }, /* 129 */ - { 12, 9, 15, }, /* 130 */ - { 12, 5, -15, }, /* 131 */ - { 1, 9, 48, }, /* 132 */ - { 1, 6, 0, }, /* 133 */ - { 1, 21, 0, }, /* 134 */ - { 1, 5, -48, }, /* 135 */ - { 1, 5, 0, }, /* 136 */ - { 1, 17, 0, }, /* 137 */ - { 25, 12, 0, }, /* 138 */ - { 25, 17, 0, }, /* 139 */ - { 25, 21, 0, }, /* 140 */ - { 25, 7, 0, }, /* 141 */ - { 0, 25, 0, }, /* 142 */ - { 0, 21, 0, }, /* 143 */ - { 0, 23, 0, }, /* 144 */ - { 0, 26, 0, }, /* 145 */ - { 0, 12, 0, }, /* 146 */ - { 0, 7, 0, }, /* 147 */ - { 0, 11, 0, }, /* 148 */ - { 0, 6, 0, }, /* 149 */ - { 0, 13, 0, }, /* 150 */ - { 49, 21, 0, }, /* 151 */ - { 49, 1, 0, }, /* 152 */ - { 49, 7, 0, }, /* 153 */ - { 49, 12, 0, }, /* 154 */ - { 55, 7, 0, }, /* 155 */ - { 55, 12, 0, }, /* 156 */ - { 63, 13, 0, }, /* 157 */ - { 63, 7, 0, }, /* 158 */ - { 63, 12, 0, }, /* 159 */ - { 63, 6, 0, }, /* 160 */ - { 63, 26, 0, }, /* 161 */ - { 63, 21, 0, }, /* 162 */ - { 89, 7, 0, }, /* 163 */ - { 89, 12, 0, }, /* 164 */ - { 89, 6, 0, }, /* 165 */ - { 89, 21, 0, }, /* 166 */ - { 14, 12, 0, }, /* 167 */ - { 14, 10, 0, }, /* 168 */ - { 14, 7, 0, }, /* 169 */ - { 14, 13, 0, }, /* 170 */ - { 14, 6, 0, }, /* 171 */ - { 2, 12, 0, }, /* 172 */ - { 2, 10, 0, }, /* 173 */ - { 2, 7, 0, }, /* 174 */ - { 2, 13, 0, }, /* 175 */ - { 2, 23, 0, }, /* 176 */ - { 2, 15, 0, }, /* 177 */ - { 2, 26, 0, }, /* 178 */ - { 21, 12, 0, }, /* 179 */ - { 21, 10, 0, }, /* 180 */ - { 21, 7, 0, }, /* 181 */ - { 21, 13, 0, }, /* 182 */ - { 20, 12, 0, }, /* 183 */ - { 20, 10, 0, }, /* 184 */ - { 20, 7, 0, }, /* 185 */ - { 20, 13, 0, }, /* 186 */ - { 20, 23, 0, }, /* 187 */ - { 43, 12, 0, }, /* 188 */ - { 43, 10, 0, }, /* 189 */ - { 43, 7, 0, }, /* 190 */ - { 43, 13, 0, }, /* 191 */ - { 43, 26, 0, }, /* 192 */ - { 53, 12, 0, }, /* 193 */ - { 53, 7, 0, }, /* 194 */ - { 53, 10, 0, }, /* 195 */ - { 53, 13, 0, }, /* 196 */ - { 53, 15, 0, }, /* 197 */ - { 53, 26, 0, }, /* 198 */ - { 53, 23, 0, }, /* 199 */ - { 54, 10, 0, }, /* 200 */ - { 54, 7, 0, }, /* 201 */ - { 54, 12, 0, }, /* 202 */ - { 54, 13, 0, }, /* 203 */ - { 54, 15, 0, }, /* 204 */ - { 54, 26, 0, }, /* 205 */ - { 28, 10, 0, }, /* 206 */ - { 28, 7, 0, }, /* 207 */ - { 28, 12, 0, }, /* 208 */ - { 28, 13, 0, }, /* 209 */ - { 36, 10, 0, }, /* 210 */ - { 36, 7, 0, }, /* 211 */ - { 36, 12, 0, }, /* 212 */ - { 36, 13, 0, }, /* 213 */ - { 36, 15, 0, }, /* 214 */ - { 36, 26, 0, }, /* 215 */ - { 47, 10, 0, }, /* 216 */ - { 47, 7, 0, }, /* 217 */ - { 47, 12, 0, }, /* 218 */ - { 47, 21, 0, }, /* 219 */ - { 56, 7, 0, }, /* 220 */ - { 56, 12, 0, }, /* 221 */ - { 56, 6, 0, }, /* 222 */ - { 56, 21, 0, }, /* 223 */ - { 56, 13, 0, }, /* 224 */ - { 32, 7, 0, }, /* 225 */ - { 32, 12, 0, }, /* 226 */ - { 32, 6, 0, }, /* 227 */ - { 32, 13, 0, }, /* 228 */ - { 57, 7, 0, }, /* 229 */ - { 57, 26, 0, }, /* 230 */ - { 57, 21, 0, }, /* 231 */ - { 57, 12, 0, }, /* 232 */ - { 57, 13, 0, }, /* 233 */ - { 57, 15, 0, }, /* 234 */ - { 57, 22, 0, }, /* 235 */ - { 57, 18, 0, }, /* 236 */ - { 57, 10, 0, }, /* 237 */ - { 38, 7, 0, }, /* 238 */ - { 38, 10, 0, }, /* 239 */ - { 38, 12, 0, }, /* 240 */ - { 38, 13, 0, }, /* 241 */ - { 38, 21, 0, }, /* 242 */ - { 38, 26, 0, }, /* 243 */ - { 16, 9, 7264, }, /* 244 */ - { 16, 7, 0, }, /* 245 */ - { 16, 6, 0, }, /* 246 */ - { 23, 7, 0, }, /* 247 */ - { 15, 7, 0, }, /* 248 */ - { 15, 12, 0, }, /* 249 */ - { 15, 26, 0, }, /* 250 */ - { 15, 21, 0, }, /* 251 */ - { 15, 15, 0, }, /* 252 */ - { 8, 7, 0, }, /* 253 */ - { 7, 17, 0, }, /* 254 */ - { 7, 7, 0, }, /* 255 */ - { 7, 21, 0, }, /* 256 */ - { 40, 29, 0, }, /* 257 */ - { 40, 7, 0, }, /* 258 */ - { 40, 22, 0, }, /* 259 */ - { 40, 18, 0, }, /* 260 */ - { 45, 7, 0, }, /* 261 */ - { 45, 14, 0, }, /* 262 */ - { 50, 7, 0, }, /* 263 */ - { 50, 12, 0, }, /* 264 */ - { 24, 7, 0, }, /* 265 */ - { 24, 12, 0, }, /* 266 */ - { 6, 7, 0, }, /* 267 */ - { 6, 12, 0, }, /* 268 */ - { 51, 7, 0, }, /* 269 */ - { 51, 12, 0, }, /* 270 */ - { 31, 7, 0, }, /* 271 */ - { 31, 1, 0, }, /* 272 */ - { 31, 10, 0, }, /* 273 */ - { 31, 12, 0, }, /* 274 */ - { 31, 21, 0, }, /* 275 */ - { 31, 6, 0, }, /* 276 */ - { 31, 23, 0, }, /* 277 */ - { 31, 13, 0, }, /* 278 */ - { 31, 15, 0, }, /* 279 */ - { 37, 21, 0, }, /* 280 */ - { 37, 17, 0, }, /* 281 */ - { 37, 12, 0, }, /* 282 */ - { 37, 29, 0, }, /* 283 */ - { 37, 13, 0, }, /* 284 */ - { 37, 7, 0, }, /* 285 */ - { 37, 6, 0, }, /* 286 */ - { 34, 7, 0, }, /* 287 */ - { 34, 12, 0, }, /* 288 */ - { 34, 10, 0, }, /* 289 */ - { 34, 26, 0, }, /* 290 */ - { 34, 21, 0, }, /* 291 */ - { 34, 13, 0, }, /* 292 */ - { 52, 7, 0, }, /* 293 */ - { 39, 7, 0, }, /* 294 */ - { 39, 10, 0, }, /* 295 */ - { 39, 13, 0, }, /* 296 */ - { 39, 21, 0, }, /* 297 */ - { 31, 26, 0, }, /* 298 */ - { 5, 7, 0, }, /* 299 */ - { 5, 12, 0, }, /* 300 */ - { 5, 10, 0, }, /* 301 */ - { 5, 21, 0, }, /* 302 */ - { 90, 7, 0, }, /* 303 */ - { 90, 10, 0, }, /* 304 */ - { 90, 12, 0, }, /* 305 */ - { 90, 13, 0, }, /* 306 */ - { 90, 21, 0, }, /* 307 */ - { 90, 6, 0, }, /* 308 */ - { 61, 12, 0, }, /* 309 */ - { 61, 10, 0, }, /* 310 */ - { 61, 7, 0, }, /* 311 */ - { 61, 13, 0, }, /* 312 */ - { 61, 21, 0, }, /* 313 */ - { 61, 26, 0, }, /* 314 */ - { 75, 12, 0, }, /* 315 */ - { 75, 10, 0, }, /* 316 */ - { 75, 7, 0, }, /* 317 */ - { 75, 13, 0, }, /* 318 */ - { 69, 7, 0, }, /* 319 */ - { 69, 10, 0, }, /* 320 */ - { 69, 12, 0, }, /* 321 */ - { 69, 21, 0, }, /* 322 */ - { 69, 13, 0, }, /* 323 */ - { 72, 13, 0, }, /* 324 */ - { 72, 7, 0, }, /* 325 */ - { 72, 6, 0, }, /* 326 */ - { 72, 21, 0, }, /* 327 */ - { 9, 10, 0, }, /* 328 */ - { 9, 7, 0, }, /* 329 */ - { 12, 5, 0, }, /* 330 */ - { 12, 6, 0, }, /* 331 */ - { 33, 5, 35332, }, /* 332 */ - { 33, 5, 3814, }, /* 333 */ - { 33, 5, -59, }, /* 334 */ - { 33, 9, -7615, }, /* 335 */ - { 19, 5, 8, }, /* 336 */ - { 19, 9, -8, }, /* 337 */ - { 19, 5, 74, }, /* 338 */ - { 19, 5, 86, }, /* 339 */ - { 19, 5, 100, }, /* 340 */ - { 19, 5, 128, }, /* 341 */ - { 19, 5, 112, }, /* 342 */ - { 19, 5, 126, }, /* 343 */ - { 19, 8, -8, }, /* 344 */ - { 19, 5, 9, }, /* 345 */ - { 19, 9, -74, }, /* 346 */ - { 19, 8, -9, }, /* 347 */ - { 19, 5, -7205, }, /* 348 */ - { 19, 9, -86, }, /* 349 */ - { 19, 9, -100, }, /* 350 */ - { 19, 9, -112, }, /* 351 */ - { 19, 9, -128, }, /* 352 */ - { 19, 9, -126, }, /* 353 */ - { 27, 1, 0, }, /* 354 */ - { 9, 27, 0, }, /* 355 */ - { 9, 28, 0, }, /* 356 */ - { 27, 11, 0, }, /* 357 */ - { 9, 9, 0, }, /* 358 */ - { 9, 5, 0, }, /* 359 */ - { 19, 9, -7517, }, /* 360 */ - { 33, 9, -8383, }, /* 361 */ - { 33, 9, -8262, }, /* 362 */ - { 33, 9, 28, }, /* 363 */ - { 33, 5, -28, }, /* 364 */ - { 33, 14, 16, }, /* 365 */ - { 33, 14, -16, }, /* 366 */ - { 33, 14, 0, }, /* 367 */ - { 9, 26, 26, }, /* 368 */ - { 9, 26, -26, }, /* 369 */ - { 4, 26, 0, }, /* 370 */ - { 17, 9, 48, }, /* 371 */ - { 17, 5, -48, }, /* 372 */ - { 33, 9, -10743, }, /* 373 */ - { 33, 9, -3814, }, /* 374 */ - { 33, 9, -10727, }, /* 375 */ - { 33, 5, -10795, }, /* 376 */ - { 33, 5, -10792, }, /* 377 */ - { 33, 9, -10780, }, /* 378 */ - { 33, 9, -10749, }, /* 379 */ - { 33, 9, -10783, }, /* 380 */ - { 33, 9, -10782, }, /* 381 */ - { 33, 9, -10815, }, /* 382 */ - { 10, 5, 0, }, /* 383 */ - { 10, 26, 0, }, /* 384 */ - { 10, 12, 0, }, /* 385 */ - { 10, 21, 0, }, /* 386 */ - { 10, 15, 0, }, /* 387 */ - { 16, 5, -7264, }, /* 388 */ - { 58, 7, 0, }, /* 389 */ - { 58, 6, 0, }, /* 390 */ - { 22, 26, 0, }, /* 391 */ - { 22, 6, 0, }, /* 392 */ - { 22, 14, 0, }, /* 393 */ - { 26, 7, 0, }, /* 394 */ - { 26, 6, 0, }, /* 395 */ - { 29, 7, 0, }, /* 396 */ - { 29, 6, 0, }, /* 397 */ - { 3, 7, 0, }, /* 398 */ - { 23, 26, 0, }, /* 399 */ - { 29, 26, 0, }, /* 400 */ - { 22, 7, 0, }, /* 401 */ - { 60, 7, 0, }, /* 402 */ - { 60, 6, 0, }, /* 403 */ - { 60, 26, 0, }, /* 404 */ - { 85, 7, 0, }, /* 405 */ - { 85, 6, 0, }, /* 406 */ - { 85, 21, 0, }, /* 407 */ - { 76, 7, 0, }, /* 408 */ - { 76, 6, 0, }, /* 409 */ - { 76, 21, 0, }, /* 410 */ - { 76, 13, 0, }, /* 411 */ - { 12, 7, 0, }, /* 412 */ - { 12, 21, 0, }, /* 413 */ - { 78, 7, 0, }, /* 414 */ - { 78, 14, 0, }, /* 415 */ - { 78, 12, 0, }, /* 416 */ - { 78, 21, 0, }, /* 417 */ - { 33, 9, -35332, }, /* 418 */ - { 48, 7, 0, }, /* 419 */ - { 48, 12, 0, }, /* 420 */ - { 48, 10, 0, }, /* 421 */ - { 48, 26, 0, }, /* 422 */ - { 64, 7, 0, }, /* 423 */ - { 64, 21, 0, }, /* 424 */ - { 74, 10, 0, }, /* 425 */ - { 74, 7, 0, }, /* 426 */ - { 74, 12, 0, }, /* 427 */ - { 74, 21, 0, }, /* 428 */ - { 74, 13, 0, }, /* 429 */ - { 14, 21, 0, }, /* 430 */ - { 68, 13, 0, }, /* 431 */ - { 68, 7, 0, }, /* 432 */ - { 68, 12, 0, }, /* 433 */ - { 68, 21, 0, }, /* 434 */ - { 73, 7, 0, }, /* 435 */ - { 73, 12, 0, }, /* 436 */ - { 73, 10, 0, }, /* 437 */ - { 73, 21, 0, }, /* 438 */ - { 83, 12, 0, }, /* 439 */ - { 83, 10, 0, }, /* 440 */ - { 83, 7, 0, }, /* 441 */ - { 83, 21, 0, }, /* 442 */ - { 83, 6, 0, }, /* 443 */ - { 83, 13, 0, }, /* 444 */ - { 67, 7, 0, }, /* 445 */ - { 67, 12, 0, }, /* 446 */ - { 67, 10, 0, }, /* 447 */ - { 67, 13, 0, }, /* 448 */ - { 67, 21, 0, }, /* 449 */ - { 38, 6, 0, }, /* 450 */ - { 91, 7, 0, }, /* 451 */ - { 91, 12, 0, }, /* 452 */ - { 91, 6, 0, }, /* 453 */ - { 91, 21, 0, }, /* 454 */ - { 86, 7, 0, }, /* 455 */ - { 86, 10, 0, }, /* 456 */ - { 86, 12, 0, }, /* 457 */ - { 86, 21, 0, }, /* 458 */ - { 86, 13, 0, }, /* 459 */ - { 9, 4, 0, }, /* 460 */ - { 9, 3, 0, }, /* 461 */ - { 25, 25, 0, }, /* 462 */ - { 35, 7, 0, }, /* 463 */ - { 19, 14, 0, }, /* 464 */ - { 19, 15, 0, }, /* 465 */ - { 19, 26, 0, }, /* 466 */ - { 70, 7, 0, }, /* 467 */ - { 66, 7, 0, }, /* 468 */ - { 41, 7, 0, }, /* 469 */ - { 41, 15, 0, }, /* 470 */ - { 18, 7, 0, }, /* 471 */ - { 18, 14, 0, }, /* 472 */ - { 59, 7, 0, }, /* 473 */ - { 59, 21, 0, }, /* 474 */ - { 42, 7, 0, }, /* 475 */ - { 42, 21, 0, }, /* 476 */ - { 42, 14, 0, }, /* 477 */ - { 13, 9, 40, }, /* 478 */ - { 13, 5, -40, }, /* 479 */ - { 46, 7, 0, }, /* 480 */ - { 44, 7, 0, }, /* 481 */ - { 44, 13, 0, }, /* 482 */ - { 11, 7, 0, }, /* 483 */ - { 80, 7, 0, }, /* 484 */ - { 80, 21, 0, }, /* 485 */ - { 80, 15, 0, }, /* 486 */ - { 65, 7, 0, }, /* 487 */ - { 65, 15, 0, }, /* 488 */ - { 65, 21, 0, }, /* 489 */ - { 71, 7, 0, }, /* 490 */ - { 71, 21, 0, }, /* 491 */ - { 30, 7, 0, }, /* 492 */ - { 30, 12, 0, }, /* 493 */ - { 30, 15, 0, }, /* 494 */ - { 30, 21, 0, }, /* 495 */ - { 87, 7, 0, }, /* 496 */ - { 87, 15, 0, }, /* 497 */ - { 87, 21, 0, }, /* 498 */ - { 77, 7, 0, }, /* 499 */ - { 77, 21, 0, }, /* 500 */ - { 82, 7, 0, }, /* 501 */ - { 82, 15, 0, }, /* 502 */ - { 81, 7, 0, }, /* 503 */ - { 81, 15, 0, }, /* 504 */ - { 88, 7, 0, }, /* 505 */ - { 0, 15, 0, }, /* 506 */ - { 84, 12, 0, }, /* 507 */ - { 84, 10, 0, }, /* 508 */ - { 84, 7, 0, }, /* 509 */ - { 84, 21, 0, }, /* 510 */ - { 84, 1, 0, }, /* 511 */ - { 62, 7, 0, }, /* 512 */ - { 62, 14, 0, }, /* 513 */ - { 62, 21, 0, }, /* 514 */ - { 79, 7, 0, }, /* 515 */ - { 19, 12, 0, }, /* 516 */ - { 26, 26, 0, }, /* 517 */ + { 33, 5, 42280, }, /* 70 */ + { 33, 5, 42308, }, /* 71 */ + { 33, 5, -209, }, /* 72 */ + { 33, 5, -211, }, /* 73 */ + { 33, 5, 10743, }, /* 74 */ + { 33, 5, 10749, }, /* 75 */ + { 33, 5, -213, }, /* 76 */ + { 33, 5, -214, }, /* 77 */ + { 33, 5, 10727, }, /* 78 */ + { 33, 5, -218, }, /* 79 */ + { 33, 5, -69, }, /* 80 */ + { 33, 5, -217, }, /* 81 */ + { 33, 5, -71, }, /* 82 */ + { 33, 5, -219, }, /* 83 */ + { 33, 6, 0, }, /* 84 */ + { 9, 6, 0, }, /* 85 */ + { 3, 24, 0, }, /* 86 */ + { 27, 12, 0, }, /* 87 */ + { 27, 12, 84, }, /* 88 */ + { 19, 9, 1, }, /* 89 */ + { 19, 5, -1, }, /* 90 */ + { 19, 24, 0, }, /* 91 */ + { 9, 2, 0, }, /* 92 */ + { 19, 6, 0, }, /* 93 */ + { 19, 5, 130, }, /* 94 */ + { 19, 9, 38, }, /* 95 */ + { 19, 9, 37, }, /* 96 */ + { 19, 9, 64, }, /* 97 */ + { 19, 9, 63, }, /* 98 */ + { 19, 5, 0, }, /* 99 */ + { 19, 9, 32, }, /* 100 */ + { 19, 5, -38, }, /* 101 */ + { 19, 5, -37, }, /* 102 */ + { 19, 5, -32, }, /* 103 */ + { 19, 5, -31, }, /* 104 */ + { 19, 5, -64, }, /* 105 */ + { 19, 5, -63, }, /* 106 */ + { 19, 9, 8, }, /* 107 */ + { 19, 5, -62, }, /* 108 */ + { 19, 5, -57, }, /* 109 */ + { 19, 9, 0, }, /* 110 */ + { 19, 5, -47, }, /* 111 */ + { 19, 5, -54, }, /* 112 */ + { 19, 5, -8, }, /* 113 */ + { 10, 9, 1, }, /* 114 */ + { 10, 5, -1, }, /* 115 */ + { 19, 5, -86, }, /* 116 */ + { 19, 5, -80, }, /* 117 */ + { 19, 5, 7, }, /* 118 */ + { 19, 9, -60, }, /* 119 */ + { 19, 5, -96, }, /* 120 */ + { 19, 25, 0, }, /* 121 */ + { 19, 9, -7, }, /* 122 */ + { 19, 9, -130, }, /* 123 */ + { 12, 9, 80, }, /* 124 */ + { 12, 9, 32, }, /* 125 */ + { 12, 5, -32, }, /* 126 */ + { 12, 5, -80, }, /* 127 */ + { 12, 9, 1, }, /* 128 */ + { 12, 5, -1, }, /* 129 */ + { 12, 26, 0, }, /* 130 */ + { 12, 12, 0, }, /* 131 */ + { 12, 11, 0, }, /* 132 */ + { 12, 9, 15, }, /* 133 */ + { 12, 5, -15, }, /* 134 */ + { 1, 9, 48, }, /* 135 */ + { 1, 6, 0, }, /* 136 */ + { 1, 21, 0, }, /* 137 */ + { 1, 5, -48, }, /* 138 */ + { 1, 5, 0, }, /* 139 */ + { 1, 17, 0, }, /* 140 */ + { 1, 23, 0, }, /* 141 */ + { 25, 12, 0, }, /* 142 */ + { 25, 17, 0, }, /* 143 */ + { 25, 21, 0, }, /* 144 */ + { 25, 7, 0, }, /* 145 */ + { 0, 1, 0, }, /* 146 */ + { 0, 25, 0, }, /* 147 */ + { 0, 21, 0, }, /* 148 */ + { 0, 23, 0, }, /* 149 */ + { 0, 26, 0, }, /* 150 */ + { 0, 12, 0, }, /* 151 */ + { 0, 7, 0, }, /* 152 */ + { 0, 6, 0, }, /* 153 */ + { 0, 13, 0, }, /* 154 */ + { 49, 21, 0, }, /* 155 */ + { 49, 1, 0, }, /* 156 */ + { 49, 7, 0, }, /* 157 */ + { 49, 12, 0, }, /* 158 */ + { 55, 7, 0, }, /* 159 */ + { 55, 12, 0, }, /* 160 */ + { 63, 13, 0, }, /* 161 */ + { 63, 7, 0, }, /* 162 */ + { 63, 12, 0, }, /* 163 */ + { 63, 6, 0, }, /* 164 */ + { 63, 26, 0, }, /* 165 */ + { 63, 21, 0, }, /* 166 */ + { 89, 7, 0, }, /* 167 */ + { 89, 12, 0, }, /* 168 */ + { 89, 6, 0, }, /* 169 */ + { 89, 21, 0, }, /* 170 */ + { 94, 7, 0, }, /* 171 */ + { 94, 12, 0, }, /* 172 */ + { 94, 21, 0, }, /* 173 */ + { 14, 12, 0, }, /* 174 */ + { 14, 10, 0, }, /* 175 */ + { 14, 7, 0, }, /* 176 */ + { 14, 13, 0, }, /* 177 */ + { 14, 21, 0, }, /* 178 */ + { 14, 6, 0, }, /* 179 */ + { 2, 12, 0, }, /* 180 */ + { 2, 10, 0, }, /* 181 */ + { 2, 7, 0, }, /* 182 */ + { 2, 13, 0, }, /* 183 */ + { 2, 23, 0, }, /* 184 */ + { 2, 15, 0, }, /* 185 */ + { 2, 26, 0, }, /* 186 */ + { 21, 12, 0, }, /* 187 */ + { 21, 10, 0, }, /* 188 */ + { 21, 7, 0, }, /* 189 */ + { 21, 13, 0, }, /* 190 */ + { 20, 12, 0, }, /* 191 */ + { 20, 10, 0, }, /* 192 */ + { 20, 7, 0, }, /* 193 */ + { 20, 13, 0, }, /* 194 */ + { 20, 21, 0, }, /* 195 */ + { 20, 23, 0, }, /* 196 */ + { 43, 12, 0, }, /* 197 */ + { 43, 10, 0, }, /* 198 */ + { 43, 7, 0, }, /* 199 */ + { 43, 13, 0, }, /* 200 */ + { 43, 26, 0, }, /* 201 */ + { 43, 15, 0, }, /* 202 */ + { 53, 12, 0, }, /* 203 */ + { 53, 7, 0, }, /* 204 */ + { 53, 10, 0, }, /* 205 */ + { 53, 13, 0, }, /* 206 */ + { 53, 15, 0, }, /* 207 */ + { 53, 26, 0, }, /* 208 */ + { 53, 23, 0, }, /* 209 */ + { 54, 10, 0, }, /* 210 */ + { 54, 7, 0, }, /* 211 */ + { 54, 12, 0, }, /* 212 */ + { 54, 13, 0, }, /* 213 */ + { 54, 15, 0, }, /* 214 */ + { 54, 26, 0, }, /* 215 */ + { 28, 10, 0, }, /* 216 */ + { 28, 7, 0, }, /* 217 */ + { 28, 12, 0, }, /* 218 */ + { 28, 13, 0, }, /* 219 */ + { 36, 10, 0, }, /* 220 */ + { 36, 7, 0, }, /* 221 */ + { 36, 12, 0, }, /* 222 */ + { 36, 13, 0, }, /* 223 */ + { 36, 15, 0, }, /* 224 */ + { 36, 26, 0, }, /* 225 */ + { 47, 10, 0, }, /* 226 */ + { 47, 7, 0, }, /* 227 */ + { 47, 12, 0, }, /* 228 */ + { 47, 21, 0, }, /* 229 */ + { 56, 7, 0, }, /* 230 */ + { 56, 12, 0, }, /* 231 */ + { 56, 6, 0, }, /* 232 */ + { 56, 21, 0, }, /* 233 */ + { 56, 13, 0, }, /* 234 */ + { 32, 7, 0, }, /* 235 */ + { 32, 12, 0, }, /* 236 */ + { 32, 6, 0, }, /* 237 */ + { 32, 13, 0, }, /* 238 */ + { 57, 7, 0, }, /* 239 */ + { 57, 26, 0, }, /* 240 */ + { 57, 21, 0, }, /* 241 */ + { 57, 12, 0, }, /* 242 */ + { 57, 13, 0, }, /* 243 */ + { 57, 15, 0, }, /* 244 */ + { 57, 22, 0, }, /* 245 */ + { 57, 18, 0, }, /* 246 */ + { 57, 10, 0, }, /* 247 */ + { 38, 7, 0, }, /* 248 */ + { 38, 10, 0, }, /* 249 */ + { 38, 12, 0, }, /* 250 */ + { 38, 13, 0, }, /* 251 */ + { 38, 21, 0, }, /* 252 */ + { 38, 26, 0, }, /* 253 */ + { 16, 9, 7264, }, /* 254 */ + { 16, 7, 0, }, /* 255 */ + { 16, 6, 0, }, /* 256 */ + { 23, 7, 0, }, /* 257 */ + { 15, 7, 0, }, /* 258 */ + { 15, 12, 0, }, /* 259 */ + { 15, 21, 0, }, /* 260 */ + { 15, 15, 0, }, /* 261 */ + { 15, 26, 0, }, /* 262 */ + { 8, 7, 0, }, /* 263 */ + { 7, 17, 0, }, /* 264 */ + { 7, 7, 0, }, /* 265 */ + { 7, 21, 0, }, /* 266 */ + { 40, 29, 0, }, /* 267 */ + { 40, 7, 0, }, /* 268 */ + { 40, 22, 0, }, /* 269 */ + { 40, 18, 0, }, /* 270 */ + { 45, 7, 0, }, /* 271 */ + { 45, 14, 0, }, /* 272 */ + { 50, 7, 0, }, /* 273 */ + { 50, 12, 0, }, /* 274 */ + { 24, 7, 0, }, /* 275 */ + { 24, 12, 0, }, /* 276 */ + { 6, 7, 0, }, /* 277 */ + { 6, 12, 0, }, /* 278 */ + { 51, 7, 0, }, /* 279 */ + { 51, 12, 0, }, /* 280 */ + { 31, 7, 0, }, /* 281 */ + { 31, 12, 0, }, /* 282 */ + { 31, 10, 0, }, /* 283 */ + { 31, 21, 0, }, /* 284 */ + { 31, 6, 0, }, /* 285 */ + { 31, 23, 0, }, /* 286 */ + { 31, 13, 0, }, /* 287 */ + { 31, 15, 0, }, /* 288 */ + { 37, 21, 0, }, /* 289 */ + { 37, 17, 0, }, /* 290 */ + { 37, 12, 0, }, /* 291 */ + { 37, 29, 0, }, /* 292 */ + { 37, 13, 0, }, /* 293 */ + { 37, 7, 0, }, /* 294 */ + { 37, 6, 0, }, /* 295 */ + { 34, 7, 0, }, /* 296 */ + { 34, 12, 0, }, /* 297 */ + { 34, 10, 0, }, /* 298 */ + { 34, 26, 0, }, /* 299 */ + { 34, 21, 0, }, /* 300 */ + { 34, 13, 0, }, /* 301 */ + { 52, 7, 0, }, /* 302 */ + { 39, 7, 0, }, /* 303 */ + { 39, 10, 0, }, /* 304 */ + { 39, 13, 0, }, /* 305 */ + { 39, 15, 0, }, /* 306 */ + { 39, 26, 0, }, /* 307 */ + { 31, 26, 0, }, /* 308 */ + { 5, 7, 0, }, /* 309 */ + { 5, 12, 0, }, /* 310 */ + { 5, 10, 0, }, /* 311 */ + { 5, 21, 0, }, /* 312 */ + { 90, 7, 0, }, /* 313 */ + { 90, 10, 0, }, /* 314 */ + { 90, 12, 0, }, /* 315 */ + { 90, 13, 0, }, /* 316 */ + { 90, 21, 0, }, /* 317 */ + { 90, 6, 0, }, /* 318 */ + { 61, 12, 0, }, /* 319 */ + { 61, 10, 0, }, /* 320 */ + { 61, 7, 0, }, /* 321 */ + { 61, 13, 0, }, /* 322 */ + { 61, 21, 0, }, /* 323 */ + { 61, 26, 0, }, /* 324 */ + { 75, 12, 0, }, /* 325 */ + { 75, 10, 0, }, /* 326 */ + { 75, 7, 0, }, /* 327 */ + { 75, 13, 0, }, /* 328 */ + { 92, 7, 0, }, /* 329 */ + { 92, 12, 0, }, /* 330 */ + { 92, 10, 0, }, /* 331 */ + { 92, 21, 0, }, /* 332 */ + { 69, 7, 0, }, /* 333 */ + { 69, 10, 0, }, /* 334 */ + { 69, 12, 0, }, /* 335 */ + { 69, 21, 0, }, /* 336 */ + { 69, 13, 0, }, /* 337 */ + { 72, 13, 0, }, /* 338 */ + { 72, 7, 0, }, /* 339 */ + { 72, 6, 0, }, /* 340 */ + { 72, 21, 0, }, /* 341 */ + { 75, 21, 0, }, /* 342 */ + { 9, 10, 0, }, /* 343 */ + { 9, 7, 0, }, /* 344 */ + { 12, 5, 0, }, /* 345 */ + { 12, 6, 0, }, /* 346 */ + { 33, 5, 35332, }, /* 347 */ + { 33, 5, 3814, }, /* 348 */ + { 33, 5, -59, }, /* 349 */ + { 33, 9, -7615, }, /* 350 */ + { 19, 5, 8, }, /* 351 */ + { 19, 9, -8, }, /* 352 */ + { 19, 5, 74, }, /* 353 */ + { 19, 5, 86, }, /* 354 */ + { 19, 5, 100, }, /* 355 */ + { 19, 5, 128, }, /* 356 */ + { 19, 5, 112, }, /* 357 */ + { 19, 5, 126, }, /* 358 */ + { 19, 8, -8, }, /* 359 */ + { 19, 5, 9, }, /* 360 */ + { 19, 9, -74, }, /* 361 */ + { 19, 8, -9, }, /* 362 */ + { 19, 5, -7205, }, /* 363 */ + { 19, 9, -86, }, /* 364 */ + { 19, 9, -100, }, /* 365 */ + { 19, 9, -112, }, /* 366 */ + { 19, 9, -128, }, /* 367 */ + { 19, 9, -126, }, /* 368 */ + { 27, 1, 0, }, /* 369 */ + { 9, 27, 0, }, /* 370 */ + { 9, 28, 0, }, /* 371 */ + { 27, 11, 0, }, /* 372 */ + { 9, 9, 0, }, /* 373 */ + { 9, 5, 0, }, /* 374 */ + { 19, 9, -7517, }, /* 375 */ + { 33, 9, -8383, }, /* 376 */ + { 33, 9, -8262, }, /* 377 */ + { 33, 9, 28, }, /* 378 */ + { 33, 5, -28, }, /* 379 */ + { 33, 14, 16, }, /* 380 */ + { 33, 14, -16, }, /* 381 */ + { 33, 14, 0, }, /* 382 */ + { 9, 26, 26, }, /* 383 */ + { 9, 26, -26, }, /* 384 */ + { 4, 26, 0, }, /* 385 */ + { 17, 9, 48, }, /* 386 */ + { 17, 5, -48, }, /* 387 */ + { 33, 9, -10743, }, /* 388 */ + { 33, 9, -3814, }, /* 389 */ + { 33, 9, -10727, }, /* 390 */ + { 33, 5, -10795, }, /* 391 */ + { 33, 5, -10792, }, /* 392 */ + { 33, 9, -10780, }, /* 393 */ + { 33, 9, -10749, }, /* 394 */ + { 33, 9, -10783, }, /* 395 */ + { 33, 9, -10782, }, /* 396 */ + { 33, 9, -10815, }, /* 397 */ + { 10, 5, 0, }, /* 398 */ + { 10, 26, 0, }, /* 399 */ + { 10, 12, 0, }, /* 400 */ + { 10, 21, 0, }, /* 401 */ + { 10, 15, 0, }, /* 402 */ + { 16, 5, -7264, }, /* 403 */ + { 58, 7, 0, }, /* 404 */ + { 58, 6, 0, }, /* 405 */ + { 58, 21, 0, }, /* 406 */ + { 58, 12, 0, }, /* 407 */ + { 22, 26, 0, }, /* 408 */ + { 22, 6, 0, }, /* 409 */ + { 22, 14, 0, }, /* 410 */ + { 23, 10, 0, }, /* 411 */ + { 26, 7, 0, }, /* 412 */ + { 26, 6, 0, }, /* 413 */ + { 29, 7, 0, }, /* 414 */ + { 29, 6, 0, }, /* 415 */ + { 3, 7, 0, }, /* 416 */ + { 23, 26, 0, }, /* 417 */ + { 29, 26, 0, }, /* 418 */ + { 22, 7, 0, }, /* 419 */ + { 60, 7, 0, }, /* 420 */ + { 60, 6, 0, }, /* 421 */ + { 60, 26, 0, }, /* 422 */ + { 85, 7, 0, }, /* 423 */ + { 85, 6, 0, }, /* 424 */ + { 85, 21, 0, }, /* 425 */ + { 76, 7, 0, }, /* 426 */ + { 76, 6, 0, }, /* 427 */ + { 76, 21, 0, }, /* 428 */ + { 76, 13, 0, }, /* 429 */ + { 12, 7, 0, }, /* 430 */ + { 12, 21, 0, }, /* 431 */ + { 78, 7, 0, }, /* 432 */ + { 78, 14, 0, }, /* 433 */ + { 78, 12, 0, }, /* 434 */ + { 78, 21, 0, }, /* 435 */ + { 33, 9, -35332, }, /* 436 */ + { 33, 9, -42280, }, /* 437 */ + { 33, 9, -42308, }, /* 438 */ + { 48, 7, 0, }, /* 439 */ + { 48, 12, 0, }, /* 440 */ + { 48, 10, 0, }, /* 441 */ + { 48, 26, 0, }, /* 442 */ + { 64, 7, 0, }, /* 443 */ + { 64, 21, 0, }, /* 444 */ + { 74, 10, 0, }, /* 445 */ + { 74, 7, 0, }, /* 446 */ + { 74, 12, 0, }, /* 447 */ + { 74, 21, 0, }, /* 448 */ + { 74, 13, 0, }, /* 449 */ + { 68, 13, 0, }, /* 450 */ + { 68, 7, 0, }, /* 451 */ + { 68, 12, 0, }, /* 452 */ + { 68, 21, 0, }, /* 453 */ + { 73, 7, 0, }, /* 454 */ + { 73, 12, 0, }, /* 455 */ + { 73, 10, 0, }, /* 456 */ + { 73, 21, 0, }, /* 457 */ + { 83, 12, 0, }, /* 458 */ + { 83, 10, 0, }, /* 459 */ + { 83, 7, 0, }, /* 460 */ + { 83, 21, 0, }, /* 461 */ + { 83, 6, 0, }, /* 462 */ + { 83, 13, 0, }, /* 463 */ + { 67, 7, 0, }, /* 464 */ + { 67, 12, 0, }, /* 465 */ + { 67, 10, 0, }, /* 466 */ + { 67, 13, 0, }, /* 467 */ + { 67, 21, 0, }, /* 468 */ + { 38, 6, 0, }, /* 469 */ + { 91, 7, 0, }, /* 470 */ + { 91, 12, 0, }, /* 471 */ + { 91, 6, 0, }, /* 472 */ + { 91, 21, 0, }, /* 473 */ + { 86, 7, 0, }, /* 474 */ + { 86, 10, 0, }, /* 475 */ + { 86, 12, 0, }, /* 476 */ + { 86, 21, 0, }, /* 477 */ + { 86, 6, 0, }, /* 478 */ + { 86, 13, 0, }, /* 479 */ + { 9, 4, 0, }, /* 480 */ + { 9, 3, 0, }, /* 481 */ + { 25, 25, 0, }, /* 482 */ + { 0, 24, 0, }, /* 483 */ + { 35, 7, 0, }, /* 484 */ + { 19, 14, 0, }, /* 485 */ + { 19, 15, 0, }, /* 486 */ + { 19, 26, 0, }, /* 487 */ + { 70, 7, 0, }, /* 488 */ + { 66, 7, 0, }, /* 489 */ + { 41, 7, 0, }, /* 490 */ + { 41, 15, 0, }, /* 491 */ + { 18, 7, 0, }, /* 492 */ + { 18, 14, 0, }, /* 493 */ + { 59, 7, 0, }, /* 494 */ + { 59, 21, 0, }, /* 495 */ + { 42, 7, 0, }, /* 496 */ + { 42, 21, 0, }, /* 497 */ + { 42, 14, 0, }, /* 498 */ + { 13, 9, 40, }, /* 499 */ + { 13, 5, -40, }, /* 500 */ + { 46, 7, 0, }, /* 501 */ + { 44, 7, 0, }, /* 502 */ + { 44, 13, 0, }, /* 503 */ + { 11, 7, 0, }, /* 504 */ + { 80, 7, 0, }, /* 505 */ + { 80, 21, 0, }, /* 506 */ + { 80, 15, 0, }, /* 507 */ + { 65, 7, 0, }, /* 508 */ + { 65, 15, 0, }, /* 509 */ + { 65, 21, 0, }, /* 510 */ + { 71, 7, 0, }, /* 511 */ + { 71, 21, 0, }, /* 512 */ + { 97, 7, 0, }, /* 513 */ + { 96, 7, 0, }, /* 514 */ + { 30, 7, 0, }, /* 515 */ + { 30, 12, 0, }, /* 516 */ + { 30, 15, 0, }, /* 517 */ + { 30, 21, 0, }, /* 518 */ + { 87, 7, 0, }, /* 519 */ + { 87, 15, 0, }, /* 520 */ + { 87, 21, 0, }, /* 521 */ + { 77, 7, 0, }, /* 522 */ + { 77, 21, 0, }, /* 523 */ + { 82, 7, 0, }, /* 524 */ + { 82, 15, 0, }, /* 525 */ + { 81, 7, 0, }, /* 526 */ + { 81, 15, 0, }, /* 527 */ + { 88, 7, 0, }, /* 528 */ + { 0, 15, 0, }, /* 529 */ + { 93, 10, 0, }, /* 530 */ + { 93, 12, 0, }, /* 531 */ + { 93, 7, 0, }, /* 532 */ + { 93, 21, 0, }, /* 533 */ + { 93, 15, 0, }, /* 534 */ + { 93, 13, 0, }, /* 535 */ + { 84, 12, 0, }, /* 536 */ + { 84, 10, 0, }, /* 537 */ + { 84, 7, 0, }, /* 538 */ + { 84, 21, 0, }, /* 539 */ + { 84, 1, 0, }, /* 540 */ + { 100, 7, 0, }, /* 541 */ + { 100, 13, 0, }, /* 542 */ + { 95, 12, 0, }, /* 543 */ + { 95, 7, 0, }, /* 544 */ + { 95, 10, 0, }, /* 545 */ + { 95, 13, 0, }, /* 546 */ + { 95, 21, 0, }, /* 547 */ + { 99, 12, 0, }, /* 548 */ + { 99, 10, 0, }, /* 549 */ + { 99, 7, 0, }, /* 550 */ + { 99, 21, 0, }, /* 551 */ + { 99, 13, 0, }, /* 552 */ + { 101, 7, 0, }, /* 553 */ + { 101, 12, 0, }, /* 554 */ + { 101, 10, 0, }, /* 555 */ + { 101, 13, 0, }, /* 556 */ + { 62, 7, 0, }, /* 557 */ + { 62, 14, 0, }, /* 558 */ + { 62, 21, 0, }, /* 559 */ + { 79, 7, 0, }, /* 560 */ + { 98, 7, 0, }, /* 561 */ + { 98, 10, 0, }, /* 562 */ + { 98, 12, 0, }, /* 563 */ + { 98, 6, 0, }, /* 564 */ + { 19, 12, 0, }, /* 565 */ + { 26, 26, 0, }, /* 566 */ }; -const uschar _pcre_ucd_stage1[] = { /* 8704 bytes */ +const pcre_uint8 PRIV(ucd_stage1)[] = { /* 8704 bytes */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* U+0000 */ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* U+0800 */ 32, 33, 34, 34, 35, 36, 37, 38, 39, 40, 40, 40, 41, 42, 43, 44, /* U+1000 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, /* U+1800 */ - 61, 62, 63, 64, 65, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, /* U+2000 */ - 76, 76, 65, 77, 65, 65, 78, 17, 79, 80, 81, 82, 83, 84, 85, 86, /* U+2800 */ + 61, 62, 63, 64, 65, 65, 66, 67, 68, 69, 70, 71, 72, 70, 73, 74, /* U+2000 */ + 75, 75, 65, 76, 65, 65, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, /* U+2800 */ 87, 88, 89, 90, 91, 92, 93, 70, 94, 94, 94, 94, 94, 94, 94, 94, /* U+3000 */ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, /* U+3800 */ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, /* U+4000 */ @@ -573,49 +622,49 @@ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, /* U+9000 */ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 96, /* U+9800 */ 97, 98, 98, 98, 98, 98, 98, 98, 98, 99,100,100,101,102,103,104, /* U+A000 */ -105,106,107,108,109,110, 17,111, 34, 34, 34, 34, 34, 34, 34, 34, /* U+A800 */ +105,106,107,108,109,110,111,112, 34, 34, 34, 34, 34, 34, 34, 34, /* U+A800 */ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, /* U+B000 */ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, /* U+B800 */ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, /* U+C000 */ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, /* U+C800 */ - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,112, /* U+D000 */ -113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113, /* U+D800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+E000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+E800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F000 */ -114,114, 94, 94,115,116,117,118,119,119,120,121,122,123,124,125, /* U+F800 */ -126,127,128,129, 17,130,131,132,133,134, 17, 17, 17, 17, 17, 17, /* U+10000 */ -135, 17,136, 17,137, 17,138, 17,139, 17, 17, 17,140, 17, 17, 17, /* U+10800 */ - 17,141, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+11000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+11800 */ -142,142,142,142,142,142,143, 17,144, 17, 17, 17, 17, 17, 17, 17, /* U+12000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+12800 */ -145,145,145,145,145,145,145,145,146, 17, 17, 17, 17, 17, 17, 17, /* U+13000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+13800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+14000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+14800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+15000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+15800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+16000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+16800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+17000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+17800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+18000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+18800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+19000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+19800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+1A000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+1A800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+1B000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+1B800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+1C000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+1C800 */ - 70,147,148,149,150, 17,151, 17,152,153,154,155,156,157,158,159, /* U+1D000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+1D800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+1E000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+1E800 */ -160,161,162,163,164, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+1F000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+1F800 */ + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,113, /* U+D000 */ +114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+D800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+E000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+E800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F000 */ +115,115, 94, 94,116,117,118,119,120,120,121,122,123,124,125,126, /* U+F800 */ +127,128,129,130, 78,131,132,133,134,135, 78, 78, 78, 78, 78, 78, /* U+10000 */ +136, 78,137,138,139, 78,140, 78,141, 78, 78, 78,142, 78, 78, 78, /* U+10800 */ +143,144,145,146, 78, 78, 78, 78, 78, 78, 78, 78, 78,147, 78, 78, /* U+11000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+11800 */ +148,148,148,148,148,148,149, 78,150, 78, 78, 78, 78, 78, 78, 78, /* U+12000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+12800 */ +151,151,151,151,151,151,151,151,152, 78, 78, 78, 78, 78, 78, 78, /* U+13000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+13800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+14000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+14800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+15000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+15800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+16000 */ +153,153,153,153,154, 78, 78, 78, 78, 78, 78, 78, 78, 78,155,156, /* U+16800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+17000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+17800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+18000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+18800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+19000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+19800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+1A000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+1A800 */ +157, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+1B000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+1B800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+1C000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+1C800 */ + 70,158,159,160,161, 78,162, 78,163,164,165,166,167,168,169,170, /* U+1D000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+1D800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+1E000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,171,172, 78, 78, /* U+1E800 */ +173,174,175,176,177, 78,178,179,180,181,182,183,184,185,186, 78, /* U+1F000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+1F800 */ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, /* U+20000 */ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, /* U+20800 */ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, /* U+21000 */ @@ -636,469 +685,469 @@ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, /* U+28800 */ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, /* U+29000 */ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, /* U+29800 */ - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,165, 94, 94, /* U+2A000 */ + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,187, 94, 94, /* U+2A000 */ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, /* U+2A800 */ - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,166, 17, /* U+2B000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+2B800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+2C000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+2C800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+2D000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+2D800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+2E000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+2E800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+2F000 */ - 94, 94, 94, 94,167, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+2F800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+30000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+30800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+31000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+31800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+32000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+32800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+33000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+33800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+34000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+34800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+35000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+35800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+36000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+36800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+37000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+37800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+38000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+38800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+39000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+39800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3A000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3A800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3B000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3B800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3C000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3C800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3D000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3D800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3E000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3E800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3F000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+3F800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+40000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+40800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+41000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+41800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+42000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+42800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+43000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+43800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+44000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+44800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+45000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+45800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+46000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+46800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+47000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+47800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+48000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+48800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+49000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+49800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4A000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4A800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4B000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4B800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4C000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4C800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4D000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4D800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4E000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4E800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4F000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+4F800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+50000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+50800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+51000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+51800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+52000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+52800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+53000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+53800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+54000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+54800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+55000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+55800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+56000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+56800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+57000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+57800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+58000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+58800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+59000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+59800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5A000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5A800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5B000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5B800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5C000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5C800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5D000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5D800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5E000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5E800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5F000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+5F800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+60000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+60800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+61000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+61800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+62000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+62800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+63000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+63800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+64000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+64800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+65000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+65800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+66000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+66800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+67000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+67800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+68000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+68800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+69000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+69800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6A000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6A800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6B000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6B800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6C000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6C800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6D000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6D800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6E000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6E800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6F000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+6F800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+70000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+70800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+71000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+71800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+72000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+72800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+73000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+73800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+74000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+74800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+75000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+75800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+76000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+76800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+77000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+77800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+78000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+78800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+79000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+79800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7A000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7A800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7B000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7B800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7C000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7C800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7D000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7D800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7E000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7E800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7F000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+7F800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+80000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+80800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+81000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+81800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+82000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+82800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+83000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+83800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+84000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+84800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+85000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+85800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+86000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+86800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+87000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+87800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+88000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+88800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+89000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+89800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8A000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8A800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8B000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8B800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8C000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8C800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8D000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8D800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8E000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8E800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8F000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+8F800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+90000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+90800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+91000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+91800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+92000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+92800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+93000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+93800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+94000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+94800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+95000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+95800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+96000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+96800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+97000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+97800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+98000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+98800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+99000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+99800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9A000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9A800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9B000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9B800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9C000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9C800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9D000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9D800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9E000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9E800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9F000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+9F800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A0000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A0800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A1000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A1800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A2000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A2800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A3000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A3800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A4000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A4800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A5000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A5800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A6000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A6800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A7000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A7800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A8000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A8800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A9000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+A9800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AA000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AA800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AB000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AB800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AC000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AC800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AD000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AD800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AE000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AE800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AF000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+AF800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B0000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B0800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B1000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B1800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B2000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B2800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B3000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B3800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B4000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B4800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B5000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B5800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B6000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B6800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B7000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B7800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B8000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B8800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B9000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+B9800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BA000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BA800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BB000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BB800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BC000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BC800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BD000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BD800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BE000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BE800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BF000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+BF800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C0000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C0800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C1000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C1800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C2000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C2800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C3000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C3800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C4000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C4800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C5000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C5800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C6000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C6800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C7000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C7800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C8000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C8800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C9000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+C9800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CA000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CA800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CB000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CB800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CC000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CC800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CD000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CD800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CE000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CE800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CF000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+CF800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D0000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D0800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D1000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D1800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D2000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D2800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D3000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D3800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D4000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D4800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D5000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D5800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D6000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D6800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D7000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D7800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D8000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D8800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D9000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+D9800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DA000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DA800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DB000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DB800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DC000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DC800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DD000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DD800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DE000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DE800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DF000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+DF800 */ -168, 17,169,170, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E0000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E0800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E1000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E1800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E2000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E2800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E3000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E3800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E4000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E4800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E5000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E5800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E6000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E6800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E7000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E7800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E8000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E8800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E9000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+E9800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+EA000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+EA800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+EB000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+EB800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+EC000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+EC800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+ED000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+ED800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+EE000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+EE800 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+EF000 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* U+EF800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F0000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F0800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F1000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F1800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F2000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F2800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F3000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F3800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F4000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F4800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F5000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F5800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F6000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F6800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F7000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F7800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F8000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F8800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F9000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+F9800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+FA000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+FA800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+FB000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+FB800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+FC000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+FC800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+FD000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+FD800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+FE000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+FE800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+FF000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,171, /* U+FF800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+100000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+100800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+101000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+101800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+102000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+102800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+103000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+103800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+104000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+104800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+105000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+105800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+106000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+106800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+107000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+107800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+108000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+108800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+109000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+109800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+10A000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+10A800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+10B000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+10B800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+10C000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+10C800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+10D000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+10D800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+10E000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+10E800 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114, /* U+10F000 */ -114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,171, /* U+10F800 */ + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,188, 94, /* U+2B000 */ +189, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+2B800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+2C000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+2C800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+2D000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+2D800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+2E000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+2E800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+2F000 */ + 94, 94, 94, 94,189, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+2F800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+30000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+30800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+31000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+31800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+32000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+32800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+33000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+33800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+34000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+34800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+35000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+35800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+36000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+36800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+37000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+37800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+38000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+38800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+39000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+39800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3A000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3A800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3B000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3B800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3C000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3C800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3D000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3D800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3E000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3E800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3F000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+3F800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+40000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+40800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+41000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+41800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+42000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+42800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+43000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+43800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+44000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+44800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+45000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+45800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+46000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+46800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+47000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+47800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+48000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+48800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+49000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+49800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4A000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4A800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4B000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4B800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4C000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4C800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4D000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4D800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4E000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4E800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4F000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+4F800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+50000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+50800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+51000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+51800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+52000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+52800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+53000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+53800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+54000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+54800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+55000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+55800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+56000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+56800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+57000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+57800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+58000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+58800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+59000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+59800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5A000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5A800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5B000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5B800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5C000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5C800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5D000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5D800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5E000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5E800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5F000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+5F800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+60000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+60800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+61000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+61800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+62000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+62800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+63000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+63800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+64000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+64800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+65000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+65800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+66000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+66800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+67000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+67800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+68000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+68800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+69000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+69800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6A000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6A800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6B000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6B800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6C000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6C800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6D000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6D800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6E000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6E800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6F000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+6F800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+70000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+70800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+71000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+71800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+72000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+72800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+73000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+73800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+74000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+74800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+75000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+75800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+76000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+76800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+77000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+77800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+78000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+78800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+79000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+79800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7A000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7A800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7B000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7B800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7C000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7C800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7D000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7D800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7E000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7E800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7F000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+7F800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+80000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+80800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+81000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+81800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+82000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+82800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+83000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+83800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+84000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+84800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+85000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+85800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+86000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+86800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+87000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+87800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+88000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+88800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+89000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+89800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8A000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8A800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8B000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8B800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8C000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8C800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8D000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8D800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8E000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8E800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8F000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+8F800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+90000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+90800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+91000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+91800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+92000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+92800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+93000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+93800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+94000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+94800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+95000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+95800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+96000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+96800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+97000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+97800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+98000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+98800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+99000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+99800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9A000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9A800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9B000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9B800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9C000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9C800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9D000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9D800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9E000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9E800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9F000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+9F800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A0000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A0800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A1000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A1800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A2000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A2800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A3000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A3800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A4000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A4800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A5000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A5800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A6000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A6800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A7000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A7800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A8000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A8800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A9000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+A9800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AA000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AA800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AB000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AB800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AC000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AC800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AD000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AD800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AE000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AE800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AF000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+AF800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B0000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B0800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B1000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B1800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B2000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B2800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B3000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B3800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B4000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B4800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B5000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B5800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B6000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B6800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B7000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B7800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B8000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B8800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B9000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+B9800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BA000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BA800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BB000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BB800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BC000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BC800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BD000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BD800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BE000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BE800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BF000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+BF800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C0000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C0800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C1000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C1800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C2000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C2800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C3000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C3800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C4000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C4800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C5000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C5800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C6000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C6800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C7000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C7800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C8000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C8800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C9000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+C9800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CA000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CA800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CB000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CB800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CC000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CC800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CD000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CD800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CE000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CE800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CF000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+CF800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D0000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D0800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D1000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D1800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D2000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D2800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D3000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D3800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D4000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D4800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D5000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D5800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D6000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D6800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D7000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D7800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D8000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D8800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D9000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+D9800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DA000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DA800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DB000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DB800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DC000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DC800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DD000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DD800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DE000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DE800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DF000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+DF800 */ +190, 78,191,192, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E0000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E0800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E1000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E1800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E2000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E2800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E3000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E3800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E4000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E4800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E5000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E5800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E6000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E6800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E7000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E7800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E8000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E8800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E9000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+E9800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+EA000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+EA800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+EB000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+EB800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+EC000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+EC800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+ED000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+ED800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+EE000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+EE800 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+EF000 */ + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, /* U+EF800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F0000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F0800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F1000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F1800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F2000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F2800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F3000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F3800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F4000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F4800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F5000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F5800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F6000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F6800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F7000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F7800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F8000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F8800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F9000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+F9800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+FA000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+FA800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+FB000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+FB800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+FC000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+FC800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+FD000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+FD800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+FE000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+FE800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+FF000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,193, /* U+FF800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+100000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+100800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+101000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+101800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+102000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+102800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+103000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+103800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+104000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+104800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+105000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+105800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+106000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+106800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+107000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+107800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+108000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+108800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+109000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+109800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+10A000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+10A800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+10B000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+10B800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+10C000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+10C800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+10D000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+10D800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+10E000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+10E800 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, /* U+10F000 */ +115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,193, /* U+10F800 */ }; -const pcre_uint16 _pcre_ucd_stage2[] = { /* 44032 bytes, block = 128 */ +const pcre_uint16 PRIV(ucd_stage2)[] = { /* 49664 bytes, block = 128 */ /* block 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1112,635 +1161,635 @@ /* block 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 3, 3, 3, 3, 13, 13, 10, 13, 14, 15, 6, 16, 13, 10, - 13, 6, 17, 17, 10, 18, 13, 2, 10, 17, 14, 19, 17, 17, 17, 2, + 1, 2, 3, 3, 3, 3, 13, 2, 10, 13, 14, 15, 6, 16, 13, 10, + 13, 6, 17, 17, 10, 18, 2, 2, 10, 17, 14, 19, 17, 17, 17, 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 6, 9, 9, 9, 9, 9, 9, 9, 14, + 9, 9, 9, 9, 9, 9, 9, 6, 9, 9, 9, 9, 9, 9, 9, 20, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 6, 12, 12, 12, 12, 12, 12, 12, 20, + 12, 12, 12, 12, 12, 12, 12, 6, 12, 12, 12, 12, 12, 12, 12, 21, /* block 2 */ - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 23, 24, 21, 22, 21, 22, 21, 22, 14, 21, 22, 21, 22, 21, 22, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 14, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 25, 21, 22, 21, 22, 21, 22, 26, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 24, 25, 22, 23, 22, 23, 22, 23, 20, 22, 23, 22, 23, 22, 23, 22, + 23, 22, 23, 22, 23, 22, 23, 22, 23, 20, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 26, 22, 23, 22, 23, 22, 23, 27, /* block 3 */ - 27, 28, 21, 22, 21, 22, 29, 21, 22, 30, 30, 21, 22, 14, 31, 32, - 33, 21, 22, 30, 34, 35, 36, 37, 21, 22, 38, 14, 36, 39, 40, 41, - 21, 22, 21, 22, 21, 22, 42, 21, 22, 42, 14, 14, 21, 22, 42, 21, - 22, 43, 43, 21, 22, 21, 22, 44, 21, 22, 14, 45, 21, 22, 14, 46, - 45, 45, 45, 45, 47, 48, 49, 47, 48, 49, 47, 48, 49, 21, 22, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 50, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 14, 47, 48, 49, 21, 22, 51, 52, 21, 22, 21, 22, 21, 22, 21, 22, + 28, 29, 22, 23, 22, 23, 30, 22, 23, 31, 31, 22, 23, 20, 32, 33, + 34, 22, 23, 31, 35, 36, 37, 38, 22, 23, 39, 20, 37, 40, 41, 42, + 22, 23, 22, 23, 22, 23, 43, 22, 23, 43, 20, 20, 22, 23, 43, 22, + 23, 44, 44, 22, 23, 22, 23, 45, 22, 23, 20, 14, 22, 23, 20, 46, + 14, 14, 14, 14, 47, 48, 49, 47, 48, 49, 47, 48, 49, 22, 23, 22, + 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 50, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 20, 47, 48, 49, 22, 23, 51, 52, 22, 23, 22, 23, 22, 23, 22, 23, /* block 4 */ - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 53, 14, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 14, 14, 14, 14, 14, 14, 54, 21, 22, 55, 56, 57, - 57, 21, 22, 58, 59, 60, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 61, 62, 63, 64, 65, 14, 66, 66, 14, 67, 14, 68, 14, 14, 14, 14, - 66, 14, 14, 69, 14, 14, 14, 14, 70, 71, 14, 72, 14, 14, 14, 71, - 14, 73, 74, 14, 14, 75, 14, 14, 14, 14, 14, 14, 14, 76, 14, 14, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 53, 20, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 20, 20, 20, 20, 20, 20, 54, 22, 23, 55, 56, 57, + 57, 22, 23, 58, 59, 60, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 61, 62, 63, 64, 65, 20, 66, 66, 20, 67, 20, 68, 20, 20, 20, 20, + 66, 20, 20, 69, 20, 70, 71, 20, 72, 73, 20, 74, 20, 20, 20, 73, + 20, 75, 76, 20, 20, 77, 20, 20, 20, 20, 20, 20, 20, 78, 20, 20, /* block 5 */ - 77, 14, 14, 77, 14, 14, 14, 14, 77, 78, 79, 79, 80, 14, 14, 14, - 14, 14, 81, 14, 45, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 10, 10, 10, 10, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 82, 82, 82, 82, 82, 10, 10, 10, 10, 10, 10, 10, 83, 10, 83, 10, + 79, 20, 20, 79, 20, 20, 20, 20, 79, 80, 81, 81, 82, 20, 20, 20, + 20, 20, 83, 20, 14, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 10, 10, 10, 10, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 84, 84, 84, 84, 84, 10, 10, 10, 10, 10, 86, 86, 85, 10, 85, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, /* block 6 */ - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 85, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 86, 87, 86, 87, 83, 88, 86, 87, 89, 89, 90, 91, 91, 91, 2, 89, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 88, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 89, 90, 89, 90, 85, 91, 89, 90, 92, 92, 93, 94, 94, 94, 2, 92, /* block 7 */ - 89, 89, 89, 89, 88, 10, 92, 2, 93, 93, 93, 89, 94, 89, 95, 95, - 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 89, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 99, 99, 99, - 96,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100, -100,100,101,100,100,100,100,100,100,100,100,100,102,103,103,104, -105,106,107,107,107,108,109,110, 86, 87, 86, 87, 86, 87, 86, 87, - 86, 87,111,112,111,112,111,112,111,112,111,112,111,112,111,112, -113,114,115, 96,116,117,118, 86, 87,119, 86, 87, 96,120,120,120, + 92, 92, 92, 92, 91, 10, 95, 2, 96, 96, 96, 92, 97, 92, 98, 98, + 99,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100, +100,100, 92,100,100,100,100,100,100,100,100,100,101,102,102,102, + 99,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103, +103,103,104,103,103,103,103,103,103,103,103,103,105,106,106,107, +108,109,110,110,110,111,112,113, 89, 90, 89, 90, 89, 90, 89, 90, + 89, 90,114,115,114,115,114,115,114,115,114,115,114,115,114,115, +116,117,118, 99,119,120,121, 89, 90,122, 89, 90, 99,123,123,123, /* block 8 */ -121,121,121,121,121,121,121,121,121,121,121,121,121,121,121,121, -122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122, -122,122,122,122,122,122,122,122,122,122,122,122,122,122,122,122, -123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, -123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, 124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, +126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126, +127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, /* block 9 */ -125,126,127,128,128, 84, 84,128,129,129,125,126,125,126,125,126, -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, -130,125,126,125,126,125,126,125,126,125,126,125,126,125,126,131, -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, +128,129,130,131,131, 87, 87,131,132,132,128,129,128,129,128,129, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, +133,128,129,128,129,128,129,128,129,128,129,128,129,128,129,134, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, /* block 10 */ -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, -125,126,125,126,125,126, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132, -132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132, -132,132,132,132,132,132,132, 89, 89,133,134,134,134,134,134,134, - 89,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, +128,129,128,129,128,129,128,129, 92, 92, 92, 92, 92, 92, 92, 92, + 92,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135, 135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135, +135,135,135,135,135,135,135, 92, 92,136,137,137,137,137,137,137, + 92,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138, +138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138, /* block 11 */ -135,135,135,135,135,135,135,136, 89, 2,137, 89, 89, 89, 89, 89, - 89,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138, -138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138, -138,138,138,138,138,138,138,138,138,138,138,138,138,138,139,138, -140,138,138,140,138,138,140,138, 89, 89, 89, 89, 89, 89, 89, 89, -141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, -141,141,141,141,141,141,141,141,141,141,141, 89, 89, 89, 89, 89, -141,141,141,140,140, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +138,138,138,138,138,138,138,139, 92, 2,140, 92, 92, 92, 92,141, + 92,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, +142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, +142,142,142,142,142,142,142,142,142,142,142,142,142,142,143,142, +144,142,142,144,142,142,144,142, 92, 92, 92, 92, 92, 92, 92, 92, +145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145, +145,145,145,145,145,145,145,145,145,145,145, 92, 92, 92, 92, 92, +145,145,145,144,144, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 12 */ - 16, 16, 16, 16, 89, 89,142,142,142,143,143,144, 2,143,145,145, -146,146,146,146,146,146,146,146,146,146,146, 2, 89, 89,143, 2, - 89,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, - 83,147,147,147,147,147,147,147,147,147,147, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84,146,146,146,146,146,146,146,146,146, 89, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,143,143,143,143,147,147, - 84,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, +146,146,146,146,146, 92,147,147,147,148,148,149, 2,148,150,150, +151,151,151,151,151,151,151,151,151,151,151, 2, 92, 92,148, 2, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, + 85,152,152,152,152,152,152,152,152,152,152, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87,151,151,151,151,151,151,151,151,151, 87, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,148,148,148,148,152,152, + 87,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, /* block 13 */ -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,143,147,146,146,146,146,146,146,146, 16,148,146, -146,146,146,146,146,149,149,146,146,145,146,146,146,146,147,147, -150,150,150,150,150,150,150,150,150,150,147,147,147,145,145,147, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,148,152,151,151,151,151,151,151,151, 16,150,151, +151,151,151,151,151,153,153,151,151,150,151,151,151,151,152,152, +154,154,154,154,154,154,154,154,154,154,152,152,152,150,150,152, /* block 14 */ -151,151,151,151,151,151,151,151,151,151,151,151,151,151, 89,152, -153,154,153,153,153,153,153,153,153,153,153,153,153,153,153,153, -153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153, -154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154, -154,154,154,154,154,154,154,154,154,154,154, 89, 89,153,153,153, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, +155,155,155,155,155,155,155,155,155,155,155,155,155,155, 92,156, +157,158,157,157,157,157,157,157,157,157,157,157,157,157,157,157, +157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157, +158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158, +158,158,158,158,158,158,158,158,158,158,158, 92, 92,157,157,157, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, /* block 15 */ -155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155, -155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155, -155,155,155,155,155,155,156,156,156,156,156,156,156,156,156,156, -156,155, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -157,157,157,157,157,157,157,157,157,157,158,158,158,158,158,158, -158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158, -158,158,158,158,158,158,158,158,158,158,158,159,159,159,159,159, -159,159,159,159,160,160,161,162,162,162,160, 89, 89, 89, 89, 89, +159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159, +159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159, +159,159,159,159,159,159,160,160,160,160,160,160,160,160,160,160, +160,159, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +161,161,161,161,161,161,161,161,161,161,162,162,162,162,162,162, +162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162, +162,162,162,162,162,162,162,162,162,162,162,163,163,163,163,163, +163,163,163,163,164,164,165,166,166,166,164, 92, 92, 92, 92, 92, /* block 16 */ -163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, -163,163,163,163,163,163,164,164,164,164,165,164,164,164,164,164, -164,164,164,164,165,164,164,164,165,164,164,164,164,164, 89, 89, -166,166,166,166,166,166,166,166,166,166,166,166,166,166,166, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, +167,167,167,167,167,167,168,168,168,168,169,168,168,168,168,168, +168,168,168,168,169,168,168,168,169,168,168,168,168,168, 92, 92, +170,170,170,170,170,170,170,170,170,170,170,170,170,170,170, 92, +171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171, +171,171,171,171,171,171,171,171,171,172,172,172, 92, 92,173, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 17 */ - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +152, 92,152,152,152,152,152,152,152,152,152,152,152, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92,151,151,151,151,151,151,151,151,151,151,151,151, +151,151,151,151,151,151,151,151,151,151,151,151,151,151,151, 92, /* block 18 */ -167,167,167,168,169,169,169,169,169,169,169,169,169,169,169,169, -169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169, -169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169, -169,169,169,169,169,169,169,169,169,169, 89, 89,167,169,168,168, -168,167,167,167,167,167,167,167,167,168,168,168,168,167,168, 89, -169, 84, 84,167,167,167, 89, 89,169,169,169,169,169,169,169,169, -169,169,167,167, 2, 2,170,170,170,170,170,170,170,170,170,170, - 2,171,169, 89, 89, 89, 89, 89, 89,169,169,169,169,169,169,169, +174,174,174,175,176,176,176,176,176,176,176,176,176,176,176,176, +176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, +176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, +176,176,176,176,176,176,176,176,176,176,174,175,174,176,175,175, +175,174,174,174,174,174,174,174,174,175,175,175,175,174,175,175, +176, 87, 87,174,174,174,174,174,176,176,176,176,176,176,176,176, +176,176,174,174, 2, 2,177,177,177,177,177,177,177,177,177,177, +178,179,176,176,176,176,176,176, 92,176,176,176,176,176,176,176, /* block 19 */ - 89,172,173,173, 89,174,174,174,174,174,174,174,174, 89, 89,174, -174, 89, 89,174,174,174,174,174,174,174,174,174,174,174,174,174, -174,174,174,174,174,174,174,174,174, 89,174,174,174,174,174,174, -174, 89,174, 89, 89, 89,174,174,174,174, 89, 89,172,174,173,173, -173,172,172,172,172, 89, 89,173,173, 89, 89,173,173,172,174, 89, - 89, 89, 89, 89, 89, 89, 89,173, 89, 89, 89, 89,174,174, 89,174, -174,174,172,172, 89, 89,175,175,175,175,175,175,175,175,175,175, -174,174,176,176,177,177,177,177,177,177,178,176, 89, 89, 89, 89, + 92,180,181,181, 92,182,182,182,182,182,182,182,182, 92, 92,182, +182, 92, 92,182,182,182,182,182,182,182,182,182,182,182,182,182, +182,182,182,182,182,182,182,182,182, 92,182,182,182,182,182,182, +182, 92,182, 92, 92, 92,182,182,182,182, 92, 92,180,182,181,181, +181,180,180,180,180, 92, 92,181,181, 92, 92,181,181,180,182, 92, + 92, 92, 92, 92, 92, 92, 92,181, 92, 92, 92, 92,182,182, 92,182, +182,182,180,180, 92, 92,183,183,183,183,183,183,183,183,183,183, +182,182,184,184,185,185,185,185,185,185,186,184, 92, 92, 92, 92, /* block 20 */ - 89,179,179,180, 89,181,181,181,181,181,181, 89, 89, 89, 89,181, -181, 89, 89,181,181,181,181,181,181,181,181,181,181,181,181,181, -181,181,181,181,181,181,181,181,181, 89,181,181,181,181,181,181, -181, 89,181,181, 89,181,181, 89,181,181, 89, 89,179, 89,180,180, -180,179,179, 89, 89, 89, 89,179,179, 89, 89,179,179,179, 89, 89, - 89,179, 89, 89, 89, 89, 89, 89, 89,181,181,181,181, 89,181, 89, - 89, 89, 89, 89, 89, 89,182,182,182,182,182,182,182,182,182,182, -179,179,181,181,181,179, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 92,187,187,188, 92,189,189,189,189,189,189, 92, 92, 92, 92,189, +189, 92, 92,189,189,189,189,189,189,189,189,189,189,189,189,189, +189,189,189,189,189,189,189,189,189, 92,189,189,189,189,189,189, +189, 92,189,189, 92,189,189, 92,189,189, 92, 92,187, 92,188,188, +188,187,187, 92, 92, 92, 92,187,187, 92, 92,187,187,187, 92, 92, + 92,187, 92, 92, 92, 92, 92, 92, 92,189,189,189,189, 92,189, 92, + 92, 92, 92, 92, 92, 92,190,190,190,190,190,190,190,190,190,190, +187,187,189,189,189,187, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 21 */ - 89,183,183,184, 89,185,185,185,185,185,185,185,185,185, 89,185, -185,185, 89,185,185,185,185,185,185,185,185,185,185,185,185,185, -185,185,185,185,185,185,185,185,185, 89,185,185,185,185,185,185, -185, 89,185,185, 89,185,185,185,185,185, 89, 89,183,185,184,184, -184,183,183,183,183,183, 89,183,183,184, 89,184,184,183, 89, 89, -185, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -185,185,183,183, 89, 89,186,186,186,186,186,186,186,186,186,186, - 89,187, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 92,191,191,192, 92,193,193,193,193,193,193,193,193,193, 92,193, +193,193, 92,193,193,193,193,193,193,193,193,193,193,193,193,193, +193,193,193,193,193,193,193,193,193, 92,193,193,193,193,193,193, +193, 92,193,193, 92,193,193,193,193,193, 92, 92,191,193,192,192, +192,191,191,191,191,191, 92,191,191,192, 92,192,192,191, 92, 92, +193, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +193,193,191,191, 92, 92,194,194,194,194,194,194,194,194,194,194, +195,196, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 22 */ - 89,188,189,189, 89,190,190,190,190,190,190,190,190, 89, 89,190, -190, 89, 89,190,190,190,190,190,190,190,190,190,190,190,190,190, -190,190,190,190,190,190,190,190,190, 89,190,190,190,190,190,190, -190, 89,190,190, 89,190,190,190,190,190, 89, 89,188,190,189,188, -189,188,188,188,188, 89, 89,189,189, 89, 89,189,189,188, 89, 89, - 89, 89, 89, 89, 89, 89,188,189, 89, 89, 89, 89,190,190, 89,190, -190,190,188,188, 89, 89,191,191,191,191,191,191,191,191,191,191, -192,190, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 92,197,198,198, 92,199,199,199,199,199,199,199,199, 92, 92,199, +199, 92, 92,199,199,199,199,199,199,199,199,199,199,199,199,199, +199,199,199,199,199,199,199,199,199, 92,199,199,199,199,199,199, +199, 92,199,199, 92,199,199,199,199,199, 92, 92,197,199,198,197, +198,197,197,197,197, 92, 92,198,198, 92, 92,198,198,197, 92, 92, + 92, 92, 92, 92, 92, 92,197,198, 92, 92, 92, 92,199,199, 92,199, +199,199,197,197, 92, 92,200,200,200,200,200,200,200,200,200,200, +201,199,202,202,202,202,202,202, 92, 92, 92, 92, 92, 92, 92, 92, /* block 23 */ - 89, 89,193,194, 89,194,194,194,194,194,194, 89, 89, 89,194,194, -194, 89,194,194,194,194, 89, 89, 89,194,194, 89,194, 89,194,194, - 89, 89, 89,194,194, 89, 89, 89,194,194,194, 89, 89, 89,194,194, -194,194,194,194,194,194,194,194,194,194, 89, 89, 89, 89,195,195, -193,195,195, 89, 89, 89,195,195,195, 89,195,195,195,193, 89, 89, -194, 89, 89, 89, 89, 89, 89,195, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89,196,196,196,196,196,196,196,196,196,196, -197,197,197,198,198,198,198,198,198,199,198, 89, 89, 89, 89, 89, + 92, 92,203,204, 92,204,204,204,204,204,204, 92, 92, 92,204,204, +204, 92,204,204,204,204, 92, 92, 92,204,204, 92,204, 92,204,204, + 92, 92, 92,204,204, 92, 92, 92,204,204,204, 92, 92, 92,204,204, +204,204,204,204,204,204,204,204,204,204, 92, 92, 92, 92,205,205, +203,205,205, 92, 92, 92,205,205,205, 92,205,205,205,203, 92, 92, +204, 92, 92, 92, 92, 92, 92,205, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92,206,206,206,206,206,206,206,206,206,206, +207,207,207,208,208,208,208,208,208,209,208, 92, 92, 92, 92, 92, /* block 24 */ - 89,200,200,200, 89,201,201,201,201,201,201,201,201, 89,201,201, -201, 89,201,201,201,201,201,201,201,201,201,201,201,201,201,201, -201,201,201,201,201,201,201,201,201, 89,201,201,201,201,201,201, -201,201,201,201, 89,201,201,201,201,201, 89, 89, 89,201,202,202, -202,200,200,200,200, 89,202,202,202, 89,202,202,202,202, 89, 89, - 89, 89, 89, 89, 89,202,202, 89,201,201, 89, 89, 89, 89, 89, 89, -201,201,202,202, 89, 89,203,203,203,203,203,203,203,203,203,203, - 89, 89, 89, 89, 89, 89, 89, 89,204,204,204,204,204,204,204,205, + 92,210,210,210, 92,211,211,211,211,211,211,211,211, 92,211,211, +211, 92,211,211,211,211,211,211,211,211,211,211,211,211,211,211, +211,211,211,211,211,211,211,211,211, 92,211,211,211,211,211,211, +211,211,211,211, 92,211,211,211,211,211, 92, 92, 92,211,212,212, +212,210,210,210,210, 92,212,212,212, 92,212,212,212,212, 92, 92, + 92, 92, 92, 92, 92,212,212, 92,211,211, 92, 92, 92, 92, 92, 92, +211,211,212,212, 92, 92,213,213,213,213,213,213,213,213,213,213, + 92, 92, 92, 92, 92, 92, 92, 92,214,214,214,214,214,214,214,215, /* block 25 */ - 89, 89,206,206, 89,207,207,207,207,207,207,207,207, 89,207,207, -207, 89,207,207,207,207,207,207,207,207,207,207,207,207,207,207, -207,207,207,207,207,207,207,207,207, 89,207,207,207,207,207,207, -207,207,207,207, 89,207,207,207,207,207, 89, 89,208,207,206,208, -206,206,206,206,206, 89,208,206,206, 89,206,206,208,208, 89, 89, - 89, 89, 89, 89, 89,206,206, 89, 89, 89, 89, 89, 89, 89,207, 89, -207,207,208,208, 89, 89,209,209,209,209,209,209,209,209,209,209, - 89, 13, 13, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 92, 92,216,216, 92,217,217,217,217,217,217,217,217, 92,217,217, +217, 92,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217, 92,217,217,217,217,217,217, +217,217,217,217, 92,217,217,217,217,217, 92, 92,218,217,216,218, +216,216,216,216,216, 92,218,216,216, 92,216,216,218,218, 92, 92, + 92, 92, 92, 92, 92,216,216, 92, 92, 92, 92, 92, 92, 92,217, 92, +217,217,218,218, 92, 92,219,219,219,219,219,219,219,219,219,219, + 92,217,217, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 26 */ - 89, 89,210,210, 89,211,211,211,211,211,211,211,211, 89,211,211, -211, 89,211,211,211,211,211,211,211,211,211,211,211,211,211,211, -211,211,211,211,211,211,211,211,211, 89,211,211,211,211,211,211, -211,211,211,211,211,211,211,211,211,211, 89, 89, 89,211,210,210, -210,212,212,212,212, 89,210,210,210, 89,210,210,210,212, 89, 89, - 89, 89, 89, 89, 89, 89, 89,210, 89, 89, 89, 89, 89, 89, 89, 89, -211,211,212,212, 89, 89,213,213,213,213,213,213,213,213,213,213, -214,214,214,214,214,214, 89, 89, 89,215,211,211,211,211,211,211, + 92, 92,220,220, 92,221,221,221,221,221,221,221,221, 92,221,221, +221, 92,221,221,221,221,221,221,221,221,221,221,221,221,221,221, +221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221, +221,221,221,221,221,221,221,221,221,221,221, 92, 92,221,220,220, +220,222,222,222,222, 92,220,220,220, 92,220,220,220,222,221, 92, + 92, 92, 92, 92, 92, 92, 92,220, 92, 92, 92, 92, 92, 92, 92, 92, +221,221,222,222, 92, 92,223,223,223,223,223,223,223,223,223,223, +224,224,224,224,224,224, 92, 92, 92,225,221,221,221,221,221,221, /* block 27 */ - 89, 89,216,216, 89,217,217,217,217,217,217,217,217,217,217,217, -217,217,217,217,217,217,217, 89, 89, 89,217,217,217,217,217,217, -217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, -217,217, 89,217,217,217,217,217,217,217,217,217, 89,217, 89, 89, -217,217,217,217,217,217,217, 89, 89, 89,218, 89, 89, 89, 89,216, -216,216,218,218,218, 89,218, 89,216,216,216,216,216,216,216,216, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89,216,216,219, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 92, 92,226,226, 92,227,227,227,227,227,227,227,227,227,227,227, +227,227,227,227,227,227,227, 92, 92, 92,227,227,227,227,227,227, +227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227, +227,227, 92,227,227,227,227,227,227,227,227,227, 92,227, 92, 92, +227,227,227,227,227,227,227, 92, 92, 92,228, 92, 92, 92, 92,226, +226,226,228,228,228, 92,228, 92,226,226,226,226,226,226,226,226, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92,226,226,229, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 28 */ - 89,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220, -220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220, -220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220, -220,221,220,220,221,221,221,221,221,221,221, 89, 89, 89, 89, 3, -220,220,220,220,220,220,222,221,221,221,221,221,221,221,221,223, -224,224,224,224,224,224,224,224,224,224,223,223, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 92,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230, +230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230, +230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230, +230,231,230,230,231,231,231,231,231,231,231, 92, 92, 92, 92, 3, +230,230,230,230,230,230,232,231,231,231,231,231,231,231,231,233, +234,234,234,234,234,234,234,234,234,234,233,233, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 29 */ - 89,225,225, 89,225, 89, 89,225,225, 89,225, 89, 89,225, 89, 89, - 89, 89, 89, 89,225,225,225,225, 89,225,225,225,225,225,225,225, - 89,225,225,225, 89,225, 89,225, 89, 89,225,225, 89,225,225,225, -225,226,225,225,226,226,226,226,226,226, 89,226,226,225, 89, 89, -225,225,225,225,225, 89,227, 89,226,226,226,226,226,226, 89, 89, -228,228,228,228,228,228,228,228,228,228, 89, 89,225,225, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 92,235,235, 92,235, 92, 92,235,235, 92,235, 92, 92,235, 92, 92, + 92, 92, 92, 92,235,235,235,235, 92,235,235,235,235,235,235,235, + 92,235,235,235, 92,235, 92,235, 92, 92,235,235, 92,235,235,235, +235,236,235,235,236,236,236,236,236,236, 92,236,236,235, 92, 92, +235,235,235,235,235, 92,237, 92,236,236,236,236,236,236, 92, 92, +238,238,238,238,238,238,238,238,238,238, 92, 92,235,235,235,235, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 30 */ -229,230,230,230,231,231,231,231,231,231,231,231,231,231,231,231, -231,231,231,230,230,230,230,230,232,232,230,230,230,230,230,230, -233,233,233,233,233,233,233,233,233,233,234,234,234,234,234,234, -234,234,234,234,230,232,230,232,230,232,235,236,235,236,237,237, -229,229,229,229,229,229,229,229, 89,229,229,229,229,229,229,229, -229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229, -229,229,229,229,229,229,229,229,229,229,229,229,229, 89, 89, 89, - 89,232,232,232,232,232,232,232,232,232,232,232,232,232,232,237, +239,240,240,240,241,241,241,241,241,241,241,241,241,241,241,241, +241,241,241,240,241,240,240,240,242,242,240,240,240,240,240,240, +243,243,243,243,243,243,243,243,243,243,244,244,244,244,244,244, +244,244,244,244,240,242,240,242,240,242,245,246,245,246,247,247, +239,239,239,239,239,239,239,239, 92,239,239,239,239,239,239,239, +239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239, +239,239,239,239,239,239,239,239,239,239,239,239,239, 92, 92, 92, + 92,242,242,242,242,242,242,242,242,242,242,242,242,242,242,247, /* block 31 */ -232,232,232,232,232,231,232,232,229,229,229,229, 89, 89, 89, 89, -232,232,232,232,232,232,232,232, 89,232,232,232,232,232,232,232, -232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232, -232,232,232,232,232,232,232,232,232,232,232,232,232, 89,230,230, -230,230,230,230,230,230,232,230,230,230,230,230,230, 89,230,230, -231,231,231,231,231, 13, 13, 13, 13, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +242,242,242,242,242,241,242,242,239,239,239,239,239,242,242,242, +242,242,242,242,242,242,242,242, 92,242,242,242,242,242,242,242, +242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242, +242,242,242,242,242,242,242,242,242,242,242,242,242, 92,240,240, +240,240,240,240,240,240,242,240,240,240,240,240,240, 92,240,240, +241,241,241,241,241, 13, 13, 13, 13,241,241, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 32 */ -238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, -238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, -238,238,238,238,238,238,238,238,238,238,238,239,239,240,240,240, -240,239,240,240,240,240,240,240,239,240,240,239,239,240,240,238, -241,241,241,241,241,241,241,241,241,241,242,242,242,242,242,242, -238,238,238,238,238,238,239,239,240,240,238,238,238,238,240,240, -240,238,239,239,239,238,238,239,239,239,239,239,239,239,238,238, -238,240,240,240,240,238,238,238,238,238,238,238,238,238,238,238, +248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, +248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, +248,248,248,248,248,248,248,248,248,248,248,249,249,250,250,250, +250,249,250,250,250,250,250,250,249,250,250,249,249,250,250,248, +251,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252, +248,248,248,248,248,248,249,249,250,250,248,248,248,248,250,250, +250,248,249,249,249,248,248,249,249,249,249,249,249,249,248,248, +248,250,250,250,250,248,248,248,248,248,248,248,248,248,248,248, /* block 33 */ -238,238,240,239,239,240,240,239,239,239,239,239,239,240,238,239, -241,241,241,241,241,241,241,241,241,241,239,239,239,240,243,243, -244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244, -244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244, -244,244,244,244,244,244, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245, -245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245, -245,245,245,245,245,245,245,245,245,245,245, 2,246, 89, 89, 89, +248,248,250,249,249,250,250,249,249,249,249,249,249,250,248,249, +251,251,251,251,251,251,251,251,251,251,249,249,249,250,253,253, +254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254, +254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254, +254,254,254,254,254,254, 92,254, 92, 92, 92, 92, 92,254, 92, 92, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255, 2,256,255,255,255, /* block 34 */ -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, /* block 35 */ -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248, 89,248,248,248,248, 89, 89, -248,248,248,248,248,248,248, 89,248, 89,248,248,248,248, 89, 89, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258, 92,258,258,258,258, 92, 92, +258,258,258,258,258,258,258, 92,258, 92,258,258,258,258, 92, 92, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, /* block 36 */ -248,248,248,248,248,248,248,248,248, 89,248,248,248,248, 89, 89, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248, 89,248,248,248,248, 89, 89,248,248,248,248,248,248,248, 89, -248, 89,248,248,248,248, 89, 89,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248, 89,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, +258,258,258,258,258,258,258,258,258, 92,258,258,258,258, 92, 92, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258, 92,258,258,258,258, 92, 92,258,258,258,258,258,258,258, 92, +258, 92,258,258,258,258, 92, 92,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258, 92,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, /* block 37 */ -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248, 89,248,248,248,248, 89, 89,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248,248,248,248,248, 89, 89, 89, 89,249, -250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252, -252,252,252,252,252,252,252,252,252,252,252,252,252, 89, 89, 89, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258, 92,258,258,258,258, 92, 92,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258,258,258,258,258, 92, 92,259,259,259, +260,260,260,260,260,260,260,260,260,261,261,261,261,261,261,261, +261,261,261,261,261,261,261,261,261,261,261,261,261, 92, 92, 92, /* block 38 */ -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -250,250,250,250,250,250,250,250,250,250, 89, 89, 89, 89, 89, 89, -253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, -253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, -253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, -253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, -253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, -253,253,253,253,253, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +262,262,262,262,262,262,262,262,262,262, 92, 92, 92, 92, 92, 92, +263,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263, +263,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263, +263,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263, +263,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263, +263,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263, +263,263,263,263,263, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 39 */ -254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +264,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, /* block 40 */ -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, /* block 41 */ -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,256,256,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,266,266,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, /* block 42 */ -257,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, -258,258,258,258,258,258,258,258,258,258,258,259,260, 89, 89, 89, -261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261, -261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261, -261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261, -261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261, -261,261,261,261,261,261,261,261,261,261,261, 2, 2, 2,262,262, -262, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +267,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268, +268,268,268,268,268,268,268,268,268,268,268,269,270, 92, 92, 92, +271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271, +271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271, +271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271, +271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271, +271,271,271,271,271,271,271,271,271,271,271, 2, 2, 2,272,272, +272, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 43 */ -263,263,263,263,263,263,263,263,263,263,263,263,263, 89,263,263, -263,263,264,264,264, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, -265,265,266,266,266, 2, 2, 89, 89, 89, 89, 89, 89, 89, 89, 89, -267,267,267,267,267,267,267,267,267,267,267,267,267,267,267,267, -267,267,268,268, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -269,269,269,269,269,269,269,269,269,269,269,269,269, 89,269,269, -269, 89,270,270, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +273,273,273,273,273,273,273,273,273,273,273,273,273, 92,273,273, +273,273,274,274,274, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +275,275,275,275,275,275,275,275,275,275,275,275,275,275,275,275, +275,275,276,276,276, 2, 2, 92, 92, 92, 92, 92, 92, 92, 92, 92, +277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277, +277,277,278,278, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +279,279,279,279,279,279,279,279,279,279,279,279,279, 92,279,279, +279, 92,280,280, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 44 */ -271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271, -271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271, -271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271, -271,271,271,271,272,272,273,274,274,274,274,274,274,274,273,273, -273,273,273,273,273,273,274,273,273,274,274,274,274,274,274,274, -274,274,274,274,275,275,275,276,275,275,275,277,271,274, 89, 89, -278,278,278,278,278,278,278,278,278,278, 89, 89, 89, 89, 89, 89, -279,279,279,279,279,279,279,279,279,279, 89, 89, 89, 89, 89, 89, +281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281, +281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281, +281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281, +281,281,281,281,282,282,283,282,282,282,282,282,282,282,283,283, +283,283,283,283,283,283,282,283,283,282,282,282,282,282,282,282, +282,282,282,282,284,284,284,285,284,284,284,286,281,282, 92, 92, +287,287,287,287,287,287,287,287,287,287, 92, 92, 92, 92, 92, 92, +288,288,288,288,288,288,288,288,288,288, 92, 92, 92, 92, 92, 92, /* block 45 */ -280,280, 2, 2,280, 2,281,280,280,280,280,282,282,282,283, 89, -284,284,284,284,284,284,284,284,284,284, 89, 89, 89, 89, 89, 89, -285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285, -285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285, -285,285,285,286,285,285,285,285,285,285,285,285,285,285,285,285, -285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285, -285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285, -285,285,285,285,285,285,285,285, 89, 89, 89, 89, 89, 89, 89, 89, +289,289, 2, 2,289, 2,290,289,289,289,289,291,291,291,292, 92, +293,293,293,293,293,293,293,293,293,293, 92, 92, 92, 92, 92, 92, +294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, +294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, +294,294,294,295,294,294,294,294,294,294,294,294,294,294,294,294, +294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, +294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, +294,294,294,294,294,294,294,294, 92, 92, 92, 92, 92, 92, 92, 92, /* block 46 */ -285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285, -285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285, -285,285,285,285,285,285,285,285,285,282,285, 89, 89, 89, 89, 89, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, +294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, +294,294,294,294,294,294,294,294,294,291,294, 92, 92, 92, 92, 92, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265,265,265,265,265,265,265,265,265,265,265, +265,265,265,265,265,265, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 47 */ -287,287,287,287,287,287,287,287,287,287,287,287,287,287,287,287, -287,287,287,287,287,287,287,287,287,287,287,287,287, 89, 89, 89, -288,288,288,289,289,289,289,288,288,289,289,289, 89, 89, 89, 89, -289,289,288,289,289,289,289,289,289,288,288,288, 89, 89, 89, 89, -290, 89, 89, 89,291,291,292,292,292,292,292,292,292,292,292,292, -293,293,293,293,293,293,293,293,293,293,293,293,293,293,293,293, -293,293,293,293,293,293,293,293,293,293,293,293,293,293, 89, 89, -293,293,293,293,293, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +296,296,296,296,296,296,296,296,296,296,296,296,296,296,296,296, +296,296,296,296,296,296,296,296,296,296,296,296,296, 92, 92, 92, +297,297,297,298,298,298,298,297,297,298,298,298, 92, 92, 92, 92, +298,298,297,298,298,298,298,298,298,297,297,297, 92, 92, 92, 92, +299, 92, 92, 92,300,300,301,301,301,301,301,301,301,301,301,301, +302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302, +302,302,302,302,302,302,302,302,302,302,302,302,302,302, 92, 92, +302,302,302,302,302, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 48 */ -294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, -294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, -294,294,294,294,294,294,294,294,294,294,294,294, 89, 89, 89, 89, -295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, -295,294,294,294,294,294,294,294,295,295, 89, 89, 89, 89, 89, 89, -296,296,296,296,296,296,296,296,296,296,296, 89, 89, 89,297,297, -298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, -298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, - -/* block 49 */ -299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299, -299,299,299,299,299,299,299,300,300,301,301,301, 89, 89,302,302, -303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303, 303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303, 303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303, -303,303,303,303,303,304,305,304,305,305,305,305,305,305,305, 89, -305,304,305,304,304,305,305,305,305,305,305,305,305,304,304,304, -304,304,304,305,305,305,305,305,305,305,305,305,305, 89, 89,305, +303,303,303,303,303,303,303,303,303,303,303,303, 92, 92, 92, 92, +304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304, +304,303,303,303,303,303,303,303,304,304, 92, 92, 92, 92, 92, 92, +305,305,305,305,305,305,305,305,305,305,306, 92, 92, 92,307,307, +308,308,308,308,308,308,308,308,308,308,308,308,308,308,308,308, +308,308,308,308,308,308,308,308,308,308,308,308,308,308,308,308, + +/* block 49 */ +309,309,309,309,309,309,309,309,309,309,309,309,309,309,309,309, +309,309,309,309,309,309,309,310,310,311,311,311, 92, 92,312,312, +313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, +313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, +313,313,313,313,313,313,313,313,313,313,313,313,313,313,313,313, +313,313,313,313,313,314,315,314,315,315,315,315,315,315,315, 92, +315,314,315,314,314,315,315,315,315,315,315,315,315,314,314,314, +314,314,314,315,315,315,315,315,315,315,315,315,315, 92, 92,315, /* block 50 */ -306,306,306,306,306,306,306,306,306,306, 89, 89, 89, 89, 89, 89, -306,306,306,306,306,306,306,306,306,306, 89, 89, 89, 89, 89, 89, -307,307,307,307,307,307,307,308,307,307,307,307,307,307, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +316,316,316,316,316,316,316,316,316,316, 92, 92, 92, 92, 92, 92, +316,316,316,316,316,316,316,316,316,316, 92, 92, 92, 92, 92, 92, +317,317,317,317,317,317,317,318,317,317,317,317,317,317, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 51 */ -309,309,309,309,310,311,311,311,311,311,311,311,311,311,311,311, -311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311, -311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311, -311,311,311,311,309,310,309,309,309,309,309,310,309,310,310,310, -310,310,309,310,310,311,311,311,311,311,311,311, 89, 89, 89, 89, -312,312,312,312,312,312,312,312,312,312,313,313,313,313,313,313, -313,314,314,314,314,314,314,314,314,314,314,309,309,309,309,309, -309,309,309,309,314,314,314,314,314,314,314,314,314, 89, 89, 89, +319,319,319,319,320,321,321,321,321,321,321,321,321,321,321,321, +321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321, +321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321, +321,321,321,321,319,320,319,319,319,319,319,320,319,320,320,320, +320,320,319,320,320,321,321,321,321,321,321,321, 92, 92, 92, 92, +322,322,322,322,322,322,322,322,322,322,323,323,323,323,323,323, +323,324,324,324,324,324,324,324,324,324,324,319,319,319,319,319, +319,319,319,319,324,324,324,324,324,324,324,324,324, 92, 92, 92, /* block 52 */ -315,315,316,317,317,317,317,317,317,317,317,317,317,317,317,317, -317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317, -317,316,315,315,315,315,316,316,315,315,316, 89, 89, 89,317,317, -318,318,318,318,318,318,318,318,318,318, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +325,325,326,327,327,327,327,327,327,327,327,327,327,327,327,327, +327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327, +327,326,325,325,325,325,326,326,325,325,326,325,326,326,327,327, +328,328,328,328,328,328,328,328,328,328,327,327,327,327,327,327, +329,329,329,329,329,329,329,329,329,329,329,329,329,329,329,329, +329,329,329,329,329,329,329,329,329,329,329,329,329,329,329,329, +329,329,329,329,329,329,330,331,330,330,331,331,331,330,331,330, +330,330,331,331, 92, 92, 92, 92, 92, 92, 92, 92,332,332,332,332, /* block 53 */ -319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, -319,319,319,319,319,319,319,319,319,319,319,319,319,319,319,319, -319,319,319,319,320,320,320,320,320,320,320,320,321,321,321,321, -321,321,321,321,320,320,321,321, 89, 89, 89,322,322,322,322,322, -323,323,323,323,323,323,323,323,323,323, 89, 89, 89,319,319,319, -324,324,324,324,324,324,324,324,324,324,325,325,325,325,325,325, -325,325,325,325,325,325,325,325,325,325,325,325,325,325,325,325, -325,325,325,325,325,325,325,325,326,326,326,326,326,326,327,327, +333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333, +333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333, +333,333,333,333,334,334,334,334,334,334,334,334,335,335,335,335, +335,335,335,335,334,334,335,335, 92, 92, 92,336,336,336,336,336, +337,337,337,337,337,337,337,337,337,337, 92, 92, 92,333,333,333, +338,338,338,338,338,338,338,338,338,338,339,339,339,339,339,339, +339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, +339,339,339,339,339,339,339,339,340,340,340,340,340,340,341,341, /* block 54 */ - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 84, 84, 84, 2, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84,328, 84, 84, 84, 84, 84, 84, 84,329,329,329,329, 84,329,329, -329,329,328, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +342,342,342,342,342,342,342,342, 92, 92, 92, 92, 92, 92, 92, 92, + 87, 87, 87, 2, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87,343, 87, 87, 87, 87, 87, 87, 87,344,344,344,344, 87,344,344, +344,344,343,343, 87,344,344, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 55 */ - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 96, 96, 96, 96, 96,330, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 90, 90, 90, - 90, 90, 14, 14, 14, 14, 96, 96, 96, 96, 96, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14,331,332, 14, 14, 14,333, 14, 14, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 99, 99, 99, 99, 99,345, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 93, 93, 93, + 93, 93, 84, 84, 84, 84, 93, 93, 93, 93, 93, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20,346,347, 20, 20, 20,348, 20, 20, /* block 56 */ - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 90, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 93, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 87, 87, 87, 87, /* block 57 */ - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, /* block 58 */ - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 14, 14, 14, 14, 14,334, 14, 14,335, 14, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 20, 20, 20, 20, 20,349, 20, 20,350, 20, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, /* block 59 */ -336,336,336,336,336,336,336,336,337,337,337,337,337,337,337,337, -336,336,336,336,336,336, 89, 89,337,337,337,337,337,337, 89, 89, -336,336,336,336,336,336,336,336,337,337,337,337,337,337,337,337, -336,336,336,336,336,336,336,336,337,337,337,337,337,337,337,337, -336,336,336,336,336,336, 89, 89,337,337,337,337,337,337, 89, 89, - 96,336, 96,336, 96,336, 96,336, 89,337, 89,337, 89,337, 89,337, -336,336,336,336,336,336,336,336,337,337,337,337,337,337,337,337, -338,338,339,339,339,339,340,340,341,341,342,342,343,343, 89, 89, +351,351,351,351,351,351,351,351,352,352,352,352,352,352,352,352, +351,351,351,351,351,351, 92, 92,352,352,352,352,352,352, 92, 92, +351,351,351,351,351,351,351,351,352,352,352,352,352,352,352,352, +351,351,351,351,351,351,351,351,352,352,352,352,352,352,352,352, +351,351,351,351,351,351, 92, 92,352,352,352,352,352,352, 92, 92, + 99,351, 99,351, 99,351, 99,351, 92,352, 92,352, 92,352, 92,352, +351,351,351,351,351,351,351,351,352,352,352,352,352,352,352,352, +353,353,354,354,354,354,355,355,356,356,357,357,358,358, 92, 92, /* block 60 */ -336,336,336,336,336,336,336,336,344,344,344,344,344,344,344,344, -336,336,336,336,336,336,336,336,344,344,344,344,344,344,344,344, -336,336,336,336,336,336,336,336,344,344,344,344,344,344,344,344, -336,336, 96,345, 96, 89, 96, 96,337,337,346,346,347, 88,348, 88, - 88, 88, 96,345, 96, 89, 96, 96,349,349,349,349,347, 88, 88, 88, -336,336, 96, 96, 89, 89, 96, 96,337,337,350,350, 89, 88, 88, 88, -336,336, 96, 96, 96,115, 96, 96,337,337,351,351,119, 88, 88, 88, - 89, 89, 96,345, 96, 89, 96, 96,352,352,353,353,347, 88, 88, 89, +351,351,351,351,351,351,351,351,359,359,359,359,359,359,359,359, +351,351,351,351,351,351,351,351,359,359,359,359,359,359,359,359, +351,351,351,351,351,351,351,351,359,359,359,359,359,359,359,359, +351,351, 99,360, 99, 92, 99, 99,352,352,361,361,362, 91,363, 91, + 91, 91, 99,360, 99, 92, 99, 99,364,364,364,364,362, 91, 91, 91, +351,351, 99, 99, 92, 92, 99, 99,352,352,365,365, 92, 91, 91, 91, +351,351, 99, 99, 99,118, 99, 99,352,352,366,366,122, 91, 91, 91, + 92, 92, 99,360, 99, 92, 99, 99,367,367,368,368,362, 91, 91, 92, /* block 61 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16,354,354, 16, 16, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16,369,369, 16, 16, 7, 7, 7, 7, 7, 7, 2, 2, 15, 19, 4, 15, 15, 19, 4, 15, - 2, 2, 2, 2, 2, 2, 2, 2,355,356, 16, 16, 16, 16, 16, 1, + 2, 2, 2, 2, 2, 2, 2, 2,370,371, 16, 16, 16, 16, 16, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 15, 19, 2, 2, 2, 2, 11, 11, 2, 2, 2, 6, 4, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, - 16, 16, 16, 16, 16, 89, 89, 89, 89, 89, 16, 16, 16, 16, 16, 16, - 17, 82, 89, 89, 17, 17, 17, 17, 17, 17, 6, 6, 6, 4, 5, 82, + 16, 16, 16, 16, 16, 92, 92, 92, 92, 92, 16, 16, 16, 16, 16, 16, + 17, 84, 92, 92, 17, 17, 17, 17, 17, 17, 6, 6, 6, 4, 5, 84, /* block 62 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 6, 6, 6, 4, 5, 89, - 82, 82, 82, 82, 82, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 6, 6, 6, 4, 5, 92, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 92, 92, 92, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,357,357,357, -357, 84,357,357,357, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,372,372,372, +372, 87,372,372,372, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 63 */ - 13, 13,358, 13, 13, 13, 13,358, 13, 13,359,358,358,358,359,359, -358,358,358,359, 13,358, 13, 13, 13,358,358,358,358,358, 13, 13, - 13, 13, 13, 13,358, 13,360, 13,358, 13,361,362,358,358, 13,359, -358,358,363,358,359,329,329,329,329,359, 13, 13,359,359,358,358, - 6, 6, 6, 6, 6,358,359,359,359,359, 13, 6, 13, 13,364, 13, + 13, 13,373, 13, 13, 13, 13,373, 13, 13,374,373,373,373,374,374, +373,373,373,374, 13,373, 13, 13, 6,373,373,373,373,373, 13, 13, + 13, 13, 13, 13,373, 13,375, 13,373, 13,376,377,373,373, 13,374, +373,373,378,373,374,344,344,344,344,374, 13, 13,374,374,373,373, + 6, 6, 6, 6, 6,373,374,374,374,374, 13, 6, 13, 13,379, 13, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, -365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365, -366,366,366,366,366,366,366,366,366,366,366,366,366,366,366,366, +380,380,380,380,380,380,380,380,380,380,380,380,380,380,380,380, +381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381, /* block 64 */ -367,367,367, 21, 22,367,367,367,367, 17, 89, 89, 89, 89, 89, 89, +382,382,382, 22, 23,382,382,382,382, 17, 92, 92, 92, 92, 92, 92, 6, 6, 6, 6, 6, 13, 13, 13, 13, 13, 6, 6, 13, 13, 13, 13, 6, 13, 13, 6, 13, 13, 6, 13, 13, 13, 13, 13, 13, 13, 6, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, @@ -1776,16 +1825,16 @@ 6, 6, 6, 6, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 6, 6, 6, 6, - 6, 6, 13, 13, 13, 13, 13, 13, 13, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 6, 6, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 68 */ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, @@ -1793,10 +1842,10 @@ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13,368,368,368,368,368,368,368,368,368,368, -368,368,368,368,368,368,368,368,368,368,368,368,368,368,368,368, -369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369, -369,369,369,369,369,369,369,369,369,369, 17, 17, 17, 17, 17, 17, + 13, 13, 13, 13, 13, 13,383,383,383,383,383,383,383,383,383,383, +383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383, +384,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384, +384,384,384,384,384,384,384,384,384,384, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, /* block 70 */ @@ -1830,46 +1879,36 @@ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, /* block 73 */ + 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 89, 13, 89, 89, 89, 89, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - -/* block 74 */ - 89, 13, 13, 13, 13, 89, 13, 13, 13, 13, 89, 89, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 89, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, 13, 89, 13, - 13, 13, 13, 89, 89, 89, 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, - 89, 13, 13, 13, 13, 13, 13, 13, 4, 5, 4, 5, 4, 5, 4, 5, + 13, 13, 13, 13, 13, 13, 13, 13, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, -/* block 75 */ +/* block 74 */ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 13, 89, 89, 89, 13, 13, 13, 13, 13, 13, 13, 13, + 17, 17, 17, 17, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 89, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, - 6, 6, 6, 6, 6, 4, 5, 6, 6, 6, 6, 89, 6, 89, 89, 89, + 6, 6, 6, 6, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, -/* block 76 */ -370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, -370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, -370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, -370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, -370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, -370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, -370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, -370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370, +/* block 75 */ +385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385, +385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385, +385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385, +385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385, +385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385, +385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385, +385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385, +385,385,385,385,385,385,385,385,385,385,385,385,385,385,385,385, -/* block 77 */ +/* block 76 */ 6, 6, 6, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, @@ -1879,145 +1918,155 @@ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 5, 6, 6, -/* block 78 */ +/* block 77 */ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 13, 13, 6, 6, 6, 6, 6, 6, 89, 89, 89, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 6, 6, 6, 6, 6, 13, 13, 6, 6, 6, 6, 6, 6, 92, 92, 92, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 78 */ + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 79 */ -371,371,371,371,371,371,371,371,371,371,371,371,371,371,371,371, -371,371,371,371,371,371,371,371,371,371,371,371,371,371,371,371, -371,371,371,371,371,371,371,371,371,371,371,371,371,371,371, 89, -372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372, -372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372, -372,372,372,372,372,372,372,372,372,372,372,372,372,372,372, 89, - 21, 22,373,374,375,376,377, 21, 22, 21, 22, 21, 22,378,379,380, -381, 14, 21, 22, 14, 21, 22, 14, 14, 14, 14, 14, 14, 82,382,382, +386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386, +386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386, +386,386,386,386,386,386,386,386,386,386,386,386,386,386,386, 92, +387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387, +387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387, +387,387,387,387,387,387,387,387,387,387,387,387,387,387,387, 92, + 22, 23,388,389,390,391,392, 22, 23, 22, 23, 22, 23,393,394,395, +396, 20, 22, 23, 20, 22, 23, 20, 20, 20, 20, 20, 84, 84,397,397, /* block 80 */ -111,112,111,112,111,112,111,112,111,112,111,112,111,112,111,112, -111,112,111,112,111,112,111,112,111,112,111,112,111,112,111,112, -111,112,111,112,111,112,111,112,111,112,111,112,111,112,111,112, -111,112,111,112,111,112,111,112,111,112,111,112,111,112,111,112, -111,112,111,112,111,112,111,112,111,112,111,112,111,112,111,112, -111,112,111,112,111,112,111,112,111,112,111,112,111,112,111,112, -111,112,111,112,383,384,384,384,384,384,384,111,112,111,112,385, -385,385, 89, 89, 89, 89, 89, 89, 89,386,386,386,386,387,386,386, +114,115,114,115,114,115,114,115,114,115,114,115,114,115,114,115, +114,115,114,115,114,115,114,115,114,115,114,115,114,115,114,115, +114,115,114,115,114,115,114,115,114,115,114,115,114,115,114,115, +114,115,114,115,114,115,114,115,114,115,114,115,114,115,114,115, +114,115,114,115,114,115,114,115,114,115,114,115,114,115,114,115, +114,115,114,115,114,115,114,115,114,115,114,115,114,115,114,115, +114,115,114,115,398,399,399,399,399,399,399,114,115,114,115,400, +400,400,114,115, 92, 92, 92, 92, 92,401,401,401,401,402,401,401, /* block 81 */ -388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388, -388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388, -388,388,388,388,388,388, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -389,389,389,389,389,389,389,389,389,389,389,389,389,389,389,389, -389,389,389,389,389,389,389,389,389,389,389,389,389,389,389,389, -389,389,389,389,389,389,389,389,389,389,389,389,389,389,389,389, -389,389,389,389,389,389, 89, 89, 89, 89, 89, 89, 89, 89, 89,390, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +403,403,403,403,403,403,403,403,403,403,403,403,403,403,403,403, +403,403,403,403,403,403,403,403,403,403,403,403,403,403,403,403, +403,403,403,403,403,403, 92,403, 92, 92, 92, 92, 92,403, 92, 92, +404,404,404,404,404,404,404,404,404,404,404,404,404,404,404,404, +404,404,404,404,404,404,404,404,404,404,404,404,404,404,404,404, +404,404,404,404,404,404,404,404,404,404,404,404,404,404,404,404, +404,404,404,404,404,404,404,404, 92, 92, 92, 92, 92, 92, 92,405, +406, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,407, /* block 82 */ -248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, -248,248,248,248,248,248,248, 89, 89, 89, 89, 89, 89, 89, 89, 89, -248,248,248,248,248,248,248, 89,248,248,248,248,248,248,248, 89, -248,248,248,248,248,248,248, 89,248,248,248,248,248,248,248, 89, -248,248,248,248,248,248,248, 89,248,248,248,248,248,248,248, 89, -248,248,248,248,248,248,248, 89,248,248,248,248,248,248,248, 89, -128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, -128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, +258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, +258,258,258,258,258,258,258, 92, 92, 92, 92, 92, 92, 92, 92, 92, +258,258,258,258,258,258,258, 92,258,258,258,258,258,258,258, 92, +258,258,258,258,258,258,258, 92,258,258,258,258,258,258,258, 92, +258,258,258,258,258,258,258, 92,258,258,258,258,258,258,258, 92, +258,258,258,258,258,258,258, 92,258,258,258,258,258,258,258, 92, +131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131, +131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131, /* block 83 */ 2, 2, 15, 19, 15, 19, 2, 2, 2, 15, 19, 2, 15, 19, 2, 2, 2, 2, 2, 2, 2, 2, 2, 7, 2, 2, 7, 2, 15, 19, 2, 2, - 15, 19, 4, 5, 4, 5, 4, 5, 4, 5, 2, 2, 2, 2, 2, 83, - 2, 2, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 15, 19, 4, 5, 4, 5, 4, 5, 4, 5, 2, 2, 2, 2, 2, 85, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 7, 7, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 84 */ -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391, 89,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408, 92,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 85 */ -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, /* block 86 */ -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, -391,391,391,391,391,391, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, 89, 89, 89, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +408,408,408,408,408,408, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, /* block 87 */ - 1, 2, 2, 2, 13,392,329,393, 4, 5, 4, 5, 4, 5, 4, 5, + 1, 2, 2, 2, 13,409,344,410, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 13, 13, 4, 5, 4, 5, 4, 5, 4, 5, 7, 4, 5, 5, - 13,393,393,393,393,393,393,393,393,393, 84, 84, 84, 84, 84, 84, - 7, 83, 83, 83, 83, 83, 13, 13,393,393,393,392,329, 2, 13, 13, - 89,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394, -394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394, -394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394, -394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394, + 13,410,410,410,410,410,410,410,410,410, 87, 87, 87, 87,411,411, + 7, 85, 85, 85, 85, 85, 13, 13,410,410,410,409,344, 2, 13, 13, + 92,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412, +412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412, +412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412, +412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412, /* block 88 */ -394,394,394,394,394,394,394,394,394,394,394,394,394,394,394,394, -394,394,394,394,394,394,394, 89, 89, 84, 84, 10, 10,395,395,394, - 7,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, -396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, -396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, -396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, -396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, -396,396,396,396,396,396,396,396,396,396,396, 2, 83,397,397,396, +412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412, +412,412,412,412,412,412,412, 92, 92, 87, 87, 10, 10,413,413,412, + 7,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, +414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, +414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, +414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, +414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, +414,414,414,414,414,414,414,414,414,414,414, 2, 85,415,415,414, /* block 89 */ - 89, 89, 89, 89, 89,398,398,398,398,398,398,398,398,398,398,398, -398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398, -398,398,398,398,398,398,398,398,398,398,398,398,398,398, 89, 89, - 89,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, + 92, 92, 92, 92, 92,416,416,416,416,416,416,416,416,416,416,416, +416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416, +416,416,416,416,416,416,416,416,416,416,416,416,416,416, 92, 92, + 92,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, /* block 90 */ -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, 89, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, 92, 13, 13, 17, 17, 17, 17, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398, -398,398,398,398,398,398,398,398, 89, 89, 89, 89, 89, 89, 89, 89, +416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416, +416,416,416,416,416,416,416,416,416,416,416, 92, 92, 92, 92, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, + 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, /* block 91 */ -399,399,399,399,399,399,399,399,399,399,399,399,399,399,399,399, -399,399,399,399,399,399,399,399,399,399,399,399,399,399,399, 89, +417,417,417,417,417,417,417,417,417,417,417,417,417,417,417,417, +417,417,417,417,417,417,417,417,417,417,417,417,417,417,417, 92, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 17, 17, 17, 17, 17, 17, 17, 17, 13, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, -399,399,399,399,399,399,399,399,399,399,399,399,399,399,399,399, -399,399,399,399,399,399,399,399,399,399,399,399,399,399,399, 13, +417,417,417,417,417,417,417,417,417,417,417,417,417,417,417,417, +417,417,417,417,417,417,417,417,417,417,417,417,417,417,417, 13, /* block 92 */ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 13, 13, 13, 13, 13, 13, @@ -2025,551 +2074,661 @@ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400, -400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400, -400,400,400,400,400,400,400,400,400,400,400,400,400,400,400, 89, +418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, +418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, +418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, 92, /* block 93 */ -400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400, -400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400, -400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400, -400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400, -400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400, -400,400,400,400,400,400,400,400, 13, 13, 13, 13, 13, 13, 13, 13, +418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, +418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, +418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, +418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, +418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, +418,418,418,418,418,418,418,418, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, /* block 94 */ -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, /* block 95 */ -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, /* block 96 */ -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 97 */ -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,403,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,421,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, /* block 98 */ -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, +420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, /* block 99 */ -402,402,402,402,402,402,402,402,402,402,402,402,402, 89, 89, 89, -404,404,404,404,404,404,404,404,404,404,404,404,404,404,404,404, -404,404,404,404,404,404,404,404,404,404,404,404,404,404,404,404, -404,404,404,404,404,404,404,404,404,404,404,404,404,404,404,404, -404,404,404,404,404,404,404, 89, 89, 89, 89, 89, 89, 89, 89, 89, -405,405,405,405,405,405,405,405,405,405,405,405,405,405,405,405, -405,405,405,405,405,405,405,405,405,405,405,405,405,405,405,405, -405,405,405,405,405,405,405,405,406,406,406,406,406,406,407,407, +420,420,420,420,420,420,420,420,420,420,420,420,420, 92, 92, 92, +422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,422, +422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,422, +422,422,422,422,422,422,422,422,422,422,422,422,422,422,422,422, +422,422,422,422,422,422,422, 92, 92, 92, 92, 92, 92, 92, 92, 92, +423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423, +423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423, +423,423,423,423,423,423,423,423,424,424,424,424,424,424,425,425, /* block 100 */ -408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, -408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, -408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, -408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, -408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, -408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, -408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, -408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, +426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, +426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, +426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, +426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, +426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, +426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, +426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, +426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, /* block 101 */ -408,408,408,408,408,408,408,408,408,408,408,408,409,410,410,410, -408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, -411,411,411,411,411,411,411,411,411,411,408,408, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, - 89, 89,125,126,125,126,125,126,125,126,125,126,125,126,412,128, -129,129,129,413, 89, 89, 89, 89, 89, 89, 89, 89,128,128,413,331, +426,426,426,426,426,426,426,426,426,426,426,426,427,428,428,428, +426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, +429,429,429,429,429,429,429,429,429,429,426,426, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,430,131, +132,132,132,431,131,131,131,131,131,131,131,131,131,131,431,346, /* block 102 */ -125,126,125,126,125,126,125,126,125,126,125,126,125,126,125,126, -125,126,125,126,125,126,125,126, 89, 89, 89, 89, 89, 89, 89, 89, -414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, -414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, -414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, -414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, -414,414,414,414,414,414,415,415,415,415,415,415,415,415,415,415, -416,416,417,417,417,417,417,417, 89, 89, 89, 89, 89, 89, 89, 89, +128,129,128,129,128,129,128,129,128,129,128,129,128,129,128,129, +128,129,128,129,128,129,128,129, 92, 92, 92, 92, 92, 92, 92,131, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,433,433,433,433,433,433,433,433,433,433, +434,434,435,435,435,435,435,435, 92, 92, 92, 92, 92, 92, 92, 92, /* block 103 */ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 10, 10, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 14, 14, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 82, 14, 14, 14, 14, 14, 14, 14, 14, 21, 22, 21, 22,418, 21, 22, + 10, 10, 10, 10, 10, 10, 10, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 10, 10, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 20, 20, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, + 84, 20, 20, 20, 20, 20, 20, 20, 20, 22, 23, 22, 23,436, 22, 23, /* block 104 */ - 21, 22, 21, 22, 21, 22, 21, 22, 83, 10, 10, 21, 22, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 45, 45, 45, 45, 45, + 22, 23, 22, 23, 22, 23, 22, 23, 85, 10, 10, 22, 23,437, 20, 92, + 22, 23, 22, 23, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 22, 23, 22, 23, 22, 23, 22, 23, 22, 23,438, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 84, 84, 20, 14, 14, 14, 14, 14, /* block 105 */ -419,419,420,419,419,419,420,419,419,419,419,420,419,419,419,419, -419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, -419,419,419,421,421,420,420,421,422,422,422,422, 89, 89, 89, 89, - 17, 17, 17, 17, 17, 17, 13, 13, 3, 13, 89, 89, 89, 89, 89, 89, -423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423, -423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423, -423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423, -423,423,423,423,424,424,424,424, 89, 89, 89, 89, 89, 89, 89, 89, +439,439,440,439,439,439,440,439,439,439,439,440,439,439,439,439, +439,439,439,439,439,439,439,439,439,439,439,439,439,439,439,439, +439,439,439,441,441,440,440,441,442,442,442,442, 92, 92, 92, 92, + 17, 17, 17, 17, 17, 17, 13, 13, 3, 13, 92, 92, 92, 92, 92, 92, +443,443,443,443,443,443,443,443,443,443,443,443,443,443,443,443, +443,443,443,443,443,443,443,443,443,443,443,443,443,443,443,443, +443,443,443,443,443,443,443,443,443,443,443,443,443,443,443,443, +443,443,443,443,444,444,444,444, 92, 92, 92, 92, 92, 92, 92, 92, /* block 106 */ -425,425,426,426,426,426,426,426,426,426,426,426,426,426,426,426, -426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, -426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, -426,426,426,426,425,425,425,425,425,425,425,425,425,425,425,425, -425,425,425,425,427, 89, 89, 89, 89, 89, 89, 89, 89, 89,428,428, -429,429,429,429,429,429,429,429,429,429, 89, 89, 89, 89, 89, 89, -167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, -167,167,169,169,169,169,169,169,430,430,430,169, 89, 89, 89, 89, +445,445,446,446,446,446,446,446,446,446,446,446,446,446,446,446, +446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446, +446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446, +446,446,446,446,445,445,445,445,445,445,445,445,445,445,445,445, +445,445,445,445,447, 92, 92, 92, 92, 92, 92, 92, 92, 92,448,448, +449,449,449,449,449,449,449,449,449,449, 92, 92, 92, 92, 92, 92, +174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174, +174,174,176,176,176,176,176,176,178,178,178,176, 92, 92, 92, 92, /* block 107 */ -431,431,431,431,431,431,431,431,431,431,432,432,432,432,432,432, -432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, -432,432,432,432,432,432,433,433,433,433,433,433,433,433,434,434, -435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435, -435,435,435,435,435,435,435,436,436,436,436,436,436,436,436,436, -436,436,437,437, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,438, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247, 89, 89, 89, +450,450,450,450,450,450,450,450,450,450,451,451,451,451,451,451, +451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,451, +451,451,451,451,451,451,452,452,452,452,452,452,452,452,453,453, +454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454, +454,454,454,454,454,454,454,455,455,455,455,455,455,455,455,455, +455,455,456,456, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,457, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257, 92, 92, 92, /* block 108 */ -439,439,439,440,441,441,441,441,441,441,441,441,441,441,441,441, -441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441, -441,441,441,441,441,441,441,441,441,441,441,441,441,441,441,441, -441,441,441,439,440,440,439,439,439,439,440,440,439,440,440,440, -440,442,442,442,442,442,442,442,442,442,442,442,442,442, 89,443, -444,444,444,444,444,444,444,444,444,444, 89, 89, 89, 89,442,442, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +458,458,458,459,460,460,460,460,460,460,460,460,460,460,460,460, +460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460, +460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460, +460,460,460,458,459,459,458,458,458,458,459,459,458,459,459,459, +459,461,461,461,461,461,461,461,461,461,461,461,461,461, 92,462, +463,463,463,463,463,463,463,463,463,463, 92, 92, 92, 92,461,461, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 109 */ -445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445, -445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445, -445,445,445,445,445,445,445,445,445,446,446,446,446,446,446,447, -447,446,446,447,447,446,446, 89, 89, 89, 89, 89, 89, 89, 89, 89, -445,445,445,446,445,445,445,445,445,445,445,445,446,447, 89, 89, -448,448,448,448,448,448,448,448,448,448, 89, 89,449,449,449,449, -238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, -450,238,238,238,238,238,238,243,243,243,238,239, 89, 89, 89, 89, +464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464, +464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464, +464,464,464,464,464,464,464,464,464,465,465,465,465,465,465,466, +466,465,465,466,466,465,465, 92, 92, 92, 92, 92, 92, 92, 92, 92, +464,464,464,465,464,464,464,464,464,464,464,464,465,466, 92, 92, +467,467,467,467,467,467,467,467,467,467, 92, 92,468,468,468,468, +248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248, +469,248,248,248,248,248,248,253,253,253,248,249, 92, 92, 92, 92, /* block 110 */ -451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,451, -451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,451, -451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,451, -452,451,452,452,452,451,451,452,452,451,451,451,451,451,452,452, -451,452,451, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,451,451,453,454,454, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +470,470,470,470,470,470,470,470,470,470,470,470,470,470,470,470, +470,470,470,470,470,470,470,470,470,470,470,470,470,470,470,470, +470,470,470,470,470,470,470,470,470,470,470,470,470,470,470,470, +471,470,471,471,471,470,470,471,471,470,470,470,470,470,471,471, +470,471,470, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,470,470,472,473,473, +474,474,474,474,474,474,474,474,474,474,474,475,476,476,475,475, +477,477,474,478,478,475,476, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 111 */ - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -455,455,455,455,455,455,455,455,455,455,455,455,455,455,455,455, -455,455,455,455,455,455,455,455,455,455,455,455,455,455,455,455, -455,455,455,456,456,457,456,456,457,456,456,458,456,457, 89, 89, -459,459,459,459,459,459,459,459,459,459, 89, 89, 89, 89, 89, 89, + 92,258,258,258,258,258,258, 92, 92,258,258,258,258,258,258, 92, + 92,258,258,258,258,258,258, 92, 92, 92, 92, 92, 92, 92, 92, 92, +258,258,258,258,258,258,258, 92,258,258,258,258,258,258,258, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 112 */ -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247, 89, 89, 89, 89,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247, 89, 89, 89, 89, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474, +474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474, +474,474,474,475,475,476,475,475,476,475,475,477,475,476, 92, 92, +479,479,479,479,479,479,479,479,479,479, 92, 92, 92, 92, 92, 92, /* block 113 */ -460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460, -460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460, -460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460, -460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460, -460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460, -460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460, -460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460, -460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257, 92, 92, 92, 92,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257, 92, 92, 92, 92, /* block 114 */ -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, +480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, +480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, +480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, +480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, +480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, +480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, +480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, +480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, /* block 115 */ -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401, 89, 89, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401, 89, 89, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, /* block 116 */ -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419, 92, 92, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, /* block 117 */ - 14, 14, 14, 14, 14, 14, 14, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89,136,136,136,136,136, 89, 89, 89, 89, 89,141,138,141, -141,141,141,141,141,141,141,141,141,462,141,141,141,141,141,141, -141,141,141,141,141,141,141, 89,141,141,141,141,141, 89,141, 89, -141,141, 89,141,141, 89,141,141,141,141,141,141,141,141,141,141, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 118 */ -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, + 20, 20, 20, 20, 20, 20, 20, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92,139,139,139,139,139, 92, 92, 92, 92, 92,145,142,145, +145,145,145,145,145,145,145,145,145,482,145,145,145,145,145,145, +145,145,145,145,145,145,145, 92,145,145,145,145,145, 92,145, 92, +145,145, 92,145,145, 92,145,145,145,145,145,145,145,145,145,145, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, /* block 119 */ -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,483,483,483,483,483,483,483,483,483,483,483,483,483,483, +483,483, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, /* block 120 */ -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147, 4, 5, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, /* block 121 */ -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, - 89, 89,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -147,147,147,147,147,147,147,147,147,147,147,147,144, 13, 89, 89, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152, 4, 5, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, /* block 122 */ - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 2, 2, 2, 2, 2, 2, 2, 4, 5, 2, 89, 89, 89, 89, 89, 89, - 84, 84, 84, 84, 84, 84, 84, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 2, 7, 7, 11, 11, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, - 5, 4, 5, 4, 5, 2, 2, 4, 5, 2, 2, 2, 2, 11, 11, 11, - 2, 2, 2, 89, 2, 2, 2, 2, 7, 4, 5, 4, 5, 4, 5, 2, - 2, 2, 6, 7, 6, 6, 6, 89, 2, 3, 2, 2, 89, 89, 89, 89, -147,147,147,147,147, 89,147,147,147,147,147,147,147,147,147,147, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, + 92, 92,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +152,152,152,152,152,152,152,152,152,152,152,152,149, 13, 92, 92, /* block 123 */ -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147, -147,147,147,147,147,147,147,147,147,147,147,147,147, 89, 89, 16, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 2, 2, 2, 2, 2, 2, 2, 4, 5, 2, 92, 92, 92, 92, 92, 92, + 87, 87, 87, 87, 87, 87, 87, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 2, 7, 7, 11, 11, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, + 5, 4, 5, 4, 5, 2, 2, 4, 5, 2, 2, 2, 2, 11, 11, 11, + 2, 2, 2, 92, 2, 2, 2, 2, 7, 4, 5, 4, 5, 4, 5, 2, + 2, 2, 6, 7, 6, 6, 6, 92, 2, 3, 2, 2, 92, 92, 92, 92, +152,152,152,152,152, 92,152,152,152,152,152,152,152,152,152,152, /* block 124 */ - 89, 2, 2, 2, 3, 2, 2, 2, 4, 5, 2, 6, 2, 7, 2, 2, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152, 92, 92, 16, + +/* block 125 */ + 92, 2, 2, 2, 3, 2, 2, 2, 4, 5, 2, 6, 2, 7, 2, 2, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2, 2, 6, 6, 6, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 4, 2, 5, 10, 11, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 4, 6, 5, 6, 4, - 5, 2, 4, 5, 2, 2,396,396,396,396,396,396,396,396,396,396, - 83,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, - -/* block 125 */ -396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, -396,396,396,396,396,396,396,396,396,396,396,396,396,396, 83, 83, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, -247,247,247,247,247,247,247,247,247,247,247,247,247,247,247, 89, - 89, 89,247,247,247,247,247,247, 89, 89,247,247,247,247,247,247, - 89, 89,247,247,247,247,247,247, 89, 89,247,247,247, 89, 89, 89, - 3, 3, 6, 10, 13, 3, 3, 89, 13, 6, 6, 6, 6, 13, 13, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 16, 16, 16, 13, 13, 89, 89, + 5, 2, 4, 5, 2, 2,414,414,414,414,414,414,414,414,414,414, + 85,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, /* block 126 */ -463,463,463,463,463,463,463,463,463,463,463,463, 89,463,463,463, -463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463, -463,463,463,463,463,463,463, 89,463,463,463,463,463,463,463,463, -463,463,463,463,463,463,463,463,463,463,463, 89,463,463, 89,463, -463,463,463,463,463,463,463,463,463,463,463,463,463,463, 89, 89, -463,463,463,463,463,463,463,463,463,463,463,463,463,463, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, +414,414,414,414,414,414,414,414,414,414,414,414,414,414, 85, 85, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,257,257,257,257,257,257, 92, + 92, 92,257,257,257,257,257,257, 92, 92,257,257,257,257,257,257, + 92, 92,257,257,257,257,257,257, 92, 92,257,257,257, 92, 92, 92, + 3, 3, 6, 10, 13, 3, 3, 92, 13, 6, 6, 6, 6, 13, 13, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 16, 16, 16, 13, 13, 92, 92, /* block 127 */ -463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463, -463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463, -463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463, -463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463, -463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463, -463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463, -463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463, -463,463,463,463,463,463,463,463,463,463,463, 89, 89, 89, 89, 89, +484,484,484,484,484,484,484,484,484,484,484,484, 92,484,484,484, +484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, +484,484,484,484,484,484,484, 92,484,484,484,484,484,484,484,484, +484,484,484,484,484,484,484,484,484,484,484, 92,484,484, 92,484, +484,484,484,484,484,484,484,484,484,484,484,484,484,484, 92, 92, +484,484,484,484,484,484,484,484,484,484,484,484,484,484, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 128 */ - 2, 2, 13, 89, 89, 89, 89, 17, 17, 17, 17, 17, 17, 17, 17, 17, +484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, +484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, +484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, +484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, +484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, +484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, +484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, +484,484,484,484,484,484,484,484,484,484,484, 92, 92, 92, 92, 92, + +/* block 129 */ + 2, 2, 2, 92, 92, 92, 92, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 89, 89, 89, 13, 13, 13, 13, 13, 13, 13, 13, 13, -464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464, -464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464, -464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464, -464,464,464,464,464,465,465,465,465,466,466,466,466,466,466,466, + 17, 17, 17, 17, 92, 92, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, +485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485, +485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485, +485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485, +485,485,485,485,485,486,486,486,486,487,487,487,487,487,487,487, -/* block 129 */ -466,466,466,466,466,466,466,466,466,466,465, 89, 89, 89, 89, 89, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +/* block 130 */ +487,487,487,487,487,487,487,487,487,487,486, 92, 92, 92, 92, 92, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 84, 89, 89, - -/* block 130 */ -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,467, 89, 89, 89, -468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468, -468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468, -468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468, -468, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 87, 92, 92, /* block 131 */ -469,469,469,469,469,469,469,469,469,469,469,469,469,469,469,469, -469,469,469,469,469,469,469,469,469,469,469,469,469,469,469, 89, -470,470,470,470, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, -471,472,471,471,471,471,471,471,471,471,472, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488, +488,488,488,488,488,488,488,488,488,488,488,488,488, 92, 92, 92, +489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, +489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, +489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, +489, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 132 */ -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -473,473,473,473,473,473,473,473,473,473,473,473,473,473, 89,474, -475,475,475,475,475,475,475,475,475,475,475,475,475,475,475,475, -475,475,475,475,475,475,475,475,475,475,475,475,475,475,475,475, -475,475,475,475, 89, 89, 89, 89,475,475,475,475,475,475,475,475, -476,477,477,477,477,477, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +490,490,490,490,490,490,490,490,490,490,490,490,490,490,490,490, +490,490,490,490,490,490,490,490,490,490,490,490,490,490,490, 92, +491,491,491,491, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, +492,493,492,492,492,492,492,492,492,492,493, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 133 */ -478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478, -478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478, -478,478,478,478,478,478,478,478,479,479,479,479,479,479,479,479, -479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479, -479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479, -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, +494,494,494,494,494,494,494,494,494,494,494,494,494,494,494,494, +494,494,494,494,494,494,494,494,494,494,494,494,494,494, 92,495, +496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, +496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, +496,496,496,496, 92, 92, 92, 92,496,496,496,496,496,496,496,496, +497,498,498,498,498,498, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 134 */ -481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, -481,481,481,481,481,481,481,481,481,481,481,481,481,481, 89, 89, -482,482,482,482,482,482,482,482,482,482, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499, +499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499, +499,499,499,499,499,499,499,499,500,500,500,500,500,500,500,500, +500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500, +500,500,500,500,500,500,500,500,500,500,500,500,500,500,500,500, +501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, +501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, +501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, /* block 135 */ -483,483,483,483,483,483, 89, 89,483, 89,483,483,483,483,483,483, -483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, -483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483, -483,483,483,483,483,483, 89,483,483, 89, 89, 89,483, 89, 89,483, -484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484, -484,484,484,484,484,484, 89,485,486,486,486,486,486,486,486,486, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502, +502,502,502,502,502,502,502,502,502,502,502,502,502,502, 92, 92, +503,503,503,503,503,503,503,503,503,503, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 136 */ -487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, -487,487,487,487,487,487,488,488,488,488,488,488, 89, 89, 89,489, -490,490,490,490,490,490,490,490,490,490,490,490,490,490,490,490, -490,490,490,490,490,490,490,490,490,490, 89, 89, 89, 89, 89,491, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +504,504,504,504,504,504, 92, 92,504, 92,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, +504,504,504,504,504,504, 92,504,504, 92, 92, 92,504, 92, 92,504, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505, 92,506,507,507,507,507,507,507,507,507, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 137 */ -492,493,493,493, 89,493,493, 89, 89, 89, 89, 89,493,493,493,493, -492,492,492,492, 89,492,492,492, 89,492,492,492,492,492,492,492, -492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, -492,492,492,492, 89, 89, 89, 89,493,493,493, 89, 89, 89, 89,493, -494,494,494,494,494,494,494,494, 89, 89, 89, 89, 89, 89, 89, 89, -495,495,495,495,495,495,495,495,495, 89, 89, 89, 89, 89, 89, 89, -496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, -496,496,496,496,496,496,496,496,496,496,496,496,496,497,497,498, +508,508,508,508,508,508,508,508,508,508,508,508,508,508,508,508, +508,508,508,508,508,508,509,509,509,509,509,509, 92, 92, 92,510, +511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511, +511,511,511,511,511,511,511,511,511,511, 92, 92, 92, 92, 92,512, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 138 */ -499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499, -499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499, -499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499, -499,499,499,499,499,499, 89, 89, 89,500,500,500,500,500,500,500, -501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501, -501,501,501,501,501,501, 89, 89,502,502,502,502,502,502,502,502, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503, 89, 89, 89, 89, 89,504,504,504,504,504,504,504,504, +513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, +513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, +514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514, +514,514,514,514,514,514,514,514, 92, 92, 92, 92, 92, 92,514,514, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 139 */ -505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, -505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, -505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, -505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, -505,505,505,505,505,505,505,505,505, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +515,516,516,516, 92,516,516, 92, 92, 92, 92, 92,516,516,516,516, +515,515,515,515, 92,515,515,515, 92,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515, 92, 92, 92, 92,516,516,516, 92, 92, 92, 92,516, +517,517,517,517,517,517,517,517, 92, 92, 92, 92, 92, 92, 92, 92, +518,518,518,518,518,518,518,518,518, 92, 92, 92, 92, 92, 92, 92, +519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519, +519,519,519,519,519,519,519,519,519,519,519,519,519,520,520,521, /* block 140 */ - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,506, -506,506,506,506,506,506,506,506,506,506,506,506,506,506,506, 89, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522, 92, 92, 92,523,523,523,523,523,523,523, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524, 92, 92,525,525,525,525,525,525,525,525, +526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, +526,526,526, 92, 92, 92, 92, 92,527,527,527,527,527,527,527,527, /* block 141 */ -507,507,508,509,509,509,509,509,509,509,509,509,509,509,509,509, -509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, -509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, -508,508,508,507,507,507,507,508,508,507,507,510,510,511,510,510, -510,510, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528, +528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528, +528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528, +528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528, +528,528,528,528,528,528,528,528,528, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 142 */ -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +529,529,529,529,529,529,529,529,529,529,529,529,529,529,529,529, +529,529,529,529,529,529,529,529,529,529,529,529,529,529,529, 92, /* block 143 */ -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +530,531,530,532,532,532,532,532,532,532,532,532,532,532,532,532, +532,532,532,532,532,532,532,532,532,532,532,532,532,532,532,532, +532,532,532,532,532,532,532,532,532,532,532,532,532,532,532,532, +532,532,532,532,532,532,532,532,531,531,531,531,531,531,531,531, +531,531,531,531,531,531,531,533,533,533,533,533,533,533, 92, 92, + 92, 92,534,534,534,534,534,534,534,534,534,534,534,534,534,534, +534,534,534,534,534,534,535,535,535,535,535,535,535,535,535,535, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 144 */ -513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, -513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, -513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, -513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, -513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, -513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, -513,513,513, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, -514,514,514,514, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +536,536,537,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +537,537,537,536,536,536,536,537,537,536,536,539,539,540,539,539, +539,539, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +541,541,541,541,541,541,541,541,541,541,541,541,541,541,541,541, +541,541,541,541,541,541,541,541,541, 92, 92, 92, 92, 92, 92, 92, +542,542,542,542,542,542,542,542,542,542, 92, 92, 92, 92, 92, 92, /* block 145 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +543,543,543,544,544,544,544,544,544,544,544,544,544,544,544,544, +544,544,544,544,544,544,544,544,544,544,544,544,544,544,544,544, +544,544,544,544,544,544,544,543,543,543,543,543,545,543,543,543, +543,543,543,543,543, 92,546,546,546,546,546,546,546,546,546,546, +547,547,547,547, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 146 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +548,548,549,550,550,550,550,550,550,550,550,550,550,550,550,550, +550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550, +550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550, +550,550,550,549,549,549,548,548,548,548,548,548,548,548,548,549, +549,550,550,550,550,551,551,551,551, 92, 92, 92, 92, 92, 92, 92, +552,552,552,552,552,552,552,552,552,552, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, /* block 147 */ +553,553,553,553,553,553,553,553,553,553,553,553,553,553,553,553, +553,553,553,553,553,553,553,553,553,553,553,553,553,553,553,553, +553,553,553,553,553,553,553,553,553,553,553,554,555,554,555,555, +554,554,554,554,554,554,555,554, 92, 92, 92, 92, 92, 92, 92, 92, +556,556,556,556,556,556,556,556,556,556, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 148 */ +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, + +/* block 149 */ +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, +557,557,557,557,557,557,557,557,557,557,557,557,557,557,557, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 150 */ +558,558,558,558,558,558,558,558,558,558,558,558,558,558,558,558, +558,558,558,558,558,558,558,558,558,558,558,558,558,558,558,558, +558,558,558,558,558,558,558,558,558,558,558,558,558,558,558,558, +558,558,558,558,558,558,558,558,558,558,558,558,558,558,558,558, +558,558,558,558,558,558,558,558,558,558,558,558,558,558,558,558, +558,558,558,558,558,558,558,558,558,558,558,558,558,558,558,558, +558,558,558, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +559,559,559,559, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 151 */ +560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, +560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, +560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, +560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, +560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, +560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, +560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, +560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, + +/* block 152 */ +560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, +560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, +560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 153 */ +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, + +/* block 154 */ +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432,432,432,432,432,432,432,432, +432,432,432,432,432,432,432,432,432, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 155 */ +561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, +561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, +561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, +561,561,561,561,561,561,561,561,561,561,561,561,561,561,561,561, +561,561,561,561,561, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +561,562,562,562,562,562,562,562,562,562,562,562,562,562,562,562, +562,562,562,562,562,562,562,562,562,562,562,562,562,562,562,562, +562,562,562,562,562,562,562,562,562,562,562,562,562,562,562, 92, + +/* block 156 */ + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,563, +563,563,563,564,564,564,564,564,564,564,564,564,564,564,564,564, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 157 */ +414,412, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 158 */ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, @@ -2577,211 +2736,321 @@ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, -/* block 148 */ +/* block 159 */ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 89, 89, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 92, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13,328,328, 84, 84, 84, 13, 13, 13,328,328,328, -328,328,328, 16, 16, 16, 16, 16, 16, 16, 16, 84, 84, 84, 84, 84, + 13, 13, 13, 13, 13,343,343, 87, 87, 87, 13, 13, 13,343,343,343, +343,343,343, 16, 16, 16, 16, 16, 16, 16, 16, 87, 87, 87, 87, 87, -/* block 149 */ - 84, 84, 84, 13, 13, 84, 84, 84, 84, 84, 84, 84, 13, 13, 13, 13, +/* block 160 */ + 87, 87, 87, 13, 13, 87, 87, 87, 87, 87, 87, 87, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 84, 84, 84, 84, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 87, 87, 87, 87, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, -/* block 150 */ -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,516,516,516,466, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +/* block 161 */ +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +487,487,565,565,565,487, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, -/* block 151 */ +/* block 162 */ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 17, 17, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, -/* block 152 */ -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,358,358,358,358,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,359,359, -359,359,359,359,359, 89,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +/* block 163 */ +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,374,374, +374,374,374,374,374, 92,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, -/* block 153 */ -358,358,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,358, 89,358,358, - 89, 89,358, 89, 89,358,358, 89, 89,358,358,358,358, 89,358,358, -358,358,358,358,358,358,359,359,359,359, 89,359, 89,359,359,359, -359,359,359,359, 89,359,359,359,359,359,359,359,359,359,359,359, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, +/* block 164 */ +373,373,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,373, 92,373,373, + 92, 92,373, 92, 92,373,373, 92, 92,373,373,373,373, 92,373,373, +373,373,373,373,373,373,374,374,374,374, 92,374, 92,374,374,374, +374,374,374,374, 92,374,374,374,374,374,374,374,374,374,374,374, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, -/* block 154 */ -359,359,359,359,358,358, 89,358,358,358,358, 89, 89,358,358,358, -358,358,358,358,358, 89,358,358,358,358,358,358,358, 89,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,358,358, 89,358,358,358,358, 89, -358,358,358,358,358, 89,358, 89, 89, 89,358,358,358,358,358,358, -358, 89,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +/* block 165 */ +374,374,374,374,373,373, 92,373,373,373,373, 92, 92,373,373,373, +373,373,373,373,373, 92,373,373,373,373,373,373,373, 92,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,373,373, 92,373,373,373,373, 92, +373,373,373,373,373, 92,373, 92, 92, 92,373,373,373,373,373,373, +373, 92,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, -/* block 155 */ -358,358,358,358,358,358,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,358,358,358,358,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, +/* block 166 */ +373,373,373,373,373,373,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, -/* block 156 */ -359,359,359,359,359,359,359,359,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, -358,358,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, +/* block 167 */ +374,374,374,374,374,374,374,374,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, -/* block 157 */ -358,358,358,358,358,358,358,358,358,358,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359,359, 89, 89,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, -358, 6,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359, 6,359,359,359,359, -359,359,358,358,358,358,358,358,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,358, 6,359,359,359,359, +/* block 168 */ +373,373,373,373,373,373,373,373,373,373,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374,374, 92, 92,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373, 6,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374, 6,374,374,374,374, +374,374,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373, 6,374,374,374,374, -/* block 158 */ -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359, 6,359,359,359,359,359,359,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, -358,358,358,358,358, 6,359,359,359,359,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, 6, -359,359,359,359,359,359,358,358,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, 6, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, +/* block 169 */ +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374, 6,374,374,374,374,374,374,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373, 6,374,374,374,374,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, 6, +374,374,374,374,374,374,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, 6, +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, -/* block 159 */ -359,359,359,359,359,359,359,359,359, 6,359,359,359,359,359,359, -358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358, -358,358,358,358,358,358,358,358,358, 6,359,359,359,359,359,359, -359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, -359,359,359, 6,359,359,359,359,359,359,358,359, 89, 89, 8, 8, +/* block 170 */ +374,374,374,374,374,374,374,374,374, 6,374,374,374,374,374,374, +373,373,373,373,373,373,373,373,373,373,373,373,373,373,373,373, +373,373,373,373,373,373,373,373,373, 6,374,374,374,374,374,374, +374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, +374,374,374, 6,374,374,374,374,374,374,373,374, 92, 92, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, -/* block 160 */ +/* block 171 */ +152,152,152,152, 92,152,152,152,152,152,152,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152, + 92,152,152, 92,152, 92, 92,152, 92,152,152,152,152,152,152,152, +152,152,152, 92,152,152,152,152, 92,152, 92,152, 92, 92, 92, 92, + 92, 92,152, 92, 92, 92, 92,152, 92,152, 92,152, 92,152,152,152, + 92,152,152, 92,152, 92, 92,152, 92,152, 92,152, 92,152, 92,152, + 92,152,152, 92,152, 92, 92,152,152,152,152, 92,152,152,152,152, +152,152,152, 92,152,152,152,152, 92,152,152,152,152, 92,152, 92, + +/* block 172 */ +152,152,152,152,152,152,152,152,152,152, 92,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152, 92, 92, 92, 92, + 92,152,152,152, 92,152,152,152,152,152, 92,152,152,152,152,152, +152,152,152,152,152,152,152,152,152,152,152,152, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +147,147, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 173 */ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, 89, 89, 89, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -/* block 161 */ +/* block 174 */ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, + 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, + 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, -/* block 162 */ - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 89, 89, 89, 89, 89, +/* block 175 */ + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 92, 92, 92, 92, 92, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, - 89, 13, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 13, 89, 13, - 89, 89, 13, 89, 89, 89, 13, 89, 89, 89, 13, 13, 13, 13, 13, 89, - 89, 89, 89, 89, 89, 89, 89, 13, 89, 89, 89, 89, 89, 89, 89, 13, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 13, 89, 13, 13, 89, 89, 13, -/* block 163 */ - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 13, 13, 13, 13, 89, 89, - 13, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +/* block 176 */ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -/* block 164 */ -517, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +/* block 177 */ +566, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 92, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, + 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, -/* block 165 */ -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +/* block 178 */ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 13, 13, 13, 13, 13, 13, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, -/* block 166 */ -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +/* block 179 */ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 92, 13, 13, 13, 13, 13, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, -/* block 167 */ -401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401, -401,401,401,401,401,401,401,401,401,401,401,401,401,401, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +/* block 180 */ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, + 13, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -/* block 168 */ - 89, 16, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +/* block 181 */ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 92, 13, 13, 13, 13, 92, 92, 92, + +/* block 182 */ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, + 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 183 */ + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 13, 13, 13, 13, 13, + +/* block 184 */ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 92, 92, 92, 92, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 185 */ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 186 */ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 187 */ +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 188 */ +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, + +/* block 189 */ +419,419,419,419,419,419,419,419,419,419,419,419,419,419,419,419, +419,419,419,419,419,419,419,419,419,419,419,419,419,419, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + +/* block 190 */ + 92, 16, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, @@ -2789,35 +3058,35 @@ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, -/* block 169 */ - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - -/* block 170 */ - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, +/* block 191 */ + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + +/* block 192 */ + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, -/* block 171 */ -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461, -461,461,461,461,461,461,461,461,461,461,461,461,461,461, 89, 89, +/* block 193 */ +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, +481,481,481,481,481,481,481,481,481,481,481,481,481,481, 92, 92, }; diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_valid_utf8.c php5-5.4.9/ext/pcre/pcrelib/pcre_valid_utf8.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_valid_utf8.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_valid_utf8.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2009 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -52,127 +52,246 @@ *************************************************/ /* This function is called (optionally) at the start of compile or match, to -validate that a supposed UTF-8 string is actually valid. The early check means +check that a supposed UTF-8 string is actually valid. The early check means that subsequent code can assume it is dealing with a valid string. The check -can be turned off for maximum performance, but the consequences of supplying -an invalid string are then undefined. +can be turned off for maximum performance, but the consequences of supplying an +invalid string are then undefined. Originally, this function checked according to RFC 2279, allowing for values in the range 0 to 0x7fffffff, up to 6 bytes long, but ensuring that they were in the canonical format. Once somebody had pointed out RFC 3629 to me (it obsoletes 2279), additional restrictions were applied. The values are now limited to be between 0 and 0x0010ffff, no more than 4 bytes long, and the -subrange 0xd000 to 0xdfff is excluded. +subrange 0xd000 to 0xdfff is excluded. However, the format of 5-byte and 6-byte +characters is still checked. + +From release 8.13 more information about the details of the error are passed +back in the returned value: + +PCRE_UTF8_ERR0 No error +PCRE_UTF8_ERR1 Missing 1 byte at the end of the string +PCRE_UTF8_ERR2 Missing 2 bytes at the end of the string +PCRE_UTF8_ERR3 Missing 3 bytes at the end of the string +PCRE_UTF8_ERR4 Missing 4 bytes at the end of the string +PCRE_UTF8_ERR5 Missing 5 bytes at the end of the string +PCRE_UTF8_ERR6 2nd-byte's two top bits are not 0x80 +PCRE_UTF8_ERR7 3rd-byte's two top bits are not 0x80 +PCRE_UTF8_ERR8 4th-byte's two top bits are not 0x80 +PCRE_UTF8_ERR9 5th-byte's two top bits are not 0x80 +PCRE_UTF8_ERR10 6th-byte's two top bits are not 0x80 +PCRE_UTF8_ERR11 5-byte character is not permitted by RFC 3629 +PCRE_UTF8_ERR12 6-byte character is not permitted by RFC 3629 +PCRE_UTF8_ERR13 4-byte character with value > 0x10ffff is not permitted +PCRE_UTF8_ERR14 3-byte character with value 0xd000-0xdfff is not permitted +PCRE_UTF8_ERR15 Overlong 2-byte sequence +PCRE_UTF8_ERR16 Overlong 3-byte sequence +PCRE_UTF8_ERR17 Overlong 4-byte sequence +PCRE_UTF8_ERR18 Overlong 5-byte sequence (won't ever occur) +PCRE_UTF8_ERR19 Overlong 6-byte sequence (won't ever occur) +PCRE_UTF8_ERR20 Isolated 0x80 byte (not within UTF-8 character) +PCRE_UTF8_ERR21 Byte with the illegal value 0xfe or 0xff Arguments: string points to the string length length of string, or -1 if the string is zero-terminated + errp pointer to an error position offset variable -Returns: < 0 if the string is a valid UTF-8 string - >= 0 otherwise; the value is the offset of the bad byte - -Bad bytes can be: - - . An isolated byte whose most significant bits are 0x80, because this - can only correctly appear within a UTF-8 character; - - . A byte whose most significant bits are 0xc0, but whose other bits indicate - that there are more than 3 additional bytes (i.e. an RFC 2279 starting - byte, which is no longer valid under RFC 3629); - - . - -The returned offset may also be equal to the length of the string; this means -that one or more bytes is missing from the final UTF-8 character. +Returns: = 0 if the string is a valid UTF-8 string + > 0 otherwise, setting the offset of the bad character */ int -_pcre_valid_utf8(USPTR string, int length) +PRIV(valid_utf)(PCRE_PUCHAR string, int length, int *erroroffset) { -#ifdef SUPPORT_UTF8 -register USPTR p; +#ifdef SUPPORT_UTF +register PCRE_PUCHAR p; if (length < 0) { for (p = string; *p != 0; p++); - length = p - string; + length = (int)(p - string); } for (p = string; length-- > 0; p++) { - register int ab; - register int c = *p; - if (c < 128) continue; - if (c < 0xc0) return p - string; - ab = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ - if (ab > 3) return p - string; /* Too many for RFC 3629 */ - if (length < ab) return p + 1 + length - string; /* Missing bytes */ - length -= ab; + register int ab, c, d; + + c = *p; + if (c < 128) continue; /* ASCII character */ + + if (c < 0xc0) /* Isolated 10xx xxxx byte */ + { + *erroroffset = (int)(p - string); + return PCRE_UTF8_ERR20; + } + + if (c >= 0xfe) /* Invalid 0xfe or 0xff bytes */ + { + *erroroffset = (int)(p - string); + return PCRE_UTF8_ERR21; + } + + ab = PRIV(utf8_table4)[c & 0x3f]; /* Number of additional bytes */ + if (length < ab) + { + *erroroffset = (int)(p - string); /* Missing bytes */ + return ab - length; /* Codes ERR1 to ERR5 */ + } + length -= ab; /* Length remaining */ /* Check top bits in the second byte */ - if ((*(++p) & 0xc0) != 0x80) return p - string; - /* Check for overlong sequences for each different length, and for the - excluded range 0xd000 to 0xdfff. */ + if (((d = *(++p)) & 0xc0) != 0x80) + { + *erroroffset = (int)(p - string) - 1; + return PCRE_UTF8_ERR6; + } + + /* For each length, check that the remaining bytes start with the 0x80 bit + set and not the 0x40 bit. Then check for an overlong sequence, and for the + excluded range 0xd800 to 0xdfff. */ switch (ab) { - /* Check for xx00 000x (overlong sequence) */ + /* 2-byte character. No further bytes to check for 0x80. Check first byte + for for xx00 000x (overlong sequence). */ - case 1: - if ((c & 0x3e) == 0) return p - string; - continue; /* We know there aren't any more bytes to check */ + case 1: if ((c & 0x3e) == 0) + { + *erroroffset = (int)(p - string) - 1; + return PCRE_UTF8_ERR15; + } + break; - /* Check for 1110 0000, xx0x xxxx (overlong sequence) or - 1110 1101, 1010 xxxx (0xd000 - 0xdfff) */ + /* 3-byte character. Check third byte for 0x80. Then check first 2 bytes + for 1110 0000, xx0x xxxx (overlong sequence) or + 1110 1101, 1010 xxxx (0xd800 - 0xdfff) */ case 2: - if ((c == 0xe0 && (*p & 0x20) == 0) || - (c == 0xed && *p >= 0xa0)) - return p - string; + if ((*(++p) & 0xc0) != 0x80) /* Third byte */ + { + *erroroffset = (int)(p - string) - 2; + return PCRE_UTF8_ERR7; + } + if (c == 0xe0 && (d & 0x20) == 0) + { + *erroroffset = (int)(p - string) - 2; + return PCRE_UTF8_ERR16; + } + if (c == 0xed && d >= 0xa0) + { + *erroroffset = (int)(p - string) - 2; + return PCRE_UTF8_ERR14; + } break; - /* Check for 1111 0000, xx00 xxxx (overlong sequence) or - greater than 0x0010ffff (f4 8f bf bf) */ + /* 4-byte character. Check 3rd and 4th bytes for 0x80. Then check first 2 + bytes for for 1111 0000, xx00 xxxx (overlong sequence), then check for a + character greater than 0x0010ffff (f4 8f bf bf) */ case 3: - if ((c == 0xf0 && (*p & 0x30) == 0) || - (c > 0xf4 ) || - (c == 0xf4 && *p > 0x8f)) - return p - string; + if ((*(++p) & 0xc0) != 0x80) /* Third byte */ + { + *erroroffset = (int)(p - string) - 2; + return PCRE_UTF8_ERR7; + } + if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */ + { + *erroroffset = (int)(p - string) - 3; + return PCRE_UTF8_ERR8; + } + if (c == 0xf0 && (d & 0x30) == 0) + { + *erroroffset = (int)(p - string) - 3; + return PCRE_UTF8_ERR17; + } + if (c > 0xf4 || (c == 0xf4 && d > 0x8f)) + { + *erroroffset = (int)(p - string) - 3; + return PCRE_UTF8_ERR13; + } break; -#if 0 - /* These cases can no longer occur, as we restrict to a maximum of four - bytes nowadays. Leave the code here in case we ever want to add an option - for longer sequences. */ + /* 5-byte and 6-byte characters are not allowed by RFC 3629, and will be + rejected by the length test below. However, we do the appropriate tests + here so that overlong sequences get diagnosed, and also in case there is + ever an option for handling these larger code points. */ + + /* 5-byte character. Check 3rd, 4th, and 5th bytes for 0x80. Then check for + 1111 1000, xx00 0xxx */ - /* Check for 1111 1000, xx00 0xxx */ case 4: - if (c == 0xf8 && (*p & 0x38) == 0) return p - string; + if ((*(++p) & 0xc0) != 0x80) /* Third byte */ + { + *erroroffset = (int)(p - string) - 2; + return PCRE_UTF8_ERR7; + } + if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */ + { + *erroroffset = (int)(p - string) - 3; + return PCRE_UTF8_ERR8; + } + if ((*(++p) & 0xc0) != 0x80) /* Fifth byte */ + { + *erroroffset = (int)(p - string) - 4; + return PCRE_UTF8_ERR9; + } + if (c == 0xf8 && (d & 0x38) == 0) + { + *erroroffset = (int)(p - string) - 4; + return PCRE_UTF8_ERR18; + } break; - /* Check for leading 0xfe or 0xff, and then for 1111 1100, xx00 00xx */ + /* 6-byte character. Check 3rd-6th bytes for 0x80. Then check for + 1111 1100, xx00 00xx. */ + case 5: - if (c == 0xfe || c == 0xff || - (c == 0xfc && (*p & 0x3c) == 0)) return p - string; + if ((*(++p) & 0xc0) != 0x80) /* Third byte */ + { + *erroroffset = (int)(p - string) - 2; + return PCRE_UTF8_ERR7; + } + if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */ + { + *erroroffset = (int)(p - string) - 3; + return PCRE_UTF8_ERR8; + } + if ((*(++p) & 0xc0) != 0x80) /* Fifth byte */ + { + *erroroffset = (int)(p - string) - 4; + return PCRE_UTF8_ERR9; + } + if ((*(++p) & 0xc0) != 0x80) /* Sixth byte */ + { + *erroroffset = (int)(p - string) - 5; + return PCRE_UTF8_ERR10; + } + if (c == 0xfc && (d & 0x3c) == 0) + { + *erroroffset = (int)(p - string) - 5; + return PCRE_UTF8_ERR19; + } break; -#endif - } - /* Check for valid bytes after the 2nd, if any; all must start 10 */ - while (--ab > 0) + /* Character is valid under RFC 2279, but 4-byte and 5-byte characters are + excluded by RFC 3629. The pointer p is currently at the last byte of the + character. */ + + if (ab > 3) { - if ((*(++p) & 0xc0) != 0x80) return p - string; + *erroroffset = (int)(p - string) - ab; + return (ab == 4)? PCRE_UTF8_ERR11 : PCRE_UTF8_ERR12; } } -#else + +#else /* SUPPORT_UTF */ (void)(string); /* Keep picky compilers happy */ (void)(length); #endif -return -1; +return PCRE_UTF8_ERR0; /* This indicates success */ } /* End of pcre_valid_utf8.c */ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_version.c php5-5.4.9/ext/pcre/pcrelib/pcre_version.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_version.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_version.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2008 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -77,8 +77,13 @@ pre-processor time. This hack uses a standard trick for avoiding calling the STRING macro with an empty argument when doing the test. */ +#ifdef COMPILE_PCRE8 PCRE_EXP_DEFN const char * PCRE_CALL_CONVENTION pcre_version(void) +#else +PCRE_EXP_DEFN const char * PCRE_CALL_CONVENTION +pcre16_version(void) +#endif { return (XSTRING(Z PCRE_PRERELEASE)[1] == 0)? XSTRING(PCRE_MAJOR.PCRE_MINOR PCRE_DATE) : diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcre_xclass.c php5-5.4.9/ext/pcre/pcrelib/pcre_xclass.c --- php5-5.4.4/ext/pcre/pcrelib/pcre_xclass.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcre_xclass.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2010 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -62,39 +62,63 @@ */ BOOL -_pcre_xclass(int c, const uschar *data) +PRIV(xclass)(int c, const pcre_uchar *data, BOOL utf) { int t; BOOL negated = (*data & XCL_NOT) != 0; +(void)utf; +#ifdef COMPILE_PCRE8 +/* In 8 bit mode, this must always be TRUE. Help the compiler to know that. */ +utf = TRUE; +#endif + /* Character values < 256 are matched against a bitmap, if one is present. If not, we still carry on, because there may be ranges that start below 256 in the additional data. */ if (c < 256) { - if ((*data & XCL_MAP) != 0 && (data[1 + c/8] & (1 << (c&7))) != 0) - return !negated; /* char found */ + if ((*data & XCL_MAP) != 0 && + (((pcre_uint8 *)(data + 1))[c/8] & (1 << (c&7))) != 0) + return !negated; /* char found */ } /* First skip the bit map if present. Then match against the list of Unicode properties or large chars or ranges that end with a large char. We won't ever encounter XCL_PROP or XCL_NOTPROP when UCP support is not compiled. */ -if ((*data++ & XCL_MAP) != 0) data += 32; +if ((*data++ & XCL_MAP) != 0) data += 32 / sizeof(pcre_uchar); while ((t = *data++) != XCL_END) { int x, y; if (t == XCL_SINGLE) { - GETCHARINC(x, data); +#ifdef SUPPORT_UTF + if (utf) + { + GETCHARINC(x, data); /* macro generates multiple statements */ + } + else +#endif + x = *data++; if (c == x) return !negated; } else if (t == XCL_RANGE) { - GETCHARINC(x, data); - GETCHARINC(y, data); +#ifdef SUPPORT_UTF + if (utf) + { + GETCHARINC(x, data); /* macro generates multiple statements */ + GETCHARINC(y, data); /* macro generates multiple statements */ + } + else +#endif + { + x = *data++; + y = *data++; + } if (c >= x && c <= y) return !negated; } @@ -115,7 +139,7 @@ break; case PT_GC: - if ((data[1] == _pcre_ucp_gentype[prop->chartype]) == (t == XCL_PROP)) + if ((data[1] == PRIV(ucp_gentype)[prop->chartype]) == (t == XCL_PROP)) return !negated; break; @@ -128,28 +152,28 @@ break; case PT_ALNUM: - if ((_pcre_ucp_gentype[prop->chartype] == ucp_L || - _pcre_ucp_gentype[prop->chartype] == ucp_N) == (t == XCL_PROP)) + if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L || + PRIV(ucp_gentype)[prop->chartype] == ucp_N) == (t == XCL_PROP)) return !negated; break; case PT_SPACE: /* Perl space */ - if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z || + if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR) == (t == XCL_PROP)) return !negated; break; case PT_PXSPACE: /* POSIX space */ - if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z || + if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z || c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || c == CHAR_FF || c == CHAR_CR) == (t == XCL_PROP)) return !negated; break; case PT_WORD: - if ((_pcre_ucp_gentype[prop->chartype] == ucp_L || - _pcre_ucp_gentype[prop->chartype] == ucp_N || c == CHAR_UNDERSCORE) + if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L || + PRIV(ucp_gentype)[prop->chartype] == ucp_N || c == CHAR_UNDERSCORE) == (t == XCL_PROP)) return !negated; break; diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcredemo.c php5-5.4.9/ext/pcre/pcrelib/pcredemo.c --- php5-5.4.4/ext/pcre/pcrelib/pcredemo.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcredemo.c 2012-11-21 05:12:20.000000000 +0000 @@ -248,7 +248,7 @@ * more than one byte. * * * * However, there is a complication concerned with newlines. When the * -* newline convention is such that CRLF is a valid newline, we want must * +* newline convention is such that CRLF is a valid newline, we must * * advance by two characters rather than one. The newline convention can * * be set in the regex by (*CR), etc.; if not, we must find the default. * *************************************************************************/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcreposix.c php5-5.4.9/ext/pcre/pcrelib/pcreposix.c --- php5-5.4.4/ext/pcre/pcrelib/pcreposix.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcreposix.c 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2010 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -150,6 +150,16 @@ REG_BADPAT, /* (*MARK) must have an argument */ REG_INVARG, /* this version of PCRE is not compiled with PCRE_UCP support */ REG_BADPAT, /* \c must be followed by an ASCII character */ + REG_BADPAT, /* \k is not followed by a braced, angle-bracketed, or quoted name */ + /* 70 */ + REG_BADPAT, /* internal error: unknown opcode in find_fixedlength() */ + REG_BADPAT, /* \N is not supported in a class */ + REG_BADPAT, /* too many forward references */ + REG_BADPAT, /* disallowed UTF-8/16 code point (>= 0xd800 && <= 0xdfff) */ + REG_BADPAT, /* invalid UTF-16 string (should not occur) */ + /* 75 */ + REG_BADPAT, /* overlong MARK name */ + REG_BADPAT /* character value in \u.... sequence is too large */ }; /* Table of texts corresponding to POSIX error codes */ @@ -220,7 +230,7 @@ PCREPOSIX_EXP_DEFN void PCRE_CALL_CONVENTION regfree(regex_t *preg) { -(pcre_free)(preg->re_pcre); +(PUBL(free))(preg->re_pcre); } @@ -265,11 +275,12 @@ if (preg->re_pcre == NULL) { - return (errorcode < sizeof(eint)/sizeof(const int))? + return (errorcode < (int)(sizeof(eint)/sizeof(const int)))? eint[errorcode] : REG_BADPAT; } -preg->re_nsub = pcre_info((const pcre *)preg->re_pcre, NULL, NULL); +(void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT, + &(preg->re_nsub)); return 0; } @@ -395,6 +406,7 @@ case PCRE_ERROR_MATCHLIMIT: return REG_ESPACE; case PCRE_ERROR_BADUTF8: return REG_INVARG; case PCRE_ERROR_BADUTF8_OFFSET: return REG_INVARG; + case PCRE_ERROR_BADMODE: return REG_INVARG; default: return REG_ASSERT; } } diff -Nru php5-5.4.4/ext/pcre/pcrelib/pcreposix.h php5-5.4.9/ext/pcre/pcrelib/pcreposix.h --- php5-5.4.4/ext/pcre/pcrelib/pcreposix.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/pcreposix.h 2012-11-21 05:12:20.000000000 +0000 @@ -9,7 +9,7 @@ Compatible Regular Expression library. It defines the things POSIX says should be there. I hope. - Copyright (c) 1997-2009 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/grepinput php5-5.4.9/ext/pcre/pcrelib/testdata/grepinput --- php5-5.4.4/ext/pcre/pcrelib/testdata/grepinput 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/grepinput 2012-11-21 05:12:20.000000000 +0000 @@ -602,6 +602,8 @@ AB.VE AB.VE the turtle +010203040506 + PUT NEW DATA ABOVE THIS LINE. ============================= diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/grepinput8 php5-5.4.9/ext/pcre/pcrelib/testdata/grepinput8 --- php5-5.4.4/ext/pcre/pcrelib/testdata/grepinput8 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/grepinput8 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,5 @@ X one -X two X three X four -X five +X two X three X four X five X six X seven…X eight
X nine
X ten diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/grepoutput php5-5.4.9/ext/pcre/pcrelib/testdata/grepoutput --- php5-5.4.4/ext/pcre/pcrelib/testdata/grepoutput 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/grepoutput 2012-11-21 05:12:20.000000000 +0000 @@ -10,7 +10,7 @@ 7:PATTERN at the start of a line. 8:In the middle of a line, PATTERN appears. 10:This pattern is in lower case. -608:Check up on PATTERN near the end. +610:Check up on PATTERN near the end. RC=0 ---------------------------- Test 4 ------------------------------ 4 @@ -19,7 +19,7 @@ ./testdata/grepinput:7:PATTERN at the start of a line. ./testdata/grepinput:8:In the middle of a line, PATTERN appears. ./testdata/grepinput:10:This pattern is in lower case. -./testdata/grepinput:608:Check up on PATTERN near the end. +./testdata/grepinput:610:Check up on PATTERN near the end. ./testdata/grepinputx:3:Here is the pattern again. ./testdata/grepinputx:5:Pattern ./testdata/grepinputx:42:This line contains pattern not on a line by itself. @@ -28,7 +28,7 @@ 7:PATTERN at the start of a line. 8:In the middle of a line, PATTERN appears. 10:This pattern is in lower case. -608:Check up on PATTERN near the end. +610:Check up on PATTERN near the end. 3:Here is the pattern again. 5:Pattern 42:This line contains pattern not on a line by itself. @@ -323,10 +323,10 @@ ./testdata/grepinput-9- ./testdata/grepinput:10:This pattern is in lower case. -- -./testdata/grepinput-605-PUT NEW DATA ABOVE THIS LINE. -./testdata/grepinput-606-============================= -./testdata/grepinput-607- -./testdata/grepinput:608:Check up on PATTERN near the end. +./testdata/grepinput-607-PUT NEW DATA ABOVE THIS LINE. +./testdata/grepinput-608-============================= +./testdata/grepinput-609- +./testdata/grepinput:610:Check up on PATTERN near the end. -- ./testdata/grepinputx-1-This is a second file of input for the pcregrep tests. ./testdata/grepinputx-2- @@ -348,8 +348,8 @@ ./testdata/grepinput-12-Here follows a whole lot of stuff that makes the file over 24K long. ./testdata/grepinput-13- -- -./testdata/grepinput:608:Check up on PATTERN near the end. -./testdata/grepinput-609-This is the last line of this file. +./testdata/grepinput:610:Check up on PATTERN near the end. +./testdata/grepinput-611-This is the last line of this file. -- ./testdata/grepinputx:3:Here is the pattern again. ./testdata/grepinputx-4- @@ -380,6 +380,7 @@ ---------------------------- Test 37 ----------------------------- aaaaa0 aaaaa2 +010203040506 RC=0 ======== STDERR ======== pcregrep: pcre_exec() gave error -8 while matching this text: @@ -390,7 +391,7 @@ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -pcregrep: Error -8 or -21 means that a resource limit was exceeded. +pcregrep: Error -8, -21 or -27 means that a resource limit was exceeded. pcregrep: Check your regex for nested unlimited loops. ---------------------------- Test 38 ------------------------------ This line contains a binary zero here >< for testing. @@ -514,7 +515,7 @@ that the pcregrep command is working correctly. The file must be more than 24K long so that it needs more than a single read -pcregrep: Error -8 or -21 means that a resource limit was exceeded. +pcregrep: Error -8, -21 or -27 means that a resource limit was exceeded. pcregrep: Check your regex for nested unlimited loops. RC=1 ---------------------------- Test 63 ----------------------------- @@ -524,7 +525,7 @@ that the pcregrep command is working correctly. The file must be more than 24K long so that it needs more than a single read -pcregrep: Error -8 or -21 means that a resource limit was exceeded. +pcregrep: Error -8, -21 or -27 means that a resource limit was exceeded. pcregrep: Check your regex for nested unlimited loops. RC=1 ---------------------------- Test 64 ------------------------------ @@ -593,3 +594,77 @@ triple: t6_txt s2_tag s_txt p_tag p_txt o_tag o_txt RC=0 +---------------------------- Test 71 ----------------------------- +01 +RC=0 +---------------------------- Test 72 ----------------------------- +010203040506 +RC=0 +---------------------------- Test 73 ----------------------------- +01 +RC=0 +---------------------------- Test 74 ----------------------------- +01 +02 +RC=0 +---------------------------- Test 75 ----------------------------- +010203040506 +RC=0 +---------------------------- Test 76 ----------------------------- +01 +02 +RC=0 +---------------------------- Test 77 ----------------------------- +01 +03 +RC=0 +---------------------------- Test 78 ----------------------------- +010203040506 +RC=0 +---------------------------- Test 79 ----------------------------- +01 +03 +RC=0 +---------------------------- Test 80 ----------------------------- +01 +RC=0 +---------------------------- Test 81 ----------------------------- +010203040506 +RC=0 +---------------------------- Test 82 ----------------------------- +01 +RC=0 +---------------------------- Test 83 ----------------------------- +pcregrep: line 4 of file ./testdata/grepinput3 is too long for the internal buffer +pcregrep: check the --buffer-size option +RC=2 +---------------------------- Test 84 ----------------------------- +testdata/grepinputv:fox jumps +testdata/grepinputx:complete pair +testdata/grepinputx:That was a complete pair +testdata/grepinputx:complete pair +RC=0 +---------------------------- Test 85 ----------------------------- +./testdata/grepinput3:Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +RC=0 +---------------------------- Test 86 ----------------------------- +Binary file ./testdata/grepbinary matches +RC=0 +---------------------------- Test 87 ----------------------------- +RC=1 +---------------------------- Test 88 ----------------------------- +Binary file ./testdata/grepbinary matches +RC=0 +---------------------------- Test 89 ----------------------------- +RC=1 +---------------------------- Test 90 ----------------------------- +RC=1 +---------------------------- Test 91 ----------------------------- +The quick brown fx jumps over the lazy dog. +RC=0 +---------------------------- Test 92 ----------------------------- +The quick brown fx jumps over the lazy dog. +RC=0 +---------------------------- Test 93 ----------------------------- +The quick brown fx jumps over the lazy dog. +RC=0 diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/grepoutput8 php5-5.4.9/ext/pcre/pcrelib/testdata/grepoutput8 --- php5-5.4.4/ext/pcre/pcrelib/testdata/grepoutput8 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/grepoutput8 2012-11-21 05:12:20.000000000 +0000 @@ -1,11 +1,12 @@ ---------------------------- Test U1 ------------------------------ 1:X one -2:X two 3:X three 4:X four -5:X five +2:X two 3:X three 4:X four 5:X five 6:X six 7:X seven…8:X eight
9:X nine
10:X ten +RC=0 ---------------------------- Test U2 ------------------------------ 12-Before 111 13-Before 222
14-Before 333…15:Match 16-After 111 17-After 222
18-After 333 +RC=0 diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/grepoutputN php5-5.4.9/ext/pcre/pcrelib/testdata/grepoutputN --- php5-5.4.4/ext/pcre/pcrelib/testdata/grepoutputN 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/grepoutputN 2012-11-21 05:12:20.000000000 +0000 @@ -1,22 +1,16 @@ ---------------------------- Test N1 ------------------------------ -1:abc -2:def ----------------------------- Test N2 ------------------------------ -1:abc -def +1:abc 2:def ---------------------------- Test N2 ------------------------------ +1:abc def 2:ghi jkl---------------------------- Test N3 ------------------------------ -2:def -3: +2:def 3: ghi jkl---------------------------- Test N4 ------------------------------ 2:ghi jkl---------------------------- Test N5 ------------------------------ -1:abc -2:def +1:abc 2:def 3:ghi 4:jkl---------------------------- Test N6 ------------------------------ -1:abc -2:def +1:abc 2:def 3:ghi 4:jkl \ No newline at end of file diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testinput1 php5-5.4.9/ext/pcre/pcrelib/testdata/testinput1 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testinput1 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testinput1 2012-11-21 05:12:20.000000000 +0000 @@ -1,5 +1,6 @@ /-- This set of tests is for features that are compatible with all versions of - Perl 5, in non-UTF-8 mode. --/ + Perl >= 5.10, in non-UTF-8 mode. It should run clean for both the 8-bit and + 16-bit PCRE libraries. --/ /the quick brown fox/ the quick brown fox @@ -4079,4 +4080,1186 @@ /^\c/ ? +/(abc)\1/i + abc + +/(abc)\1/ + abc + +/[^a]*/i + 12abc + 12ABC + +/[^a]*+/i + 12abc + 12ABC + +/[^a]*?X/i + ** Failers + 12abc + 12ABC + +/[^a]+?X/i + ** Failers + 12abc + 12ABC + +/[^a]?X/i + 12aXbcX + 12AXBCX + BCX + +/[^a]??X/i + 12aXbcX + 12AXBCX + BCX + +/[^a]?+X/i + 12aXbcX + 12AXBCX + BCX + +/[^a]{2,3}/i + abcdef + ABCDEF + +/[^a]{2,3}?/i + abcdef + ABCDEF + +/[^a]{2,3}+/i + abcdef + ABCDEF + +/((a|)+)+Z/ + Z + +/(a)b|(a)c/ + ac + +/(?>(a))b|(a)c/ + ac + +/(?=(a))ab|(a)c/ + ac + +/((?>(a))b|(a)c)/ + ac + +/((?>(a))b|(a)c)++/ + ac + +/(?:(?>(a))b|(a)c)++/ + ac + +/(?=(?>(a))b|(a)c)(..)/ + ac + +/(?>(?>(a))b|(a)c)/ + ac + +/(?:(?>([ab])))+a=/+ + =ba= + +/(?>([ab]))+a=/+ + =ba= + +/((?>(a+)b)+(aabab))/ + aaaabaaabaabab + +/(?>a+|ab)+?c/ + aabc + +/(?>a+|ab)+c/ + aabc + +/(?:a+|ab)+c/ + aabc + +/(?(?=(a))a)/ + a + +/(?(?=(a))a)(b)/ + ab + +/^(?:a|ab)++c/ + aaaabc + +/^(?>a|ab)++c/ + aaaabc + +/^(?:a|ab)+c/ + aaaabc + +/(?=abc){3}abc/+ + abcabcabc + ** Failers + xyz + +/(?=abc)+abc/+ + abcabcabc + ** Failers + xyz + +/(?=abc)++abc/+ + abcabcabc + ** Failers + xyz + +/(?=abc){0}xyz/ + xyz + +/(?=abc){1}xyz/ + ** Failers + xyz + +/(?=(a))?./ + ab + bc + +/(?=(a))??./ + ab + bc + +/^(?=(a)){0}b(?1)/ + backgammon + +/^(?=(?1))?[az]([abc])d/ + abd + zcdxx + +/^(?!a){0}\w+/ + aaaaa + +/(?<=(abc))?xyz/ + abcxyz + pqrxyz + +/^[\g]+/ + ggg<<>> + ** Failers + \\ga + +/^[\ga]+/ + gggagagaxyz + +/^[:a[:digit:]]+/ + aaaa444:::Z + +/^[:a[:digit:]:b]+/ + aaaa444:::bbbZ + +/[:a]xxx[b:]/ + :xxx: + +/(?<=a{2})b/i + xaabc + ** Failers + xabc + +/(?XNNNYZ + > X NYQZ + ** Failers + >XYZ + > X NY Z + +/\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ + >XY\x0aZ\x0aA\x0bNN\x0c + >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c + +/(foo)\Kbar/ + foobar + +/(foo)(\Kbar|baz)/ + foobar + foobaz + +/(foo\Kbar)baz/ + foobarbaz + +/abc\K|def\K/g+ + Xabcdefghi + +/ab\Kc|de\Kf/g+ + Xabcdefghi + +/(?=C)/g+ + ABCDECBA + +/^abc\K/+ + abcdef + ** Failers + defabcxyz + +/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/ + ababababbbabZXXXX + +/(?tom|bon)-\g{A}/ + tom-tom + bon-bon + +/(^(a|b\g{-1}))/ + bacxxx + +/(?|(abc)|(xyz))\1/ + abcabc + xyzxyz + ** Failers + abcxyz + xyzabc + +/(?|(abc)|(xyz))(?1)/ + abcabc + xyzabc + ** Failers + xyzxyz + +/^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/ + XYabcdY + +/^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/ + XYabcdY + +/^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/ + XYabcdY + +/(?'abc'\w+):\k{2}/ + a:aaxyz + ab:ababxyz + ** Failers + a:axyz + ab:abxyz + +/(?'abc'\w+):\g{abc}{2}/ + a:aaxyz + ab:ababxyz + ** Failers + a:axyz + ab:abxyz + +/^(?a)? (?()b|c) (?('ab')d|e)/x + abd + ce + +/^(a.)\g-1Z/ + aXaXZ + +/^(a.)\g{-1}Z/ + aXaXZ + +/^(?(DEFINE) (? a) (? b) ) (?&A) (?&B) /x + abcd + +/(?(?&NAME_PAT))\s+(?(?&ADDRESS_PAT)) + (?(DEFINE) + (?[a-z]+) + (?\d+) + )/x + metcalfe 33 + +/(?(DEFINE)(?2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/ + 1.2.3.4 + 131.111.10.206 + 10.0.0.0 + ** Failers + 10.6 + 455.3.4.5 + +/\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/ + 1.2.3.4 + 131.111.10.206 + 10.0.0.0 + ** Failers + 10.6 + 455.3.4.5 + +/^(\w++|\s++)*$/ + now is the time for all good men to come to the aid of the party + *** Failers + this is not a line with only words and spaces! + +/(\d++)(\w)/ + 12345a + *** Failers + 12345+ + +/a++b/ + aaab + +/(a++b)/ + aaab + +/(a++)b/ + aaab + +/([^()]++|\([^()]*\))+/ + ((abc(ade)ufh()()x + +/\(([^()]++|\([^()]+\))+\)/ + (abc) + (abc(def)xyz) + *** Failers + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/^([^()]|\((?1)*\))*$/ + abc + a(b)c + a(b(c))d + *** Failers) + a(b(c)d + +/^>abc>([^()]|\((?1)*\))*abc>123abc>1(2)3abc>(1(2)3)]*+) | (?2)) * >))/x + <> + + hij> + hij> + def> + + *** Failers + a)(?<=b(?&X))/ + baz + +/^(?|(abc)|(def))\1/ + abcabc + defdef + ** Failers + abcdef + defabc + +/^(?|(abc)|(def))(?1)/ + abcabc + defabc + ** Failers + defdef + abcdef + +/(?:a(? (?')|(?")) |b(? (?')|(?")) ) (?('quote')[a-z]+|[0-9]+)/xJ + a\"aaaaa + b\"aaaaa + ** Failers + b\"11111 + +/(?:(?1)|B)(A(*F)|C)/ + ABCD + CCD + ** Failers + CAD + +/^(?:(?1)|B)(A(*F)|C)/ + CCD + BCD + ** Failers + ABCD + CAD + BAD + +/(?:(?1)|B)(A(*ACCEPT)XX|C)D/ + AAD + ACD + BAD + BCD + BAX + ** Failers + ACX + ABC + +/(?(DEFINE)(A))B(?1)C/ + BAC + +/(?(DEFINE)((A)\2))B(?1)C/ + BAAC + +/(? \( ( [^()]++ | (?&pn) )* \) )/x + (ab(cd)ef) + +/^(?!a(*SKIP)b)/ + ac + +/^(?=a(*SKIP)b|ac)/ + ** Failers + ac + +/^(?=a(*THEN)b|ac)/ + ac + +/^(?=a(*PRUNE)b)/ + ab + ** Failers + ac + +/^(?=a(*ACCEPT)b)/ + ac + +/^(?(?!a(*SKIP)b))/ + ac + +/(?>a\Kb)/ + ab + +/((?>a\Kb))/ + ab + +/(a\Kb)/ + ab + +/^a\Kcz|ac/ + ac + +/(?>a\Kbz|ab)/ + ab + +/^(?&t)(?(DEFINE)(?a\Kb))$/ + ab + +/^([^()]|\((?1)*\))*$/ + a(b)c + a(b(c)d)e + +/(?P(?P0)(?P>L1)|(?P>L2))/ + 0 + 00 + 0000 + +/(?P(?P0)|(?P>L2)(?P>L1))/ + 0 + 00 + 0000 + +/--- This one does fail, as expected, in Perl. It needs the complex item at the + end of the pattern. A single letter instead of (B|D) makes it not fail, + which I think is a Perl bug. --- / + +/A(*COMMIT)(B|D)/ + ACABX + +/--- Check the use of names for failure ---/ + +/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K + ** Failers + AC + CB + +/--- Force no study, otherwise mark is not seen. The studied version is in + test 2 because it isn't Perl-compatible. ---/ + +/(*MARK:A)(*SKIP:B)(C|X)/KSS + C + D + +/^(A(*THEN:A)B|C(*THEN:B)D)/K + ** Failers + CB + +/^(?:A(*THEN:A)B|C(*THEN:B)D)/K + CB + +/^(?>A(*THEN:A)B|C(*THEN:B)D)/K + CB + +/--- This should succeed, as the skip causes bump to offset 1 (the mark). Note +that we have to have something complicated such as (B|Z) at the end because, +for Perl, a simple character somehow causes an unwanted optimization to mess +with the handling of backtracking verbs. ---/ + +/A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK + AAAC + +/--- Test skipping over a non-matching mark. ---/ + +/A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK + AAAC + +/--- Check shorthand for MARK ---/ + +/A(*:A)A+(*SKIP:A)(B|Z) | AC/xK + AAAC + +/--- Don't loop! Force no study, otherwise mark is not seen. ---/ + +/(*:A)A+(*SKIP:A)(B|Z)/KSS + AAAC + +/--- This should succeed, as a non-existent skip name disables the skip ---/ + +/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK + AAAC + +/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK + AAAC + +/--- COMMIT at the start of a pattern should act like an anchor. Again, +however, we need the complication for Perl. ---/ + +/(*COMMIT)(A|P)(B|P)(C|P)/ + ABCDEFG + ** Failers + DEFGABC + +/--- COMMIT inside an atomic group can't stop backtracking over the group. ---/ + +/(\w+)(?>b(*COMMIT))\w{2}/ + abbb + +/(\w+)b(*COMMIT)\w{2}/ + abbb + +/--- Check opening parens in comment when seeking forward reference. ---/ + +/(?&t)(?#()(?(DEFINE)(?a))/ + bac + +/--- COMMIT should override THEN ---/ + +/(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/ + yes + +/(?>(*COMMIT)(yes|no)(*THEN)(*F))?/ + yes + +/b?(*SKIP)c/ + bc + abc + +/(*SKIP)bc/ + a + +/(*SKIP)b/ + a + +/(?P(?P=abn)xxx|)+/ + xxx + +/(?i:([^b]))(?1)/ + aa + aA + ** Failers + ab + aB + Ba + ba + +/^(?&t)*+(?(DEFINE)(?a))\w$/ + aaaaaaX + ** Failers + aaaaaa + +/^(?&t)*(?(DEFINE)(?a))\w$/ + aaaaaaX + aaaaaa + +/^(a)*+(\w)/ + aaaaX + YZ + ** Failers + aaaa + +/^(?:a)*+(\w)/ + aaaaX + YZ + ** Failers + aaaa + +/^(a)++(\w)/ + aaaaX + ** Failers + aaaa + YZ + +/^(?:a)++(\w)/ + aaaaX + ** Failers + aaaa + YZ + +/^(a)?+(\w)/ + aaaaX + YZ + +/^(?:a)?+(\w)/ + aaaaX + YZ + +/^(a){2,}+(\w)/ + aaaaX + ** Failers + aaa + YZ + +/^(?:a){2,}+(\w)/ + aaaaX + ** Failers + aaa + YZ + +/(a|)*(?1)b/ + b + ab + aab + +/(a)++(?1)b/ + ** Failers + ab + aab + +/(a)*+(?1)b/ + ** Failers + ab + aab + +/(?1)(?:(b)){0}/ + b + +/(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x + foo(bar(baz)+baz(bop)) + +/(A (A|B(*ACCEPT)|C) D)(E)/x + AB + +/\A.*?(?:a|b(*THEN)c)/ + ba + +/\A.*?(?:a|bc)/ + ba + +/\A.*?(a|b(*THEN)c)/ + ba + +/\A.*?(a|bc)/ + ba + +/\A.*?(?:a|b(*THEN)c)++/ + ba + +/\A.*?(?:a|bc)++/ + ba + +/\A.*?(a|b(*THEN)c)++/ + ba + +/\A.*?(a|bc)++/ + ba + +/\A.*?(?:a|b(*THEN)c|d)/ + ba + +/\A.*?(?:a|bc|d)/ + ba + +/(?:(b))++/ + beetle + +/(?(?=(a(*ACCEPT)z))a)/ + a + +/^(a)(?1)+ab/ + aaaab + +/^(a)(?1)++ab/ + aaaab + +/^(?=a(*:M))aZ/K + aZbc + +/^(?!(*:M)b)aZ/K + aZbc + +/(?(DEFINE)(a))?b(?1)/ + backgammon + +/^\N+/ + abc\ndef + +/^\N{1,}/ + abc\ndef + +/(?(R)a+|(?R)b)/ + aaaabcde + +/(?(R)a+|((?R))b)/ + aaaabcde + +/((?(R)a+|(?1)b))/ + aaaabcde + +/((?(R1)a+|(?1)b))/ + aaaabcde + +/a(*:any +name)/K + abc + +/(?>(?&t)c|(?&t))(?(DEFINE)(?a|b(*PRUNE)c))/ + a + ba + bba + +/--- Checking revised (*THEN) handling ---/ + +/--- Capture ---/ + +/^.*? (a(*THEN)b) c/x + aabc + +/^.*? (a(*THEN)b|(*F)) c/x + aabc + +/^.*? ( (a(*THEN)b) | (*F) ) c/x + aabc + +/^.*? ( (a(*THEN)b) ) c/x + aabc + +/--- Non-capture ---/ + +/^.*? (?:a(*THEN)b) c/x + aabc + +/^.*? (?:a(*THEN)b|(*F)) c/x + aabc + +/^.*? (?: (?:a(*THEN)b) | (*F) ) c/x + aabc + +/^.*? (?: (?:a(*THEN)b) ) c/x + aabc + +/--- Atomic ---/ + +/^.*? (?>a(*THEN)b) c/x + aabc + +/^.*? (?>a(*THEN)b|(*F)) c/x + aabc + +/^.*? (?> (?>a(*THEN)b) | (*F) ) c/x + aabc + +/^.*? (?> (?>a(*THEN)b) ) c/x + aabc + +/--- Possessive capture ---/ + +/^.*? (a(*THEN)b)++ c/x + aabc + +/^.*? (a(*THEN)b|(*F))++ c/x + aabc + +/^.*? ( (a(*THEN)b)++ | (*F) )++ c/x + aabc + +/^.*? ( (a(*THEN)b)++ )++ c/x + aabc + +/--- Possessive non-capture ---/ + +/^.*? (?:a(*THEN)b)++ c/x + aabc + +/^.*? (?:a(*THEN)b|(*F))++ c/x + aabc + +/^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x + aabc + +/^.*? (?: (?:a(*THEN)b)++ )++ c/x + aabc + +/--- Condition assertion ---/ + +/^(?(?=a(*THEN)b)ab|ac)/ + ac + +/--- Condition ---/ + +/^.*?(?(?=a)a|b(*THEN)c)/ + ba + +/^.*?(?:(?(?=a)a|b(*THEN)c)|d)/ + ba + +/^.*?(?(?=a)a(*THEN)b|c)/ + ac + +/--- Assertion ---/ + +/^.*(?=a(*THEN)b)/ + aabc + +/------------------------------/ + +/(?>a(*:m))/imsxSK + a + +/(?>(a)(*:m))/imsxSK + a + +/(?<=a(*ACCEPT)b)c/ + xacd + +/(?<=(a(*ACCEPT)b))c/ + xacd + +/(?<=(a(*COMMIT)b))c/ + xabcd + ** Failers + xacd + +/(?a?)*)*c/ + aac + /-- End of testinput1 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testinput10 php5-5.4.9/ext/pcre/pcrelib/testdata/testinput10 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testinput10 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testinput10 2012-11-21 05:12:20.000000000 +0000 @@ -1,137 +1,1029 @@ -/-- These are a few representative patterns whose lengths and offsets are to be -shown when the link size is 2. This is just a doublecheck test to ensure the -sizes don't go horribly wrong when something is changed. The pattern contents -are all themselves checked in other tests. Unicode, including property support, -is required for these tests. --/ - -/((?i)b)/BM - -/(?s)(.*X|^B)/BM - -/(?s:.*X|^B)/BM - -/^[[:alnum:]]/BM - -/#/IxMD - -/a#/IxMD - -/x?+/BM - -/x++/BM - -/x{1,3}+/BM - -/(x)*+/BM - -/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/BM - -|8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|BM - -|\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|BM - -/(a(?1)b)/BM - -/(a(?1)+b)/BM - -/a(?Pb|c)d(?Pe)/BM - -/(?:a(?Pc(?Pd)))(?Pa)/BM - -/(?Pa)...(?P=a)bbb(?P>a)d/BM - -/abc(?C255)de(?C)f/BM - -/abcde/CBM - -/\x{100}/8BM - -/\x{1000}/8BM - -/\x{10000}/8BM - -/\x{100000}/8BM - -/\x{1000000}/8BM - -/\x{4000000}/8BM - -/\x{7fffFFFF}/8BM - -/[\x{ff}]/8BM - -/[\x{100}]/8BM - -/\x80/8BM - -/\xff/8BM - -/\x{0041}\x{2262}\x{0391}\x{002e}/D8M +/-- This set of tests check Unicode property support with the DFA matching + functionality of pcre_dfa_exec(). The -dfa flag must be used with pcretest + when running it. --/ + +/\pL\P{Nd}/8 + AB + *** Failers + A0 + 00 + +/\X./8 + AB + A\x{300}BC + A\x{300}\x{301}\x{302}BC + *** Failers + \x{300} + +/\X\X/8 + ABC + A\x{300}B\x{300}\x{301}C + A\x{300}\x{301}\x{302}BC + *** Failers + \x{300} + +/^\pL+/8 + abcd + a + *** Failers + +/^\PL+/8 + 1234 + = + *** Failers + abcd + +/^\X+/8 + abcdA\x{300}\x{301}\x{302} + A\x{300}\x{301}\x{302} + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} + a + *** Failers + \x{300}\x{301}\x{302} + +/\X?abc/8 + abc + A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + \x{300}abc + *** Failers + +/^\X?abc/8 + abc + A\x{300}abc + *** Failers + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + \x{300}abc + +/\X*abc/8 + abc + A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + \x{300}abc + *** Failers + +/^\X*abc/8 + abc + A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + *** Failers + \x{300}abc + +/^\pL?=./8 + A=b + =c + *** Failers + 1=2 + AAAA=b + +/^\pL*=./8 + AAAA=b + =c + *** Failers + 1=2 + +/^\X{2,3}X/8 + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + *** Failers + X + A\x{300}\x{301}\x{302}X + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + +/^\pC\pL\pM\pN\pP\pS\pZ\p{Xsp}/8 + >\x{1680}\x{2028}\x{0b} + ** Failers + \x{0b} -/[^a]/BM +/^>\p{Xsp}+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} -/[^a]/8BM +/^>\p{Xsp}*/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>\p{Xsp}{2,9}/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>[\p{Xsp}]/8 + >\x{2028}\x{0b} + +/^>[\p{Xsp}]+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>\p{Xps}/8 + >\x{1680}\x{2028}\x{0b} + >\x{a0} + ** Failers + \x{0b} -/[^\xaa]/BM +/^>\p{Xps}+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} -/[^\xaa]/8BM +/^>\p{Xps}+?/8 + >\x{1680}\x{2028}\x{0b} -/[^\d]/8WB +/^>\p{Xps}*/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>\p{Xps}{2,9}/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>\p{Xps}{2,9}?/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>[\p{Xps}]/8 + >\x{2028}\x{0b} + +/^>[\p{Xps}]+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^\p{Xwd}/8 + ABCD + 1234 + \x{6ca} + \x{a6c} + \x{10a7} + _ABC + ** Failers + [] -/[[:^alpha:][:^cntrl:]]+/8WB +/^\p{Xwd}+/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ -/[[:^cntrl:][:^alpha:]]+/8WB +/^\p{Xwd}*/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + +/^\p{Xwd}{2,9}/8 + A_12\x{6ca}\x{a6c}\x{10a7} + +/^[\p{Xwd}]/8 + ABCD1234_ + 1234abcd_ + \x{6ca} + \x{a6c} + \x{10a7} + _ABC + ** Failers + [] + +/^[\p{Xwd}]+/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + +/-- Unicode properties for \b abd \B --/ + +/\b...\B/8W + abc_ + \x{37e}abc\x{376} + \x{37e}\x{376}\x{371}\x{393}\x{394} + !\x{c0}++\x{c1}\x{c2} + !\x{c0}+++++ + +/-- Without PCRE_UCP, non-ASCII always fail, even if < 256 --/ + +/\b...\B/8 + abc_ + ** Failers + \x{37e}abc\x{376} + \x{37e}\x{376}\x{371}\x{393}\x{394} + !\x{c0}++\x{c1}\x{c2} + !\x{c0}+++++ + +/-- With PCRE_UCP, non-UTF8 chars that are < 256 still check properties --/ + +/\b...\B/W + abc_ + !\x{c0}++\x{c1}\x{c2} + !\x{c0}+++++ + +/-- Caseless single negated characters > 127 need UCP support --/ -/[[:alpha:]]+/8WB +/[^\x{100}]/8i + \x{100}\x{101}X -/[[:^alpha:]\S]+/8WB +/[^\x{100}]+/8i + \x{100}\x{101}XX -/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/B +/^\X/8 + A\P + A\P\P + A\x{300}\x{301}\P + A\x{300}\x{301}\P\P + A\x{301}\P + A\x{301}\P\P + +/^\X{2,3}/8 + A\P + A\P\P + AA\P + AA\P\P + A\x{300}\x{301}\P + A\x{300}\x{301}\P\P + A\x{300}\x{301}A\x{300}\x{301}\P + A\x{300}\x{301}A\x{300}\x{301}\P\P + +/^\X{2}/8 + AA\P + AA\P\P + A\x{300}\x{301}A\x{300}\x{301}\P + A\x{300}\x{301}A\x{300}\x{301}\P\P + +/^\X+/8 + AA\P + AA\P\P + +/^\X+?Z/8 + AA\P + AA\P\P -/-- End of testinput10 --/ +/-- End of testinput10 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testinput2 php5-5.4.9/ext/pcre/pcrelib/testdata/testinput2 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testinput2 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testinput2 2012-11-21 05:12:20.000000000 +0000 @@ -3,12 +3,11 @@ It also checks the non-Perl syntax the PCRE supports (Python, .NET, Oniguruma). Finally, there are some tests where PCRE and Perl differ, either because PCRE can't be compatible, or there is a possible Perl - bug. --/ + bug. + + NOTE: This is a non-UTF set of tests. When UTF support is needed, use + test 5, and if Unicode Property Support is needed, use test 7. --/ -/-- Originally, the Perl >= 5.10 things were in here too, but now I have - separated many (most?) of them out into test 11. However, there may still - be some that were overlooked. --/ - /(a)b|/I /abc/I @@ -144,40 +143,6 @@ defabc \Zdefabc -/abc/P - abc - *** Failers - -/^abc|def/P - abcdef - abcdef\B - -/.*((abc)$|(def))/P - defabc - \Zdefabc - -/the quick brown fox/P - the quick brown fox - *** Failers - The Quick Brown Fox - -/the quick brown fox/Pi - the quick brown fox - The Quick Brown Fox - -/abc.def/P - *** Failers - abc\ndef - -/abc$/P - abc - abc\n - -/(abc)\2/P - -/(abc\1)/P - abc - /)/ /a[]b/ @@ -442,8 +407,6 @@ /abc/\ -/abc/\P - /abc/\i /(a)bc(d)/I @@ -491,9 +454,6 @@ /\Biss\B/I+ Mississippi -/\Biss\B/I+P - Mississippi - /iss/IG+ Mississippi @@ -629,15 +589,6 @@ *** Failers \Nabc -/a*(b+)(z)(z)/P - aaaabbbbzzzz - aaaabbbbzzzz\O0 - aaaabbbbzzzz\O1 - aaaabbbbzzzz\O2 - aaaabbbbzzzz\O3 - aaaabbbbzzzz\O4 - aaaabbbbzzzz\O5 - /^.?abcd/IS /\( # ( at start @@ -1061,7 +1012,12 @@ /abc(?C)de(?C1)f/I 123abcdef -/(?C1)\dabc(?C2)def/I +/(?C1)\dabc(?C2)def/IS + 1234abcdef + *** Failers + abcdef + +/(?C1)\dabc(?C2)def/ISS 1234abcdef *** Failers abcdef @@ -1310,7 +1266,12 @@ abcde abcdfe -/a*b/ICDZ +/a*b/ICDZS + ab + aaaab + aaaacb + +/a*b/ICDZSS ab aaaab aaaacb @@ -1320,9 +1281,16 @@ aaaab aaaacb -/(abc|def)x/ICDZ +/(abc|def)x/ICDZS abcx defx + ** Failers + abcdefzx + +/(abc|def)x/ICDZSS + abcx + defx + ** Failers abcdefzx /(ab|cd){3,4}/IC @@ -1330,7 +1298,10 @@ abcdabcd abcdcdcdcdcd -/([ab]{,4}c|xy)/ICDZ +/([ab]{,4}c|xy)/ICDZS + Note: that { does NOT introduce a quantifier + +/([ab]{,4}c|xy)/ICDZSS Note: that { does NOT introduce a quantifier /([ab]{1,4}c|xy){4,5}?123/ICDZ @@ -1404,13 +1375,25 @@ 1X 123456\P -/abc/I>testsavedregex +/abc/IS>testsavedregex +testsavedregex testsavedregex +/abc/IFS>testsavedregex +testsavedregex testsavedregex +testsavedregex testsavedregex +(.)*~smgI - \n\n\nPartner der LCO\nde\nPartner der LINEAS Consulting\nGmbH\nLINEAS Consulting GmbH Hamburg\nPartnerfirmen\n30 days\nindex,follow\n\nja\n3\nPartner\n\n\nLCO\nLINEAS Consulting\n15.10.2003\n\n\n\n\nDie Partnerfirmen der LINEAS Consulting\nGmbH\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n + \J1024\n\n\nPartner der LCO\nde\nPartner der LINEAS Consulting\nGmbH\nLINEAS Consulting GmbH Hamburg\nPartnerfirmen\n30 days\nindex,follow\n\nja\n3\nPartner\n\n\nLCO\nLINEAS Consulting\n15.10.2003\n\n\n\n\nDie Partnerfirmen der LINEAS Consulting\nGmbH\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /^a/IF @@ -1447,17 +1442,6 @@ ** Failers line one\nthis is a line\nbreak in the second line -/ab.cd/P - ab-cd - ab=cd - ** Failers - ab\ncd - -/ab.cd/Ps - ab-cd - ab=cd - ab\ncd - /(?i)(?-i)AbCd/I AbCd ** Failers @@ -1508,14 +1492,6 @@ (this) ((this)) -/a(b)c/PN - abc - -/a(?Pb)c/PN - abc - -/\x{100}/I - /\x{0000ff}/I /^((?Pa1)|(?Pa2)b)/I @@ -1593,8 +1569,6 @@ /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?PX|Y))+/I bXXaYYaY -/\777/I - /\s*,\s*/IS \x0b,\x0b \x0c,\x0d @@ -1976,8 +1950,6 @@ /(?(DEFINE) abc) xyz/xI -/(?(DEFINE) abc){3} xyz/x - /(a|)*\d/ \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 @@ -2199,22 +2171,6 @@ xabcpqrx xxyzx -/[\h]/BZ - >\x09< - -/[\h]+/BZ - >\x09\x20\xa0< - -/[\v]/BZ - -/[\H]/BZ - -/[^\h]/BZ - -/[\V]/BZ - -/[\x0a\V]/BZ - /\H++X/BZ ** Failers XXXX @@ -2255,7 +2211,7 @@ /\V+\v\V+\w/BZ /\( (?: [^()]* | (?R) )* \)/x -(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0) +\J1024(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0) /[\E]AAA/ @@ -2295,7 +2251,7 @@ /\g6666666666/ -/[\g6666666666]/ +/[\g6666666666]/BZ /(?1)\c[/ @@ -2453,6 +2409,10 @@ /\k{}/ +/\k/ + +/\kabc/ + /(?P=)/ /(?P>)/ @@ -2570,11 +2530,6 @@ /(?(?=.*b).*b|^d)/I -/a?|b?/P - abc - ** Failers - ddd\N - /xyz/C xyz abcxyz @@ -2766,12 +2721,6 @@ abc\P abc\P\P -/\w+A/P - CDAAAAB - -/\w+A/PU - CDAAAAB - /abc\K123/ xyzabc123pqr xyzabc12\P @@ -2915,201 +2864,6 @@ /^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/SI -/ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional leading comment -(?: (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # one word, optionally followed by.... -(?: -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... -\( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) | # comments, or... - -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -# quoted strings -)* -< (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # leading < -(?: @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* - -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* , (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -)* # further okay, if led by comma -: # closing colon -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* )? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address spec -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* > # trailing > -# name and address -) (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional trailing comment -/xSI - /]{0,})>]{0,})>([\d]{0,}\.)(.*)((
([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/isIS "(?>.*/)foo"SI @@ -3276,104 +3030,19 @@ /A(*PRUNE)B|A(*PRUNE)C/K AC -/--- A whole lot of tests of verbs with arguments are here rather than in test - 11 because Perl doesn't seem to follow its specification entirely - correctly. ---/ - -/--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is - not clear how Perl defines "involved in the failure of the match". ---/ - -/^(A(*THEN:A)B|C(*THEN:B)D)/K - AB - CD - ** Failers - AC - CB - -/--- Check the use of names for success and failure. PCRE doesn't show these -names for success, though Perl does, contrary to its spec. ---/ - -/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K - AB - CD - ** Failers - AC - CB - -/--- An empty name does not pass back an empty string. It is the same as if no -name were given. ---/ - -/^(A(*PRUNE:)B|C(*PRUNE:B)D)/K - AB - CD - -/--- PRUNE goes to next bumpalong; COMMIT does not. ---/ - -/A(*PRUNE:A)B/K - ACAB - -/(*MARK:A)(*PRUNE:B)(C|X)/K - C - D - -/(*MARK:A)(*THEN:B)(C|X)/K - C - D - -/--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/ - -/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK - AAAC - -/--- Same --/ - -/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK - AAAC - /--- This should fail; the SKIP advances by one, but when we get to AC, the - PRUNE kills it. ---/ + PRUNE kills it. Perl behaves differently. ---/ /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK AAAC -/A(*:A)A+(*SKIP)(B|Z) | AC/xK - AAAC - -/--- This should fail, as a null name is the same as no name ---/ - -/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK - AAAC - -/--- This fails in PCRE, and I think that is in accordance with Perl's - documentation, though in Perl it succeeds. ---/ - -/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK - AAAC - -/--- Mark names can be duplicated ---/ +/--- Mark names can be duplicated. Perl doesn't give a mark for this one, +though PCRE does. ---/ -/A(*:A)B|X(*:A)Y/K - AABC - XXYZ - /^A(*:A)B|^X(*:A)Y/K ** Failers XAQQ -/--- A check on what happens after hitting a mark and them bumping along to -something that does not even start. Perl reports tags after the failures here, -though it does not when the individual letters are made into something -more complicated. ---/ - -/A(*:A)B|XX(*:B)Y/K - AABC - XXYZ - ** Failers - XAQQ - XAQQXZZ - AXQQQ - AXXQQQ - /--- COMMIT at the start of a pattern should be the same as an anchor. Perl optimizations defeat this. So does the PCRE optimization unless we disable it with \Y. ---/ @@ -3383,78 +3052,6 @@ ** Failers DEFGABC\Y -/--- Repeat some tests with added studying. ---/ - -/A(*COMMIT)B/+KS - ACABX - -/A(*THEN)B|A(*THEN)C/KS - AC - -/A(*PRUNE)B|A(*PRUNE)C/KS - AC - -/^(A(*THEN:A)B|C(*THEN:B)D)/KS - AB - CD - ** Failers - AC - CB - -/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS - AB - CD - ** Failers - AC - CB - -/^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS - AB - CD - -/A(*PRUNE:A)B/KS - ACAB - -/(*MARK:A)(*PRUNE:B)(C|X)/KS - C - D - -/(*MARK:A)(*THEN:B)(C|X)/KS - C - D - -/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS - AAAC - -/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS - AAAC - -/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS - AAAC - -/A(*:A)A+(*SKIP)(B|Z) | AC/xKS - AAAC - -/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS - AAAC - -/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS - AAAC - -/A(*:A)B|XX(*:B)Y/KS - AABC - XXYZ - ** Failers - XAQQ - XAQQXZZ - AXQQQ - AXXQQQ - -/(*COMMIT)ABC/ - ABCDEFG - ** Failers - DEFGABC\Y - /^(ab (c+(*THEN)cd) | xyz)/x abcccd @@ -3505,6 +3102,24 @@ /\d*\R/BZ /\s*\R/BZ + \x20\x0a + \x20\x0d + \x20\x0d\x0a + +/\S*\R/BZ + a\x0a + +/X\h*\R/BZ + X\x20\x0a + +/X\H*\R/BZ + X\x0d\x0a + +/X\H+\R/BZ + X\x0d\x0a + +/X\H++\R/BZ + X\x0d\x0a /-- Perl treats this one differently, not failing the second string. I believe that is a bug in Perl. --/ @@ -3570,4 +3185,588 @@ /(?P(?P=axn)xxx)(?yy)/BZ +/-- These tests are here because Perl gets the first one wrong. --/ + +/(\R*)(.)/s + \r\n + \r\r\n\n\r + \r\r\n\n\r\n + +/(\R)*(.)/s + \r\n + \r\r\n\n\r + \r\r\n\n\r\n + +/((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s + \r\n + \r\r\n\n\r + \r\r\n\n\r\n + +/-- --/ + +/^abc$/BZ + +/^abc$/BZm + +/^(a)*+(\w)/S + aaaaX + ** Failers + aaaa + +/^(?:a)*+(\w)/S + aaaaX + ** Failers + aaaa + +/(a)++1234/SDZ + +/([abc])++1234/SI + +/(?<=(abc)+)X/ + +/(^ab)/I + +/(^ab)++/I + +/(^ab|^)+/I + +/(^ab|^)++/I + +/(?:^ab)/I + +/(?:^ab)++/I + +/(?:^ab|^)+/I + +/(?:^ab|^)++/I + +/(.*ab)/I + +/(.*ab)++/I + +/(.*ab|.*)+/I + +/(.*ab|.*)++/I + +/(?:.*ab)/I + +/(?:.*ab)++/I + +/(?:.*ab|.*)+/I + +/(?:.*ab|.*)++/I + +/(?=a)[bcd]/I + +/((?=a))[bcd]/I + +/((?=a))+[bcd]/I + +/((?=a))++[bcd]/I + +/(?=a+)[bcd]/iI + +/(?=a+?)[bcd]/iI + +/(?=a++)[bcd]/iI + +/(?=a{3})[bcd]/iI + +/(abc)\1+/S + +/-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/ + +/(?1)(?:(b(*ACCEPT))){0}/ + b + +/(?1)(?:(b(*ACCEPT))){0}c/ + bc + ** Failers + b + +/(?1)(?:((*ACCEPT))){0}c/ + c + c\N + +/^.*?(?(?=a)a|b(*THEN)c)/ + ba + +/^.*?(?(?=a)a|bc)/ + ba + +/^.*?(?(?=a)a(*THEN)b|c)/ + ac + +/^.*?(?(?=a)a(*THEN)b)c/ + ac + +/^.*?(a(*THEN)b)c/ + aabc + +/^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x + aabc + +/^.*?(a(*THEN)b|z)c/ + aabc + +/^.*?(z|a(*THEN)b)c/ + aabc + +/-- --/ + +/-- These studied versions are here because they are not Perl-compatible; the + studying means the mark is not seen. --/ + +/(*MARK:A)(*SKIP:B)(C|X)/KS + C + D + +/(*:A)A+(*SKIP:A)(B|Z)/KS + AAAC + +/-- --/ + +"(?=a*(*ACCEPT)b)c" + c + c\N + +/(?1)c(?(DEFINE)((*ACCEPT)b))/ + c + c\N + +/(?>(*ACCEPT)b)c/ + c + c\N + +/(?:(?>(a)))+a%/++ + %aa% + +/(a)b|ac/++SS + ac\O3 + +/(a)(b)x|abc/++ + abc\O6 + +/(a)bc|(a)(b)\2/ + \O3abc + \O4abc + +/(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI + +/(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI + +/(a(?2)|b)(b(?1)|a)(?1)(?2)/SI + +/(abc)(?1)/SI + +/^(?>a)++/ + aa\M + aaaaaaaaa\M + +/(a)(?1)++/ + aa\M + aaaaaaaaa\M + +/(?:(foo)|(bar)|(baz))X/SS= + bazfooX + foobazbarX + barfooX + bazX + foobarbazX + bazfooX\O0 + bazfooX\O2 + bazfooX\O4 + bazfooX\O6 + bazfooX\O8 + bazfooX\O10 + +/(?=abc){3}abc/BZ + +/(?=abc)+abc/BZ + +/(?=abc)++abc/BZ + +/(?=abc){0}xyz/BZ + +/(?=(a))?./BZ + +/(?=(a))??./BZ + +/^(?=(a)){0}b(?1)/BZ + +/(?(DEFINE)(a))?b(?1)/BZ + +/^(?=(?1))?[az]([abc])d/BZ + +/^(?!a){0}\w+/BZ + +/(?<=(abc))?xyz/BZ + +/[:a[:abc]b:]/BZ + +/((?2))((?1))/SS + abc + +/((?(R2)a+|(?1)b))/SS + aaaabcde + +/(?(R)a*(?1)|((?R))b)/SS + aaaabcde + +/(a+|(?R)b)/ + +/^(a(*:A)(d|e(*:B))z|aeq)/C + adz + aez + aeqwerty + +/.(*F)/ + \P\Pabc + +/\btype\b\W*?\btext\b\W*?\bjavascript\b/IS + +/\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|a+)(?>(z+))\w/BZ + aaaazzzzb + ** Failers + aazz + +/(.)(\1|a(?2))/ + bab + +/\1|(.)(?R)\1/ + cbbbc + +/(.)((?(1)c|a)|a(?2))/ + baa + +/(?P(?P=abn)xxx)/BZ + +/(a\1z)/BZ + +/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/ + \Maabbccddee + +/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/ + \Maabbccddee + +/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/ + \Maabbccddee + +/^a\x41z/ + aAz + *** Failers + ax41z + +/^a[m\x41]z/ + aAz + +/^a\x1z/ + ax1z + +/^a\u0041z/ + aAz + *** Failers + au0041z + +/^a[m\u0041]z/ + aAz + +/^a\u041z/ + au041z + *** Failers + aAz + +/^a\U0041z/ + aU0041z + *** Failers + aAz + +/(?(?=c)c|d)++Y/BZ + +/(?(?=c)c|d)*+Y/BZ + +/a[\NB]c/ + aNc + +/a[B-\Nc]/ + +/(a)(?2){0,1999}?(b)/ + +/(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/ + +/--- This test, with something more complicated than individual letters, causes +different behaviour in Perl. Perhaps it disables some optimization; no tag is +passed back for the failures, whereas in PCRE there is a tag. ---/ + +/(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK + AABC + XXYZ + ** Failers + XAQQ + XAQQXZZ + AXQQQ + AXXQQQ + +/-- Perl doesn't give marks for these, though it does if the alternatives are +replaced by single letters. --/ + +/(b|q)(*:m)f|a(*:n)w/K + aw + ** Failers + abc + +/(q|b)(*:m)f|a(*:n)w/K + aw + ** Failers + abc + +/-- After a partial match, the behaviour is as for a failure. --/ + +/^a(*:X)bcde/K + abc\P + +/-- These are here because Perl doesn't return a mark, except for the first --/ + +/(?=(*:x))(q|)/K+ + abc + +/(?=(*:x))((*:y)q|)/K+ + abc + +/(?=(*:x))(?:(*:y)q|)/K+ + abc + +/(?=(*:x))(?>(*:y)q|)/K+ + abc + +/(?=a(*:x))(?!a(*:y)c)/K+ + ab + +/(?=a(*:x))(?=a(*:y)c|)/K+ + ab + +/(..)\1/ + ab\P + aba\P + abab\P + +/(..)\1/i + ab\P + abA\P + aBAb\P + +/(..)\1{2,}/ + ab\P + aba\P + abab\P + ababa\P + ababab\P + ababab\P\P + abababa\P + abababa\P\P + +/(..)\1{2,}/i + ab\P + aBa\P + aBAb\P + AbaBA\P + abABAb\P + aBAbaB\P\P + abABabA\P + abaBABa\P\P + +/(..)\1{2,}?x/i + ab\P + abA\P + aBAb\P + abaBA\P + abAbaB\P + abaBabA\P + abAbABaBx\P + +/^(..)\1/ + aba\P + +/^(..)\1{2,3}x/ + aba\P + ababa\P + ababa\P\P + abababx + ababababx + +/^(..)\1{2,3}?x/ + aba\P + ababa\P + ababa\P\P + abababx + ababababx + +/^(..)(\1{2,3})ab/ + abababab + +/^\R/ + \r\P + \r\P\P + +/^\R{2,3}x/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + \r\rx + \r\r\rx + +/^\R{2,3}?x/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + \r\rx + \r\r\rx + +/^\R?x/ + \r\P + \r\P\P + x + \rx + +/^\R+x/ + \r\P + \r\P\P + \r\n\P + \r\n\P\P + \rx + +/^a$/ + a\r\P + a\r\P\P + +/^a$/m + a\r\P + a\r\P\P + +/^(a$|a\r)/ + a\r\P + a\r\P\P + +/^(a$|a\r)/m + a\r\P + a\r\P\P + +/./ + \r\P + \r\P\P + +/.{2,3}/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + +/.{2,3}?/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + +/-- These two are here because Perl does not match: it seems to allow the +COMMIT to escape from the assertion. --/ + +/(?=a(*COMMIT)b|ac)ac|ac/ + ac + +/(?=a(*COMMIT)b|(ac)) ac | (a)c/x + ac + +"AB(C(D))(E(F))?(?(?=\2)(?=\4))" + ABCDGHI\O03 + +/-- This one is here because Perl does not confine the *COMMIT to the +assertion, and therefore fails the entire subroutine call. --/ + +/((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/ + ac + /-- End of testinput2 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testinput4 php5-5.4.9/ext/pcre/pcrelib/testdata/testinput4 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testinput4 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testinput4 2012-11-21 05:12:20.000000000 +0000 @@ -1,5 +1,6 @@ -/-- This set of tests if for UTF-8 support, excluding Unicode properties. It is - compatible with all versions of Perl 5. --/ +/-- This set of tests is for UTF support, excluding Unicode properties. It is + compatible with all versions of Perl >= 5.10 and both the 8-bit and 16-bit + PCRE libraries. --/ /a.b/8 acb @@ -126,31 +127,6 @@ *** Failers XYZ -/X(\C{3})/8 - X\x{1234} - -/X(\C{4})/8 - X\x{1234}YZ - -/X\C*/8 - XYZabcdce - -/X\C*?/8 - XYZabcde - -/X\C{3,5}/8 - Xabcdefg - X\x{1234} - X\x{1234}YZ - X\x{1234}\x{512} - X\x{1234}\x{512}YZ - -/X\C{3,5}?/8 - Xabcdefg - X\x{1234} - X\x{1234}YZ - X\x{1234}\x{512} - /[^a]+/8g bcd \x{100}aY\x{256}Z @@ -456,17 +432,6 @@ \x{150}X \x{200}X -/a\Cb/ - aXb - a\nb - -/a\Cb/8 - aXb - a\nb - -/a\C\Cb/8 - a\x{100}b - /[z-\x{100}]/8i z Z @@ -644,4 +609,16 @@ /A*/g8 AAB\x{123}BAA +/(abc)\1/8i + abc + +/(abc)\1/8 + abc + +/a(*:a\x{1234}b)/8K + abc + +/a(*:a£b)/8K + abc + /-- End of testinput4 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testinput5 php5-5.4.9/ext/pcre/pcrelib/testdata/testinput5 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testinput5 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testinput5 2012-11-21 05:12:20.000000000 +0000 @@ -1,72 +1,36 @@ -/-- This set of tests checks the API, internals, and non-Perl stuff for UTF-8 - support, excluding Unicode properties. --/ +/-- This set of tests checks the API, internals, and non-Perl stuff for UTF + support, excluding Unicode properties. However, tests that give different + results in 8-bit and 16-bit modes are excluded (see tests 16 and 17). --/ -/\x{100}/8DZ +/\x{110000}/8DZ -/\x{1000}/8DZ - -/\x{10000}/8DZ - -/\x{100000}/8DZ - -/\x{1000000}/8DZ +/\x{ffffffff}/8 -/\x{4000000}/8DZ +/\x{100000000}/8 -/\x{7fffFFFF}/8DZ +/\x{d800}/8 -/[\x{ff}]/8DZ +/\x{dfff}/8 -/[\x{100}]/8DZ +/\x{d7ff}/8 -/\x{ffffffff}/8 - -/\x{100000000}/8 +/\x{e000}/8 /^\x{100}a\x{1234}/8 \x{100}a\x{1234}bcd -/\x80/8DZ - -/\xff/8DZ - /\x{0041}\x{2262}\x{0391}\x{002e}/DZ8 \x{0041}\x{2262}\x{0391}\x{002e} -/\x{D55c}\x{ad6d}\x{C5B4}/DZ8 - \x{D55c}\x{ad6d}\x{C5B4} - -/\x{65e5}\x{672c}\x{8a9e}/DZ8 - \x{65e5}\x{672c}\x{8a9e} - -/\x{80}/DZ8 - -/\x{084}/DZ8 - -/\x{104}/DZ8 - -/\x{861}/DZ8 - -/\x{212ab}/DZ8 - /.{3,5}X/DZ8 \x{212ab}\x{212ab}\x{212ab}\x{861}X - /.{3,5}?/DZ8 \x{212ab}\x{212ab}\x{212ab}\x{861} /(?<=\C)X/8 Should produce an error diagnostic -/-- This one is here not because it's different to Perl, but because the way -the captured single-byte is displayed. (In Perl it becomes a character, and you -can't tell the difference.) --/ - -/X(\C)(.*)/8 - X\x{1234} - X\nabc - /^[ab]/8DZ bar *** Failers @@ -81,26 +45,6 @@ *** Failers aaa -/[^ab\xC0-\xF0]/8SDZ - \x{f1} - \x{bf} - \x{100} - \x{1000} - *** Failers - \x{c0} - \x{f0} - -/Ā{3,4}/8SDZ - \x{100}\x{100}\x{100}\x{100\x{100} - -/(\x{100}+|x)/8SDZ - -/(\x{100}*a|x)/8SDZ - -/(\x{100}{0,2}a|x)/8SDZ - -/(\x{100}{1,2}a|x)/8SDZ - /\x{100}*(\d+|"(?1)")/8 1234 "1234" @@ -111,33 +55,17 @@ *** Failers \x{100}\x{100}abcd -/\x{100}/8DZ - /\x{100}*/8DZ /a\x{100}*/8DZ /ab\x{100}*/8DZ -/a\x{100}\x{101}*/8DZ - -/a\x{100}\x{101}+/8DZ - /\x{100}*A/8DZ A /\x{100}*\d(?R)/8DZ -/[^\x{c4}]/DZ - -/[^\x{c4}]/8DZ - -/[\x{100}]/8DZ - \x{100} - Z\x{100} - \x{100}Z - *** Failers - /[Z\x{100}]/8DZ Z\x{100} \x{100} @@ -162,13 +90,8 @@ /[\xFF]/DZ >\xff< -/[\xff]/DZ8 - >\x{ff}< - /[^\xFF]/DZ -/[^\xff]/8DZ - /[Ä-Ü]/8 Ö # Matches without Study \x{d6} @@ -185,45 +108,6 @@ Ö <-- Same with Study \x{d6} -/[]/8 - -//8 - -/xxx/8 - -/xxx/8?DZ - -/abc/8 - ] - - - \? - -/anything/8 - \xc0\x80 - \xc1\x8f - \xe0\x9f\x80 - \xf0\x8f\x80\x80 - \xf8\x87\x80\x80\x80 - \xfc\x83\x80\x80\x80\x80 - \xfe\x80\x80\x80\x80\x80 - \xff\x80\x80\x80\x80\x80 - \xc3\x8f - \xe0\xaf\x80 - \xe1\x80\x80 - \xf0\x9f\x80\x80 - \xf1\x8f\x80\x80 - \xf8\x88\x80\x80\x80 - \xf9\x87\x80\x80\x80 - \xfc\x84\x80\x80\x80\x80 - \xfd\x83\x80\x80\x80\x80 - \?\xf8\x88\x80\x80\x80 - \?\xf9\x87\x80\x80\x80 - \?\xfc\x84\x80\x80\x80\x80 - \?\xfd\x83\x80\x80\x80\x80 - -/\x{100}abc(xyz(?1))/8DZ - /[^\x{100}]abc(xyz(?1))/8DZ /[ab\x{100}]abc(xyz(?1))/8DZ @@ -243,17 +127,8 @@ /\w/8 \x{100}X -/a\x{1234}b/P8 - a\x{1234}b - /^\ሴ/8DZ -/\777/I - -/\777/8I - \x{1ff} - \777 - /\x{100}*\d/8DZ /\x{100}*\s/8DZ @@ -266,12 +141,6 @@ /\x{100}*\W/8DZ -/\x{100}+\x{200}/8DZ - -/\x{100}+X/8DZ - -/X+\x{200}/8DZ - /()()()()()()()()()() ()()()()()()()()()() ()()()()()()()()()() @@ -283,8 +152,6 @@ /^[\QĀ\E-\QŐ\E]/BZ8 -/^[\QĀ\E-\QŐ\E/BZ8 - /^abc./mgx8 abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x{0085}abc7 \x{2028}abc8 \x{2029}abc9 JUNK @@ -379,23 +246,6 @@ /.*$/8 \x{1ec5} -/-- This tests the stricter UTF-8 check according to RFC 3629. --/ - -/X/8 - \x{0}\x{d7ff}\x{e000}\x{10ffff} - \x{d800} - \x{d800}\? - \x{da00} - \x{da00}\? - \x{dfff} - \x{dfff}\? - \x{110000} - \x{110000}\? - \x{2000000} - \x{2000000}\? - \x{7fffffff} - \x{7fffffff}\? - /a\Rb/I8 a\rb a\nb @@ -454,16 +304,10 @@ /(\x{de})\1/ \x{de}\x{de} - \x{123} /X/8f A\x{1ec5}ABCXYZ -/(*UTF8)\x{1234}/ - abcd\x{1234}pqr - -/(*CRLF)(*UTF8)(*BSR_UNICODE)a\Rb/I - /Xa{2,4}b/8 X\P Xa\P @@ -745,53 +589,184 @@ /X\W{3}X/8 \PX -/\h/SI +/\sxxx\s/8T1 + AB\x{85}xxx\x{a0}XYZ + AB\x{a0}xxx\x{85}XYZ + +/\S \S/8T1 + \x{a2} \x{84} -/\h/SI8 - ABC\x{09} - ABC\x{20} - ABC\x{a0} - ABC\x{1680} - ABC\x{180e} - ABC\x{2000} - ABC\x{202f} - ABC\x{205f} - ABC\x{3000} - -/\v/SI - -/\v/SI8 - ABC\x{0a} - ABC\x{0b} - ABC\x{0c} - ABC\x{0d} - ABC\x{85} - ABC\x{2028} - -/\R/SI +'A#хц'8xBZ -/\R/SI8 +'A#хц + PQ'8xBZ + +/a+#хaa + z#XX?/8xBZ -/\h*A/SI8 - CDBABC - -/\v+A/SI8 +/a+#хaa + z#х?/8xBZ -/\s?xxx\s/8SI +/\g{A}xxx#bXX(?'A'123) (?'A'456)/8xBZ -/\sxxx\s/8T1 - AB\x{85}xxx\x{a0}XYZ - AB\x{a0}xxx\x{85}XYZ +/\g{A}xxx#bх(?'A'123) (?'A'456)/8xBZ + +/^\cģ/8 + +/(\R*)(.)/s8 + \r\n + \r\r\n\n\r + \r\r\n\n\r\n + +/(\R)*(.)/s8 + \r\n + \r\r\n\n\r + \r\r\n\n\r\n + +/[^\x{1234}]+/iS8I + +/[^\x{1234}]+?/iS8I + +/[^\x{1234}]++/iS8I + +/[^\x{1234}]{2}/iS8I + +// + +/f.*/ + \P\Pfor + +/f.*/s + \P\Pfor + +/f.*/8 + \P\Pfor + +/f.*/8s + \P\Pfor + +/\x{d7ff}\x{e000}/8 + +/\x{d800}/8 + +/\x{dfff}/8 + +/\h+/8 + \x{1681}\x{200b}\x{1680}\x{2000}\x{202f}\x{3000} + \x{3001}\x{2fff}\x{200a}\x{a0}\x{2000} + +/[\h\x{e000}]+/8BZ + \x{1681}\x{200b}\x{1680}\x{2000}\x{202f}\x{3000} + \x{3001}\x{2fff}\x{200a}\x{a0}\x{2000} + +/\H+/8 + \x{1680}\x{180e}\x{167f}\x{1681}\x{180d}\x{180f} + \x{2000}\x{200a}\x{1fff}\x{200b} + \x{202f}\x{205f}\x{202e}\x{2030}\x{205e}\x{2060} + \x{a0}\x{3000}\x{9f}\x{a1}\x{2fff}\x{3001} + +/[\H\x{d7ff}]+/8BZ + \x{1680}\x{180e}\x{167f}\x{1681}\x{180d}\x{180f} + \x{2000}\x{200a}\x{1fff}\x{200b} + \x{202f}\x{205f}\x{202e}\x{2030}\x{205e}\x{2060} + \x{a0}\x{3000}\x{9f}\x{a1}\x{2fff}\x{3001} + +/\v+/8 + \x{2027}\x{2030}\x{2028}\x{2029} + \x09\x0e\x{84}\x{86}\x{85}\x0a\x0b\x0c\x0d + +/[\v\x{e000}]+/8BZ + \x{2027}\x{2030}\x{2028}\x{2029} + \x09\x0e\x{84}\x{86}\x{85}\x0a\x0b\x0c\x0d + +/\V+/8 + \x{2028}\x{2029}\x{2027}\x{2030} + \x{85}\x0a\x0b\x0c\x0d\x09\x0e\x{84}\x{86} + +/[\V\x{d7ff}]+/8BZ + \x{2028}\x{2029}\x{2027}\x{2030} + \x{85}\x0a\x0b\x0c\x0d\x09\x0e\x{84}\x{86} + +/\R+/8 + \x{2027}\x{2030}\x{2028}\x{2029} + \x09\x0e\x{84}\x{86}\x{85}\x0a\x0b\x0c\x0d + +/(..)\1/8 + ab\P + aba\P + abab\P + +/(..)\1/8i + ab\P + abA\P + aBAb\P + +/(..)\1{2,}/8 + ab\P + aba\P + abab\P + ababa\P + ababab\P + ababab\P\P + abababa\P + abababa\P\P + +/(..)\1{2,}/8i + ab\P + aBa\P + aBAb\P + AbaBA\P + abABAb\P + aBAbaB\P\P + abABabA\P + abaBABa\P\P + +/(..)\1{2,}?x/8i + ab\P + abA\P + aBAb\P + abaBA\P + abAbaB\P + abaBabA\P + abAbABaBx\P + +/./8 + \r\P + \r\P\P + +/.{2,3}/8 + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P -/\sxxx\s/I8ST1 - AB\x{85}xxx\x{a0}XYZ - AB\x{a0}xxx\x{85}XYZ +/.{2,3}?/8 + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P -/\S \S/8T1 - \x{a2} \x{84} +/[^\x{100}][^\x{1234}][^\x{ffff}][^\x{10000}][^\x{10ffff}]/8BZ -/\S \S/I8ST1 - \x{a2} \x{84} - A Z +/[^\x{100}][^\x{1234}][^\x{ffff}][^\x{10000}][^\x{10ffff}]/8BZi + +/[^\x{100}]*[^\x{10000}]+[^\x{10ffff}]??[^\x{8000}]{4,}[^\x{7fff}]{2,9}?[^\x{fffff}]{5,6}+/8BZ + +/[^\x{100}]*[^\x{10000}]+[^\x{10ffff}]??[^\x{8000}]{4,}[^\x{7fff}]{2,9}?[^\x{fffff}]{5,6}+/8BZi + +/(?<=\x{1234}\x{1234})\bxy/I8 + +/(?8BZ + +/[\u0100-\u0200]/8BZ + +/\ud800/8 /-- End of testinput5 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testinput6 php5-5.4.9/ext/pcre/pcrelib/testdata/testinput6 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testinput6 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testinput6 2012-11-21 05:12:20.000000000 +0000 @@ -655,6 +655,7 @@ A\x80 /^[\p{Arabic}]/8 + \x{604} \x{60e} \x{656} \x{657} @@ -670,7 +671,6 @@ \x{6ef} \x{6fa} ** Failers - \x{600} \x{650} \x{651} \x{652} @@ -688,7 +688,6 @@ \x{61f} \x{964} \x{965} - \x{970} /^\p{Inherited}/8 \x{64b} @@ -802,4 +801,18 @@ ** Failers a\xFCb +/ⱥ/8i + ⱥ + Ⱥx + Ⱥ + +/[ⱥ]/8i + ⱥ + Ⱥx + Ⱥ + +/Ⱥ/8i + Ⱥ + ⱥ + /-- End of testinput6 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testinput7 php5-5.4.9/ext/pcre/pcrelib/testdata/testinput7 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testinput7 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testinput7 2012-11-21 05:12:20.000000000 +0000 @@ -1,4610 +1,625 @@ -/-- This set of tests check the DFA matching functionality of pcre_dfa_exec(). - The -dfa flag must be used with pcretest when running it. --/ - -/abc/ - abc - -/ab*c/ - abc - abbbbc - ac - -/ab+c/ - abc - abbbbbbc - *** Failers - ac - ab - -/a*/ - a - aaaaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\F - -/(a|abcd|african)/ - a - abcd - african - -/^abc/ - abcdef - *** Failers - xyzabc - xyz\nabc - -/^abc/m - abcdef - xyz\nabc - *** Failers - xyzabc - -/\Aabc/ - abcdef - *** Failers - xyzabc - xyz\nabc - -/\Aabc/m - abcdef - *** Failers - xyzabc - xyz\nabc - -/\Gabc/ - abcdef - xyzabc\>3 - *** Failers - xyzabc - xyzabc\>2 - -/x\dy\Dz/ - x9yzz - x0y+z - *** Failers - xyz - xxy0z - -/x\sy\Sz/ - x yzz - x y+z - *** Failers - xyz - xxyyz - -/x\wy\Wz/ - xxy+z - *** Failers - xxy0z - x+y+z - -/x.y/ - x+y - x-y - *** Failers - x\ny - -/x.y/s - x+y - x-y - x\ny - -/(a.b(?s)c.d|x.y)p.q/ - a+bc+dp+q - a+bc\ndp+q - x\nyp+q - *** Failers - a\nbc\ndp+q - a+bc\ndp\nq - x\nyp\nq - -/a\d\z/ - ba0 - *** Failers - ba0\n - ba0\ncd - -/a\d\z/m - ba0 - *** Failers - ba0\n - ba0\ncd - -/a\d\Z/ - ba0 - ba0\n - *** Failers - ba0\ncd - -/a\d\Z/m - ba0 - ba0\n - *** Failers - ba0\ncd - -/a\d$/ - ba0 - ba0\n - *** Failers - ba0\ncd - -/a\d$/m - ba0 - ba0\n - ba0\ncd - *** Failers - -/abc/i - abc - aBc - ABC - -/[^a]/ - abcd - -/ab?\w/ - abz - abbz - azz - -/x{0,3}yz/ - ayzq - axyzq - axxyz - axxxyzq - axxxxyzq - *** Failers - ax - axx - -/x{3}yz/ - axxxyzq - axxxxyzq - *** Failers - ax - axx - ayzq - axyzq - axxyz - -/x{2,3}yz/ - axxyz - axxxyzq - axxxxyzq - *** Failers - ax - axx - ayzq - axyzq - -/[^a]+/ - bac - bcdefax - *** Failers - aaaaa - -/[^a]*/ - bac - bcdefax - *** Failers - aaaaa - -/[^a]{3,5}/ - xyz - awxyza - abcdefa - abcdefghijk - *** Failers - axya - axa - aaaaa - -/\d*/ - 1234b567 - xyz - -/\D*/ - a1234b567 - xyz - -/\d+/ - ab1234c56 - *** Failers - xyz - -/\D+/ - ab123c56 - *** Failers - 789 - -/\d?A/ - 045ABC - ABC - *** Failers - XYZ - -/\D?A/ - ABC - BAC - 9ABC - *** Failers - -/a+/ - aaaa - -/^.*xyz/ - xyz - ggggggggxyz - -/^.+xyz/ - abcdxyz - axyz - *** Failers - xyz - -/^.?xyz/ - xyz - cxyz - -/^\d{2,3}X/ - 12X - 123X - *** Failers - X - 1X - 1234X - -/^[abcd]\d/ - a45 - b93 - c99z - d04 - *** Failers - e45 - abcd - abcd1234 - 1234 - -/^[abcd]*\d/ - a45 - b93 - c99z - d04 - abcd1234 - 1234 - *** Failers - e45 - abcd - -/^[abcd]+\d/ - a45 - b93 - c99z - d04 - abcd1234 - *** Failers - 1234 - e45 - abcd - -/^a+X/ - aX - aaX - -/^[abcd]?\d/ - a45 - b93 - c99z - d04 - 1234 - *** Failers - abcd1234 - e45 - -/^[abcd]{2,3}\d/ - ab45 - bcd93 - *** Failers - 1234 - a36 - abcd1234 - ee45 - -/^(abc)*\d/ - abc45 - abcabcabc45 - 42xyz - *** Failers - -/^(abc)+\d/ - abc45 - abcabcabc45 - *** Failers - 42xyz - -/^(abc)?\d/ - abc45 - 42xyz - *** Failers - abcabcabc45 - -/^(abc){2,3}\d/ - abcabc45 - abcabcabc45 - *** Failers - abcabcabcabc45 - abc45 - 42xyz - -/1(abc|xyz)2(?1)3/ - 1abc2abc3456 - 1abc2xyz3456 - -/^(a*\w|ab)=(a*\w|ab)/ - ab=ab - -/^(a*\w|ab)=(?1)/ - ab=ab - -/^([^()]|\((?1)*\))*$/ - abc - a(b)c - a(b(c))d - *** Failers) - a(b(c)d - -/^>abc>([^()]|\((?1)*\))*abc>123abc>1(2)3abc>(1(2)3)a*)\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876 - *** Failers - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x - <> - - hij> - hij> - def> - - *** Failers - 3 - *** Failers - defabcxyz - -/^abcdef/ - ab\P - abcde\P - abcdef\P - *** Failers - abx\P - -/^a{2,4}\d+z/ - a\P - aa\P - aa2\P - aaa\P - aaa23\P - aaaa12345\P - aa0z\P - aaaa4444444444444z\P - *** Failers - az\P - aaaaa\P - a56\P - -/^abcdef/ - abc\P - def\R - -/(?<=foo)bar/ - xyzfo\P - foob\P\>2 - foobar...\R\P\>4 - xyzfo\P - foobar\>2 - *** Failers - xyzfo\P - obar\R - -/(ab*(cd|ef))+X/ - adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\P\Z - lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\P\B\Z - cdabbbbbbbb\P\R\B\Z - efabbbbbbbbbbbbbbbb\P\R\B\Z - bbbbbbbbbbbbcdXyasdfadf\P\R\B\Z - -/(a|b)/SF>testsavedregex ->>aaabxyzpqrrrabbxyyyypqAzz - >aaaabxyzpqrrrabbxyyyypqAzz - >>>>abcxyzpqrrrabbxyyyypqAzz - *** Failers - abxyzpqrrabbxyyyypqAzz - abxyzpqrrrrabbxyyyypqAzz - abxyzpqrrrabxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyypqAzz - aaabcxyzpqrrrabbxyyyypqqqqqqqAzz - -/^(abc){1,2}zz/ - abczz - abcabczz - *** Failers - zz - abcabcabczz - >>abczz - -/^(b+?|a){1,2}?c/ - bc - bbc - bbbc - bac - bbac - aac - abbbbbbbbbbbc - bbbbbbbbbbbac - *** Failers - aaac - abbbbbbbbbbbac - -/^(b+|a){1,2}c/ - bc - bbc - bbbc - bac - bbac - aac - abbbbbbbbbbbc - bbbbbbbbbbbac - *** Failers - aaac - abbbbbbbbbbbac - -/^(b+|a){1,2}?bc/ - bbc - -/^(b*|ba){1,2}?bc/ - babc - bbabc - bababc - *** Failers - bababbc - babababc - -/^(ba|b*){1,2}?bc/ - babc - bbabc - bababc - *** Failers - bababbc - babababc - -/^\ca\cA\c[\c{\c:/ - \x01\x01\e;z - -/^[ab\]cde]/ - athing - bthing - ]thing - cthing - dthing - ething - *** Failers - fthing - [thing - \\thing - -/^[]cde]/ - ]thing - cthing - dthing - ething - *** Failers - athing - fthing - -/^[^ab\]cde]/ - fthing - [thing - \\thing - *** Failers - athing - bthing - ]thing - cthing - dthing - ething - -/^[^]cde]/ - athing - fthing - *** Failers - ]thing - cthing - dthing - ething - -/^\/ - - -/^/ - - -/^[0-9]+$/ - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 100 - *** Failers - abc - -/^.*nter/ - enter - inter - uponter - -/^xxx[0-9]+$/ - xxx0 - xxx1234 - *** Failers - xxx - -/^.+[0-9][0-9][0-9]$/ - x123 - xx123 - 123456 - *** Failers - 123 - x1234 - -/^.+?[0-9][0-9][0-9]$/ - x123 - xx123 - 123456 - *** Failers - 123 - x1234 - -/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ - abc!pqr=apquxz.ixr.zzz.ac.uk - *** Failers - !pqr=apquxz.ixr.zzz.ac.uk - abc!=apquxz.ixr.zzz.ac.uk - abc!pqr=apquxz:ixr.zzz.ac.uk - abc!pqr=apquxz.ixr.zzz.ac.ukk - -/:/ - Well, we need a colon: somewhere - *** Fail if we don't - -/([\da-f:]+)$/i - 0abc - abc - fed - E - :: - 5f03:12C0::932e - fed def - Any old stuff - *** Failers - 0zzz - gzzz - fed\x20 - Any old rubbish - -/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ - .1.2.3 - A.12.123.0 - *** Failers - .1.2.3333 - 1.2.3 - 1234.2.3 - -/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ - 1 IN SOA non-sp1 non-sp2( - 1 IN SOA non-sp1 non-sp2 ( - *** Failers - 1IN SOA non-sp1 non-sp2( - -/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ - a. - Z. - 2. - ab-c.pq-r. - sxk.zzz.ac.uk. - x-.y-. - *** Failers - -abc.peq. - -/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ - *.a - *.b0-a - *.c3-b.c - *.c-a.b-c - *** Failers - *.0 - *.a- - *.a-b.c- - *.c-a.0-c - -/^(?=ab(de))(abd)(e)/ - abde - -/^(?!(ab)de|x)(abd)(f)/ - abdf - -/^(?=(ab(cd)))(ab)/ - abcd - -/^[\da-f](\.[\da-f])*$/i - a.b.c.d - A.B.C.D - a.b.c.1.2.3.C - -/^\".*\"\s*(;.*)?$/ - \"1234\" - \"abcd\" ; - \"\" ; rhubarb - *** Failers - \"1234\" : things - -/^$/ - \ - *** Failers - -/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x - ab c - *** Failers - abc - ab cde - -/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ - ab c - *** Failers - abc - ab cde - -/^ a\ b[c ]d $/x - a bcd - a b d - *** Failers - abcd - ab d - -/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ - abcdefhijklm - -/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ - abcdefhijklm - -/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ - a+ Z0+\x08\n\x1d\x12 - -/^[.^$|()*+?{,}]+/ - .^\$(*+)|{?,?} - -/^a*\w/ - z - az - aaaz - a - aa - aaaa - a+ - aa+ - -/^a*?\w/ - z - az - aaaz - a - aa - aaaa - a+ - aa+ - -/^a+\w/ - az - aaaz - aa - aaaa - aa+ - -/^a+?\w/ - az - aaaz - aa - aaaa - aa+ - -/^\d{8}\w{2,}/ - 1234567890 - 12345678ab - 12345678__ - *** Failers - 1234567 - -/^[aeiou\d]{4,5}$/ - uoie - 1234 - 12345 - aaaaa - *** Failers - 123456 - -/^[aeiou\d]{4,5}?/ - uoie - 1234 - 12345 - aaaaa - 123456 - -/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ - From abcd Mon Sep 01 12:33:02 1997 - -/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ - From abcd Mon Sep 01 12:33:02 1997 - From abcd Mon Sep 1 12:33:02 1997 - *** Failers - From abcd Sep 01 12:33:02 1997 - -/^12.34/s - 12\n34 - 12\r34 - -/\w+(?=\t)/ - the quick brown\t fox - -/foo(?!bar)(.*)/ - foobar is foolish see? - -/(?:(?!foo)...|^.{0,2})bar(.*)/ - foobar crowbar etc - barrel - 2barrel - A barrel - -/^(\D*)(?=\d)(?!123)/ - abc456 - *** Failers - abc123 - -/^1234(?# test newlines - inside)/ - 1234 - -/^1234 #comment in extended re - /x - 1234 - -/#rhubarb - abcd/x - abcd - -/^abcd#rhubarb/x - abcd - -/(?!^)abc/ - the abc - *** Failers - abc - -/(?=^)abc/ - abc - *** Failers - the abc - -/^[ab]{1,3}(ab*|b)/ - aabbbbb - -/^[ab]{1,3}?(ab*|b)/ - aabbbbb - -/^[ab]{1,3}?(ab*?|b)/ - aabbbbb - -/^[ab]{1,3}(ab*?|b)/ - aabbbbb - -/ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional leading comment -(?: (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # one word, optionally followed by.... -(?: -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... -\( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) | # comments, or... - -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -# quoted strings -)* -< (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # leading < -(?: @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* - -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* , (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -)* # further okay, if led by comma -: # closing colon -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* )? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address spec -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* > # trailing > -# name and address -) (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional trailing comment -/x - Alan Other - - user\@dom.ain - \"A. Other\" (a comment) - A. Other (a comment) - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - A missing angle @,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -# leading word -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces -(?: -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -| -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -) # "special" comment or quoted string -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" -)* -< -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# < -(?: -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -(?: , -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -)* # additional domains -: -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address spec -> # > -# name and address -) -/x - Alan Other - - user\@dom.ain - \"A. Other\" (a comment) - A. Other (a comment) - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - A missing angle - a\rb - *** Failers - a\nb - -/abc$/ - abc - abc\n - *** Failers - abc\ndef - -/(abc)\123/ - abc\x53 - -/(abc)\223/ - abc\x93 - -/(abc)\323/ - abc\xd3 - -/(abc)\100/ - abc\x40 - abc\100 - -/(abc)\1000/ - abc\x400 - abc\x40\x30 - abc\1000 - abc\100\x30 - abc\100\060 - abc\100\60 - -/abc\81/ - abc\081 - abc\0\x38\x31 - -/abc\91/ - abc\091 - abc\0\x39\x31 - -/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/ - abcdefghijk\12S - -/ab\idef/ - abidef - -/a{0}bc/ - bc - -/(a|(bc)){0,0}?xyz/ - xyz - -/abc[\10]de/ - abc\010de - -/abc[\1]de/ - abc\1de - -/(abc)[\1]de/ - abc\1de - -/(?s)a.b/ - a\nb - -/^([^a])([^\b])([^c]*)([^d]{3,4})/ - baNOTccccd - baNOTcccd - baNOTccd - bacccd - *** Failers - anything - b\bc - baccd - -/[^a]/ - Abc - -/[^a]/i - Abc - -/[^a]+/ - AAAaAbc - -/[^a]+/i - AAAaAbc - -/[^a]+/ - bbb\nccc - -/[^k]$/ - abc - *** Failers - abk - -/[^k]{2,3}$/ - abc - kbc - kabc - *** Failers - abk - akb - akk - -/^\d{8,}\@.+[^k]$/ - 12345678\@a.b.c.d - 123456789\@x.y.z - *** Failers - 12345678\@x.y.uk - 1234567\@a.b.c.d - -/[^a]/ - aaaabcd - aaAabcd - -/[^a]/i - aaaabcd - aaAabcd - -/[^az]/ - aaaabcd - aaAabcd - -/[^az]/i - aaaabcd - aaAabcd - -/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/ - \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377 - -/P[^*]TAIRE[^*]{1,6}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - -/P[^*]TAIRE[^*]{1,}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - -/(\.\d\d[1-9]?)\d+/ - 1.230003938 - 1.875000282 - 1.235 - -/(\.\d\d((?=0)|\d(?=\d)))/ - 1.230003938 - 1.875000282 - *** Failers - 1.235 - -/a(?)b/ - ab - -/\b(foo)\s+(\w+)/i - Food is on the foo table - -/foo(.*)bar/ - The food is under the bar in the barn. - -/foo(.*?)bar/ - The food is under the bar in the barn. - -/(.*)(\d*)/ - I have 2 numbers: 53147 - -/(.*)(\d+)/ - I have 2 numbers: 53147 - -/(.*?)(\d*)/ - I have 2 numbers: 53147 - -/(.*?)(\d+)/ - I have 2 numbers: 53147 - -/(.*)(\d+)$/ - I have 2 numbers: 53147 - -/(.*?)(\d+)$/ - I have 2 numbers: 53147 - -/(.*)\b(\d+)$/ - I have 2 numbers: 53147 - -/(.*\D)(\d+)$/ - I have 2 numbers: 53147 - -/^\D*(?!123)/ - ABC123 - -/^(\D*)(?=\d)(?!123)/ - ABC445 - *** Failers - ABC123 - -/^[W-]46]/ - W46]789 - -46]789 - *** Failers - Wall - Zebra - 42 - [abcd] - ]abcd[ - -/^[W-\]46]/ - W46]789 - Wall - Zebra - Xylophone - 42 - [abcd] - ]abcd[ - \\backslash - *** Failers - -46]789 - well - -/\d\d\/\d\d\/\d\d\d\d/ - 01/01/2000 - -/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark - -/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope - -/^(a){0,0}/ - bcd - abc - aab - -/^(a){0,1}/ - bcd - abc - aab - -/^(a){0,2}/ - bcd - abc - aab - -/^(a){0,3}/ - bcd - abc - aab - aaa - -/^(a){0,}/ - bcd - abc - aab - aaa - aaaaaaaa - -/^(a){1,1}/ - bcd - abc - aab - -/^(a){1,2}/ - bcd - abc - aab - -/^(a){1,3}/ - bcd - abc - aab - aaa - -/^(a){1,}/ - bcd - abc - aab - aaa - aaaaaaaa - -/.*\.gif/ - borfle\nbib.gif\nno - -/.{0,}\.gif/ - borfle\nbib.gif\nno - -/.*\.gif/m - borfle\nbib.gif\nno - -/.*\.gif/s - borfle\nbib.gif\nno - -/.*\.gif/ms - borfle\nbib.gif\nno - -/.*$/ - borfle\nbib.gif\nno - -/.*$/m - borfle\nbib.gif\nno - -/.*$/s - borfle\nbib.gif\nno - -/.*$/ms - borfle\nbib.gif\nno - -/.*$/ - borfle\nbib.gif\nno\n - -/.*$/m - borfle\nbib.gif\nno\n - -/.*$/s - borfle\nbib.gif\nno\n - -/.*$/ms - borfle\nbib.gif\nno\n - -/(.*X|^B)/ - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/(.*X|^B)/m - abcde\n1234Xyz - BarFoo - abcde\nBar - -/(.*X|^B)/s - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/(.*X|^B)/ms - abcde\n1234Xyz - BarFoo - abcde\nBar - -/(?s)(.*X|^B)/ - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/(?s:.*X|^B)/ - abcde\n1234Xyz - BarFoo - *** Failers - abcde\nBar - -/^.*B/ - **** Failers - abc\nB - -/(?s)^.*B/ - abc\nB - -/(?m)^.*B/ - abc\nB - -/(?ms)^.*B/ - abc\nB - -/(?ms)^B/ - abc\nB - -/(?s)B$/ - B\n - -/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ - 123456654321 - -/^\d\d\d\d\d\d\d\d\d\d\d\d/ - 123456654321 - -/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ - 123456654321 - -/^[abc]{12}/ - abcabcabcabc - -/^[a-c]{12}/ - abcabcabcabc - -/^(a|b|c){12}/ - abcabcabcabc - -/^[abcdefghijklmnopqrstuvwxy0123456789]/ - n - *** Failers - z - -/abcde{0,0}/ - abcd - *** Failers - abce - -/ab[cd]{0,0}e/ - abe - *** Failers - abcde - -/ab(c){0,0}d/ - abd - *** Failers - abcd - -/a(b*)/ - a - ab - abbbb - *** Failers - bbbbb - -/ab\d{0}e/ - abe - *** Failers - ab1e - -/"([^\\"]+|\\.)*"/ - the \"quick\" brown fox - \"the \\\"quick\\\" brown fox\" - -/.*?/g+ - abc - -/\b/g+ - abc - -/\b/+g - abc - -//g - abc - -/]{0,})>]{0,})>([\d]{0,}\.)(.*)((
([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is - 43.
Word Processor
(N-1286)
Lega lstaff.comCA - Statewide - -/a[^a]b/ - acb - a\nb - -/a.b/ - acb - *** Failers - a\nb - -/a[^a]b/s - acb - a\nb - -/a.b/s - acb - a\nb - -/^(b+?|a){1,2}?c/ - bac - bbac - bbbac - bbbbac - bbbbbac - -/^(b+|a){1,2}?c/ - bac - bbac - bbbac - bbbbac - bbbbbac - -/(?!\A)x/m - x\nb\n - a\bx\n - -/\x0{ab}/ - \0{ab} - -/(A|B)*?CD/ - CD - -/(A|B)*CD/ - CD - -/(?.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ - -"(?>.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo - -/(?>(\.\d\d[1-9]?))\d+/ - 1.230003938 - 1.875000282 - *** Failers - 1.235 - -/^((?>\w+)|(?>\s+))*$/ - now is the time for all good men to come to the aid of the party - *** Failers - this is not a line with only words and spaces! - -/(\d+)(\w)/ - 12345a - 12345+ - -/((?>\d+))(\w)/ - 12345a - *** Failers - 12345+ - -/(?>a+)b/ - aaab - -/((?>a+)b)/ - aaab - -/(?>(a+))b/ - aaab - -/(?>b)+/ - aaabbbccc - -/(?>a+|b+|c+)*c/ - aaabbbbccccd - -/(a+|b+|c+)*c/ - aaabbbbccccd - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - -/\(((?>[^()]+)|\([^()]+\))+\)/ - (abc) - (abc(def)xyz) - *** Failers - ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/a(?-i)b/i - ab - Ab - *** Failers - aB - AB - -/(a (?x)b c)d e/ - a bcd e - *** Failers - a b cd e - abcd e - a bcde - -/(a b(?x)c d (?-x)e f)/ - a bcde f - *** Failers - abcdef - -/(a(?i)b)c/ - abc - aBc - *** Failers - abC - aBC - Abc - ABc - ABC - AbC - -/a(?i:b)c/ - abc - aBc - *** Failers - ABC - abC - aBC - -/a(?i:b)*c/ - aBc - aBBc - *** Failers - aBC - aBBC - -/a(?=b(?i)c)\w\wd/ - abcd - abCd - *** Failers - aBCd - abcD - -/(?s-i:more.*than).*million/i - more than million - more than MILLION - more \n than Million - *** Failers - MORE THAN MILLION - more \n than \n million - -/(?:(?s-i)more.*than).*million/i - more than million - more than MILLION - more \n than Million - *** Failers - MORE THAN MILLION - more \n than \n million - -/(?>a(?i)b+)+c/ - abc - aBbc - aBBc - *** Failers - Abc - abAb - abbC - -/(?=a(?i)b)\w\wc/ - abc - aBc - *** Failers - Ab - abC - aBC - -/(?<=a(?i)b)(\w\w)c/ - abxxc - aBxxc - *** Failers - Abxxc - ABxxc - abxxC - -/^(?(?=abc)\w{3}:|\d\d)$/ - abc: - 12 - *** Failers - 123 - xyz - -/^(?(?!abc)\d\d|\w{3}:)$/ - abc: - 12 - *** Failers - 123 - xyz - -/(?(?<=foo)bar|cat)/ - foobar - cat - fcat - focat - *** Failers - foocat - -/(?(?a*)*/ - a - aa - aaaa - -/(abc|)+/ - abc - abcabc - abcabcabc - xyz - -/([a]*)*/ - a - aaaaa - -/([ab]*)*/ - a - b - ababab - aaaabcde - bbbb - -/([^a]*)*/ - b - bbbb - aaa - -/([^ab]*)*/ - cccc - abab - -/([a]*?)*/ - a - aaaa - -/([ab]*?)*/ - a - b - abab - baba - -/([^a]*?)*/ - b - bbbb - aaa - -/([^ab]*?)*/ - c - cccc - baba - -/(?>a*)*/ - a - aaabcde - -/((?>a*))*/ - aaaaa - aabbaa - -/((?>a*?))*/ - aaaaa - aabbaa - -/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x - 12-sep-98 - 12-09-98 - *** Failers - sep-12-98 - -/(?i:saturday|sunday)/ - saturday - sunday - Saturday - Sunday - SATURDAY - SUNDAY - SunDay - -/(a(?i)bc|BB)x/ - abcx - aBCx - bbx - BBx - *** Failers - abcX - aBCX - bbX - BBX - -/^([ab](?i)[cd]|[ef])/ - ac - aC - bD - elephant - Europe - frog - France - *** Failers - Africa - -/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ - ab - aBd - xy - xY - zebra - Zambesi - *** Failers - aCD - XY - -/(?<=foo\n)^bar/m - foo\nbar - *** Failers - bar - baz\nbar - -/(?<=(?]&/ - <&OUT - -/(?:(f)(o)(o)|(b)(a)(r))*/ - foobar - -/(?<=a)b/ - ab - *** Failers - cb - b - -/(?\p{Xsp}/8 + >\x{1680}\x{2028}\x{0b} + >\x{a0} + ** Failers + \x{0b} -/((?s)^a(.))((?m)^b$)/ - a\nb\nc\n +/^>\p{Xsp}+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} -/((?m)^b$)/ - a\nb\nc\n +/^>\p{Xsp}+?/8 + >\x{1680}\x{2028}\x{0b} -/(?m)^b/ - a\nb\n +/^>\p{Xsp}*/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>\p{Xsp}{2,9}/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>\p{Xsp}{2,9}?/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>[\p{Xsp}]/8 + >\x{2028}\x{0b} + +/^>[\p{Xsp}]+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} -/(?m)^(b)/ - a\nb\n +/^>\p{Xps}/8 + >\x{1680}\x{2028}\x{0b} + >\x{a0} + ** Failers + \x{0b} -/((?m)^b)/ - a\nb\n +/^>\p{Xps}+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} -/\n((?m)^b)/ - a\nb\n +/^>\p{Xps}+?/8 + >\x{1680}\x{2028}\x{0b} -/((?s).)c(?!.)/ - a\nb\nc\n - a\nb\nc\n +/^>\p{Xps}*/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>\p{Xps}{2,9}/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>\p{Xps}{2,9}?/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>[\p{Xps}]/8 + >\x{2028}\x{0b} + +/^>[\p{Xps}]+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} -/((?s)b.)c(?!.)/ - a\nb\nc\n - a\nb\nc\n +/^\p{Xwd}/8 + ABCD + 1234 + \x{6ca} + \x{a6c} + \x{10a7} + _ABC + ** Failers + [] -/^b/ +/^\p{Xwd}+/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ -/()^b/ - *** Failers - a\nb\nc\n - a\nb\nc\n +/^\p{Xwd}+?/8 + \x{6ca}\x{a6c}\x{10a7}_ -/((?m)^b)/ - a\nb\nc\n +/^\p{Xwd}*/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + +/^\p{Xwd}{2,9}/8 + A_B12\x{6ca}\x{a6c}\x{10a7} + +/^\p{Xwd}{2,9}?/8 + \x{6ca}\x{a6c}\x{10a7}_ + +/^[\p{Xwd}]/8 + ABCD1234_ + 1234abcd_ + \x{6ca} + \x{a6c} + \x{10a7} + _ABC + ** Failers + [] + +/^[\p{Xwd}]+/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ -/(?(?!a)a|b)/ +/-- A check not in UTF-8 mode --/ -/(?(?!a)b|a)/ - a +/^[\p{Xwd}]+/ + ABCD1234_ + +/-- Some negative checks --/ -/(?(?=a)b|a)/ - *** Failers - a - a +/^[\P{Xwd}]+/8 + !.+\x{019}\x{35a}AB -/(?(?=a)a|b)/ - a +/^[\p{^Xwd}]+/8 + !.+\x{019}\x{35a}AB -/(\w+:)+/ - one: +/[\D]/WBZ8 + 1\x{3c8}2 -/$(?<=^(a))/ - a +/[\d]/WBZ8 + >\x{6f4}< -/([\w:]+::)?(\w+)$/ - abcd - xy:z:::abcd - -/^[^bcd]*(c+)/ - aexycd - -/(a*)b+/ - caab - -/([\w:]+::)?(\w+)$/ - abcd - xy:z:::abcd - *** Failers - abcd: - abcd: +/[\S]/WBZ8 + \x{1680}\x{6f4}\x{1680} -/^[^bcd]*(c+)/ - aexycd +/[\s]/WBZ8 + >\x{1680}< -/(>a+)ab/ +/[\W]/WBZ8 + A\x{1712}B -/(?>a+)b/ - aaab +/[\w]/WBZ8 + >\x{1723}< -/([[:]+)/ - a:[b]: +/\D/WBZ8 + 1\x{3c8}2 -/([[=]+)/ - a=[b]= +/\d/WBZ8 + >\x{6f4}< -/([[.]+)/ - a.[b]. +/\S/WBZ8 + \x{1680}\x{6f4}\x{1680} -/((?>a+)b)/ - aaab +/\s/WBZ8 + >\x{1680}> -/(?>(a+))b/ - aaab +/\W/WBZ8 + A\x{1712}B -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x +/\w/WBZ8 + >\x{1723}< -/a\Z/ - *** Failers - aaab - a\nb\n +/[[:alpha:]]/WBZ -/b\Z/ - a\nb\n +/[[:lower:]]/WBZ -/b\z/ +/[[:upper:]]/WBZ -/b\Z/ - a\nb +/[[:alnum:]]/WBZ -/b\z/ - a\nb - *** Failers - -/(?>.*)(?<=(abcd|wxyz))/ - alphabetabcd - endingwxyz - *** Failers - a rather long string that doesn't end with one of them +/[[:ascii:]]/WBZ -/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark - -/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope +/[[:cntrl:]]/WBZ -/(?<=\d{3}(?!999))foo/ - 999foo - 123999foo - *** Failers - 123abcfoo - -/(?<=(?!...999)\d{3})foo/ - 999foo - 123999foo - *** Failers - 123abcfoo +/[[:digit:]]/WBZ -/(?<=\d{3}(?!999)...)foo/ - 123abcfoo - 123456foo - *** Failers - 123999foo - -/(?<=\d{3}...)(?Z)+|A)*/ - ZABCDEFG +/[[:word:]]/WBZ -/((?>)+|A)*/ - ZABCDEFG +/[[:xdigit:]]/WBZ -/a*/g - abbab +/-- Unicode properties for \b abd \B --/ -/^[a-\d]/ - abcde - -things - 0digit - *** Failers - bcdef +/\b...\B/8W + abc_ + \x{37e}abc\x{376} + \x{37e}\x{376}\x{371}\x{393}\x{394} + !\x{c0}++\x{c1}\x{c2} + !\x{c0}+++++ -/^[\d-a]/ - abcde - -things - 0digit - *** Failers - bcdef - -/[[:space:]]+/ - > \x09\x0a\x0c\x0d\x0b< - -/[[:blank:]]+/ - > \x09\x0a\x0c\x0d\x0b< - -/[\s]+/ - > \x09\x0a\x0c\x0d\x0b< - -/\s+/ - > \x09\x0a\x0c\x0d\x0b< - -/a b/x - ab +/-- Without PCRE_UCP, non-ASCII always fail, even if < 256 --/ -/(?!\A)x/m - a\nxb\n +/\b...\B/8 + abc_ + ** Failers + \x{37e}abc\x{376} + \x{37e}\x{376}\x{371}\x{393}\x{394} + !\x{c0}++\x{c1}\x{c2} + !\x{c0}+++++ -/(?!^)x/m - a\nxb\n +/-- With PCRE_UCP, non-UTF8 chars that are < 256 still check properties --/ -/abc\Qabc\Eabc/ - abcabcabc - -/abc\Q(*+|\Eabc/ - abc(*+|abc +/\b...\B/W + abc_ + !\x{c0}++\x{c1}\x{c2} + !\x{c0}+++++ -/ abc\Q abc\Eabc/x - abc abcabc - *** Failers - abcabcabc - -/abc#comment - \Q#not comment - literal\E/x - abc#not comment\n literal - -/abc#comment - \Q#not comment - literal/x - abc#not comment\n literal - -/abc#comment - \Q#not comment - literal\E #more comment - /x - abc#not comment\n literal - -/abc#comment - \Q#not comment - literal\E #more comment/x - abc#not comment\n literal +/-- Some of these are silly, but they check various combinations --/ -/\Qabc\$xyz\E/ - abc\\\$xyz +/[[:^alpha:][:^cntrl:]]+/8WBZ + 123 + abc -/\Qabc\E\$\Qxyz\E/ - abc\$xyz +/[[:^cntrl:][:^alpha:]]+/8WBZ + 123 + abc -/\Gabc/ +/[[:alpha:]]+/8WBZ abc - *** Failers - xyzabc -/\Gabc./g - abc1abc2xyzabc3 - -/abc./g - abc1abc2xyzabc3 - -/a(?x: b c )d/ - XabcdY - *** Failers - Xa b c d Y - -/((?x)x y z | a b c)/ - XabcY - AxyzB +/[[:^alpha:]\S]+/8WBZ + 123 + abc -/(?i)AB(?-i)C/ - XabCY - *** Failers - XabcY +/[^\d]+/8WBZ + abc123 + abc\x{123} + \x{660}abc -/((?i)AB(?-i)C|D)E/ - abCE - DE - *** Failers - abcE - abCe - dE - De +/\p{Lu}+9\p{Lu}+B\p{Lu}+b/BZ -/[z\Qa-d]\E]/ - z - a - - - d - ] - *** Failers - b +/\p{^Lu}+9\p{^Lu}+B\p{^Lu}+b/BZ -/[\z\C]/ - z - C - -/\M/ - M - -/(a+)*b/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/(?i)reg(?:ul(?:[a]|ae)r|ex)/ - REGular - regulaer - Regex - regulr - -/[--]+/ - - - - - -/(?<=Z)X./ - \x84XAZXB - -/^(?(2)a|(1)(2))+$/ - 123a - -/(?<=a|bbbb)c/ - ac - bbbbc +/\P{Lu}+9\P{Lu}+B\P{Lu}+b/BZ -/abc/>testsavedregex -testsavedregex -testsavedregex -testsavedregex - - xyz\r\nabc\ - xyz\rabc\ - xyz\r\nabc\ - ** Failers - xyz\nabc\ - xyz\r\nabc\ - xyz\nabc\ - xyz\rabc\ - xyz\rabc\ - -/abc$/m - xyzabc - xyzabc\n - xyzabc\npqr - xyzabc\r\ - xyzabc\rpqr\ - xyzabc\r\n\ - xyzabc\r\npqr\ - ** Failers - xyzabc\r - xyzabc\rpqr - xyzabc\r\n - xyzabc\r\npqr - -/^abc/m - xyz\rabcdef - xyz\nabcdef\ - ** Failers - xyz\nabcdef - -/^abc/m - xyz\nabcdef - xyz\rabcdef\ - ** Failers - xyz\rabcdef - -/^abc/m - xyz\r\nabcdef - xyz\rabcdef\ - ** Failers - xyz\rabcdef - -/.*/ - abc\ndef - abc\rdef - abc\r\ndef - \abc\ndef - \abc\rdef - \abc\r\ndef - \abc\ndef - \abc\rdef - \abc\r\ndef - -/\w+(.)(.)?def/s - abc\ndef - abc\rdef - abc\r\ndef - -/^\w+=.*(\\\n.*)*/ - abc=xyz\\\npqr - -/^(a()*)*/ - aaaa - -/^(?:a(?:(?:))*)*/ - aaaa - -/^(a()+)+/ - aaaa - -/^(?:a(?:(?:))+)+/ - aaaa - -/(a|)*\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - -/(?>a|)*\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - -/(?:a|)*\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - -/^a.b/ - a\rb - a\nb\ - ** Failers - a\nb - a\nb\ - a\rb\ - a\rb\ - -/^abc./mgx - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK - -/abc.$/mgx - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 - -/^a\Rb/ - a\nb - a\rb - a\r\nb - a\x0bb - a\x0cb - a\x85b - ** Failers - a\n\rb +/A+\p{N}A+\dB+\p{N}*B+\d*/WBZ -/^a\R*b/ - ab - a\nb - a\rb - a\r\nb - a\x0bb - a\x0cb - a\x85b - a\n\rb - a\n\r\x85\x0cb - -/^a\R+b/ - a\nb - a\rb - a\r\nb - a\x0bb - a\x0cb - a\x85b - a\n\rb - a\n\r\x85\x0cb - ** Failers - ab - -/^a\R{1,3}b/ - a\nb - a\n\rb - a\n\r\x85b - a\r\n\r\nb - a\r\n\r\n\r\nb - a\n\r\n\rb - a\n\n\r\nb - ** Failers - a\n\n\n\rb - a\r +/-- These behaved oddly in Perl, so they are kept in this test --/ -/^a[\R]b/ - aRb - ** Failers - a\nb +/(\x{23a}\x{23a}\x{23a})?\1/8i + \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65} -/.+foo/ - afoo - ** Failers - \r\nfoo - \nfoo +/(ȺȺȺ)?\1/8i + ȺȺȺⱥⱥ -/.+foo/ - afoo - \nfoo - ** Failers - \r\nfoo +/(\x{23a}\x{23a}\x{23a})?\1/8i + \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65} -/.+foo/ - afoo - ** Failers - \nfoo - \r\nfoo +/(ȺȺȺ)?\1/8i + ȺȺȺⱥⱥⱥ -/.+foo/s - afoo - \r\nfoo - \nfoo - -/^$/mg - abc\r\rxyz - abc\n\rxyz - ** Failers - abc\r\nxyz +/(\x{23a}\x{23a}\x{23a})\1/8i + \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65} -/^X/m - XABC - ** Failers - XABC\B +/(ȺȺȺ)\1/8i + ȺȺȺⱥⱥ -/(?m)^$/g+ - abc\r\n\r\n +/(\x{23a}\x{23a}\x{23a})\1/8i + \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65} -/(?m)^$|^\r\n/g+ - abc\r\n\r\n - -/(?m)$/g+ - abc\r\n\r\n +/(ȺȺȺ)\1/8i + ȺȺȺⱥⱥⱥ -/(?|(abc)|(xyz))/ - >abc< - >xyz< - -/(x)(?|(abc)|(xyz))(x)/ - xabcx - xxyzx - -/(x)(?|(abc)(pqr)|(xyz))(x)/ - xabcpqrx - xxyzx - -/(?|(abc)|(xyz))(?1)/ - abcabc - xyzabc - ** Failers - xyzxyz - -/\H\h\V\v/ - X X\x0a - X\x09X\x0b - ** Failers - \xa0 X\x0a - -/\H*\h+\V?\v{3,4}/ - \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a - \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a - \x09\x20\xa0\x0a\x0b\x0c - ** Failers - \x09\x20\xa0\x0a\x0b - -/\H{3,4}/ - XY ABCDE - XY PQR ST +/(\x{2c65}\x{2c65})\1/8i + \x{2c65}\x{2c65}\x{23a}\x{23a} -/.\h{3,4}./ - XY AB PQRS - -/\h*X\h?\H+Y\H?Z/ - >XNNNYZ - > X NYQZ - ** Failers - >XYZ - > X NY Z - -/\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ - >XY\x0aZ\x0aA\x0bNN\x0c - >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c - -/.+A/ - \r\nA +/(ⱥⱥ)\1/8i + ⱥⱥȺȺ -/\nA/ - \r\nA +/(\x{23a}\x{23a}\x{23a})\1Y/8i + X\x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65}YZ -/[\r\n]A/ - \r\nA +/(\x{2c65}\x{2c65})\1Y/8i + X\x{2c65}\x{2c65}\x{23a}\x{23a}YZ -/(\r|\n)A/ - \r\nA +/-- --/ -/a\Rb/I - a\rb - a\nb - a\r\nb - ** Failers - a\x85b - a\x0bb +/-- These scripts weren't yet in Perl when I added Unicode 6.0.0 to PCRE --/ -/a\Rb/I - a\rb - a\nb - a\r\nb - a\x85b - a\x0bb - ** Failers - a\x85b\ - a\x0bb\ - -/a\R?b/I - a\rb - a\nb - a\r\nb +/^[\p{Batak}]/8 + \x{1bc0} + \x{1bff} ** Failers - a\x85b - a\x0bb - -/a\R?b/I - a\rb - a\nb - a\r\nb - a\x85b - a\x0bb - ** Failers - a\x85b\ - a\x0bb\ + \x{1bf4} -/a\R{2,4}b/I - a\r\n\nb - a\n\r\rb - a\r\n\r\n\r\n\r\nb +/^[\p{Brahmi}]/8 + \x{11000} + \x{1106f} ** Failers - a\x85\85b - a\x0b\0bb - -/a\R{2,4}b/I - a\r\rb - a\n\n\nb - a\r\n\n\r\rb - a\x85\85b - a\x0b\0bb - ** Failers - a\r\r\r\r\rb - a\x85\85b\ - a\x0b\0bb\ + \x{1104e} -/a(?!)|\wbc/ - abc - -/a[]b/ +/^[\p{Mandaic}]/8 + \x{840} + \x{85e} ** Failers - ab + \x{85c} + \x{85d} -/a[]+b/ - ** Failers - ab +/-- --/ -/a[]*+b/ - ** Failers - ab +/(\X*)(.)/s8 + A\x{300} -/a[^]b/ - aXb - a\nb - ** Failers - ab +/^S(\X*)e(\X*)$/8 + Stéréo -/a[^]+b/ - aXb - a\nX\nXb - ** Failers - ab - -/X$/E - X - ** Failers - X\n - -/X$/ - X - X\n - -/xyz/C - xyz - abcxyz - abcxyz\Y - ** Failers - abc - abc\Y - abcxypqr - abcxypqr\Y +/^\X/8 + ́réo -/(*NO_START_OPT)xyz/C - abcxyz - -/(?C)ab/ - ab - \C-ab - -/ab/C - ab - \C-ab - -/^"((?(?=[a])[^"])|b)*"$/C - "ab" - \C-"ab" - -/\d+X|9+Y/ - ++++123999\P - ++++123999Y\P - -/Z(*F)/ - Z\P - ZA\P - -/Z(?!)/ - Z\P - ZA\P - -/dog(sbody)?/ - dogs\P - dogs\P\P - -/dog(sbody)??/ - dogs\P - dogs\P\P - -/dog|dogsbody/ - dogs\P - dogs\P\P - -/dogsbody|dog/ - dogs\P - dogs\P\P - -/Z(*F)Q|ZXY/ - Z\P - ZA\P - X\P - -/\bthe cat\b/ - the cat\P - the cat\P\P - -/dog(sbody)?/ - dogs\D\P - body\D\R - -/dog(sbody)?/ - dogs\D\P\P - body\D\R - -/abc/ - abc\P - abc\P\P +/^a\X41z/ + aX41z + *** Failers + aAz -/abc\K123/ - xyzabc123pqr - -/(?<=abc)123/ - xyzabc123pqr - xyzabc12\P - xyzabc12\P\P - -/\babc\b/ - +++abc+++ - +++ab\P - +++ab\P\P - -/(?=C)/g+ - ABCDECBA - -/(abc|def|xyz)/I - terhjk;abcdaadsfe - the quick xyz brown fox - \Yterhjk;abcdaadsfe - \Ythe quick xyz brown fox - ** Failers - thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd - \Ythejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd +/(?<=ab\Cde)X/8 -/(abc|def|xyz)/SI - terhjk;abcdaadsfe - the quick xyz brown fox - \Yterhjk;abcdaadsfe - \Ythe quick xyz brown fox - ** Failers - thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd - \Ythejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd +/\X/ + a\P + a\P\P -/abcd*/+ - xxxxabcd\P - xxxxabcd\P\P - dddxxx\R - xxxxabcd\P\P - xxx\R - -/abcd*/i - xxxxabcd\P - xxxxabcd\P\P - XXXXABCD\P - XXXXABCD\P\P - -/abc\d*/ - xxxxabc1\P - xxxxabc1\P\P - -/abc[de]*/ - xxxxabcde\P - xxxxabcde\P\P +/\Xa/ + aa\P + aa\P\P -/(?:(?1)|B)(A(*F)|C)/ - ABCD - CCD - ** Failers - CAD +/\X{2}/ + aa\P + aa\P\P -/^(?:(?1)|B)(A(*F)|C)/ - CCD - BCD - ** Failers - ABCD - CAD - BAD +/\X+a/ + a\P + aa\P + aa\P\P -/^(?!a(*SKIP)b)/ - ac - -/^(?=a(*SKIP)b|ac)/ - ** Failers - ac - -/^(?=a(*THEN)b|ac)/ - ac +/\X+?a/ + a\P + ab\P + aa\P + aa\P\P + aba\P -/^(?=a(*PRUNE)b)/ - ab - ** Failers - ac - -/^(?(?!a(*SKIP)b))/ - ac - -/(?<=abc)def/ - abc\P\P - -/abc$/ - abc - abc\P - abc\P\P - -/abc$/m - abc - abc\n - abc\P\P - abc\n\P\P - abc\P - abc\n\P - -/abc\z/ - abc - abc\P - abc\P\P - -/abc\Z/ - abc - abc\P - abc\P\P - -/abc\b/ - abc - abc\P - abc\P\P +/-- These Unicode 6.1.0 scripts are not known to Perl. --/ -/abc\B/ - abc - abc\P - abc\P\P +/\p{Chakma}\d/8W + \x{11100}\x{1113c} -/.+/ - abc\>0 - abc\>1 - abc\>2 - abc\>3 - abc\>4 - abc\>-4 +/\p{Takri}\d/8W + \x{11680}\x{116c0} + +/^\X/8 + A\P + A\P\P + A\x{300}\x{301}\P + A\x{300}\x{301}\P\P + A\x{301}\P + A\x{301}\P\P + +/^\X{2,3}/8 + A\P + A\P\P + AA\P + AA\P\P + A\x{300}\x{301}\P + A\x{300}\x{301}\P\P + A\x{300}\x{301}A\x{300}\x{301}\P + A\x{300}\x{301}A\x{300}\x{301}\P\P + +/^\X{2}/8 + AA\P + AA\P\P + A\x{300}\x{301}A\x{300}\x{301}\P + A\x{300}\x{301}A\x{300}\x{301}\P\P + +/^\X+/8 + AA\P + AA\P\P + +/^\X+?Z/8 + AA\P + AA\P\P /-- End of testinput7 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testinput8 php5-5.4.9/ext/pcre/pcrelib/testdata/testinput8 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testinput8 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testinput8 2012-11-21 05:12:20.000000000 +0000 @@ -1,590 +1,4199 @@ -/-- This set of tests checks UTF-8 support with the DFA matching functionality - of pcre_dfa_exec(). The -dfa flag must be used with pcretest when running - it. --/ +/-- This set of tests check the DFA matching functionality of pcre_dfa_exec(). + The -dfa flag must be used with pcretest when running it. --/ + +/abc/ + abc + +/ab*c/ + abc + abbbbc + ac + +/ab+c/ + abc + abbbbbbc + *** Failers + ac + ab + +/a*/ + a + aaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\F + +/(a|abcd|african)/ + a + abcd + african + +/^abc/ + abcdef + *** Failers + xyzabc + xyz\nabc + +/^abc/m + abcdef + xyz\nabc + *** Failers + xyzabc + +/\Aabc/ + abcdef + *** Failers + xyzabc + xyz\nabc + +/\Aabc/m + abcdef + *** Failers + xyzabc + xyz\nabc + +/\Gabc/ + abcdef + xyzabc\>3 + *** Failers + xyzabc + xyzabc\>2 + +/x\dy\Dz/ + x9yzz + x0y+z + *** Failers + xyz + xxy0z + +/x\sy\Sz/ + x yzz + x y+z + *** Failers + xyz + xxyyz + +/x\wy\Wz/ + xxy+z + *** Failers + xxy0z + x+y+z + +/x.y/ + x+y + x-y + *** Failers + x\ny + +/x.y/s + x+y + x-y + x\ny + +/(a.b(?s)c.d|x.y)p.q/ + a+bc+dp+q + a+bc\ndp+q + x\nyp+q + *** Failers + a\nbc\ndp+q + a+bc\ndp\nq + x\nyp\nq + +/a\d\z/ + ba0 + *** Failers + ba0\n + ba0\ncd + +/a\d\z/m + ba0 + *** Failers + ba0\n + ba0\ncd + +/a\d\Z/ + ba0 + ba0\n + *** Failers + ba0\ncd + +/a\d\Z/m + ba0 + ba0\n + *** Failers + ba0\ncd + +/a\d$/ + ba0 + ba0\n + *** Failers + ba0\ncd + +/a\d$/m + ba0 + ba0\n + ba0\ncd + *** Failers + +/abc/i + abc + aBc + ABC + +/[^a]/ + abcd + +/ab?\w/ + abz + abbz + azz + +/x{0,3}yz/ + ayzq + axyzq + axxyz + axxxyzq + axxxxyzq + *** Failers + ax + axx + +/x{3}yz/ + axxxyzq + axxxxyzq + *** Failers + ax + axx + ayzq + axyzq + axxyz + +/x{2,3}yz/ + axxyz + axxxyzq + axxxxyzq + *** Failers + ax + axx + ayzq + axyzq + +/[^a]+/ + bac + bcdefax + *** Failers + aaaaa + +/[^a]*/ + bac + bcdefax + *** Failers + aaaaa + +/[^a]{3,5}/ + xyz + awxyza + abcdefa + abcdefghijk + *** Failers + axya + axa + aaaaa + +/\d*/ + 1234b567 + xyz + +/\D*/ + a1234b567 + xyz + +/\d+/ + ab1234c56 + *** Failers + xyz + +/\D+/ + ab123c56 + *** Failers + 789 + +/\d?A/ + 045ABC + ABC + *** Failers + XYZ + +/\D?A/ + ABC + BAC + 9ABC + *** Failers + +/a+/ + aaaa + +/^.*xyz/ + xyz + ggggggggxyz + +/^.+xyz/ + abcdxyz + axyz + *** Failers + xyz + +/^.?xyz/ + xyz + cxyz + +/^\d{2,3}X/ + 12X + 123X + *** Failers + X + 1X + 1234X + +/^[abcd]\d/ + a45 + b93 + c99z + d04 + *** Failers + e45 + abcd + abcd1234 + 1234 + +/^[abcd]*\d/ + a45 + b93 + c99z + d04 + abcd1234 + 1234 + *** Failers + e45 + abcd + +/^[abcd]+\d/ + a45 + b93 + c99z + d04 + abcd1234 + *** Failers + 1234 + e45 + abcd + +/^a+X/ + aX + aaX + +/^[abcd]?\d/ + a45 + b93 + c99z + d04 + 1234 + *** Failers + abcd1234 + e45 + +/^[abcd]{2,3}\d/ + ab45 + bcd93 + *** Failers + 1234 + a36 + abcd1234 + ee45 + +/^(abc)*\d/ + abc45 + abcabcabc45 + 42xyz + *** Failers + +/^(abc)+\d/ + abc45 + abcabcabc45 + *** Failers + 42xyz + +/^(abc)?\d/ + abc45 + 42xyz + *** Failers + abcabcabc45 + +/^(abc){2,3}\d/ + abcabc45 + abcabcabc45 + *** Failers + abcabcabcabc45 + abc45 + 42xyz + +/1(abc|xyz)2(?1)3/ + 1abc2abc3456 + 1abc2xyz3456 + +/^(a*\w|ab)=(a*\w|ab)/ + ab=ab + +/^(a*\w|ab)=(?1)/ + ab=ab + +/^([^()]|\((?1)*\))*$/ + abc + a(b)c + a(b(c))d + *** Failers) + a(b(c)d + +/^>abc>([^()]|\((?1)*\))*abc>123abc>1(2)3abc>(1(2)3)a*)\d/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876 + *** Failers + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x + <> + + hij> + hij> + def> + + *** Failers + 3 + *** Failers + defabcxyz + +/^abcdef/ + ab\P + abcde\P + abcdef\P + *** Failers + abx\P + +/^a{2,4}\d+z/ + a\P + aa\P + aa2\P + aaa\P + aaa23\P + aaaa12345\P + aa0z\P + aaaa4444444444444z\P + *** Failers + az\P + aaaaa\P + a56\P + +/^abcdef/ + abc\P + def\R + +/(?<=foo)bar/ + xyzfo\P + foob\P\>2 + foobar...\R\P\>4 + xyzfo\P + foobar\>2 + *** Failers + xyzfo\P + obar\R + +/(ab*(cd|ef))+X/ + adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\P\Z + lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\P\B\Z + cdabbbbbbbb\P\R\B\Z + efabbbbbbbbbbbbbbbb\P\R\B\Z + bbbbbbbbbbbbcdXyasdfadf\P\R\B\Z + +/(a|b)/SF>testsavedregex +>>aaabxyzpqrrrabbxyyyypqAzz + >aaaabxyzpqrrrabbxyyyypqAzz + >>>>abcxyzpqrrrabbxyyyypqAzz + *** Failers + abxyzpqrrabbxyyyypqAzz + abxyzpqrrrrabbxyyyypqAzz + abxyzpqrrrabxyyyypqAzz + aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz + aaaabcxyzzzzpqrrrabbbxyyypqAzz + aaabcxyzpqrrrabbxyyyypqqqqqqqAzz + +/^(abc){1,2}zz/ + abczz + abcabczz + *** Failers + zz + abcabcabczz + >>abczz + +/^(b+?|a){1,2}?c/ + bc + bbc + bbbc + bac + bbac + aac + abbbbbbbbbbbc + bbbbbbbbbbbac + *** Failers + aaac + abbbbbbbbbbbac + +/^(b+|a){1,2}c/ + bc + bbc + bbbc + bac + bbac + aac + abbbbbbbbbbbc + bbbbbbbbbbbac + *** Failers + aaac + abbbbbbbbbbbac + +/^(b+|a){1,2}?bc/ + bbc + +/^(b*|ba){1,2}?bc/ + babc + bbabc + bababc + *** Failers + bababbc + babababc + +/^(ba|b*){1,2}?bc/ + babc + bbabc + bababc + *** Failers + bababbc + babababc + +/^\ca\cA\c[\c{\c:/ + \x01\x01\e;z + +/^[ab\]cde]/ + athing + bthing + ]thing + cthing + dthing + ething + *** Failers + fthing + [thing + \\thing + +/^[]cde]/ + ]thing + cthing + dthing + ething + *** Failers + athing + fthing + +/^[^ab\]cde]/ + fthing + [thing + \\thing + *** Failers + athing + bthing + ]thing + cthing + dthing + ething + +/^[^]cde]/ + athing + fthing + *** Failers + ]thing + cthing + dthing + ething + +/^\/ + + +/^/ + + +/^[0-9]+$/ + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 100 + *** Failers + abc + +/^.*nter/ + enter + inter + uponter + +/^xxx[0-9]+$/ + xxx0 + xxx1234 + *** Failers + xxx + +/^.+[0-9][0-9][0-9]$/ + x123 + xx123 + 123456 + *** Failers + 123 + x1234 + +/^.+?[0-9][0-9][0-9]$/ + x123 + xx123 + 123456 + *** Failers + 123 + x1234 + +/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ + abc!pqr=apquxz.ixr.zzz.ac.uk + *** Failers + !pqr=apquxz.ixr.zzz.ac.uk + abc!=apquxz.ixr.zzz.ac.uk + abc!pqr=apquxz:ixr.zzz.ac.uk + abc!pqr=apquxz.ixr.zzz.ac.ukk + +/:/ + Well, we need a colon: somewhere + *** Fail if we don't + +/([\da-f:]+)$/i + 0abc + abc + fed + E + :: + 5f03:12C0::932e + fed def + Any old stuff + *** Failers + 0zzz + gzzz + fed\x20 + Any old rubbish + +/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ + .1.2.3 + A.12.123.0 + *** Failers + .1.2.3333 + 1.2.3 + 1234.2.3 + +/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ + 1 IN SOA non-sp1 non-sp2( + 1 IN SOA non-sp1 non-sp2 ( + *** Failers + 1IN SOA non-sp1 non-sp2( + +/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ + a. + Z. + 2. + ab-c.pq-r. + sxk.zzz.ac.uk. + x-.y-. + *** Failers + -abc.peq. + +/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ + *.a + *.b0-a + *.c3-b.c + *.c-a.b-c + *** Failers + *.0 + *.a- + *.a-b.c- + *.c-a.0-c + +/^(?=ab(de))(abd)(e)/ + abde + +/^(?!(ab)de|x)(abd)(f)/ + abdf + +/^(?=(ab(cd)))(ab)/ + abcd + +/^[\da-f](\.[\da-f])*$/i + a.b.c.d + A.B.C.D + a.b.c.1.2.3.C + +/^\".*\"\s*(;.*)?$/ + \"1234\" + \"abcd\" ; + \"\" ; rhubarb + *** Failers + \"1234\" : things + +/^$/ + \ + *** Failers + +/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x + ab c + *** Failers + abc + ab cde + +/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ + ab c + *** Failers + abc + ab cde + +/^ a\ b[c ]d $/x + a bcd + a b d + *** Failers + abcd + ab d + +/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ + abcdefhijklm + +/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ + abcdefhijklm + +/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ + a+ Z0+\x08\n\x1d\x12 + +/^[.^$|()*+?{,}]+/ + .^\$(*+)|{?,?} + +/^a*\w/ + z + az + aaaz + a + aa + aaaa + a+ + aa+ + +/^a*?\w/ + z + az + aaaz + a + aa + aaaa + a+ + aa+ + +/^a+\w/ + az + aaaz + aa + aaaa + aa+ + +/^a+?\w/ + az + aaaz + aa + aaaa + aa+ + +/^\d{8}\w{2,}/ + 1234567890 + 12345678ab + 12345678__ + *** Failers + 1234567 + +/^[aeiou\d]{4,5}$/ + uoie + 1234 + 12345 + aaaaa + *** Failers + 123456 + +/^[aeiou\d]{4,5}?/ + uoie + 1234 + 12345 + aaaaa + 123456 + +/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ + From abcd Mon Sep 01 12:33:02 1997 + +/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ + From abcd Mon Sep 01 12:33:02 1997 + From abcd Mon Sep 1 12:33:02 1997 + *** Failers + From abcd Sep 01 12:33:02 1997 + +/^12.34/s + 12\n34 + 12\r34 + +/\w+(?=\t)/ + the quick brown\t fox + +/foo(?!bar)(.*)/ + foobar is foolish see? + +/(?:(?!foo)...|^.{0,2})bar(.*)/ + foobar crowbar etc + barrel + 2barrel + A barrel + +/^(\D*)(?=\d)(?!123)/ + abc456 + *** Failers + abc123 + +/^1234(?# test newlines + inside)/ + 1234 + +/^1234 #comment in extended re + /x + 1234 + +/#rhubarb + abcd/x + abcd + +/^abcd#rhubarb/x + abcd + +/(?!^)abc/ + the abc + *** Failers + abc + +/(?=^)abc/ + abc + *** Failers + the abc + +/^[ab]{1,3}(ab*|b)/ + aabbbbb + +/^[ab]{1,3}?(ab*|b)/ + aabbbbb + +/^[ab]{1,3}?(ab*?|b)/ + aabbbbb + +/^[ab]{1,3}(ab*?|b)/ + aabbbbb + +/ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional leading comment +(?: (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # one word, optionally followed by.... +(?: +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... +\( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) | # comments, or... + +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +# quoted strings +)* +< (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # leading < +(?: @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* + +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* , (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +)* # further okay, if led by comma +: # closing colon +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* )? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address spec +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* > # trailing > +# name and address +) (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional trailing comment +/x + Alan Other + + user\@dom.ain + \"A. Other\" (a comment) + A. Other (a comment) + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + A missing angle @,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +# leading word +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces +(?: +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +| +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +) # "special" comment or quoted string +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" +)* +< +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# < +(?: +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +(?: , +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +)* # additional domains +: +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address spec +> # > +# name and address +) +/x + Alan Other + + user\@dom.ain + \"A. Other\" (a comment) + A. Other (a comment) + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + A missing angle + a\rb + *** Failers + a\nb + +/abc$/ + abc + abc\n + *** Failers + abc\ndef + +/(abc)\123/ + abc\x53 + +/(abc)\223/ + abc\x93 + +/(abc)\323/ + abc\xd3 + +/(abc)\100/ + abc\x40 + abc\100 + +/(abc)\1000/ + abc\x400 + abc\x40\x30 + abc\1000 + abc\100\x30 + abc\100\060 + abc\100\60 + +/abc\81/ + abc\081 + abc\0\x38\x31 + +/abc\91/ + abc\091 + abc\0\x39\x31 + +/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/ + abcdefghijk\12S + +/ab\idef/ + abidef + +/a{0}bc/ + bc + +/(a|(bc)){0,0}?xyz/ + xyz + +/abc[\10]de/ + abc\010de + +/abc[\1]de/ + abc\1de + +/(abc)[\1]de/ + abc\1de + +/(?s)a.b/ + a\nb + +/^([^a])([^\b])([^c]*)([^d]{3,4})/ + baNOTccccd + baNOTcccd + baNOTccd + bacccd + *** Failers + anything + b\bc + baccd + +/[^a]/ + Abc + +/[^a]/i + Abc + +/[^a]+/ + AAAaAbc + +/[^a]+/i + AAAaAbc + +/[^a]+/ + bbb\nccc + +/[^k]$/ + abc + *** Failers + abk + +/[^k]{2,3}$/ + abc + kbc + kabc + *** Failers + abk + akb + akk + +/^\d{8,}\@.+[^k]$/ + 12345678\@a.b.c.d + 123456789\@x.y.z + *** Failers + 12345678\@x.y.uk + 1234567\@a.b.c.d + +/[^a]/ + aaaabcd + aaAabcd + +/[^a]/i + aaaabcd + aaAabcd + +/[^az]/ + aaaabcd + aaAabcd + +/[^az]/i + aaaabcd + aaAabcd + +/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/ + \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377 + +/P[^*]TAIRE[^*]{1,6}?LL/ + xxxxxxxxxxxPSTAIREISLLxxxxxxxxx + +/P[^*]TAIRE[^*]{1,}?LL/ + xxxxxxxxxxxPSTAIREISLLxxxxxxxxx + +/(\.\d\d[1-9]?)\d+/ + 1.230003938 + 1.875000282 + 1.235 + +/(\.\d\d((?=0)|\d(?=\d)))/ + 1.230003938 + 1.875000282 + *** Failers + 1.235 + +/a(?)b/ + ab + +/\b(foo)\s+(\w+)/i + Food is on the foo table + +/foo(.*)bar/ + The food is under the bar in the barn. + +/foo(.*?)bar/ + The food is under the bar in the barn. + +/(.*)(\d*)/ + I have 2 numbers: 53147 + +/(.*)(\d+)/ + I have 2 numbers: 53147 + +/(.*?)(\d*)/ + I have 2 numbers: 53147 + +/(.*?)(\d+)/ + I have 2 numbers: 53147 + +/(.*)(\d+)$/ + I have 2 numbers: 53147 + +/(.*?)(\d+)$/ + I have 2 numbers: 53147 + +/(.*)\b(\d+)$/ + I have 2 numbers: 53147 + +/(.*\D)(\d+)$/ + I have 2 numbers: 53147 + +/^\D*(?!123)/ + ABC123 + +/^(\D*)(?=\d)(?!123)/ + ABC445 + *** Failers + ABC123 + +/^[W-]46]/ + W46]789 + -46]789 + *** Failers + Wall + Zebra + 42 + [abcd] + ]abcd[ + +/^[W-\]46]/ + W46]789 + Wall + Zebra + Xylophone + 42 + [abcd] + ]abcd[ + \\backslash + *** Failers + -46]789 + well + +/\d\d\/\d\d\/\d\d\d\d/ + 01/01/2000 + +/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark otherword + word cat dog elephant mussel cow horse canary baboon snake shark + +/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope + +/^(a){0,0}/ + bcd + abc + aab + +/^(a){0,1}/ + bcd + abc + aab + +/^(a){0,2}/ + bcd + abc + aab + +/^(a){0,3}/ + bcd + abc + aab + aaa + +/^(a){0,}/ + bcd + abc + aab + aaa + aaaaaaaa + +/^(a){1,1}/ + bcd + abc + aab + +/^(a){1,2}/ + bcd + abc + aab + +/^(a){1,3}/ + bcd + abc + aab + aaa + +/^(a){1,}/ + bcd + abc + aab + aaa + aaaaaaaa + +/.*\.gif/ + borfle\nbib.gif\nno + +/.{0,}\.gif/ + borfle\nbib.gif\nno + +/.*\.gif/m + borfle\nbib.gif\nno + +/.*\.gif/s + borfle\nbib.gif\nno + +/.*\.gif/ms + borfle\nbib.gif\nno + +/.*$/ + borfle\nbib.gif\nno + +/.*$/m + borfle\nbib.gif\nno + +/.*$/s + borfle\nbib.gif\nno + +/.*$/ms + borfle\nbib.gif\nno + +/.*$/ + borfle\nbib.gif\nno\n + +/.*$/m + borfle\nbib.gif\nno\n + +/.*$/s + borfle\nbib.gif\nno\n + +/.*$/ms + borfle\nbib.gif\nno\n + +/(.*X|^B)/ + abcde\n1234Xyz + BarFoo + *** Failers + abcde\nBar + +/(.*X|^B)/m + abcde\n1234Xyz + BarFoo + abcde\nBar + +/(.*X|^B)/s + abcde\n1234Xyz + BarFoo + *** Failers + abcde\nBar + +/(.*X|^B)/ms + abcde\n1234Xyz + BarFoo + abcde\nBar + +/(?s)(.*X|^B)/ + abcde\n1234Xyz + BarFoo + *** Failers + abcde\nBar + +/(?s:.*X|^B)/ + abcde\n1234Xyz + BarFoo + *** Failers + abcde\nBar + +/^.*B/ + **** Failers + abc\nB + +/(?s)^.*B/ + abc\nB + +/(?m)^.*B/ + abc\nB + +/(?ms)^.*B/ + abc\nB + +/(?ms)^B/ + abc\nB + +/(?s)B$/ + B\n + +/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ + 123456654321 + +/^\d\d\d\d\d\d\d\d\d\d\d\d/ + 123456654321 + +/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ + 123456654321 + +/^[abc]{12}/ + abcabcabcabc + +/^[a-c]{12}/ + abcabcabcabc + +/^(a|b|c){12}/ + abcabcabcabc + +/^[abcdefghijklmnopqrstuvwxy0123456789]/ + n + *** Failers + z + +/abcde{0,0}/ + abcd + *** Failers + abce + +/ab[cd]{0,0}e/ + abe + *** Failers + abcde + +/ab(c){0,0}d/ + abd + *** Failers + abcd + +/a(b*)/ + a + ab + abbbb + *** Failers + bbbbb + +/ab\d{0}e/ + abe + *** Failers + ab1e + +/"([^\\"]+|\\.)*"/ + the \"quick\" brown fox + \"the \\\"quick\\\" brown fox\" + +/.*?/g+ + abc + +/\b/g+ + abc + +/\b/+g + abc + +//g + abc + +/]{0,})>]{0,})>([\d]{0,}\.)(.*)((
([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is + 43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide + +/a[^a]b/ + acb + a\nb + +/a.b/ + acb + *** Failers + a\nb + +/a[^a]b/s + acb + a\nb + +/a.b/s + acb + a\nb + +/^(b+?|a){1,2}?c/ + bac + bbac + bbbac + bbbbac + bbbbbac + +/^(b+|a){1,2}?c/ + bac + bbac + bbbac + bbbbac + bbbbbac + +/(?!\A)x/m + x\nb\n + a\bx\n + +/\x0{ab}/ + \0{ab} + +/(A|B)*?CD/ + CD + +/(A|B)*CD/ + CD + +/(?.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ + +"(?>.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo + +/(?>(\.\d\d[1-9]?))\d+/ + 1.230003938 + 1.875000282 + *** Failers + 1.235 + +/^((?>\w+)|(?>\s+))*$/ + now is the time for all good men to come to the aid of the party + *** Failers + this is not a line with only words and spaces! + +/(\d+)(\w)/ + 12345a + 12345+ + +/((?>\d+))(\w)/ + 12345a + *** Failers + 12345+ + +/(?>a+)b/ + aaab + +/((?>a+)b)/ + aaab + +/(?>(a+))b/ + aaab + +/(?>b)+/ + aaabbbccc + +/(?>a+|b+|c+)*c/ + aaabbbbccccd + +/(a+|b+|c+)*c/ + aaabbbbccccd + +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + +/\(((?>[^()]+)|\([^()]+\))+\)/ + (abc) + (abc(def)xyz) + *** Failers + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/a(?-i)b/i + ab + Ab + *** Failers + aB + AB + +/(a (?x)b c)d e/ + a bcd e + *** Failers + a b cd e + abcd e + a bcde + +/(a b(?x)c d (?-x)e f)/ + a bcde f + *** Failers + abcdef + +/(a(?i)b)c/ + abc + aBc + *** Failers + abC + aBC + Abc + ABc + ABC + AbC + +/a(?i:b)c/ + abc + aBc + *** Failers + ABC + abC + aBC + +/a(?i:b)*c/ + aBc + aBBc + *** Failers + aBC + aBBC + +/a(?=b(?i)c)\w\wd/ + abcd + abCd + *** Failers + aBCd + abcD + +/(?s-i:more.*than).*million/i + more than million + more than MILLION + more \n than Million + *** Failers + MORE THAN MILLION + more \n than \n million + +/(?:(?s-i)more.*than).*million/i + more than million + more than MILLION + more \n than Million + *** Failers + MORE THAN MILLION + more \n than \n million + +/(?>a(?i)b+)+c/ + abc + aBbc + aBBc + *** Failers + Abc + abAb + abbC + +/(?=a(?i)b)\w\wc/ + abc + aBc + *** Failers + Ab + abC + aBC + +/(?<=a(?i)b)(\w\w)c/ + abxxc + aBxxc + *** Failers + Abxxc + ABxxc + abxxC + +/^(?(?=abc)\w{3}:|\d\d)$/ + abc: + 12 + *** Failers + 123 + xyz + +/^(?(?!abc)\d\d|\w{3}:)$/ + abc: + 12 + *** Failers + 123 + xyz + +/(?(?<=foo)bar|cat)/ + foobar + cat + fcat + focat + *** Failers + foocat + +/(?(?a*)*/ + a + aa + aaaa + +/(abc|)+/ + abc + abcabc + abcabcabc + xyz + +/([a]*)*/ + a + aaaaa + +/([ab]*)*/ + a + b + ababab + aaaabcde + bbbb + +/([^a]*)*/ + b + bbbb + aaa + +/([^ab]*)*/ + cccc + abab + +/([a]*?)*/ + a + aaaa + +/([ab]*?)*/ + a + b + abab + baba + +/([^a]*?)*/ + b + bbbb + aaa + +/([^ab]*?)*/ + c + cccc + baba + +/(?>a*)*/ + a + aaabcde + +/((?>a*))*/ + aaaaa + aabbaa + +/((?>a*?))*/ + aaaaa + aabbaa + +/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x + 12-sep-98 + 12-09-98 + *** Failers + sep-12-98 + +/(?i:saturday|sunday)/ + saturday + sunday + Saturday + Sunday + SATURDAY + SUNDAY + SunDay + +/(a(?i)bc|BB)x/ + abcx + aBCx + bbx + BBx + *** Failers + abcX + aBCX + bbX + BBX + +/^([ab](?i)[cd]|[ef])/ + ac + aC + bD + elephant + Europe + frog + France + *** Failers + Africa + +/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ + ab + aBd + xy + xY + zebra + Zambesi + *** Failers + aCD + XY + +/(?<=foo\n)^bar/m + foo\nbar + *** Failers + bar + baz\nbar + +/(?<=(?]&/ + <&OUT + +/(?:(f)(o)(o)|(b)(a)(r))*/ + foobar + +/(?<=a)b/ ab - a\x{100}b - a\x{100}\x{100}b - -/a\x{100}+b/8 - a\x{100}b - a\x{100}\x{100}b - *** Failers + *** Failers + cb + b + +/(?\S/8 - > >X Y - > >\x{100} Y - -/\d/8 - \x{100}3 - -/\s/8 - \x{100} X - -/\D+/8 - 12abcd34 +/((?-i:a.))b/i *** Failers - 1234 + AB + a\nB -/\D{2,3}/8 - 12abcd34 - 12ab34 - *** Failers - 1234 - 12a34 +/((?s-i:a.))b/i + a\nB -/\D{2,3}?/8 - 12abcd34 - 12ab34 - *** Failers - 1234 - 12a34 +/(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/ + cabbbb -/\d+/8 - 12abcd34 - *** Failers +/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/ + caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -/\d{2,3}/8 - 12abcd34 - 1234abcd - *** Failers - 1.4 +/foo\w*\d{4}baz/ + foobar1234baz -/\d{2,3}?/8 - 12abcd34 - 1234abcd - *** Failers - 1.4 +/x(~~)*(?:(?:F)?)?/ + x~~ -/\S+/8 - 12abcd34 - *** Failers - \ \ +/^a(?#xxx){3}c/ + aaac -/\S{2,3}/8 - 12abcd34 - 1234abcd - *** Failers - \ \ +/^a (?#xxx) (?#yyy) {3}c/x + aaac -/\S{2,3}?/8 - 12abcd34 - 1234abcd +/(?\s+ <34 - *** Failers +/(?\s{2,3} \s{2,3}? a+)ab/ -/[\x{100}\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - *** Failers +/(?>a+)b/ + aaab -/[\x{100}-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - *** Failers +/([[:]+)/ + a:[b]: -/[z-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - abzcd - ab|cd - *** Failers +/([[=]+)/ + a=[b]= -/[Q\x{100}\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - Q? - *** Failers +/([[.]+)/ + a.[b]. -/[Q\x{100}-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - Q? - *** Failers +/((?>a+)b)/ + aaab -/[Qz-\x{200}]/8 - ab\x{100}cd - ab\x{200}cd - ab\x{111}cd - abzcd - ab|cd - Q? - *** Failers +/(?>(a+))b/ + aaab -/[\x{100}\x{200}]{1,3}/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + +/a\Z/ + *** Failers + aaab + a\nb\n -/[\x{100}\x{200}]{1,3}?/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers +/b\Z/ + a\nb\n -/[Q\x{100}\x{200}]{1,3}/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers +/b\z/ -/[Q\x{100}\x{200}]{1,3}?/8 - ab\x{100}cd - ab\x{200}cd - ab\x{200}\x{100}\x{200}\x{100}cd - *** Failers +/b\Z/ + a\nb -/(?<=[\x{100}\x{200}])X/8 - abc\x{200}X - abc\x{100}X +/b\z/ + a\nb + *** Failers + +/(?>.*)(?<=(abcd|wxyz))/ + alphabetabcd + endingwxyz *** Failers - X + a rather long string that doesn't end with one of them -/(?<=[Q\x{100}\x{200}])X/8 - abc\x{200}X - abc\x{100}X - abQX +/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark otherword + word cat dog elephant mussel cow horse canary baboon snake shark + +/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope + +/(?<=\d{3}(?!999))foo/ + 999foo + 123999foo + *** Failers + 123abcfoo + +/(?<=(?!...999)\d{3})foo/ + 999foo + 123999foo *** Failers - X + 123abcfoo -/(?<=[\x{100}\x{200}]{3})X/8 - abc\x{100}\x{200}\x{100}X +/(?<=\d{3}(?!999)...)foo/ + 123abcfoo + 123456foo *** Failers - abc\x{200}X - X + 123999foo + +/(?<=\d{3}...)(?Z)+|A)*/ + ZABCDEFG + +/((?>)+|A)*/ + ZABCDEFG + +/a*/g + abbab + +/^[a-\d]/ + abcde + -things + 0digit *** Failers - \x{100}X - \x{200}X + bcdef -/[^Q\x{100}\x{200}]X/8 - AX - \x{150}X - \x{500}X +/^[\d-a]/ + abcde + -things + 0digit *** Failers - \x{100}X - \x{200}X - QX + bcdef + +/[[:space:]]+/ + > \x09\x0a\x0c\x0d\x0b< + +/[[:blank:]]+/ + > \x09\x0a\x0c\x0d\x0b< + +/[\s]+/ + > \x09\x0a\x0c\x0d\x0b< + +/\s+/ + > \x09\x0a\x0c\x0d\x0b< + +/a b/x + ab + +/(?!\A)x/m + a\nxb\n + +/(?!^)x/m + a\nxb\n -/[^\x{100}-\x{200}]X/8 - AX - \x{500}X +/abc\Qabc\Eabc/ + abcabcabc + +/abc\Q(*+|\Eabc/ + abc(*+|abc + +/ abc\Q abc\Eabc/x + abc abcabc *** Failers - \x{100}X - \x{150}X - \x{200}X + abcabcabc + +/abc#comment + \Q#not comment + literal\E/x + abc#not comment\n literal + +/abc#comment + \Q#not comment + literal/x + abc#not comment\n literal + +/abc#comment + \Q#not comment + literal\E #more comment + /x + abc#not comment\n literal + +/abc#comment + \Q#not comment + literal\E #more comment/x + abc#not comment\n literal -/[z-\x{100}]/8i - z - Z - \x{100} +/\Qabc\$xyz\E/ + abc\\\$xyz + +/\Qabc\E\$\Qxyz\E/ + abc\$xyz + +/\Gabc/ + abc *** Failers - \x{102} - y + xyzabc -/[\xFF]/ - >\xff< +/\Gabc./g + abc1abc2xyzabc3 -/[\xff]/8 - >\x{ff}< +/abc./g + abc1abc2xyzabc3 -/[^\xFF]/ - XYZ +/a(?x: b c )d/ + XabcdY + *** Failers + Xa b c d Y -/[^\xff]/8 - XYZ - \x{123} +/((?x)x y z | a b c)/ + XabcY + AxyzB -/^[ac]*b/8 - xb +/(?i)AB(?-i)C/ + XabCY + *** Failers + XabcY -/^[ac\x{100}]*b/8 - xb +/((?i)AB(?-i)C|D)E/ + abCE + DE + *** Failers + abcE + abCe + dE + De -/^[^x]*b/8i - xb +/[z\Qa-d]\E]/ + z + a + - + d + ] + *** Failers + b -/^[^x]*b/8 - xb - -/^\d*b/8 - xb +/[\z\C]/ + z + C + +/\M/ + M + +/(a+)*b/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +/(?i)reg(?:ul(?:[a]|ae)r|ex)/ + REGular + regulaer + Regex + regulr + +/[--]+/ + + + + + +/(?<=Z)X./ + \x84XAZXB + +/^(?(2)a|(1)(2))+$/ + 123a + +/(?<=a|bbbb)c/ + ac + bbbbc + +/abc/SS>testsavedregex +testsavedregex +testsavedregex +testsavedregex + + xyz\r\nabc\ + xyz\rabc\ + xyz\r\nabc\ + ** Failers + xyz\nabc\ + xyz\r\nabc\ + xyz\nabc\ + xyz\rabc\ + xyz\rabc\ + +/abc$/m + xyzabc + xyzabc\n + xyzabc\npqr + xyzabc\r\ + xyzabc\rpqr\ + xyzabc\r\n\ + xyzabc\r\npqr\ + ** Failers + xyzabc\r + xyzabc\rpqr + xyzabc\r\n + xyzabc\r\npqr + +/^abc/m + xyz\rabcdef + xyz\nabcdef\ + ** Failers + xyz\nabcdef + +/^abc/m + xyz\nabcdef + xyz\rabcdef\ + ** Failers + xyz\rabcdef + +/^abc/m + xyz\r\nabcdef + xyz\rabcdef\ + ** Failers + xyz\rabcdef + +/.*/ + abc\ndef + abc\rdef + abc\r\ndef + \abc\ndef + \abc\rdef + \abc\r\ndef + \abc\ndef + \abc\rdef + \abc\r\ndef + +/\w+(.)(.)?def/s + abc\ndef + abc\rdef + abc\r\ndef + +/^\w+=.*(\\\n.*)*/ + abc=xyz\\\npqr + +/^(a()*)*/ + aaaa + +/^(?:a(?:(?:))*)*/ + aaaa + +/^(a()+)+/ + aaaa + +/^(?:a(?:(?:))+)+/ + aaaa + +/(a|)*\d/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 + +/(?>a|)*\d/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 + +/(?:a|)*\d/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 -/^\x{85}$/8i - \x{85} +/^a.b/ + a\rb + a\nb\ + ** Failers + a\nb + a\nb\ + a\rb\ + a\rb\ -/^abc./mgx8 - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x{0085}abc7 \x{2028}abc8 \x{2029}abc9 JUNK +/^abc./mgx + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK -/abc.$/mgx8 - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x{0085} abc7\x{2028} abc8\x{2029} abc9 +/abc.$/mgx + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 -/^a\Rb/8 +/^a\Rb/ a\nb a\rb a\r\nb a\x0bb a\x0cb - a\x{85}b - a\x{2028}b - a\x{2029}b + a\x85b ** Failers a\n\rb -/^a\R*b/8 +/^a\R*b/ ab a\nb a\rb a\r\nb a\x0bb - a\x0c\x{2028}\x{2029}b - a\x{85}b + a\x0cb + a\x85b a\n\rb - a\n\r\x{85}\x0cb + a\n\r\x85\x0cb -/^a\R+b/8 +/^a\R+b/ a\nb a\rb a\r\nb a\x0bb - a\x0c\x{2028}\x{2029}b - a\x{85}b + a\x0cb + a\x85b a\n\rb - a\n\r\x{85}\x0cb + a\n\r\x85\x0cb ** Failers ab - -/^a\R{1,3}b/8 + +/^a\R{1,3}b/ a\nb a\n\rb - a\n\r\x{85}b + a\n\r\x85b a\r\n\r\nb a\r\n\r\n\r\nb a\n\r\n\rb @@ -593,111 +4202,600 @@ a\n\n\n\rb a\r -/\h+\V?\v{3,4}/8 - \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a +/^a[\R]b/ + aRb + ** Failers + a\nb + +/.+foo/ + afoo + ** Failers + \r\nfoo + \nfoo + +/.+foo/ + afoo + \nfoo + ** Failers + \r\nfoo + +/.+foo/ + afoo + ** Failers + \nfoo + \r\nfoo + +/.+foo/s + afoo + \r\nfoo + \nfoo + +/^$/mg + abc\r\rxyz + abc\n\rxyz + ** Failers + abc\r\nxyz -/\V?\v{3,4}/8 - \x20\x{a0}X\x0a\x0b\x0c\x0d\x0a +/^X/m + XABC + ** Failers + XABC\B -/\h+\V?\v{3,4}/8 - >\x09\x20\x{a0}X\x0a\x0a\x0a< +/(?m)^$/g+ + abc\r\n\r\n -/\V?\v{3,4}/8 - >\x09\x20\x{a0}X\x0a\x0a\x0a< +/(?m)^$|^\r\n/g+ + abc\r\n\r\n + +/(?m)$/g+ + abc\r\n\r\n -/\H\h\V\v/8 +/(?|(abc)|(xyz))/ + >abc< + >xyz< + +/(x)(?|(abc)|(xyz))(x)/ + xabcx + xxyzx + +/(x)(?|(abc)(pqr)|(xyz))(x)/ + xabcpqrx + xxyzx + +/(?|(abc)|(xyz))(?1)/ + abcabc + xyzabc + ** Failers + xyzxyz + +/\H\h\V\v/ X X\x0a X\x09X\x0b ** Failers - \x{a0} X\x0a + \xa0 X\x0a -/\H*\h+\V?\v{3,4}/8 - \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a - \x09\x20\x{a0}\x0a\x0b\x0c\x0d\x0a - \x09\x20\x{a0}\x0a\x0b\x0c - ** Failers - \x09\x20\x{a0}\x0a\x0b - -/\H\h\V\v/8 - \x{3001}\x{3000}\x{2030}\x{2028} - X\x{180e}X\x{85} - ** Failers - \x{2009} X\x0a - -/\H*\h+\V?\v{3,4}/8 - \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x0c\x0d\x0a - \x09\x{205f}\x{a0}\x0a\x{2029}\x0c\x{2028}\x0a - \x09\x20\x{202f}\x0a\x0b\x0c +/\H*\h+\V?\v{3,4}/ + \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a + \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a + \x09\x20\xa0\x0a\x0b\x0c ** Failers - \x09\x{200a}\x{a0}\x{2028}\x0b + \x09\x20\xa0\x0a\x0b -/a\Rb/I8 +/\H{3,4}/ + XY ABCDE + XY PQR ST + +/.\h{3,4}./ + XY AB PQRS + +/\h*X\h?\H+Y\H?Z/ + >XNNNYZ + > X NYQZ + ** Failers + >XYZ + > X NY Z + +/\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ + >XY\x0aZ\x0aA\x0bNN\x0c + >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c + +/.+A/ + \r\nA + +/\nA/ + \r\nA + +/[\r\n]A/ + \r\nA + +/(\r|\n)A/ + \r\nA + +/a\Rb/I a\rb a\nb a\r\nb ** Failers - a\x{85}b + a\x85b a\x0bb -/a\Rb/I8 +/a\Rb/I a\rb a\nb a\r\nb - a\x{85}b + a\x85b a\x0bb ** Failers - a\x{85}b\ + a\x85b\ a\x0bb\ -/a\R?b/I8 +/a\R?b/I a\rb a\nb a\r\nb ** Failers - a\x{85}b + a\x85b a\x0bb -/a\R?b/I8 +/a\R?b/I a\rb a\nb a\r\nb - a\x{85}b + a\x85b a\x0bb ** Failers - a\x{85}b\ + a\x85b\ a\x0bb\ + +/a\R{2,4}b/I + a\r\n\nb + a\n\r\rb + a\r\n\r\n\r\n\r\nb + ** Failers + a\x85\85b + a\x0b\0bb + +/a\R{2,4}b/I + a\r\rb + a\n\n\nb + a\r\n\n\r\rb + a\x85\85b + a\x0b\0bb + ** Failers + a\r\r\r\r\rb + a\x85\85b\ + a\x0b\0bb\ + +/a(?!)|\wbc/ + abc + +/a[]b/ + ** Failers + ab + +/a[]+b/ + ** Failers + ab + +/a[]*+b/ + ** Failers + ab + +/a[^]b/ + aXb + a\nb + ** Failers + ab + +/a[^]+b/ + aXb + a\nX\nXb + ** Failers + ab + +/X$/E + X + ** Failers + X\n + +/X$/ + X + X\n + +/xyz/C + xyz + abcxyz + abcxyz\Y + ** Failers + abc + abc\Y + abcxypqr + abcxypqr\Y + +/(*NO_START_OPT)xyz/C + abcxyz + +/(?C)ab/ + ab + \C-ab + +/ab/C + ab + \C-ab + +/^"((?(?=[a])[^"])|b)*"$/C + "ab" + \C-"ab" + +/\d+X|9+Y/ + ++++123999\P + ++++123999Y\P + +/Z(*F)/ + Z\P + ZA\P + +/Z(?!)/ + Z\P + ZA\P + +/dog(sbody)?/ + dogs\P + dogs\P\P + +/dog(sbody)??/ + dogs\P + dogs\P\P + +/dog|dogsbody/ + dogs\P + dogs\P\P -/X/8f - A\x{1ec5}ABCXYZ +/dogsbody|dog/ + dogs\P + dogs\P\P + +/Z(*F)Q|ZXY/ + Z\P + ZA\P + X\P + +/\bthe cat\b/ + the cat\P + the cat\P\P + +/dog(sbody)?/ + dogs\D\P + body\D\R + +/dog(sbody)?/ + dogs\D\P\P + body\D\R + +/abc/ + abc\P + abc\P\P + +/abc\K123/ + xyzabc123pqr + +/(?<=abc)123/ + xyzabc123pqr + xyzabc12\P + xyzabc12\P\P + +/\babc\b/ + +++abc+++ + +++ab\P + +++ab\P\P + +/(?=C)/g+ + ABCDECBA + +/(abc|def|xyz)/I + terhjk;abcdaadsfe + the quick xyz brown fox + \Yterhjk;abcdaadsfe + \Ythe quick xyz brown fox + ** Failers + thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd + \Ythejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd + +/(abc|def|xyz)/SI + terhjk;abcdaadsfe + the quick xyz brown fox + \Yterhjk;abcdaadsfe + \Ythe quick xyz brown fox + ** Failers + thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd + \Ythejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd -/abcd*/8 +/abcd*/+ xxxxabcd\P xxxxabcd\P\P + dddxxx\R + xxxxabcd\P\P + xxx\R -/abcd*/i8 +/abcd*/i xxxxabcd\P xxxxabcd\P\P XXXXABCD\P XXXXABCD\P\P -/abc\d*/8 +/abc\d*/ xxxxabc1\P xxxxabc1\P\P -/abc[de]*/8 +/abc[de]*/ xxxxabcde\P xxxxabcde\P\P -/\bthe cat\b/8 - the cat\P - the cat\P\P +/(?:(?1)|B)(A(*F)|C)/ + ABCD + CCD + ** Failers + CAD + +/^(?:(?1)|B)(A(*F)|C)/ + CCD + BCD + ** Failers + ABCD + CAD + BAD + +/^(?!a(*SKIP)b)/ + ac + +/^(?=a(*SKIP)b|ac)/ + ** Failers + ac + +/^(?=a(*THEN)b|ac)/ + ac + +/^(?=a(*PRUNE)b)/ + ab + ** Failers + ac + +/^(?(?!a(*SKIP)b))/ + ac + +/(?<=abc)def/ + abc\P\P + +/abc$/ + abc + abc\P + abc\P\P + +/abc$/m + abc + abc\n + abc\P\P + abc\n\P\P + abc\P + abc\n\P + +/abc\z/ + abc + abc\P + abc\P\P + +/abc\Z/ + abc + abc\P + abc\P\P + +/abc\b/ + abc + abc\P + abc\P\P + +/abc\B/ + abc + abc\P + abc\P\P + +/.+/ + abc\>0 + abc\>1 + abc\>2 + abc\>3 + abc\>4 + abc\>-4 + +/^(?:a)++\w/ + aaaab + ** Failers + aaaa + bbb + +/^(?:aa|(?:a)++\w)/ + aaaab + aaaa + ** Failers + bbb + +/^(?:a)*+\w/ + aaaab + bbb + ** Failers + aaaa + +/^(a)++\w/ + aaaab + ** Failers + aaaa + bbb + +/^(a|)++\w/ + aaaab + ** Failers + aaaa + bbb + +/(?=abc){3}abc/+ + abcabcabc + ** Failers + xyz + +/(?=abc)+abc/+ + abcabcabc + ** Failers + xyz + +/(?=abc)++abc/+ + abcabcabc + ** Failers + xyz + +/(?=abc){0}xyz/ + xyz + +/(?=abc){1}xyz/ + ** Failers + xyz + +/(?=(a))?./ + ab + bc + +/(?=(a))??./ + ab + bc -/a+/8 - a\x{123}aa\>1 - a\x{123}aa\>2 - a\x{123}aa\>3 - a\x{123}aa\>4 - a\x{123}aa\>5 - a\x{123}aa\>6 +/^(?=(a)){0}b(?1)/ + backgammon + +/^(?=(?1))?[az]([abc])d/ + abd + zcdxx + +/^(?!a){0}\w+/ + aaaaa + +/(?<=(abc))?xyz/ + abcxyz + pqrxyz + +/((?2))((?1))/ + abc + +/(?(R)a+|(?R)b)/ + aaaabcde + +/(?(R)a+|((?R))b)/ + aaaabcde + +/((?(R)a+|(?1)b))/ + aaaabcde + +/((?(R2)a+|(?1)b))/ + aaaabcde + +/(?(R)a*(?1)|((?R))b)/ + aaaabcde + +/(a+)/ + \O6aaaa + \O8aaaa + +/ab\Cde/ + abXde + +/(?<=ab\Cde)X/ + abZdeX + +/^\R/ + \r\P + \r\P\P + +/^\R{2,3}x/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + \r\rx + \r\r\rx + +/^\R{2,3}?x/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + \r\rx + \r\r\rx + +/^\R?x/ + \r\P + \r\P\P + x + \rx + +/^\R+x/ + \r\P + \r\P\P + \r\n\P + \r\n\P\P + \rx + +/^a$/ + a\r\P + a\r\P\P + +/^a$/m + a\r\P + a\r\P\P + +/^(a$|a\r)/ + a\r\P + a\r\P\P + +/^(a$|a\r)/m + a\r\P + a\r\P\P + +/./ + \r\P + \r\P\P + +/.{2,3}/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + +/.{2,3}?/ + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + +/-- Test simple validity check for restarts --/ + +/abcdef/ + abc\R + +/)(.)|(?R))++)*F>/ + text text xxxxx text F> text2 more text. + +/^(?>.{4})abc|^\w\w.xabcd/ + xxxxabcd + xx\xa0xabcd + +/^(.{4}){2}+abc|^\w\w.x\w\w\w\wabcd/ + xxxxxxxxabcd + xx\xa0xxxxxabcd -/-- End of testinput8 --/ +/-- End of testinput8 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testinput9 php5-5.4.9/ext/pcre/pcrelib/testdata/testinput9 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testinput9 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testinput9 2012-11-21 05:12:20.000000000 +0000 @@ -1,989 +1,717 @@ -/-- This set of tests check Unicode property support with the DFA matching - functionality of pcre_dfa_exec(). The -dfa flag must be used with pcretest - when running it. --/ - -/\pL\P{Nd}/8 - AB +/-- This set of tests checks UTF-8 support with the DFA matching functionality + of pcre_dfa_exec(). The -dfa flag must be used with pcretest when running + it. --/ + +/\x{100}ab/8 + \x{100}ab + +/a\x{100}*b/8 + ab + a\x{100}b + a\x{100}\x{100}b + +/a\x{100}+b/8 + a\x{100}b + a\x{100}\x{100}b + *** Failers + ab + +/\bX/8 + Xoanon + +Xoanon + \x{300}Xoanon + *** Failers + YXoanon + +/\BX/8 + YXoanon *** Failers - A0 - 00 + Xoanon + +Xoanon + \x{300}Xoanon + +/X\b/8 + X+oanon + ZX\x{300}oanon + FAX + *** Failers + Xoanon + +/X\B/8 + Xoanon + *** Failers + X+oanon + ZX\x{300}oanon + FAX + +/[^a]/8 + abcd + a\x{100} -/\X./8 - AB - A\x{300}BC - A\x{300}\x{301}\x{302}BC +/^[abc\x{123}\x{400}-\x{402}]{2,3}\d/8 + ab99 + \x{123}\x{123}45 + \x{400}\x{401}\x{402}6 + *** Failers + d99 + \x{123}\x{122}4 + \x{400}\x{403}6 + \x{400}\x{401}\x{402}\x{402}6 + +/a.b/8 + acb + a\x7fb + a\x{100}b + *** Failers + a\nb + +/a(.{3})b/8 + a\x{4000}xyb + a\x{4000}\x7fyb + a\x{4000}\x{100}yb + *** Failers + a\x{4000}b + ac\ncb + +/a(.*?)(.)/ + a\xc0\x88b + +/a(.*?)(.)/8 + a\x{100}b + +/a(.*)(.)/ + a\xc0\x88b + +/a(.*)(.)/8 + a\x{100}b + +/a(.)(.)/ + a\xc0\x92bcd + +/a(.)(.)/8 + a\x{240}bcd + +/a(.?)(.)/ + a\xc0\x92bcd + +/a(.?)(.)/8 + a\x{240}bcd + +/a(.??)(.)/ + a\xc0\x92bcd + +/a(.??)(.)/8 + a\x{240}bcd + +/a(.{3})b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + *** Failers + a\x{1234}b + ac\ncb + +/a(.{3,})b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + *** Failers + a\x{1234}b + +/a(.{3,}?)b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + *** Failers + a\x{1234}b + +/a(.{3,5})b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + axbxxbcdefghijb + axxxxxbcdefghijb + *** Failers + a\x{1234}b + axxxxxxbcdefghijb + +/a(.{3,5}?)b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + axbxxbcdefghijb + axxxxxbcdefghijb *** Failers - \x{300} + a\x{1234}b + axxxxxxbcdefghijb -/\X\X/8 - ABC - A\x{300}B\x{300}\x{301}C - A\x{300}\x{301}\x{302}BC +/^[a\x{c0}]/8 *** Failers - \x{300} + \x{100} -/^\pL+/8 - abcd - a - *** Failers +/(?<=aXb)cd/8 + aXbcd -/^\PL+/8 - 1234 - = - *** Failers - abcd +/(?<=a\x{100}b)cd/8 + a\x{100}bcd -/^\X+/8 - abcdA\x{300}\x{301}\x{302} - A\x{300}\x{301}\x{302} - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} - a +/(?<=a\x{100000}b)cd/8 + a\x{100000}bcd + +/(?:\x{100}){3}b/8 + \x{100}\x{100}\x{100}b *** Failers - \x{300}\x{301}\x{302} + \x{100}\x{100}b -/\X?abc/8 - abc - A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - \x{300}abc - *** Failers +/\x{ab}/8 + \x{ab} + \xc2\xab + *** Failers + \x00{ab} -/^\X?abc/8 - abc - A\x{300}abc +/(?<=(.))X/8 + WXYZ + \x{256}XYZ *** Failers - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - \x{300}abc + XYZ -/\X*abc/8 - abc - A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - \x{300}abc - *** Failers +/[^a]+/8g + bcd + \x{100}aY\x{256}Z + +/^[^a]{2}/8 + \x{100}bc + +/^[^a]{2,}/8 + \x{100}bcAa -/^\X*abc/8 - abc - A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - *** Failers - \x{300}abc +/^[^a]{2,}?/8 + \x{100}bca -/^\pL?=./8 - A=b - =c - *** Failers - 1=2 - AAAA=b +/[^a]+/8ig + bcd + \x{100}aY\x{256}Z + +/^[^a]{2}/8i + \x{100}bc + +/^[^a]{2,}/8i + \x{100}bcAa -/^\pL*=./8 - AAAA=b - =c - *** Failers - 1=2 +/^[^a]{2,}?/8i + \x{100}bca -/^\X{2,3}X/8 - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - *** Failers - X - A\x{300}\x{301}\x{302}X - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X +/\x{100}{0,0}/8 + abcd + +/\x{100}?/8 + abcd + \x{100}\x{100} -/^\pC\pL\pM\pN\pP\pS\pZ\S/8 + > >X Y + > >\x{100} Y + +/\d/8 + \x{100}3 + +/\s/8 + \x{100} X + /\D+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\P{Nd}+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\D]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\P{Nd}]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/[\D\P{Nd}]+/8 - 11111111111111111111111111111111111111111111111111111111111111111111111 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\pL/8 - a - A - -/\pL/8i - a - A - -/\p{Lu}/8 - A - aZ - ** Failers - abc + 12abcd34 + *** Failers + 1234 -/\p{Lu}/8i - A - aZ - ** Failers - abc +/\D{2,3}/8 + 12abcd34 + 12ab34 + *** Failers + 1234 + 12a34 -/\p{Ll}/8 - a - Az - ** Failers - ABC +/\D{2,3}?/8 + 12abcd34 + 12ab34 + *** Failers + 1234 + 12a34 -/\p{Ll}/8i - a - Az - ** Failers - ABC +/\d+/8 + 12abcd34 + *** Failers -/^\x{c0}$/8i - \x{c0} - \x{e0} - -/^\x{e0}$/8i - \x{c0} - \x{e0} +/\d{2,3}/8 + 12abcd34 + 1234abcd + *** Failers + 1.4 -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8 - A\x{391}\x{10427}\x{ff3a}\x{1fb0} - ** Failers - a\x{391}\x{10427}\x{ff3a}\x{1fb0} - A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} - A\x{391}\x{1044F}\x{ff3a}\x{1fb0} - A\x{391}\x{10427}\x{ff5a}\x{1fb0} - A\x{391}\x{10427}\x{ff3a}\x{1fb8} - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8i - A\x{391}\x{10427}\x{ff3a}\x{1fb0} - a\x{391}\x{10427}\x{ff3a}\x{1fb0} - A\x{3b1}\x{10427}\x{ff3a}\x{1fb0} - A\x{391}\x{1044F}\x{ff3a}\x{1fb0} - A\x{391}\x{10427}\x{ff5a}\x{1fb0} - A\x{391}\x{10427}\x{ff3a}\x{1fb8} - -/\x{391}+/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391} - -/\x{391}{3,5}(.)/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - -/\x{391}{3,5}?(.)/8i - \x{391}\x{3b1}\x{3b1}\x{3b1}\x{391}X - -/[\x{391}\x{ff3a}]/8i - \x{391} - \x{ff3a} - \x{3b1} - \x{ff5a} - -/[\x{c0}\x{391}]/8i - \x{c0} - \x{e0} - -/[\x{105}-\x{109}]/8i - \x{104} - \x{105} - \x{109} - ** Failers - \x{100} - \x{10a} - -/[z-\x{100}]/8i - Z - z - \x{39c} - \x{178} - | - \x{80} - \x{ff} - \x{100} - \x{101} - ** Failers - \x{102} - Y - y +/\d{2,3}?/8 + 12abcd34 + 1234abcd + *** Failers + 1.4 -/[z-\x{100}]/8i +/\S+/8 + 12abcd34 + *** Failers + \ \ -/^\X/8 - A - A\x{300}BC - A\x{300}\x{301}\x{302}BC +/\S{2,3}/8 + 12abcd34 + 1234abcd *** Failers - \x{300} + \ \ -/^[\X]/8 - X123 +/\S{2,3}?/8 + 12abcd34 + 1234abcd *** Failers - AXYZ + \ \ -/^(\X*)C/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C +/>\s+ <34 + *** Failers -/^(\X*?)C/8 - A\x{300}\x{301}\x{302}BCA\x{300}\x{301} - A\x{300}\x{301}\x{302}BCA\x{300}\x{301}C +/>\s{2,3} \s{2,3}? \xff< -/^[\p{Any}]*X/8 +/[\xff]/8 + >\x{ff}< + +/[^\xFF]/ XYZ - AXYZ - \x{1234}XYZ - A\x{1234}XYZ - ** Failers -/^[\P{Any}]*X/8 +/[^\xff]/8 XYZ - ** Failers - AXYZ - \x{1234}XYZ - A\x{1234}XYZ - -/^\p{Any}{3,5}?/8 - abcdefgh - \x{1234}\n\r\x{3456}xyz - -/^\p{Any}{3,5}/8 - abcdefgh - \x{1234}\n\r\x{3456}xyz + \x{123} -/^\P{Any}{3,5}?/8 - ** Failers - abcdefgh - \x{1234}\n\r\x{3456}xyz +/^[ac]*b/8 + xb -/^\p{L&}X/8 - AXY - aXY - \x{1c5}XY - ** Failers - \x{1bb}XY - \x{2b0}XY - !XY - -/^[\p{L&}]X/8 - AXY - aXY - \x{1c5}XY - ** Failers - \x{1bb}XY - \x{2b0}XY - !XY - -/^\p{L&}+X/8 - AXY - aXY - AbcdeXyz - \x{1c5}AbXY - abcDEXypqreXlmn - ** Failers - \x{1bb}XY - \x{2b0}XY - !XY - -/^[\p{L&}]+X/8 - AXY - aXY - AbcdeXyz - \x{1c5}AbXY - abcDEXypqreXlmn - ** Failers - \x{1bb}XY - \x{2b0}XY - !XY - -/^\p{L&}+?X/8 - AXY - aXY - AbcdeXyz - \x{1c5}AbXY - abcDEXypqreXlmn - ** Failers - \x{1bb}XY - \x{2b0}XY - !XY - -/^[\p{L&}]+?X/8 - AXY - aXY - AbcdeXyz - \x{1c5}AbXY - abcDEXypqreXlmn - ** Failers - \x{1bb}XY - \x{2b0}XY - !XY - -/^\P{L&}X/8 - !XY - \x{1bb}XY - \x{2b0}XY - ** Failers - \x{1c5}XY - AXY - -/^[\P{L&}]X/8 - !XY - \x{1bb}XY - \x{2b0}XY - ** Failers - \x{1c5}XY - AXY +/^[ac\x{100}]*b/8 + xb -/^\x{023a}+?(\x{0130}+)/8i - \x{023a}\x{2c65}\x{0130} +/^[^x]*b/8i + xb + +/^[^x]*b/8 + xb -/^\x{023a}+([^X])/8i - \x{023a}\x{2c65}X - -/\x{c0}+\x{116}+/8i - \x{c0}\x{e0}\x{116}\x{117} +/^\d*b/8 + xb -/[\x{c0}\x{116}]+/8i - \x{c0}\x{e0}\x{116}\x{117} +/(|a)/g8 + catac + a\x{256}a -/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{85}$/8i + \x{85} -/\x{a77d}\x{1d79}/8 - \x{a77d}\x{1d79} - ** Failers - \x{1d79}\x{a77d} +/^abc./mgx8 + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x{0085}abc7 \x{2028}abc8 \x{2029}abc9 JUNK -/^\p{Xan}/8 - ABCD - 1234 - \x{6ca} - \x{a6c} - \x{10a7} - ** Failers - _ABC +/abc.$/mgx8 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x{0085} abc7\x{2028} abc8\x{2029} abc9 -/^\p{Xan}+/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ +/^a\Rb/8 + a\nb + a\rb + a\r\nb + a\x0bb + a\x0cb + a\x{85}b + a\x{2028}b + a\x{2029}b ** Failers - _ABC + a\n\rb -/^\p{Xan}*/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - -/^\p{Xan}{2,9}/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - -/^[\p{Xan}]/8 - ABCD1234_ - 1234abcd_ - \x{6ca} - \x{a6c} - \x{10a7} - ** Failers - _ABC - -/^[\p{Xan}]+/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - ** Failers - _ABC +/^a\R*b/8 + ab + a\nb + a\rb + a\r\nb + a\x0bb + a\x0c\x{2028}\x{2029}b + a\x{85}b + a\n\rb + a\n\r\x{85}\x0cb -/^>\p{Xsp}/8 - >\x{1680}\x{2028}\x{0b} +/^a\R+b/8 + a\nb + a\rb + a\r\nb + a\x0bb + a\x0c\x{2028}\x{2029}b + a\x{85}b + a\n\rb + a\n\r\x{85}\x0cb ** Failers - \x{0b} - -/^>\p{Xsp}+/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - -/^>\p{Xsp}*/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - -/^>\p{Xsp}{2,9}/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - -/^>[\p{Xsp}]/8 - >\x{2028}\x{0b} - -/^>[\p{Xsp}]+/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + ab -/^>\p{Xps}/8 - >\x{1680}\x{2028}\x{0b} - >\x{a0} +/^a\R{1,3}b/8 + a\nb + a\n\rb + a\n\r\x{85}b + a\r\n\r\nb + a\r\n\r\n\r\nb + a\n\r\n\rb + a\n\n\r\nb ** Failers - \x{0b} + a\n\n\n\rb + a\r -/^>\p{Xps}+/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} +/\h+\V?\v{3,4}/8 + \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a -/^>\p{Xps}+?/8 - >\x{1680}\x{2028}\x{0b} +/\V?\v{3,4}/8 + \x20\x{a0}X\x0a\x0b\x0c\x0d\x0a -/^>\p{Xps}*/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - -/^>\p{Xps}{2,9}/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - -/^>\p{Xps}{2,9}?/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - -/^>[\p{Xps}]/8 - >\x{2028}\x{0b} - -/^>[\p{Xps}]+/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} +/\h+\V?\v{3,4}/8 + >\x09\x20\x{a0}X\x0a\x0a\x0a< -/^\p{Xwd}/8 - ABCD - 1234 - \x{6ca} - \x{a6c} - \x{10a7} - _ABC - ** Failers - [] +/\V?\v{3,4}/8 + >\x09\x20\x{a0}X\x0a\x0a\x0a< -/^\p{Xwd}+/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - -/^\p{Xwd}*/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - -/^\p{Xwd}{2,9}/8 - A_12\x{6ca}\x{a6c}\x{10a7} - -/^[\p{Xwd}]/8 - ABCD1234_ - 1234abcd_ - \x{6ca} - \x{a6c} - \x{10a7} - _ABC +/\H\h\V\v/8 + X X\x0a + X\x09X\x0b ** Failers - [] + \x{a0} X\x0a + +/\H*\h+\V?\v{3,4}/8 + \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a + \x09\x20\x{a0}\x0a\x0b\x0c\x0d\x0a + \x09\x20\x{a0}\x0a\x0b\x0c + ** Failers + \x09\x20\x{a0}\x0a\x0b + +/\H\h\V\v/8 + \x{3001}\x{3000}\x{2030}\x{2028} + X\x{180e}X\x{85} + ** Failers + \x{2009} X\x0a + +/\H*\h+\V?\v{3,4}/8 + \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x0c\x0d\x0a + \x09\x{205f}\x{a0}\x0a\x{2029}\x0c\x{2028}\x0a + \x09\x20\x{202f}\x0a\x0b\x0c + ** Failers + \x09\x{200a}\x{a0}\x{2028}\x0b + +/a\Rb/I8 + a\rb + a\nb + a\r\nb + ** Failers + a\x{85}b + a\x0bb + +/a\Rb/I8 + a\rb + a\nb + a\r\nb + a\x{85}b + a\x0bb + ** Failers + a\x{85}b\ + a\x0bb\ + +/a\R?b/I8 + a\rb + a\nb + a\r\nb + ** Failers + a\x{85}b + a\x0bb + +/a\R?b/I8 + a\rb + a\nb + a\r\nb + a\x{85}b + a\x0bb + ** Failers + a\x{85}b\ + a\x0bb\ -/^[\p{Xwd}]+/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ +/X/8f + A\x{1ec5}ABCXYZ -/-- Unicode properties for \b abd \B --/ +/abcd*/8 + xxxxabcd\P + xxxxabcd\P\P + +/abcd*/i8 + xxxxabcd\P + xxxxabcd\P\P + XXXXABCD\P + XXXXABCD\P\P + +/abc\d*/8 + xxxxabc1\P + xxxxabc1\P\P + +/abc[de]*/8 + xxxxabcde\P + xxxxabcde\P\P + +/\bthe cat\b/8 + the cat\P + the cat\P\P + +/ab\Cde/8 + abXde + +/(?<=ab\Cde)X/8 + +/./8 + \r\P + \r\P\P + +/.{2,3}/8 + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P + +/.{2,3}?/8 + \r\P + \r\P\P + \r\r\P + \r\r\P\P + \r\r\r\P + \r\r\r\P\P -/\b...\B/8W - abc_ - \x{37e}abc\x{376} - \x{37e}\x{376}\x{371}\x{393}\x{394} - !\x{c0}++\x{c1}\x{c2} - !\x{c0}+++++ +/[^\x{100}]/8 + \x{100}\x{101}X -/-- Without PCRE_UCP, non-ASCII always fail, even if < 256 --/ - -/\b...\B/8 - abc_ - ** Failers - \x{37e}abc\x{376} - \x{37e}\x{376}\x{371}\x{393}\x{394} - !\x{c0}++\x{c1}\x{c2} - !\x{c0}+++++ - -/-- With PCRE_UCP, non-UTF8 chars that are < 256 still check properties --/ - -/\b...\B/W - abc_ - !\x{c0}++\x{c1}\x{c2} - !\x{c0}+++++ +/[^\x{100}]+/8 + \x{100}\x{101}X /-- End of testinput9 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput1 php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput1 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput1 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput1 2012-11-21 05:12:20.000000000 +0000 @@ -1,5 +1,6 @@ /-- This set of tests is for features that are compatible with all versions of - Perl 5, in non-UTF-8 mode. --/ + Perl >= 5.10, in non-UTF-8 mode. It should run clean for both the 8-bit and + 16-bit PCRE libraries. --/ /the quick brown fox/ the quick brown fox @@ -6666,4 +6667,2070 @@ ? 0: ? +/(abc)\1/i + abc +No match + +/(abc)\1/ + abc +No match + +/[^a]*/i + 12abc + 0: 12 + 12ABC + 0: 12 + +/[^a]*+/i + 12abc + 0: 12 + 12ABC + 0: 12 + +/[^a]*?X/i + ** Failers +No match + 12abc +No match + 12ABC +No match + +/[^a]+?X/i + ** Failers +No match + 12abc +No match + 12ABC +No match + +/[^a]?X/i + 12aXbcX + 0: X + 12AXBCX + 0: X + BCX + 0: CX + +/[^a]??X/i + 12aXbcX + 0: X + 12AXBCX + 0: X + BCX + 0: CX + +/[^a]?+X/i + 12aXbcX + 0: cX + 12AXBCX + 0: CX + BCX + 0: CX + +/[^a]{2,3}/i + abcdef + 0: bcd + ABCDEF + 0: BCD + +/[^a]{2,3}?/i + abcdef + 0: bc + ABCDEF + 0: BC + +/[^a]{2,3}+/i + abcdef + 0: bcd + ABCDEF + 0: BCD + +/((a|)+)+Z/ + Z + 0: Z + 1: + 2: + +/(a)b|(a)c/ + ac + 0: ac + 1: + 2: a + +/(?>(a))b|(a)c/ + ac + 0: ac + 1: + 2: a + +/(?=(a))ab|(a)c/ + ac + 0: ac + 1: + 2: a + +/((?>(a))b|(a)c)/ + ac + 0: ac + 1: ac + 2: + 3: a + +/((?>(a))b|(a)c)++/ + ac + 0: ac + 1: ac + 2: + 3: a + +/(?:(?>(a))b|(a)c)++/ + ac + 0: ac + 1: + 2: a + +/(?=(?>(a))b|(a)c)(..)/ + ac + 0: ac + 1: + 2: a + 3: ac + +/(?>(?>(a))b|(a)c)/ + ac + 0: ac + 1: + 2: a + +/(?:(?>([ab])))+a=/+ + =ba= + 0: ba= + 0+ + 1: b + +/(?>([ab]))+a=/+ + =ba= + 0: ba= + 0+ + 1: b + +/((?>(a+)b)+(aabab))/ + aaaabaaabaabab + 0: aaaabaaabaabab + 1: aaaabaaabaabab + 2: aaa + 3: aabab + +/(?>a+|ab)+?c/ + aabc +No match + +/(?>a+|ab)+c/ + aabc +No match + +/(?:a+|ab)+c/ + aabc + 0: aabc + +/(?(?=(a))a)/ + a + 0: a + 1: a + +/(?(?=(a))a)(b)/ + ab + 0: ab + 1: a + 2: b + +/^(?:a|ab)++c/ + aaaabc +No match + +/^(?>a|ab)++c/ + aaaabc +No match + +/^(?:a|ab)+c/ + aaaabc + 0: aaaabc + +/(?=abc){3}abc/+ + abcabcabc + 0: abc + 0+ abcabc + ** Failers +No match + xyz +No match + +/(?=abc)+abc/+ + abcabcabc + 0: abc + 0+ abcabc + ** Failers +No match + xyz +No match + +/(?=abc)++abc/+ + abcabcabc + 0: abc + 0+ abcabc + ** Failers +No match + xyz +No match + +/(?=abc){0}xyz/ + xyz + 0: xyz + +/(?=abc){1}xyz/ + ** Failers +No match + xyz +No match + +/(?=(a))?./ + ab + 0: a + 1: a + bc + 0: b + +/(?=(a))??./ + ab + 0: a + bc + 0: b + +/^(?=(a)){0}b(?1)/ + backgammon + 0: ba + +/^(?=(?1))?[az]([abc])d/ + abd + 0: abd + 1: b + zcdxx + 0: zcd + 1: c + +/^(?!a){0}\w+/ + aaaaa + 0: aaaaa + +/(?<=(abc))?xyz/ + abcxyz + 0: xyz + 1: abc + pqrxyz + 0: xyz + +/^[\g]+/ + ggg<<>> + 0: ggg<<>> + ** Failers +No match + \\ga +No match + +/^[\ga]+/ + gggagagaxyz + 0: gggagaga + +/^[:a[:digit:]]+/ + aaaa444:::Z + 0: aaaa444::: + +/^[:a[:digit:]:b]+/ + aaaa444:::bbbZ + 0: aaaa444:::bbb + +/[:a]xxx[b:]/ + :xxx: + 0: :xxx: + +/(?<=a{2})b/i + xaabc + 0: b + ** Failers +No match + xabc +No match + +/(?XNNNYZ + 0: XNNNYZ + > X NYQZ + 0: X NYQZ + ** Failers +No match + >XYZ +No match + > X NY Z +No match + +/\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ + >XY\x0aZ\x0aA\x0bNN\x0c + 0: XY\x0aZ\x0aA\x0bNN\x0c + >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c + 0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c + +/(foo)\Kbar/ + foobar + 0: bar + 1: foo + +/(foo)(\Kbar|baz)/ + foobar + 0: bar + 1: foo + 2: bar + foobaz + 0: foobaz + 1: foo + 2: baz + +/(foo\Kbar)baz/ + foobarbaz + 0: barbaz + 1: foobar + +/abc\K|def\K/g+ + Xabcdefghi + 0: + 0+ defghi + 0: + 0+ ghi + +/ab\Kc|de\Kf/g+ + Xabcdefghi + 0: c + 0+ defghi + 0: f + 0+ ghi + +/(?=C)/g+ + ABCDECBA + 0: + 0+ CDECBA + 0: + 0+ CBA + +/^abc\K/+ + abcdef + 0: + 0+ def + ** Failers +No match + defabcxyz +No match + +/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/ + ababababbbabZXXXX + 0: ababababbbabZ + 1: ab + 2: b + +/(?tom|bon)-\g{A}/ + tom-tom + 0: tom-tom + 1: tom + bon-bon + 0: bon-bon + 1: bon + +/(^(a|b\g{-1}))/ + bacxxx +No match + +/(?|(abc)|(xyz))\1/ + abcabc + 0: abcabc + 1: abc + xyzxyz + 0: xyzxyz + 1: xyz + ** Failers +No match + abcxyz +No match + xyzabc +No match + +/(?|(abc)|(xyz))(?1)/ + abcabc + 0: abcabc + 1: abc + xyzabc + 0: xyzabc + 1: xyz + ** Failers +No match + xyzxyz +No match + +/^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/ + XYabcdY + 0: XYabcdY + 1: a + 2: b + 3: c + 4: d + 5: Y + +/^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/ + XYabcdY + 0: XYabcdY + 1: a + 2: b + 3: + 4: + 5: c + 6: d + 7: Y + +/^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/ + XYabcdY + 0: XYabcdY + 1: a + 2: b + 3: + 4: + 5: c + 6: d + 7: Y + +/(?'abc'\w+):\k{2}/ + a:aaxyz + 0: a:aa + 1: a + ab:ababxyz + 0: ab:abab + 1: ab + ** Failers +No match + a:axyz +No match + ab:abxyz +No match + +/(?'abc'\w+):\g{abc}{2}/ + a:aaxyz + 0: a:aa + 1: a + ab:ababxyz + 0: ab:abab + 1: ab + ** Failers +No match + a:axyz +No match + ab:abxyz +No match + +/^(?a)? (?()b|c) (?('ab')d|e)/x + abd + 0: abd + 1: a + ce + 0: ce + +/^(a.)\g-1Z/ + aXaXZ + 0: aXaXZ + 1: aX + +/^(a.)\g{-1}Z/ + aXaXZ + 0: aXaXZ + 1: aX + +/^(?(DEFINE) (? a) (? b) ) (?&A) (?&B) /x + abcd + 0: ab + +/(?(?&NAME_PAT))\s+(?(?&ADDRESS_PAT)) + (?(DEFINE) + (?[a-z]+) + (?\d+) + )/x + metcalfe 33 + 0: metcalfe 33 + 1: metcalfe + 2: 33 + +/(?(DEFINE)(?2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/ + 1.2.3.4 + 0: 1.2.3.4 + 1: + 2: .4 + 131.111.10.206 + 0: 131.111.10.206 + 1: + 2: .206 + 10.0.0.0 + 0: 10.0.0.0 + 1: + 2: .0 + ** Failers +No match + 10.6 +No match + 455.3.4.5 +No match + +/\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/ + 1.2.3.4 + 0: 1.2.3.4 + 1: .4 + 131.111.10.206 + 0: 131.111.10.206 + 1: .206 + 10.0.0.0 + 0: 10.0.0.0 + 1: .0 + ** Failers +No match + 10.6 +No match + 455.3.4.5 +No match + +/^(\w++|\s++)*$/ + now is the time for all good men to come to the aid of the party + 0: now is the time for all good men to come to the aid of the party + 1: party + *** Failers +No match + this is not a line with only words and spaces! +No match + +/(\d++)(\w)/ + 12345a + 0: 12345a + 1: 12345 + 2: a + *** Failers +No match + 12345+ +No match + +/a++b/ + aaab + 0: aaab + +/(a++b)/ + aaab + 0: aaab + 1: aaab + +/(a++)b/ + aaab + 0: aaab + 1: aaa + +/([^()]++|\([^()]*\))+/ + ((abc(ade)ufh()()x + 0: abc(ade)ufh()()x + 1: x + +/\(([^()]++|\([^()]+\))+\)/ + (abc) + 0: (abc) + 1: abc + (abc(def)xyz) + 0: (abc(def)xyz) + 1: xyz + *** Failers +No match + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + +/^([^()]|\((?1)*\))*$/ + abc + 0: abc + 1: c + a(b)c + 0: a(b)c + 1: c + a(b(c))d + 0: a(b(c))d + 1: d + *** Failers) +No match + a(b(c)d +No match + +/^>abc>([^()]|\((?1)*\))*abc>123abc>123abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(1(2)3) + 2: + 3: Satanoscillatemymetallicsonatas + 4: S + AmanaplanacanalPanama + 0: AmanaplanacanalPanama + 1: + 2: + 3: AmanaplanacanalPanama + 4: A + AblewasIereIsawElba + 0: AblewasIereIsawElba + 1: + 2: + 3: AblewasIereIsawElba + 4: A + *** Failers +No match + Thequickbrownfox +No match + +/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/ + 12 + 0: 12 + 1: 12 + (((2+2)*-3)-7) + 0: (((2+2)*-3)-7) + 1: (((2+2)*-3)-7) + 2: - + -12 + 0: -12 + 1: -12 + *** Failers +No match + ((2+2)*-3)-7) +No match + +/^(x(y|(?1){2})z)/ + xyz + 0: xyz + 1: xyz + 2: y + xxyzxyzz + 0: xxyzxyzz + 1: xxyzxyzz + 2: xyzxyz + *** Failers +No match + xxyzz +No match + xxyzxyzxyzz +No match + +/((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x + <> + 0: <> + 1: <> + 2: <> + + 0: + 1: + 2: + hij> + 0: hij> + 1: hij> + 2: hij> + hij> + 0: + 1: + 2: + def> + 0: def> + 1: def> + 2: def> + + 0: <> + 1: <> + 2: <> + *** Failers +No match + + 2: + 3: Satan, oscillate my metallic sonatas + 4: S + A man, a plan, a canal: Panama! + 0: A man, a plan, a canal: Panama! + 1: + 2: + 3: A man, a plan, a canal: Panama + 4: A + Able was I ere I saw Elba. + 0: Able was I ere I saw Elba. + 1: + 2: + 3: Able was I ere I saw Elba + 4: A + *** Failers +No match + The quick brown fox +No match + +/^((.)(?1)\2|.)$/ + a + 0: a + 1: a + aba + 0: aba + 1: aba + 2: a + aabaa + 0: aabaa + 1: aabaa + 2: a + abcdcba + 0: abcdcba + 1: abcdcba + 2: a + pqaabaaqp + 0: pqaabaaqp + 1: pqaabaaqp + 2: p + ablewasiereisawelba + 0: ablewasiereisawelba + 1: ablewasiereisawelba + 2: a + rhubarb +No match + the quick brown fox +No match + +/(a)(?<=b(?1))/ + baz + 0: a + 1: a + ** Failers +No match + caz +No match + +/(?<=b(?1))(a)/ + zbaaz + 0: a + 1: a + ** Failers +No match + aaa +No match + +/(?a)(?<=b(?&X))/ + baz + 0: a + 1: a + +/^(?|(abc)|(def))\1/ + abcabc + 0: abcabc + 1: abc + defdef + 0: defdef + 1: def + ** Failers +No match + abcdef +No match + defabc +No match + +/^(?|(abc)|(def))(?1)/ + abcabc + 0: abcabc + 1: abc + defabc + 0: defabc + 1: def + ** Failers +No match + defdef +No match + abcdef +No match + +/(?:a(? (?')|(?")) |b(? (?')|(?")) ) (?('quote')[a-z]+|[0-9]+)/xJ + a\"aaaaa + 0: a"aaaaa + 1: " + 2: + 3: " + b\"aaaaa + 0: b"aaaaa + 1: + 2: + 3: + 4: " + 5: + 6: " + ** Failers +No match + b\"11111 +No match + +/(?:(?1)|B)(A(*F)|C)/ + ABCD + 0: BC + 1: C + CCD + 0: CC + 1: C + ** Failers +No match + CAD +No match + +/^(?:(?1)|B)(A(*F)|C)/ + CCD + 0: CC + 1: C + BCD + 0: BC + 1: C + ** Failers +No match + ABCD +No match + CAD +No match + BAD +No match + +/(?:(?1)|B)(A(*ACCEPT)XX|C)D/ + AAD + 0: AA + 1: A + ACD + 0: ACD + 1: C + BAD + 0: BA + 1: A + BCD + 0: BCD + 1: C + BAX + 0: BA + 1: A + ** Failers +No match + ACX +No match + ABC +No match + +/(?(DEFINE)(A))B(?1)C/ + BAC + 0: BAC + +/(?(DEFINE)((A)\2))B(?1)C/ + BAAC + 0: BAAC + +/(? \( ( [^()]++ | (?&pn) )* \) )/x + (ab(cd)ef) + 0: (ab(cd)ef) + 1: (ab(cd)ef) + 2: ef + +/^(?!a(*SKIP)b)/ + ac + 0: + +/^(?=a(*SKIP)b|ac)/ + ** Failers +No match + ac +No match + +/^(?=a(*THEN)b|ac)/ + ac + 0: + +/^(?=a(*PRUNE)b)/ + ab + 0: + ** Failers +No match + ac +No match + +/^(?=a(*ACCEPT)b)/ + ac + 0: + +/^(?(?!a(*SKIP)b))/ + ac + 0: + +/(?>a\Kb)/ + ab + 0: b + +/((?>a\Kb))/ + ab + 0: b + 1: ab + +/(a\Kb)/ + ab + 0: b + 1: ab + +/^a\Kcz|ac/ + ac + 0: ac + +/(?>a\Kbz|ab)/ + ab + 0: ab + +/^(?&t)(?(DEFINE)(?a\Kb))$/ + ab + 0: b + +/^([^()]|\((?1)*\))*$/ + a(b)c + 0: a(b)c + 1: c + a(b(c)d)e + 0: a(b(c)d)e + 1: e + +/(?P(?P0)(?P>L1)|(?P>L2))/ + 0 + 0: 0 + 1: 0 + 00 + 0: 00 + 1: 00 + 2: 0 + 0000 + 0: 0000 + 1: 0000 + 2: 0 + +/(?P(?P0)|(?P>L2)(?P>L1))/ + 0 + 0: 0 + 1: 0 + 2: 0 + 00 + 0: 0 + 1: 0 + 2: 0 + 0000 + 0: 0 + 1: 0 + 2: 0 + +/--- This one does fail, as expected, in Perl. It needs the complex item at the + end of the pattern. A single letter instead of (B|D) makes it not fail, + which I think is a Perl bug. --- / + +/A(*COMMIT)(B|D)/ + ACABX +No match + +/--- Check the use of names for failure ---/ + +/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K + ** Failers +No match + AC +No match, mark = A + CB +No match, mark = B + +/--- Force no study, otherwise mark is not seen. The studied version is in + test 2 because it isn't Perl-compatible. ---/ + +/(*MARK:A)(*SKIP:B)(C|X)/KSS + C + 0: C + 1: C +MK: A + D +No match, mark = A + +/^(A(*THEN:A)B|C(*THEN:B)D)/K + ** Failers +No match + CB +No match, mark = B + +/^(?:A(*THEN:A)B|C(*THEN:B)D)/K + CB +No match, mark = B + +/^(?>A(*THEN:A)B|C(*THEN:B)D)/K + CB +No match, mark = B + +/--- This should succeed, as the skip causes bump to offset 1 (the mark). Note +that we have to have something complicated such as (B|Z) at the end because, +for Perl, a simple character somehow causes an unwanted optimization to mess +with the handling of backtracking verbs. ---/ + +/A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK + AAAC + 0: AC + +/--- Test skipping over a non-matching mark. ---/ + +/A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK + AAAC + 0: AC + +/--- Check shorthand for MARK ---/ + +/A(*:A)A+(*SKIP:A)(B|Z) | AC/xK + AAAC + 0: AC + +/--- Don't loop! Force no study, otherwise mark is not seen. ---/ + +/(*:A)A+(*SKIP:A)(B|Z)/KSS + AAAC +No match, mark = A + +/--- This should succeed, as a non-existent skip name disables the skip ---/ + +/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK + AAAC + 0: AC + +/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK + AAAC + 0: AC +MK: B + +/--- COMMIT at the start of a pattern should act like an anchor. Again, +however, we need the complication for Perl. ---/ + +/(*COMMIT)(A|P)(B|P)(C|P)/ + ABCDEFG + 0: ABC + 1: A + 2: B + 3: C + ** Failers +No match + DEFGABC +No match + +/--- COMMIT inside an atomic group can't stop backtracking over the group. ---/ + +/(\w+)(?>b(*COMMIT))\w{2}/ + abbb + 0: abbb + 1: a + +/(\w+)b(*COMMIT)\w{2}/ + abbb +No match + +/--- Check opening parens in comment when seeking forward reference. ---/ + +/(?&t)(?#()(?(DEFINE)(?a))/ + bac + 0: a + +/--- COMMIT should override THEN ---/ + +/(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/ + yes +No match + +/(?>(*COMMIT)(yes|no)(*THEN)(*F))?/ + yes +No match + +/b?(*SKIP)c/ + bc + 0: bc + abc + 0: bc + +/(*SKIP)bc/ + a +No match + +/(*SKIP)b/ + a +No match + +/(?P(?P=abn)xxx|)+/ + xxx + 0: + 1: + +/(?i:([^b]))(?1)/ + aa + 0: aa + 1: a + aA + 0: aA + 1: a + ** Failers + 0: ** + 1: * + ab +No match + aB +No match + Ba +No match + ba +No match + +/^(?&t)*+(?(DEFINE)(?a))\w$/ + aaaaaaX + 0: aaaaaaX + ** Failers +No match + aaaaaa +No match + +/^(?&t)*(?(DEFINE)(?a))\w$/ + aaaaaaX + 0: aaaaaaX + aaaaaa + 0: aaaaaa + +/^(a)*+(\w)/ + aaaaX + 0: aaaaX + 1: a + 2: X + YZ + 0: Y + 1: + 2: Y + ** Failers +No match + aaaa +No match + +/^(?:a)*+(\w)/ + aaaaX + 0: aaaaX + 1: X + YZ + 0: Y + 1: Y + ** Failers +No match + aaaa +No match + +/^(a)++(\w)/ + aaaaX + 0: aaaaX + 1: a + 2: X + ** Failers +No match + aaaa +No match + YZ +No match + +/^(?:a)++(\w)/ + aaaaX + 0: aaaaX + 1: X + ** Failers +No match + aaaa +No match + YZ +No match + +/^(a)?+(\w)/ + aaaaX + 0: aa + 1: a + 2: a + YZ + 0: Y + 1: + 2: Y + +/^(?:a)?+(\w)/ + aaaaX + 0: aa + 1: a + YZ + 0: Y + 1: Y + +/^(a){2,}+(\w)/ + aaaaX + 0: aaaaX + 1: a + 2: X + ** Failers +No match + aaa +No match + YZ +No match + +/^(?:a){2,}+(\w)/ + aaaaX + 0: aaaaX + 1: X + ** Failers +No match + aaa +No match + YZ +No match + +/(a|)*(?1)b/ + b + 0: b + 1: + ab + 0: ab + 1: + aab + 0: aab + 1: + +/(a)++(?1)b/ + ** Failers +No match + ab +No match + aab +No match + +/(a)*+(?1)b/ + ** Failers +No match + ab +No match + aab +No match + +/(?1)(?:(b)){0}/ + b + 0: b + +/(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x + foo(bar(baz)+baz(bop)) + 0: foo(bar(baz)+baz(bop)) + 1: foo(bar(baz)+baz(bop)) + 2: (bar(baz)+baz(bop)) + 3: bar(baz)+baz(bop) + +/(A (A|B(*ACCEPT)|C) D)(E)/x + AB + 0: AB + 1: AB + 2: B + +/\A.*?(?:a|b(*THEN)c)/ + ba + 0: ba + +/\A.*?(?:a|bc)/ + ba + 0: ba + +/\A.*?(a|b(*THEN)c)/ + ba + 0: ba + 1: a + +/\A.*?(a|bc)/ + ba + 0: ba + 1: a + +/\A.*?(?:a|b(*THEN)c)++/ + ba + 0: ba + +/\A.*?(?:a|bc)++/ + ba + 0: ba + +/\A.*?(a|b(*THEN)c)++/ + ba + 0: ba + 1: a + +/\A.*?(a|bc)++/ + ba + 0: ba + 1: a + +/\A.*?(?:a|b(*THEN)c|d)/ + ba + 0: ba + +/\A.*?(?:a|bc|d)/ + ba + 0: ba + +/(?:(b))++/ + beetle + 0: b + 1: b + +/(?(?=(a(*ACCEPT)z))a)/ + a + 0: a + 1: a + +/^(a)(?1)+ab/ + aaaab + 0: aaaab + 1: a + +/^(a)(?1)++ab/ + aaaab +No match + +/^(?=a(*:M))aZ/K + aZbc + 0: aZ +MK: M + +/^(?!(*:M)b)aZ/K + aZbc + 0: aZ + +/(?(DEFINE)(a))?b(?1)/ + backgammon + 0: ba + +/^\N+/ + abc\ndef + 0: abc + +/^\N{1,}/ + abc\ndef + 0: abc + +/(?(R)a+|(?R)b)/ + aaaabcde + 0: aaaab + +/(?(R)a+|((?R))b)/ + aaaabcde + 0: aaaab + 1: aaaa + +/((?(R)a+|(?1)b))/ + aaaabcde + 0: aaaab + 1: aaaab + +/((?(R1)a+|(?1)b))/ + aaaabcde + 0: aaaab + 1: aaaab + +/a(*:any +name)/K + abc + 0: a +MK: any \x0aname + +/(?>(?&t)c|(?&t))(?(DEFINE)(?a|b(*PRUNE)c))/ + a + 0: a + ba + 0: a + bba + 0: a + +/--- Checking revised (*THEN) handling ---/ + +/--- Capture ---/ + +/^.*? (a(*THEN)b) c/x + aabc +No match + +/^.*? (a(*THEN)b|(*F)) c/x + aabc + 0: aabc + 1: ab + +/^.*? ( (a(*THEN)b) | (*F) ) c/x + aabc + 0: aabc + 1: ab + 2: ab + +/^.*? ( (a(*THEN)b) ) c/x + aabc +No match + +/--- Non-capture ---/ + +/^.*? (?:a(*THEN)b) c/x + aabc +No match + +/^.*? (?:a(*THEN)b|(*F)) c/x + aabc + 0: aabc + +/^.*? (?: (?:a(*THEN)b) | (*F) ) c/x + aabc + 0: aabc + +/^.*? (?: (?:a(*THEN)b) ) c/x + aabc +No match + +/--- Atomic ---/ + +/^.*? (?>a(*THEN)b) c/x + aabc +No match + +/^.*? (?>a(*THEN)b|(*F)) c/x + aabc + 0: aabc + +/^.*? (?> (?>a(*THEN)b) | (*F) ) c/x + aabc + 0: aabc + +/^.*? (?> (?>a(*THEN)b) ) c/x + aabc +No match + +/--- Possessive capture ---/ + +/^.*? (a(*THEN)b)++ c/x + aabc +No match + +/^.*? (a(*THEN)b|(*F))++ c/x + aabc + 0: aabc + 1: ab + +/^.*? ( (a(*THEN)b)++ | (*F) )++ c/x + aabc + 0: aabc + 1: ab + 2: ab + +/^.*? ( (a(*THEN)b)++ )++ c/x + aabc +No match + +/--- Possessive non-capture ---/ + +/^.*? (?:a(*THEN)b)++ c/x + aabc +No match + +/^.*? (?:a(*THEN)b|(*F))++ c/x + aabc + 0: aabc + +/^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x + aabc + 0: aabc + +/^.*? (?: (?:a(*THEN)b)++ )++ c/x + aabc +No match + +/--- Condition assertion ---/ + +/^(?(?=a(*THEN)b)ab|ac)/ + ac + 0: ac + +/--- Condition ---/ + +/^.*?(?(?=a)a|b(*THEN)c)/ + ba +No match + +/^.*?(?:(?(?=a)a|b(*THEN)c)|d)/ + ba + 0: ba + +/^.*?(?(?=a)a(*THEN)b|c)/ + ac +No match + +/--- Assertion ---/ + +/^.*(?=a(*THEN)b)/ + aabc + 0: a + +/------------------------------/ + +/(?>a(*:m))/imsxSK + a + 0: a +MK: m + +/(?>(a)(*:m))/imsxSK + a + 0: a + 1: a +MK: m + +/(?<=a(*ACCEPT)b)c/ + xacd + 0: c + +/(?<=(a(*ACCEPT)b))c/ + xacd + 0: c + 1: a + +/(?<=(a(*COMMIT)b))c/ + xabcd + 0: c + 1: ab + ** Failers +No match + xacd +No match + +/(? + 2: + +/(another)?(\1+)test/ + hello world test +No match + +/(a(*COMMIT)b){0}a(?1)|aac/ + aac + 0: aac + +/(?!a(*COMMIT)b)ac|cd/ + ac + 0: ac + +/((?:a?)*)*c/ + aac + 0: aac + 1: + +/((?>a?)*)*c/ + aac + 0: aac + 1: + /-- End of testinput1 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput10 php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput10 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput10 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput10 2012-11-21 05:12:20.000000000 +0000 @@ -1,739 +1,2103 @@ -/-- These are a few representative patterns whose lengths and offsets are to be -shown when the link size is 2. This is just a doublecheck test to ensure the -sizes don't go horribly wrong when something is changed. The pattern contents -are all themselves checked in other tests. Unicode, including property support, -is required for these tests. --/ - -/((?i)b)/BM -Memory allocation (code space): 21 ------------------------------------------------------------------- - 0 17 Bra - 3 9 CBra 1 - 8 01 Opt - 10 NC b - 12 9 Ket - 15 00 Opt - 17 17 Ket - 20 End ------------------------------------------------------------------- - -/(?s)(.*X|^B)/BM -Memory allocation (code space): 25 ------------------------------------------------------------------- - 0 21 Bra - 3 9 CBra 1 - 8 AllAny* - 10 X - 12 6 Alt - 15 ^ - 16 B - 18 15 Ket - 21 21 Ket - 24 End ------------------------------------------------------------------- - -/(?s:.*X|^B)/BM -Memory allocation (code space): 29 ------------------------------------------------------------------- - 0 25 Bra - 3 9 Bra - 6 04 Opt - 8 AllAny* - 10 X - 12 8 Alt - 15 04 Opt - 17 ^ - 18 B - 20 17 Ket - 23 00 Opt - 25 25 Ket - 28 End ------------------------------------------------------------------- - -/^[[:alnum:]]/BM -Memory allocation (code space): 41 ------------------------------------------------------------------- - 0 37 Bra - 3 ^ - 4 [0-9A-Za-z] - 37 37 Ket - 40 End ------------------------------------------------------------------- - -/#/IxMD -Memory allocation (code space): 7 ------------------------------------------------------------------- - 0 3 Bra - 3 3 Ket - 6 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: extended -No first char -No need char - -/a#/IxMD -Memory allocation (code space): 9 ------------------------------------------------------------------- - 0 5 Bra - 3 a - 5 5 Ket - 8 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: extended -First char = 'a' -No need char - -/x?+/BM -Memory allocation (code space): 9 ------------------------------------------------------------------- - 0 5 Bra - 3 x?+ - 5 5 Ket - 8 End ------------------------------------------------------------------- - -/x++/BM -Memory allocation (code space): 9 ------------------------------------------------------------------- - 0 5 Bra - 3 x++ - 5 5 Ket - 8 End ------------------------------------------------------------------- - -/x{1,3}+/BM -Memory allocation (code space): 19 ------------------------------------------------------------------- - 0 15 Bra - 3 9 Once - 6 x - 8 x{0,2} - 12 9 Ket - 15 15 Ket - 18 End ------------------------------------------------------------------- - -/(x)*+/BM -Memory allocation (code space): 24 ------------------------------------------------------------------- - 0 20 Bra - 3 14 Once - 6 Brazero - 7 7 CBra 1 - 12 x - 14 7 KetRmax - 17 14 Ket - 20 20 Ket - 23 End ------------------------------------------------------------------- - -/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/BM -Memory allocation (code space): 120 ------------------------------------------------------------------- - 0 116 Bra - 3 ^ - 4 109 CBra 1 - 9 7 CBra 2 - 14 a+ - 16 7 Ket - 19 39 CBra 3 - 24 [ab]+? - 58 39 Ket - 61 39 CBra 4 - 66 [bc]+ -100 39 Ket -103 7 CBra 5 -108 \w* -110 7 Ket -113 109 Ket -116 116 Ket -119 End ------------------------------------------------------------------- - -|8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|BM -Memory allocation (code space): 826 ------------------------------------------------------------------- - 0 822 Bra - 3 8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDDqmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X -821 \b -822 822 Ket -825 End ------------------------------------------------------------------- - -|\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|BM -Memory allocation (code space): 816 ------------------------------------------------------------------- - 0 812 Bra - 3 $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDDqmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X -811 \b -812 812 Ket -815 End ------------------------------------------------------------------- - -/(a(?1)b)/BM -Memory allocation (code space): 28 ------------------------------------------------------------------- - 0 24 Bra - 3 18 CBra 1 - 8 a - 10 6 Once - 13 3 Recurse - 16 6 Ket - 19 b - 21 18 Ket - 24 24 Ket - 27 End ------------------------------------------------------------------- - -/(a(?1)+b)/BM -Memory allocation (code space): 28 ------------------------------------------------------------------- - 0 24 Bra - 3 18 CBra 1 - 8 a - 10 6 Once - 13 3 Recurse - 16 6 KetRmax - 19 b - 21 18 Ket - 24 24 Ket - 27 End ------------------------------------------------------------------- - -/a(?Pb|c)d(?Pe)/BM -Memory allocation (code space): 42 ------------------------------------------------------------------- - 0 32 Bra - 3 a - 5 7 CBra 1 - 10 b - 12 5 Alt - 15 c - 17 12 Ket - 20 d - 22 7 CBra 2 - 27 e - 29 7 Ket - 32 32 Ket - 35 End ------------------------------------------------------------------- - -/(?:a(?Pc(?Pd)))(?Pa)/BM -Memory allocation (code space): 54 ------------------------------------------------------------------- - 0 41 Bra - 3 25 Bra - 6 a - 8 17 CBra 1 - 13 c - 15 7 CBra 2 - 20 d - 22 7 Ket - 25 17 Ket - 28 25 Ket - 31 7 CBra 3 - 36 a - 38 7 Ket - 41 41 Ket - 44 End ------------------------------------------------------------------- - -/(?Pa)...(?P=a)bbb(?P>a)d/BM -Memory allocation (code space): 43 ------------------------------------------------------------------- - 0 36 Bra - 3 7 CBra 1 - 8 a - 10 7 Ket - 13 Any - 14 Any - 15 Any - 16 \1 - 19 bbb - 25 6 Once - 28 3 Recurse - 31 6 Ket - 34 d - 36 36 Ket - 39 End ------------------------------------------------------------------- - -/abc(?C255)de(?C)f/BM -Memory allocation (code space): 31 ------------------------------------------------------------------- - 0 27 Bra - 3 abc - 9 Callout 255 10 1 - 15 de - 19 Callout 0 16 1 - 25 f - 27 27 Ket - 30 End ------------------------------------------------------------------- - -/abcde/CBM -Memory allocation (code space): 53 ------------------------------------------------------------------- - 0 49 Bra - 3 Callout 255 0 1 - 9 a - 11 Callout 255 1 1 - 17 b - 19 Callout 255 2 1 - 25 c - 27 Callout 255 3 1 - 33 d - 35 Callout 255 4 1 - 41 e - 43 Callout 255 5 0 - 49 49 Ket - 52 End ------------------------------------------------------------------- - -/\x{100}/8BM -Memory allocation (code space): 10 ------------------------------------------------------------------- - 0 6 Bra - 3 \x{100} - 6 6 Ket - 9 End ------------------------------------------------------------------- - -/\x{1000}/8BM -Memory allocation (code space): 11 ------------------------------------------------------------------- - 0 7 Bra - 3 \x{1000} - 7 7 Ket - 10 End ------------------------------------------------------------------- - -/\x{10000}/8BM -Memory allocation (code space): 12 ------------------------------------------------------------------- - 0 8 Bra - 3 \x{10000} - 8 8 Ket - 11 End ------------------------------------------------------------------- - -/\x{100000}/8BM -Memory allocation (code space): 12 ------------------------------------------------------------------- - 0 8 Bra - 3 \x{100000} - 8 8 Ket - 11 End ------------------------------------------------------------------- - -/\x{1000000}/8BM -Memory allocation (code space): 13 ------------------------------------------------------------------- - 0 9 Bra - 3 \x{1000000} - 9 9 Ket - 12 End ------------------------------------------------------------------- - -/\x{4000000}/8BM -Memory allocation (code space): 14 ------------------------------------------------------------------- - 0 10 Bra - 3 \x{4000000} - 10 10 Ket - 13 End ------------------------------------------------------------------- - -/\x{7fffFFFF}/8BM -Memory allocation (code space): 14 ------------------------------------------------------------------- - 0 10 Bra - 3 \x{7fffffff} - 10 10 Ket - 13 End ------------------------------------------------------------------- - -/[\x{ff}]/8BM -Memory allocation (code space): 10 ------------------------------------------------------------------- - 0 6 Bra - 3 \x{ff} - 6 6 Ket - 9 End ------------------------------------------------------------------- - -/[\x{100}]/8BM -Memory allocation (code space): 15 ------------------------------------------------------------------- - 0 11 Bra - 3 [\x{100}] - 11 11 Ket - 14 End ------------------------------------------------------------------- - -/\x80/8BM -Memory allocation (code space): 10 ------------------------------------------------------------------- - 0 6 Bra - 3 \x{80} - 6 6 Ket - 9 End ------------------------------------------------------------------- - -/\xff/8BM -Memory allocation (code space): 10 ------------------------------------------------------------------- - 0 6 Bra - 3 \x{ff} - 6 6 Ket - 9 End ------------------------------------------------------------------- - -/\x{0041}\x{2262}\x{0391}\x{002e}/D8M -Memory allocation (code space): 18 ------------------------------------------------------------------- - 0 14 Bra - 3 A\x{2262}\x{391}. - 14 14 Ket - 17 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 'A' -Need char = '.' - -/\x{D55c}\x{ad6d}\x{C5B4}/D8M -Memory allocation (code space): 19 ------------------------------------------------------------------- - 0 15 Bra - 3 \x{d55c}\x{ad6d}\x{c5b4} - 15 15 Ket - 18 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 237 -Need char = 180 - -/\x{65e5}\x{672c}\x{8a9e}/D8M -Memory allocation (code space): 19 ------------------------------------------------------------------- - 0 15 Bra - 3 \x{65e5}\x{672c}\x{8a9e} - 15 15 Ket - 18 End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 230 -Need char = 158 - -/[\x{100}]/8BM -Memory allocation (code space): 15 ------------------------------------------------------------------- - 0 11 Bra - 3 [\x{100}] - 11 11 Ket - 14 End ------------------------------------------------------------------- - -/[Z\x{100}]/8BM -Memory allocation (code space): 47 ------------------------------------------------------------------- - 0 43 Bra - 3 [Z\x{100}] - 43 43 Ket - 46 End ------------------------------------------------------------------- - -/^[\x{100}\E-\Q\E\x{150}]/B8M -Memory allocation (code space): 18 ------------------------------------------------------------------- - 0 14 Bra - 3 ^ - 4 [\x{100}-\x{150}] - 14 14 Ket - 17 End ------------------------------------------------------------------- - -/^[\QĀ\E-\QŐ\E]/B8M -Memory allocation (code space): 18 ------------------------------------------------------------------- - 0 14 Bra - 3 ^ - 4 [\x{100}-\x{150}] - 14 14 Ket - 17 End ------------------------------------------------------------------- - -/^[\QĀ\E-\QŐ\E/B8M -Failed: missing terminating ] for character class at offset 15 - -/[\p{L}]/BM -Memory allocation (code space): 15 ------------------------------------------------------------------- - 0 11 Bra - 3 [\p{L}] - 11 11 Ket - 14 End ------------------------------------------------------------------- - -/[\p{^L}]/BM -Memory allocation (code space): 15 ------------------------------------------------------------------- - 0 11 Bra - 3 [\P{L}] - 11 11 Ket - 14 End ------------------------------------------------------------------- - -/[\P{L}]/BM -Memory allocation (code space): 15 ------------------------------------------------------------------- - 0 11 Bra - 3 [\P{L}] - 11 11 Ket - 14 End ------------------------------------------------------------------- - -/[\P{^L}]/BM -Memory allocation (code space): 15 ------------------------------------------------------------------- - 0 11 Bra - 3 [\p{L}] - 11 11 Ket - 14 End ------------------------------------------------------------------- - -/[abc\p{L}\x{0660}]/8BM -Memory allocation (code space): 50 ------------------------------------------------------------------- - 0 46 Bra - 3 [a-c\p{L}\x{660}] - 46 46 Ket - 49 End ------------------------------------------------------------------- - -/[\p{Nd}]/8BM -Memory allocation (code space): 15 ------------------------------------------------------------------- - 0 11 Bra - 3 [\p{Nd}] - 11 11 Ket - 14 End ------------------------------------------------------------------- - -/[\p{Nd}+-]+/8BM -Memory allocation (code space): 48 ------------------------------------------------------------------- - 0 44 Bra - 3 [+\-\p{Nd}]+ - 44 44 Ket - 47 End ------------------------------------------------------------------- - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8iBM -Memory allocation (code space): 25 ------------------------------------------------------------------- - 0 21 Bra - 3 NC A\x{391}\x{10427}\x{ff3a}\x{1fb0} - 21 21 Ket - 24 End ------------------------------------------------------------------- - -/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/8BM -Memory allocation (code space): 25 ------------------------------------------------------------------- - 0 21 Bra - 3 A\x{391}\x{10427}\x{ff3a}\x{1fb0} - 21 21 Ket - 24 End ------------------------------------------------------------------- - -/[\x{105}-\x{109}]/8iBM -Memory allocation (code space): 17 ------------------------------------------------------------------- - 0 13 Bra - 3 [\x{104}-\x{109}] - 13 13 Ket - 16 End ------------------------------------------------------------------- - -/( ( (?(1)0|) )* )/xBM -Memory allocation (code space): 38 ------------------------------------------------------------------- - 0 34 Bra - 3 28 CBra 1 - 8 Brazero - 9 19 SCBra 2 - 14 8 Cond - 17 1 Cond ref - 20 0 - 22 3 Alt - 25 11 Ket - 28 19 KetRmax - 31 28 Ket - 34 34 Ket - 37 End ------------------------------------------------------------------- - -/( (?(1)0|)* )/xBM -Memory allocation (code space): 30 ------------------------------------------------------------------- - 0 26 Bra - 3 20 CBra 1 - 8 Brazero - 9 8 SCond - 12 1 Cond ref - 15 0 - 17 3 Alt - 20 11 KetRmax - 23 20 Ket - 26 26 Ket - 29 End ------------------------------------------------------------------- - -/[a]/BM -Memory allocation (code space): 9 ------------------------------------------------------------------- - 0 5 Bra - 3 a - 5 5 Ket - 8 End ------------------------------------------------------------------- - -/[a]/8BM -Memory allocation (code space): 9 ------------------------------------------------------------------- - 0 5 Bra - 3 a - 5 5 Ket - 8 End ------------------------------------------------------------------- - -/[\xaa]/BM -Memory allocation (code space): 9 ------------------------------------------------------------------- - 0 5 Bra - 3 \xaa - 5 5 Ket - 8 End ------------------------------------------------------------------- - -/[\xaa]/8BM -Memory allocation (code space): 10 ------------------------------------------------------------------- - 0 6 Bra - 3 \x{aa} - 6 6 Ket - 9 End ------------------------------------------------------------------- - -/[^a]/BM -Memory allocation (code space): 9 ------------------------------------------------------------------- - 0 5 Bra - 3 [^a] - 5 5 Ket - 8 End ------------------------------------------------------------------- - -/[^a]/8BM -Memory allocation (code space): 9 ------------------------------------------------------------------- - 0 5 Bra - 3 [^a] - 5 5 Ket - 8 End ------------------------------------------------------------------- - -/[^\xaa]/BM -Memory allocation (code space): 9 ------------------------------------------------------------------- - 0 5 Bra - 3 [^\xaa] - 5 5 Ket - 8 End ------------------------------------------------------------------- - -/[^\xaa]/8BM -Memory allocation (code space): 40 ------------------------------------------------------------------- - 0 36 Bra - 3 [\x00-\xa9\xab-\xff] (neg) - 36 36 Ket - 39 End ------------------------------------------------------------------- - -/[^\d]/8WB ------------------------------------------------------------------- - 0 11 Bra - 3 [^\p{Nd}] - 11 11 Ket - 14 End ------------------------------------------------------------------- - -/[[:^alpha:][:^cntrl:]]+/8WB ------------------------------------------------------------------- - 0 44 Bra - 3 [ -~\x80-\xff\P{L}]+ - 44 44 Ket - 47 End ------------------------------------------------------------------- - -/[[:^cntrl:][:^alpha:]]+/8WB ------------------------------------------------------------------- - 0 44 Bra - 3 [ -~\x80-\xff\P{L}]+ - 44 44 Ket - 47 End ------------------------------------------------------------------- - -/[[:alpha:]]+/8WB ------------------------------------------------------------------- - 0 12 Bra - 3 [\p{L}]+ - 12 12 Ket - 15 End ------------------------------------------------------------------- - -/[[:^alpha:]\S]+/8WB ------------------------------------------------------------------- - 0 15 Bra - 3 [\P{L}\P{Xsp}]+ - 15 15 Ket - 18 End ------------------------------------------------------------------- - -/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/B ------------------------------------------------------------------- - 0 79 Bra - 3 abc - 9 7 CBra 1 - 14 d - 16 5 Alt - 19 e - 21 12 Ket - 24 *THEN 24 - 27 x - 29 16 CBra 2 - 34 123 - 40 *THEN 11 - 43 4 - 45 31 Alt - 48 567 - 54 7 CBra 3 - 59 b - 61 5 Alt - 64 q - 66 12 Ket - 69 *THEN 24 - 72 xx - 76 47 Ket - 79 79 Ket - 82 End ------------------------------------------------------------------- +/-- This set of tests check Unicode property support with the DFA matching + functionality of pcre_dfa_exec(). The -dfa flag must be used with pcretest + when running it. --/ + +/\pL\P{Nd}/8 + AB + 0: AB + *** Failers + 0: Fa + A0 +No match + 00 +No match + +/\X./8 + AB + 0: AB + A\x{300}BC + 0: A\x{300}B + A\x{300}\x{301}\x{302}BC + 0: A\x{300}\x{301}\x{302}B + *** Failers + 0: ** + \x{300} +No match + +/\X\X/8 + ABC + 0: AB + A\x{300}B\x{300}\x{301}C + 0: A\x{300}B\x{300}\x{301} + A\x{300}\x{301}\x{302}BC + 0: A\x{300}\x{301}\x{302}B + *** Failers + 0: ** + \x{300} +No match + +/^\pL+/8 + abcd + 0: abcd + 1: abc + 2: ab + 3: a + a + 0: a + *** Failers +No match + +/^\PL+/8 + 1234 + 0: 1234 + 1: 123 + 2: 12 + 3: 1 + = + 0: = + *** Failers + 0: *** + 1: *** + 2: ** + 3: * + abcd +No match + +/^\X+/8 + abcdA\x{300}\x{301}\x{302} + 0: abcdA\x{300}\x{301}\x{302} + 1: abcd + 2: abc + 3: ab + 4: a + A\x{300}\x{301}\x{302} + 0: A\x{300}\x{301}\x{302} + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} + 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} + 1: A\x{300}\x{301}\x{302} + a + 0: a + *** Failers + 0: *** Failers + 1: *** Failer + 2: *** Faile + 3: *** Fail + 4: *** Fai + 5: *** Fa + 6: *** F + 7: *** + 8: *** + 9: ** +10: * + \x{300}\x{301}\x{302} +No match + +/\X?abc/8 + abc + 0: abc + A\x{300}abc + 0: A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + 0: A\x{300}abc + \x{300}abc + 0: abc + *** Failers +No match + +/^\X?abc/8 + abc + 0: abc + A\x{300}abc + 0: A\x{300}abc + *** Failers +No match + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz +No match + \x{300}abc +No match + +/\X*abc/8 + abc + 0: abc + A\x{300}abc + 0: A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + 0: A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abc + \x{300}abc + 0: abc + *** Failers +No match + +/^\X*abc/8 + abc + 0: abc + A\x{300}abc + 0: A\x{300}abc + A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + 0: A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abc + *** Failers +No match + \x{300}abc +No match + +/^\pL?=./8 + A=b + 0: A=b + =c + 0: =c + *** Failers +No match + 1=2 +No match + AAAA=b +No match + +/^\pL*=./8 + AAAA=b + 0: AAAA=b + =c + 0: =c + *** Failers +No match + 1=2 +No match + +/^\X{2,3}X/8 + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + *** Failers +No match + X +No match + A\x{300}\x{301}\x{302}X +No match + A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X +No match + +/^\pC\pL\pM\pN\pP\pS\pZ\p{Xsp}/8 + >\x{1680}\x{2028}\x{0b} + 0: >\x{1680} + ** Failers +No match + \x{0b} +No match + +/^>\p{Xsp}+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} + 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} + 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} + 3: > \x{09}\x{0a}\x{0c}\x{0d} + 4: > \x{09}\x{0a}\x{0c} + 5: > \x{09}\x{0a} + 6: > \x{09} + 7: > + +/^>\p{Xsp}*/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} + 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} + 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} + 3: > \x{09}\x{0a}\x{0c}\x{0d} + 4: > \x{09}\x{0a}\x{0c} + 5: > \x{09}\x{0a} + 6: > \x{09} + 7: > + 8: > + +/^>\p{Xsp}{2,9}/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} + 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} + 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} + 3: > \x{09}\x{0a}\x{0c}\x{0d} + 4: > \x{09}\x{0a}\x{0c} + 5: > \x{09}\x{0a} + 6: > \x{09} + +/^>[\p{Xsp}]/8 + >\x{2028}\x{0b} + 0: >\x{2028} + +/^>[\p{Xsp}]+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} + 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} + 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} + 3: > \x{09}\x{0a}\x{0c}\x{0d} + 4: > \x{09}\x{0a}\x{0c} + 5: > \x{09}\x{0a} + 6: > \x{09} + 7: > + +/^>\p{Xps}/8 + >\x{1680}\x{2028}\x{0b} + 0: >\x{1680} + >\x{a0} + 0: >\x{a0} + ** Failers +No match + \x{0b} +No match + +/^>\p{Xps}+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} + 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} + 3: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} + 4: > \x{09}\x{0a}\x{0c}\x{0d} + 5: > \x{09}\x{0a}\x{0c} + 6: > \x{09}\x{0a} + 7: > \x{09} + 8: > + +/^>\p{Xps}+?/8 + >\x{1680}\x{2028}\x{0b} + 0: >\x{1680}\x{2028}\x{0b} + 1: >\x{1680}\x{2028} + 2: >\x{1680} + +/^>\p{Xps}*/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} + 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} + 3: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} + 4: > \x{09}\x{0a}\x{0c}\x{0d} + 5: > \x{09}\x{0a}\x{0c} + 6: > \x{09}\x{0a} + 7: > \x{09} + 8: > + 9: > + +/^>\p{Xps}{2,9}/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} + 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} + 3: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} + 4: > \x{09}\x{0a}\x{0c}\x{0d} + 5: > \x{09}\x{0a}\x{0c} + 6: > \x{09}\x{0a} + 7: > \x{09} + +/^>\p{Xps}{2,9}?/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} + 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} + 3: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} + 4: > \x{09}\x{0a}\x{0c}\x{0d} + 5: > \x{09}\x{0a}\x{0c} + 6: > \x{09}\x{0a} + 7: > \x{09} + +/^>[\p{Xps}]/8 + >\x{2028}\x{0b} + 0: >\x{2028} + +/^>[\p{Xps}]+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} + 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} + 3: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} + 4: > \x{09}\x{0a}\x{0c}\x{0d} + 5: > \x{09}\x{0a}\x{0c} + 6: > \x{09}\x{0a} + 7: > \x{09} + 8: > + +/^\p{Xwd}/8 + ABCD + 0: A + 1234 + 0: 1 + \x{6ca} + 0: \x{6ca} + \x{a6c} + 0: \x{a6c} + \x{10a7} + 0: \x{10a7} + _ABC + 0: _ + ** Failers +No match + [] +No match + +/^\p{Xwd}+/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 0: ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 1: ABCD1234\x{6ca}\x{a6c}\x{10a7} + 2: ABCD1234\x{6ca}\x{a6c} + 3: ABCD1234\x{6ca} + 4: ABCD1234 + 5: ABCD123 + 6: ABCD12 + 7: ABCD1 + 8: ABCD + 9: ABC +10: AB +11: A + +/^\p{Xwd}*/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 0: ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 1: ABCD1234\x{6ca}\x{a6c}\x{10a7} + 2: ABCD1234\x{6ca}\x{a6c} + 3: ABCD1234\x{6ca} + 4: ABCD1234 + 5: ABCD123 + 6: ABCD12 + 7: ABCD1 + 8: ABCD + 9: ABC +10: AB +11: A +12: + +/^\p{Xwd}{2,9}/8 + A_12\x{6ca}\x{a6c}\x{10a7} + 0: A_12\x{6ca}\x{a6c}\x{10a7} + 1: A_12\x{6ca}\x{a6c} + 2: A_12\x{6ca} + 3: A_12 + 4: A_1 + 5: A_ + +/^[\p{Xwd}]/8 + ABCD1234_ + 0: A + 1234abcd_ + 0: 1 + \x{6ca} + 0: \x{6ca} + \x{a6c} + 0: \x{a6c} + \x{10a7} + 0: \x{10a7} + _ABC + 0: _ + ** Failers +No match + [] +No match + +/^[\p{Xwd}]+/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 0: ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 1: ABCD1234\x{6ca}\x{a6c}\x{10a7} + 2: ABCD1234\x{6ca}\x{a6c} + 3: ABCD1234\x{6ca} + 4: ABCD1234 + 5: ABCD123 + 6: ABCD12 + 7: ABCD1 + 8: ABCD + 9: ABC +10: AB +11: A + +/-- Unicode properties for \b abd \B --/ + +/\b...\B/8W + abc_ + 0: abc + \x{37e}abc\x{376} + 0: abc + \x{37e}\x{376}\x{371}\x{393}\x{394} + 0: \x{376}\x{371}\x{393} + !\x{c0}++\x{c1}\x{c2} + 0: ++\x{c1} + !\x{c0}+++++ + 0: \x{c0}++ + +/-- Without PCRE_UCP, non-ASCII always fail, even if < 256 --/ + +/\b...\B/8 + abc_ + 0: abc + ** Failers + 0: Fai + \x{37e}abc\x{376} +No match + \x{37e}\x{376}\x{371}\x{393}\x{394} +No match + !\x{c0}++\x{c1}\x{c2} +No match + !\x{c0}+++++ +No match + +/-- With PCRE_UCP, non-UTF8 chars that are < 256 still check properties --/ + +/\b...\B/W + abc_ + 0: abc + !\x{c0}++\x{c1}\x{c2} + 0: ++\xc1 + !\x{c0}+++++ + 0: \xc0++ + +/-- Caseless single negated characters > 127 need UCP support --/ + +/[^\x{100}]/8i + \x{100}\x{101}X + 0: X + +/[^\x{100}]+/8i + \x{100}\x{101}XX + 0: XX + 1: X + +/^\X/8 + A\P + 0: A + A\P\P +Partial match: A + A\x{300}\x{301}\P + 0: A\x{300}\x{301} + A\x{300}\x{301}\P\P +Partial match: A\x{300}\x{301} + A\x{301}\P + 0: A\x{301} + A\x{301}\P\P +Partial match: A\x{301} + +/^\X{2,3}/8 + A\P +Partial match: A + A\P\P +Partial match: A + AA\P + 0: AA + AA\P\P +Partial match: AA + A\x{300}\x{301}\P +Partial match: A\x{300}\x{301} + A\x{300}\x{301}\P\P +Partial match: A\x{300}\x{301} + A\x{300}\x{301}A\x{300}\x{301}\P + 0: A\x{300}\x{301}A\x{300}\x{301} + A\x{300}\x{301}A\x{300}\x{301}\P\P +Partial match: A\x{300}\x{301}A\x{300}\x{301} + +/^\X{2}/8 + AA\P + 0: AA + AA\P\P +Partial match: AA + A\x{300}\x{301}A\x{300}\x{301}\P + 0: A\x{300}\x{301}A\x{300}\x{301} + A\x{300}\x{301}A\x{300}\x{301}\P\P +Partial match: A\x{300}\x{301}A\x{300}\x{301} + +/^\X+/8 + AA\P + 0: AA + 1: A + AA\P\P +Partial match: AA + +/^\X+?Z/8 + AA\P +Partial match: AA + AA\P\P +Partial match: AA -/-- End of testinput10 --/ +/-- End of testinput10 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput2 php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput2 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput2 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput2 2012-11-21 05:12:20.000000000 +0000 @@ -3,12 +3,11 @@ It also checks the non-Perl syntax the PCRE supports (Python, .NET, Oniguruma). Finally, there are some tests where PCRE and Perl differ, either because PCRE can't be compatible, or there is a possible Perl - bug. --/ + bug. + + NOTE: This is a non-UTF set of tests. When UTF support is needed, use + test 5, and if Unicode Property Support is needed, use test 7. --/ -/-- Originally, the Perl >= 5.10 things were in here too, but now I have - separated many (most?) of them out into test 11. However, there may still - be some that were overlooked. --/ - /(a)b|/I Capturing subpattern count = 1 No options @@ -377,61 +376,6 @@ 2: 3: def -/abc/P - abc - 0: abc - *** Failers -No match: POSIX code 17: match failed - -/^abc|def/P - abcdef - 0: abc - abcdef\B - 0: def - -/.*((abc)$|(def))/P - defabc - 0: defabc - 1: abc - 2: abc - \Zdefabc - 0: def - 1: def - 3: def - -/the quick brown fox/P - the quick brown fox - 0: the quick brown fox - *** Failers -No match: POSIX code 17: match failed - The Quick Brown Fox -No match: POSIX code 17: match failed - -/the quick brown fox/Pi - the quick brown fox - 0: the quick brown fox - The Quick Brown Fox - 0: The Quick Brown Fox - -/abc.def/P - *** Failers -No match: POSIX code 17: match failed - abc\ndef -No match: POSIX code 17: match failed - -/abc$/P - abc - 0: abc - abc\n - 0: abc - -/(abc)\2/P -Failed: POSIX code 15: bad back reference at offset 7 - -/(abc\1)/P - abc -No match: POSIX code 17: match failed - /)/ Failed: unmatched parentheses at offset 0 @@ -507,6 +451,7 @@ No options First char = 'f' Need char = 'o' +Max lookbehind = 6 foo 0: foo catfoo @@ -632,10 +577,8 @@ ------------------------------------------------------------------ Bra CBra 1 - 01 Opt - NC b + /i b Ket - 00 Opt Ket End ------------------------------------------------------------------ @@ -716,6 +659,7 @@ No options No first char No need char +Max lookbehind = 3 Subject length lower bound = 1 Starting byte set: a b @@ -724,6 +668,7 @@ No options No first char Need char = 'a' +Max lookbehind = 3 Subject length lower bound = 5 Starting byte set: a o @@ -741,6 +686,7 @@ Options: multiline No first char Need char = 'r' +Max lookbehind = 4 foo\nbarbar 0: bar ***Failers @@ -758,6 +704,7 @@ Options: multiline First char at start or follows newline Need char = 'r' +Max lookbehind = 4 foo\nbarbar 0: bar ***Failers @@ -799,6 +746,7 @@ No options First char = '-' Need char = 't' +Max lookbehind = 7 the bullock-cart 0: -cart a donkey-cart race @@ -815,12 +763,14 @@ No options No first char No need char +Max lookbehind = 3 /(?>.*)(?<=(abcd)|(xyz))/I Capturing subpattern count = 2 No options First char at start or follows newline No need char +Max lookbehind = 4 alphabetabcd 0: alphabetabcd 1: abcd @@ -834,6 +784,7 @@ No options First char = 'Z' Need char = 'Z' +Max lookbehind = 4 abxyZZ 0: ZZ abXyZZ @@ -862,6 +813,7 @@ No options First char = 'b' Need char = 'r' +Max lookbehind = 4 bar 0: bar foobbar @@ -1033,9 +985,6 @@ /abc/\ Failed: \ at end of pattern at offset 4 -/abc/\P -Failed: POSIX code 9: bad escape sequence at offset 4 - /abc/\i Failed: \ at end of pattern at offset 4 @@ -1151,7 +1100,7 @@ No need char abc\00def\L\C0 0: abc\x00def - 0C abc (7) + 0C abc\x00def (7) 0L abc /word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ @@ -1247,15 +1196,12 @@ ------------------------------------------------------------------ Bra Bra - 04 Opt AllAny* X Alt - 04 Opt ^ B Ket - 00 Opt Ket End ------------------------------------------------------------------ @@ -1269,11 +1215,7 @@ No options First char = 'i' Need char = 's' - Mississippi - 0: iss - 0+ issippi - -/\Biss\B/I+P +Max lookbehind = 1 Mississippi 0: iss 0+ issippi @@ -1294,6 +1236,7 @@ No options First char = 'i' Need char = 's' +Max lookbehind = 1 Mississippi 0: iss 0+ issippi @@ -1303,6 +1246,7 @@ No options First char = 'i' Need char = 's' +Max lookbehind = 1 Mississippi 0: iss 0+ issippi @@ -1318,6 +1262,7 @@ No options First char = 'i' Need char = 's' +Max lookbehind = 1 Mississippi 0: iss 0+ issippi @@ -1329,6 +1274,7 @@ No options First char = 'i' Need char = 's' +Max lookbehind = 1 Mississippi 0: iss 0+ issippi @@ -1407,7 +1353,7 @@ Contains explicit CR or LF match Options: multiline First char at start or follows newline -Need char = 10 +Need char = \x0a ab\nab\ncd 0: ab\x0a 0+ ab\x0acd @@ -1509,6 +1455,7 @@ No options No first char No need char +Max lookbehind = 3 /abc(?!pqr)/I Capturing subpattern count = 0 @@ -1694,33 +1641,6 @@ \Nabc No match -/a*(b+)(z)(z)/P - aaaabbbbzzzz - 0: aaaabbbbzz - 1: bbbb - 2: z - 3: z - aaaabbbbzzzz\O0 - aaaabbbbzzzz\O1 - 0: aaaabbbbzz - aaaabbbbzzzz\O2 - 0: aaaabbbbzz - 1: bbbb - aaaabbbbzzzz\O3 - 0: aaaabbbbzz - 1: bbbb - 2: z - aaaabbbbzzzz\O4 - 0: aaaabbbbzz - 1: bbbb - 2: z - 3: z - aaaabbbbzzzz\O5 - 0: aaaabbbbzz - 1: bbbb - 2: z - 3: z - /^.?abcd/IS Capturing subpattern count = 0 Options: anchored @@ -2764,8 +2684,7 @@ ------------------------------------------------------------------ Bra a - 01 Opt - NC b + /i b Ket End ------------------------------------------------------------------ @@ -2787,10 +2706,8 @@ Bra CBra 1 a - 01 Opt - NC b + /i b Ket - 00 Opt Ket End ------------------------------------------------------------------ @@ -2812,7 +2729,7 @@ / (?i)abc/IxDZ ------------------------------------------------------------------ Bra - NC abc + /i abc Ket End ------------------------------------------------------------------ @@ -2825,7 +2742,7 @@ (?i)abc/IxDZ ------------------------------------------------------------------ Bra - NC abc + /i abc Ket End ------------------------------------------------------------------ @@ -2998,12 +2915,10 @@ /(x)*+/DZ ------------------------------------------------------------------ Bra - Once - Brazero - CBra 1 + Braposzero + CBraPos 1 x - KetRmax - Ket + KetRpos Ket End ------------------------------------------------------------------ @@ -3321,6 +3236,7 @@ No options First char = '8' Need char = 'X' +Max lookbehind = 1 |\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b|IDZ ------------------------------------------------------------------ @@ -3334,6 +3250,7 @@ No options First char = '$' Need char = 'X' +Max lookbehind = 1 /(.*)\d+\1/I Capturing subpattern count = 1 @@ -3590,7 +3507,27 @@ 1 ^ ^ f 0: abcdef -/(?C1)\dabc(?C2)def/I +/(?C1)\dabc(?C2)def/IS +Capturing subpattern count = 0 +No options +No first char +Need char = 'f' +Subject length lower bound = 7 +Starting byte set: 0 1 2 3 4 5 6 7 8 9 + 1234abcdef +--->1234abcdef + 1 ^ \d + 1 ^ \d + 1 ^ \d + 1 ^ \d + 2 ^ ^ d + 0: 4abcdef + *** Failers +No match + abcdef +No match + +/(?C1)\dabc(?C2)def/ISS Capturing subpattern count = 0 No options No first char @@ -3829,6 +3766,7 @@ No options First char = 'x' Need char = 'z' +Max lookbehind = 3 abcxyz\C+ Callout 0: last capture = 1 0: @@ -3994,9 +3932,7 @@ Bra CBra 1 a - Once Recurse - Ket b Ket Ket @@ -4217,9 +4153,7 @@ Any \1 bbb - Once Recurse - Ket d Ket End @@ -4591,9 +4525,7 @@ a CBra 2 b - Once Recurse - Ket c Ket Ket @@ -4613,9 +4545,7 @@ a CBra 2 b - Once Recurse - Ket c Ket KetRmax @@ -4636,9 +4566,7 @@ a CBra 2 b - Once Recurse - Ket c Ket Ket @@ -4647,9 +4575,7 @@ a CBra 2 b - Once Recurse - Ket c Ket Ket @@ -4788,7 +4714,51 @@ +4 ^ ^ e No match -/a*b/ICDZ +/a*b/ICDZS +------------------------------------------------------------------ + Bra + Callout 255 0 2 + a*+ + Callout 255 2 1 + b + Callout 255 3 0 + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: +No first char +Need char = 'b' +Subject length lower bound = 1 +Starting byte set: a b + ab +--->ab + +0 ^ a* + +2 ^^ b + +3 ^ ^ + 0: ab + aaaab +--->aaaab + +0 ^ a* + +2 ^ ^ b + +3 ^ ^ + 0: aaaab + aaaacb +--->aaaacb + +0 ^ a* + +2 ^ ^ b + +0 ^ a* + +2 ^ ^ b + +0 ^ a* + +2 ^ ^ b + +0 ^ a* + +2 ^^ b + +0 ^ a* + +2 ^ b + +3 ^^ + 0: b + +/a*b/ICDZSS ------------------------------------------------------------------ Bra Callout 255 0 2 @@ -4871,7 +4841,83 @@ +2 ^^ b No match -/(abc|def)x/ICDZ +/(abc|def)x/ICDZS +------------------------------------------------------------------ + Bra + Callout 255 0 9 + CBra 1 + Callout 255 1 1 + a + Callout 255 2 1 + b + Callout 255 3 1 + c + Callout 255 4 0 + Alt + Callout 255 5 1 + d + Callout 255 6 1 + e + Callout 255 7 1 + f + Callout 255 8 0 + Ket + Callout 255 9 1 + x + Callout 255 10 0 + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Options: +No first char +Need char = 'x' +Subject length lower bound = 4 +Starting byte set: a d + abcx +--->abcx + +0 ^ (abc|def) + +1 ^ a + +2 ^^ b + +3 ^ ^ c + +4 ^ ^ | + +9 ^ ^ x ++10 ^ ^ + 0: abcx + 1: abc + defx +--->defx + +0 ^ (abc|def) + +1 ^ a + +5 ^ d + +6 ^^ e + +7 ^ ^ f + +8 ^ ^ ) + +9 ^ ^ x ++10 ^ ^ + 0: defx + 1: def + ** Failers +No match + abcdefzx +--->abcdefzx + +0 ^ (abc|def) + +1 ^ a + +2 ^^ b + +3 ^ ^ c + +4 ^ ^ | + +9 ^ ^ x + +5 ^ d + +0 ^ (abc|def) + +1 ^ a + +5 ^ d + +6 ^^ e + +7 ^ ^ f + +8 ^ ^ ) + +9 ^ ^ x +No match + +/(abc|def)x/ICDZSS ------------------------------------------------------------------ Bra Callout 255 0 9 @@ -4925,6 +4971,8 @@ +10 ^ ^ 0: defx 1: def + ** Failers +No match abcdefzx --->abcdefzx +0 ^ (abc|def) @@ -5025,7 +5073,58 @@ 0: abcdcdcd 1: cd -/([ab]{,4}c|xy)/ICDZ +/([ab]{,4}c|xy)/ICDZS +------------------------------------------------------------------ + Bra + Callout 255 0 14 + CBra 1 + Callout 255 1 4 + [ab] + Callout 255 5 1 + { + Callout 255 6 1 + , + Callout 255 7 1 + 4 + Callout 255 8 1 + } + Callout 255 9 1 + c + Callout 255 10 0 + Alt + Callout 255 11 1 + x + Callout 255 12 1 + y + Callout 255 13 0 + Ket + Callout 255 14 0 + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 1 +Options: +No first char +No need char +Subject length lower bound = 2 +Starting byte set: a b x + Note: that { does NOT introduce a quantifier +--->Note: that { does NOT introduce a quantifier + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] + +5 ^^ { ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] + +5 ^^ { ++11 ^ x + +0 ^ ([ab]{,4}c|xy) + +1 ^ [ab] + +5 ^^ { ++11 ^ x +No match + +/([ab]{,4}c|xy)/ICDZSS ------------------------------------------------------------------ Bra Callout 255 0 14 @@ -5315,6 +5414,7 @@ No options No first char No need char +Max lookbehind = 1 ab cd\>1 0: cd @@ -5323,6 +5423,7 @@ Options: dotall No first char No need char +Max lookbehind = 1 ab cd\>1 0: cd @@ -5477,15 +5578,18 @@ 123456\P No match -/abc/I>testsavedregex +/abc/IS>testsavedregex Capturing subpattern count = 0 No options First char = 'a' Need char = 'c' -Compiled regex written to testsavedregex +Subject length lower bound = 3 +No set of starting bytes +Compiled pattern written to testsavedregex +Study data written to testsavedregex testsavedregex +/abc/ISS>testsavedregex Capturing subpattern count = 0 No options First char = 'a' Need char = 'c' -Compiled regex written to testsavedregex +Compiled pattern written to testsavedregex testsavedregex -Capturing subpattern count = 1 +/abc/IFS>testsavedregex +Capturing subpattern count = 0 No options -No first char +First char = 'a' +Need char = 'c' +Subject length lower bound = 3 +No set of starting bytes +Compiled pattern written to testsavedregex +Study data written to testsavedregex +testsavedregex +Capturing subpattern count = 0 +No options +First char = 'a' +Need char = 'c' +Compiled pattern written to testsavedregex +testsavedregex +Capturing subpattern count = 1 +No options +No first char No need char Subject length lower bound = 1 Starting byte set: a b -Compiled regex written to testsavedregex +Compiled pattern written to testsavedregex Study data written to testsavedregex testsavedregex +Capturing subpattern count = 1 +No options +No first char +No need char +Compiled pattern written to testsavedregex +testsavedregex Capturing subpattern count = 1 No options @@ -5537,10 +5694,10 @@ No need char Subject length lower bound = 1 Starting byte set: a b -Compiled regex written to testsavedregex +Compiled pattern written to testsavedregex Study data written to testsavedregex testsavedregex +Capturing subpattern count = 1 +No options +No first char +No need char +Compiled pattern written to testsavedregex +(.)*~smgI Capturing subpattern count = 3 Max back reference = 1 Options: multiline dotall First char = '<' Need char = '>' - \n\n\nPartner der LCO\nde\nPartner der LINEAS Consulting\nGmbH\nLINEAS Consulting GmbH Hamburg\nPartnerfirmen\n30 days\nindex,follow\n\nja\n3\nPartner\n\n\nLCO\nLINEAS Consulting\n15.10.2003\n\n\n\n\nDie Partnerfirmen der LINEAS Consulting\nGmbH\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n + \J1024\n\n\nPartner der LCO\nde\nPartner der LINEAS Consulting\nGmbH\nLINEAS Consulting GmbH Hamburg\nPartnerfirmen\n30 days\nindex,follow\n\nja\n3\nPartner\n\n\nLCO\nLINEAS Consulting\n15.10.2003\n\n\n\n\nDie Partnerfirmen der LINEAS Consulting\nGmbH\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n 0: \x0a\x0aPartner der LCO\x0ade\x0aPartner der LINEAS Consulting\x0aGmbH\x0aLINEAS Consulting GmbH Hamburg\x0aPartnerfirmen\x0a30 days\x0aindex,follow\x0a\x0aja\x0a3\x0aPartner\x0a\x0a\x0aLCO\x0aLINEAS Consulting\x0a15.10.2003\x0a\x0a\x0a\x0a\x0aDie Partnerfirmen der LINEAS Consulting\x0aGmbH\x0a\x0a\x0a \x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a 1: seite 2: \x0a @@ -5606,24 +5781,6 @@ line one\nthis is a line\nbreak in the second line No match -/ab.cd/P - ab-cd - 0: ab-cd - ab=cd - 0: ab=cd - ** Failers -No match: POSIX code 17: match failed - ab\ncd -No match: POSIX code 17: match failed - -/ab.cd/Ps - ab-cd - 0: ab-cd - ab=cd - 0: ab=cd - ab\ncd - 0: ab\x0acd - /(?i)(?-i)AbCd/I Capturing subpattern count = 0 No options @@ -5916,21 +6073,10 @@ ((this)) 0: ((this)) -/a(b)c/PN - abc -Matched with REG_NOSUB - -/a(?Pb)c/PN - abc -Matched with REG_NOSUB - -/\x{100}/I -Failed: character value in \x{...} sequence is too large at offset 6 - /\x{0000ff}/I Capturing subpattern count = 0 No options -First char = 255 +First char = \xff No need char /^((?Pa1)|(?Pa2)b)/I @@ -6040,7 +6186,7 @@ 0: a1 1: a1 2: a1 -copy substring Z failed -7 +get substring Z failed -7 G a1 (2) A /^(?Pa)(?Pb)/IJ @@ -6072,7 +6218,7 @@ G a (1) A cd\GA 0: cd -copy substring A failed -7 +get substring A failed -7 /^(?Pa)(?Pb)|cd(?Pef)(?Pgh)/IJ Capturing subpattern count = 4 @@ -6240,9 +6386,6 @@ 9: 10: Y -/\777/I -Failed: octal value is greater than \377 (not in UTF-8 mode) at offset 3 - /\s*,\s*/IS Capturing subpattern count = 0 No options @@ -6674,8 +6817,8 @@ ------------------------------------------------------------------ Bra ^ - a* - NC A + /i a* + /i A \d Ket End @@ -7303,8 +7446,8 @@ /[^a]+a/BZi ------------------------------------------------------------------ Bra - [^A]++ - NC a + /i [^a]++ + /i a Ket End ------------------------------------------------------------------ @@ -7312,8 +7455,8 @@ /[^a]+A/BZi ------------------------------------------------------------------ Bra - [^A]++ - NC A + /i [^a]++ + /i A Ket End ------------------------------------------------------------------ @@ -7508,9 +7651,7 @@ ------------------------------------------------------------------ Bra ^ - Once Recurse - Ket [()] CBra 1 Ket @@ -7544,9 +7685,7 @@ ------------------------------------------------------------------ Bra ^ - Once Recurse - Ket () CBra 1 Ket @@ -7558,9 +7697,7 @@ ------------------------------------------------------------------ Bra ^ - Once Recurse - Ket [(\]a] CBra 1 Ket @@ -7573,9 +7710,7 @@ ------------------------------------------------------------------ Bra ^ - Once Recurse - Ket CBra 1 Ket Ket @@ -7707,9 +7842,6 @@ First char = 'x' Need char = 'z' -/(?(DEFINE) abc){3} xyz/x -Failed: repeating a DEFINE group is not allowed at offset 17 - /(a|)*\d/ \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa No match @@ -8027,10 +8159,8 @@ Alt c Ket - Once Recurse Ket - Ket End ------------------------------------------------------------------ abc @@ -8041,9 +8171,7 @@ ------------------------------------------------------------------ Bra xy - Once Recurse - Ket CBra 1 abc Ket @@ -8273,66 +8401,6 @@ 3: 4: x -/[\h]/BZ ------------------------------------------------------------------- - Bra - [\x09 \xa0] - Ket - End ------------------------------------------------------------------- - >\x09< - 0: \x09 - -/[\h]+/BZ ------------------------------------------------------------------- - Bra - [\x09 \xa0]+ - Ket - End ------------------------------------------------------------------- - >\x09\x20\xa0< - 0: \x09 \xa0 - -/[\v]/BZ ------------------------------------------------------------------- - Bra - [\x0a-\x0d\x85] - Ket - End ------------------------------------------------------------------- - -/[\H]/BZ ------------------------------------------------------------------- - Bra - [\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff] - Ket - End ------------------------------------------------------------------- - -/[^\h]/BZ ------------------------------------------------------------------- - Bra - [\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff] (neg) - Ket - End ------------------------------------------------------------------- - -/[\V]/BZ ------------------------------------------------------------------- - Bra - [\x00-\x09\x0e-\x84\x86-\xff] - Ket - End ------------------------------------------------------------------- - -/[\x0a\V]/BZ ------------------------------------------------------------------- - Bra - [\x00-\x0a\x0e-\x84\x86-\xff] - Ket - End ------------------------------------------------------------------- - /\H++X/BZ ------------------------------------------------------------------ Bra @@ -8524,7 +8592,7 @@ ------------------------------------------------------------------ /\( (?: [^()]* | (?R) )* \)/x -(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0) +\J1024(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0) 0: (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0) /[\E]AAA/ @@ -8706,8 +8774,13 @@ /\g6666666666/ Failed: number is too big at offset 11 -/[\g6666666666]/ -Failed: number is too big at offset 12 +/[\g6666666666]/BZ +------------------------------------------------------------------ + Bra + [6g] + Ket + End +------------------------------------------------------------------ /(?1)\c[/ Failed: reference to non-existent subpattern at offset 3 @@ -9013,6 +9086,12 @@ /\k{}/ Failed: subpattern name expected at offset 3 +/\k/ +Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 2 + +/\kabc/ +Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 5 + /(?P=)/ Failed: subpattern name expected at offset 4 @@ -9234,14 +9313,6 @@ First char at start or follows newline No need char -/a?|b?/P - abc - 0: a - ** Failers - 0: - ddd\N -No match: POSIX code 17: match failed - /xyz/C xyz --->xyz @@ -9636,14 +9707,6 @@ abc\P\P 0: abc -/\w+A/P - CDAAAAB - 0: CDAAAA - -/\w+A/PU - CDAAAAB - 0: CDA - /abc\K123/ xyzabc123pqr 0: 123 @@ -9671,12 +9734,8 @@ /(?&word)(?&element)(?(DEFINE)(?<[^m][^>]>[^<])(?\w*+))/BZ ------------------------------------------------------------------ Bra - Once Recurse - Ket - Once Recurse - Ket Cond Cond def CBra 1 @@ -9697,12 +9756,8 @@ /(?&word)(?&element)(?(DEFINE)(?<[^\d][^>]>[^<])(?\w*+))/BZ ------------------------------------------------------------------ Bra - Once Recurse - Ket - Once Recurse - Ket Cond Cond def CBra 1 @@ -10044,210 +10099,6 @@ Subject length lower bound = 22 No set of starting bytes -/ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional leading comment -(?: (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # one word, optionally followed by.... -(?: -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... -\( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) | # comments, or... - -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -# quoted strings -)* -< (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # leading < -(?: @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* - -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* , (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -)* # further okay, if led by comma -: # closing colon -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* )? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address spec -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* > # trailing > -# name and address -) (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional trailing comment -/xSI -Capturing subpattern count = 0 -Contains explicit CR or LF match -Options: extended -No first char -No need char -Subject length lower bound = 3 -Starting byte set: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8 - 9 = ? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ^ _ ` a b c d e - f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f - /]{0,})>]{0,})>([\d]{0,}\.)(.*)((
([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/isIS Capturing subpattern count = 11 Options: caseless dotall @@ -10443,12 +10294,10 @@ Cond nrecurse 1 $ Alt - Once Recurse Ket Ket Ket - Ket End ------------------------------------------------------------------ Capturing subpattern count = 4 @@ -10586,11 +10435,9 @@ /(?i)a(?-i)b|c/BZ ------------------------------------------------------------------ Bra - NC a - 00 Opt + /i a b Alt - 00 Opt c Ket End @@ -10609,12 +10456,9 @@ /(?i)a(?s)b|c/BZ ------------------------------------------------------------------ Bra - NC a - 05 Opt - NC b + /i ab Alt - 05 Opt - NC c + /i c Ket End ------------------------------------------------------------------ @@ -10622,11 +10466,9 @@ /(?i)a(?s-i)b|c/BZ ------------------------------------------------------------------ Bra - NC a - 04 Opt + /i a b Alt - 04 Opt c Ket End @@ -10673,12 +10515,10 @@ ------------------------------------------------------------------ Bra ^ - Once - Brazero - Once + Braposzero + SBraPos Recurse - KetRmax - Ket + KetRpos Cond Cond def CBra 1 @@ -10767,152 +10607,22 @@ AC No match -/--- A whole lot of tests of verbs with arguments are here rather than in test - 11 because Perl doesn't seem to follow its specification entirely - correctly. ---/ - -/--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is - not clear how Perl defines "involved in the failure of the match". ---/ - -/^(A(*THEN:A)B|C(*THEN:B)D)/K - AB - 0: AB - 1: AB - CD - 0: CD - 1: CD - ** Failers -No match - AC -No match - CB -No match, mark = B - -/--- Check the use of names for success and failure. PCRE doesn't show these -names for success, though Perl does, contrary to its spec. ---/ - -/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K - AB - 0: AB - 1: AB - CD - 0: CD - 1: CD - ** Failers -No match - AC -No match, mark = A - CB -No match, mark = B - -/--- An empty name does not pass back an empty string. It is the same as if no -name were given. ---/ - -/^(A(*PRUNE:)B|C(*PRUNE:B)D)/K - AB - 0: AB - 1: AB - CD - 0: CD - 1: CD - -/--- PRUNE goes to next bumpalong; COMMIT does not. ---/ - -/A(*PRUNE:A)B/K - ACAB - 0: AB - -/(*MARK:A)(*PRUNE:B)(C|X)/K - C - 0: C - 1: C -MK: A - D -No match, mark = B - -/(*MARK:A)(*THEN:B)(C|X)/K - C - 0: C - 1: C -MK: A - D -No match, mark = B - -/--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/ - -/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK - AAAC -No match - -/--- Same --/ - -/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK - AAAC -No match - /--- This should fail; the SKIP advances by one, but when we get to AC, the - PRUNE kills it. ---/ + PRUNE kills it. Perl behaves differently. ---/ /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK AAAC -No match - -/A(*:A)A+(*SKIP)(B|Z) | AC/xK - AAAC -No match - -/--- This should fail, as a null name is the same as no name ---/ - -/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK - AAAC -No match - -/--- This fails in PCRE, and I think that is in accordance with Perl's - documentation, though in Perl it succeeds. ---/ - -/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK - AAAC -No match +No match, mark = A -/--- Mark names can be duplicated ---/ +/--- Mark names can be duplicated. Perl doesn't give a mark for this one, +though PCRE does. ---/ -/A(*:A)B|X(*:A)Y/K - AABC - 0: AB -MK: A - XXYZ - 0: XY -MK: A - /^A(*:A)B|^X(*:A)Y/K ** Failers No match XAQQ No match, mark = A -/--- A check on what happens after hitting a mark and them bumping along to -something that does not even start. Perl reports tags after the failures here, -though it does not when the individual letters are made into something -more complicated. ---/ - -/A(*:A)B|XX(*:B)Y/K - AABC - 0: AB -MK: A - XXYZ - 0: XXY -MK: B - ** Failers -No match - XAQQ -No match - XAQQXZZ -No match - AXQQQ -No match - AXXQQQ -No match - /--- COMMIT at the start of a pattern should be the same as an anchor. Perl optimizations defeat this. So does the PCRE optimization unless we disable it with \Y. ---/ @@ -10925,132 +10635,12 @@ DEFGABC\Y No match -/--- Repeat some tests with added studying. ---/ - -/A(*COMMIT)B/+KS - ACABX +/^(ab (c+(*THEN)cd) | xyz)/x + abcccd No match - -/A(*THEN)B|A(*THEN)C/KS - AC - 0: AC -/A(*PRUNE)B|A(*PRUNE)C/KS - AC -No match - -/^(A(*THEN:A)B|C(*THEN:B)D)/KS - AB - 0: AB - 1: AB - CD - 0: CD - 1: CD - ** Failers -No match - AC -No match - CB -No match, mark = B - -/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS - AB - 0: AB - 1: AB - CD - 0: CD - 1: CD - ** Failers -No match - AC -No match, mark = A - CB -No match, mark = B - -/^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS - AB - 0: AB - 1: AB - CD - 0: CD - 1: CD - -/A(*PRUNE:A)B/KS - ACAB - 0: AB - -/(*MARK:A)(*PRUNE:B)(C|X)/KS - C - 0: C - 1: C -MK: A - D -No match - -/(*MARK:A)(*THEN:B)(C|X)/KS - C - 0: C - 1: C -MK: A - D -No match - -/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS - AAAC -No match - -/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS - AAAC -No match - -/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS - AAAC -No match - -/A(*:A)A+(*SKIP)(B|Z) | AC/xKS - AAAC -No match - -/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS - AAAC -No match - -/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS - AAAC -No match - -/A(*:A)B|XX(*:B)Y/KS - AABC - 0: AB -MK: A - XXYZ - 0: XXY -MK: B - ** Failers -No match - XAQQ -No match - XAQQXZZ -No match - AXQQQ -No match - AXXQQQ -No match - -/(*COMMIT)ABC/ - ABCDEFG - 0: ABC - ** Failers -No match - DEFGABC\Y -No match - -/^(ab (c+(*THEN)cd) | xyz)/x - abcccd -No match - -/^(ab (c+(*PRUNE)cd) | xyz)/x - abcccd +/^(ab (c+(*PRUNE)cd) | xyz)/x + abcccd No match /^(ab (c+(*FAIL)cd) | xyz)/x @@ -11165,11 +10755,76 @@ /\s*\R/BZ ------------------------------------------------------------------ Bra - \s*+ + \s* + \R + Ket + End +------------------------------------------------------------------ + \x20\x0a + 0: \x0a + \x20\x0d + 0: \x0d + \x20\x0d\x0a + 0: \x0d\x0a + +/\S*\R/BZ +------------------------------------------------------------------ + Bra + \S*+ + \R + Ket + End +------------------------------------------------------------------ + a\x0a + 0: a\x0a + +/X\h*\R/BZ +------------------------------------------------------------------ + Bra + X + \h*+ + \R + Ket + End +------------------------------------------------------------------ + X\x20\x0a + 0: X \x0a + +/X\H*\R/BZ +------------------------------------------------------------------ + Bra + X + \H* + \R + Ket + End +------------------------------------------------------------------ + X\x0d\x0a + 0: X\x0d\x0a + +/X\H+\R/BZ +------------------------------------------------------------------ + Bra + X + \H+ + \R + Ket + End +------------------------------------------------------------------ + X\x0d\x0a + 0: X\x0d\x0a + +/X\H++\R/BZ +------------------------------------------------------------------ + Bra + X + \H++ \R Ket End ------------------------------------------------------------------ + X\x0d\x0a +No match /-- Perl treats this one differently, not failing the second string. I believe that is a bug in Perl. --/ @@ -11251,9 +10906,9 @@ abc\>3 No match abc\>4 -Error -24 +Error -24 (bad offset value) abc\>-4 -Error -24 +Error -24 (bad offset value) /^\cģ/ Failed: \c must be followed by an ASCII character at offset 3 @@ -11305,4 +10960,1405 @@ End ------------------------------------------------------------------ +/-- These tests are here because Perl gets the first one wrong. --/ + +/(\R*)(.)/s + \r\n + 0: \x0d + 1: + 2: \x0d + \r\r\n\n\r + 0: \x0d\x0d\x0a\x0a\x0d + 1: \x0d\x0d\x0a\x0a + 2: \x0d + \r\r\n\n\r\n + 0: \x0d\x0d\x0a\x0a\x0d + 1: \x0d\x0d\x0a\x0a + 2: \x0d + +/(\R)*(.)/s + \r\n + 0: \x0d + 1: + 2: \x0d + \r\r\n\n\r + 0: \x0d\x0d\x0a\x0a\x0d + 1: \x0a + 2: \x0d + \r\r\n\n\r\n + 0: \x0d\x0d\x0a\x0a\x0d + 1: \x0a + 2: \x0d + +/((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s + \r\n + 0: \x0d + 1: + 2: \x0d + \r\r\n\n\r + 0: \x0d\x0d\x0a\x0a\x0d + 1: \x0d\x0d\x0a\x0a + 2: \x0d + \r\r\n\n\r\n + 0: \x0d\x0d\x0a\x0a\x0d + 1: \x0d\x0d\x0a\x0a + 2: \x0d + +/-- --/ + +/^abc$/BZ +------------------------------------------------------------------ + Bra + ^ + abc + $ + Ket + End +------------------------------------------------------------------ + +/^abc$/BZm +------------------------------------------------------------------ + Bra + /m ^ + abc + /m $ + Ket + End +------------------------------------------------------------------ + +/^(a)*+(\w)/S + aaaaX + 0: aaaaX + 1: a + 2: X + ** Failers +No match + aaaa +No match + +/^(?:a)*+(\w)/S + aaaaX + 0: aaaaX + 1: X + ** Failers +No match + aaaa +No match + +/(a)++1234/SDZ +------------------------------------------------------------------ + Bra + CBraPos 1 + a + KetRpos + 1234 + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 1 +No options +First char = 'a' +Need char = '4' +Subject length lower bound = 5 +No set of starting bytes + +/([abc])++1234/SI +Capturing subpattern count = 1 +No options +No first char +Need char = '4' +Subject length lower bound = 5 +Starting byte set: a b c + +/(?<=(abc)+)X/ +Failed: lookbehind assertion is not fixed length at offset 10 + +/(^ab)/I +Capturing subpattern count = 1 +Options: anchored +No first char +No need char + +/(^ab)++/I +Capturing subpattern count = 1 +Options: anchored +No first char +No need char + +/(^ab|^)+/I +Capturing subpattern count = 1 +Options: anchored +No first char +No need char + +/(^ab|^)++/I +Capturing subpattern count = 1 +Options: anchored +No first char +No need char + +/(?:^ab)/I +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/(?:^ab)++/I +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/(?:^ab|^)+/I +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/(?:^ab|^)++/I +Capturing subpattern count = 0 +Options: anchored +No first char +No need char + +/(.*ab)/I +Capturing subpattern count = 1 +No options +First char at start or follows newline +Need char = 'b' + +/(.*ab)++/I +Capturing subpattern count = 1 +No options +First char at start or follows newline +Need char = 'b' + +/(.*ab|.*)+/I +Capturing subpattern count = 1 +No options +First char at start or follows newline +No need char + +/(.*ab|.*)++/I +Capturing subpattern count = 1 +No options +First char at start or follows newline +No need char + +/(?:.*ab)/I +Capturing subpattern count = 0 +No options +First char at start or follows newline +Need char = 'b' + +/(?:.*ab)++/I +Capturing subpattern count = 0 +No options +First char at start or follows newline +Need char = 'b' + +/(?:.*ab|.*)+/I +Capturing subpattern count = 0 +No options +First char at start or follows newline +No need char + +/(?:.*ab|.*)++/I +Capturing subpattern count = 0 +No options +First char at start or follows newline +No need char + +/(?=a)[bcd]/I +Capturing subpattern count = 0 +No options +First char = 'a' +No need char + +/((?=a))[bcd]/I +Capturing subpattern count = 1 +No options +First char = 'a' +No need char + +/((?=a))+[bcd]/I +Capturing subpattern count = 1 +No options +First char = 'a' +No need char + +/((?=a))++[bcd]/I +Capturing subpattern count = 1 +No options +First char = 'a' +No need char + +/(?=a+)[bcd]/iI +Capturing subpattern count = 0 +Options: caseless +First char = 'a' (caseless) +No need char + +/(?=a+?)[bcd]/iI +Capturing subpattern count = 0 +Options: caseless +First char = 'a' (caseless) +No need char + +/(?=a++)[bcd]/iI +Capturing subpattern count = 0 +Options: caseless +First char = 'a' (caseless) +No need char + +/(?=a{3})[bcd]/iI +Capturing subpattern count = 0 +Options: caseless +First char = 'a' (caseless) +Need char = 'a' (caseless) + +/(abc)\1+/S + +/-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/ + +/(?1)(?:(b(*ACCEPT))){0}/ + b + 0: b + +/(?1)(?:(b(*ACCEPT))){0}c/ + bc + 0: bc + ** Failers +No match + b +No match + +/(?1)(?:((*ACCEPT))){0}c/ + c + 0: c + c\N + 0: c + +/^.*?(?(?=a)a|b(*THEN)c)/ + ba +No match + +/^.*?(?(?=a)a|bc)/ + ba + 0: ba + +/^.*?(?(?=a)a(*THEN)b|c)/ + ac +No match + +/^.*?(?(?=a)a(*THEN)b)c/ + ac +No match + +/^.*?(a(*THEN)b)c/ + aabc +No match + +/^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x + aabc + 0: aabc + +/^.*?(a(*THEN)b|z)c/ + aabc + 0: aabc + 1: ab + +/^.*?(z|a(*THEN)b)c/ + aabc + 0: aabc + 1: ab + +/-- --/ + +/-- These studied versions are here because they are not Perl-compatible; the + studying means the mark is not seen. --/ + +/(*MARK:A)(*SKIP:B)(C|X)/KS + C + 0: C + 1: C +MK: A + D +No match, mark = A + +/(*:A)A+(*SKIP:A)(B|Z)/KS + AAAC +No match, mark = A + +/-- --/ + +"(?=a*(*ACCEPT)b)c" + c + 0: c + c\N + 0: c + +/(?1)c(?(DEFINE)((*ACCEPT)b))/ + c + 0: c + c\N + 0: c + +/(?>(*ACCEPT)b)c/ + c + 0: + c\N +No match + +/(?:(?>(a)))+a%/++ + %aa% + 0: aa% + 0+ + 1: a + 1+ a% + +/(a)b|ac/++SS + ac\O3 +Matched, but too many substrings + 0: ac + 0+ + +/(a)(b)x|abc/++ + abc\O6 + 0: abc + 0+ + +/(a)bc|(a)(b)\2/ + \O3abc +Matched, but too many substrings + 0: abc + \O4abc +Matched, but too many substrings + 0: abc + +/(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI +Capturing subpattern count = 2 +No options +No first char +No need char +Subject length lower bound = 1 +No set of starting bytes + +/(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI +Capturing subpattern count = 2 +No options +No first char +No need char +Subject length lower bound = 3 +Starting byte set: a b + +/(a(?2)|b)(b(?1)|a)(?1)(?2)/SI +Capturing subpattern count = 2 +No options +No first char +No need char +Subject length lower bound = 4 +Starting byte set: a b + +/(abc)(?1)/SI +Capturing subpattern count = 1 +No options +First char = 'a' +Need char = 'c' +Subject length lower bound = 6 +No set of starting bytes + +/^(?>a)++/ + aa\M +Minimum match() limit = 5 +Minimum match() recursion limit = 2 + 0: aa + aaaaaaaaa\M +Minimum match() limit = 12 +Minimum match() recursion limit = 2 + 0: aaaaaaaaa + +/(a)(?1)++/ + aa\M +Minimum match() limit = 7 +Minimum match() recursion limit = 4 + 0: aa + 1: a + aaaaaaaaa\M +Minimum match() limit = 21 +Minimum match() recursion limit = 4 + 0: aaaaaaaaa + 1: a + +/(?:(foo)|(bar)|(baz))X/SS= + bazfooX + 0: fooX + 1: foo + 2: + 3: + foobazbarX + 0: barX + 1: + 2: bar + 3: + barfooX + 0: fooX + 1: foo + 2: + 3: + bazX + 0: bazX + 1: + 2: + 3: baz + foobarbazX + 0: bazX + 1: + 2: + 3: baz + bazfooX\O0 +Matched, but too many substrings + bazfooX\O2 +Matched, but too many substrings + 0: fooX + bazfooX\O4 +Matched, but too many substrings + 0: fooX + 1: + bazfooX\O6 +Matched, but too many substrings + 0: fooX + 1: foo + 2: + bazfooX\O8 +Matched, but too many substrings + 0: fooX + 1: foo + 2: + 3: + bazfooX\O10 + 0: fooX + 1: foo + 2: + 3: + +/(?=abc){3}abc/BZ +------------------------------------------------------------------ + Bra + Assert + abc + Ket + abc + Ket + End +------------------------------------------------------------------ + +/(?=abc)+abc/BZ +------------------------------------------------------------------ + Bra + Assert + abc + Ket + abc + Ket + End +------------------------------------------------------------------ + +/(?=abc)++abc/BZ +------------------------------------------------------------------ + Bra + Assert + abc + Ket + abc + Ket + End +------------------------------------------------------------------ + +/(?=abc){0}xyz/BZ +------------------------------------------------------------------ + Bra + Skip zero + Assert + abc + Ket + xyz + Ket + End +------------------------------------------------------------------ + +/(?=(a))?./BZ +------------------------------------------------------------------ + Bra + Brazero + Assert + CBra 1 + a + Ket + Ket + Any + Ket + End +------------------------------------------------------------------ + +/(?=(a))??./BZ +------------------------------------------------------------------ + Bra + Braminzero + Assert + CBra 1 + a + Ket + Ket + Any + Ket + End +------------------------------------------------------------------ + +/^(?=(a)){0}b(?1)/BZ +------------------------------------------------------------------ + Bra + ^ + Skip zero + Assert + CBra 1 + a + Ket + Ket + b + Recurse + Ket + End +------------------------------------------------------------------ + +/(?(DEFINE)(a))?b(?1)/BZ +------------------------------------------------------------------ + Bra + Cond + Cond def + CBra 1 + a + Ket + Ket + b + Recurse + Ket + End +------------------------------------------------------------------ + +/^(?=(?1))?[az]([abc])d/BZ +------------------------------------------------------------------ + Bra + ^ + Brazero + Assert + Recurse + Ket + [az] + CBra 1 + [a-c] + Ket + d + Ket + End +------------------------------------------------------------------ + +/^(?!a){0}\w+/BZ +------------------------------------------------------------------ + Bra + ^ + Skip zero + Assert not + a + Ket + \w+ + Ket + End +------------------------------------------------------------------ + +/(?<=(abc))?xyz/BZ +------------------------------------------------------------------ + Bra + Brazero + AssertB + Reverse + CBra 1 + abc + Ket + Ket + xyz + Ket + End +------------------------------------------------------------------ + +/[:a[:abc]b:]/BZ +------------------------------------------------------------------ + Bra + [:[a-c] + b:] + Ket + End +------------------------------------------------------------------ + +/((?2))((?1))/SS + abc +Error -26 (nested recursion at the same subject position) + +/((?(R2)a+|(?1)b))/SS + aaaabcde +Error -26 (nested recursion at the same subject position) + +/(?(R)a*(?1)|((?R))b)/SS + aaaabcde +Error -26 (nested recursion at the same subject position) + +/(a+|(?R)b)/ +Failed: recursive call could loop indefinitely at offset 7 + +/^(a(*:A)(d|e(*:B))z|aeq)/C + adz +--->adz + +0 ^ ^ + +1 ^ (a(*:A)(d|e(*:B))z|aeq) + +2 ^ a + +3 ^^ (*:A) + +8 ^^ (d|e(*:B)) +Latest Mark: A + +9 ^^ d ++10 ^ ^ | ++18 ^ ^ z ++19 ^ ^ | ++24 ^ ^ + 0: adz + 1: adz + 2: d + aez +--->aez + +0 ^ ^ + +1 ^ (a(*:A)(d|e(*:B))z|aeq) + +2 ^ a + +3 ^^ (*:A) + +8 ^^ (d|e(*:B)) +Latest Mark: A + +9 ^^ d ++11 ^^ e ++12 ^ ^ (*:B) ++17 ^ ^ ) +Latest Mark: B ++18 ^ ^ z ++19 ^ ^ | ++24 ^ ^ + 0: aez + 1: aez + 2: e + aeqwerty +--->aeqwerty + +0 ^ ^ + +1 ^ (a(*:A)(d|e(*:B))z|aeq) + +2 ^ a + +3 ^^ (*:A) + +8 ^^ (d|e(*:B)) +Latest Mark: A + +9 ^^ d ++11 ^^ e ++12 ^ ^ (*:B) ++17 ^ ^ ) +Latest Mark: B ++18 ^ ^ z ++20 ^ a ++21 ^^ e ++22 ^ ^ q ++23 ^ ^ ) ++24 ^ ^ + 0: aeq + 1: aeq + +/.(*F)/ + \P\Pabc +No match + +/\btype\b\W*?\btext\b\W*?\bjavascript\b/IS +Capturing subpattern count = 0 +No options +First char = 't' +Need char = 't' +Max lookbehind = 1 +Subject length lower bound = 18 +No set of starting bytes + +/\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|a+)(?>(z+))\w/BZ +------------------------------------------------------------------ + Bra + ^ + Once_NC + a+ + Ket + Once + CBra 1 + z+ + Ket + Ket + \w + Ket + End +------------------------------------------------------------------ + aaaazzzzb + 0: aaaazzzzb + 1: zzzz + ** Failers +No match + aazz +No match + +/(.)(\1|a(?2))/ + bab + 0: bab + 1: b + 2: ab + +/\1|(.)(?R)\1/ + cbbbc + 0: cbbbc + 1: c + +/(.)((?(1)c|a)|a(?2))/ + baa +No match + +/(?P(?P=abn)xxx)/BZ +------------------------------------------------------------------ + Bra + Once + CBra 1 + \1 + xxx + Ket + Ket + Ket + End +------------------------------------------------------------------ + +/(a\1z)/BZ +------------------------------------------------------------------ + Bra + Once + CBra 1 + a + \1 + z + Ket + Ket + Ket + End +------------------------------------------------------------------ + +/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/ + \Maabbccddee +Minimum match() limit = 12 +Minimum match() recursion limit = 3 + 0: aabbccddee + +/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/ + \Maabbccddee +Minimum match() limit = 22 +Minimum match() recursion limit = 21 + 0: aabbccddee + 1: aa + 2: bb + 3: cc + 4: dd + 5: ee + +/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/ + \Maabbccddee +Minimum match() limit = 18 +Minimum match() recursion limit = 13 + 0: aabbccddee + 1: aa + 2: cc + 3: ee + +/^a\x41z/ + aAz + 0: aAz + *** Failers +No match + ax41z +No match + +/^a[m\x41]z/ + aAz + 0: aAz + +/^a\x1z/ + ax1z + 0: ax1z + +/^a\u0041z/ + aAz + 0: aAz + *** Failers +No match + au0041z +No match + +/^a[m\u0041]z/ + aAz + 0: aAz + +/^a\u041z/ + au041z + 0: au041z + *** Failers +No match + aAz +No match + +/^a\U0041z/ + aU0041z + 0: aU0041z + *** Failers +No match + aAz +No match + +/(?(?=c)c|d)++Y/BZ +------------------------------------------------------------------ + Bra + BraPos + Cond + Assert + c + Ket + c + Alt + d + Ket + KetRpos + Y + Ket + End +------------------------------------------------------------------ + +/(?(?=c)c|d)*+Y/BZ +------------------------------------------------------------------ + Bra + Braposzero + BraPos + Cond + Assert + c + Ket + c + Alt + d + Ket + KetRpos + Y + Ket + End +------------------------------------------------------------------ + +/a[\NB]c/ +Failed: \N is not supported in a class at offset 3 + +/a[B-\Nc]/ +Failed: \N is not supported in a class at offset 5 + +/(a)(?2){0,1999}?(b)/ + +/(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/ + +/--- This test, with something more complicated than individual letters, causes +different behaviour in Perl. Perhaps it disables some optimization; no tag is +passed back for the failures, whereas in PCRE there is a tag. ---/ + +/(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK + AABC + 0: AB + 1: A + 2: B +MK: A + XXYZ + 0: XXY + 1: + 2: + 3: X + 4: X + 5: Y +MK: B + ** Failers +No match + XAQQ +No match, mark = A + XAQQXZZ +No match, mark = A + AXQQQ +No match, mark = A + AXXQQQ +No match, mark = B + +/-- Perl doesn't give marks for these, though it does if the alternatives are +replaced by single letters. --/ + +/(b|q)(*:m)f|a(*:n)w/K + aw + 0: aw +MK: n + ** Failers +No match, mark = n + abc +No match, mark = m + +/(q|b)(*:m)f|a(*:n)w/K + aw + 0: aw +MK: n + ** Failers +No match, mark = n + abc +No match, mark = m + +/-- After a partial match, the behaviour is as for a failure. --/ + +/^a(*:X)bcde/K + abc\P +Partial match, mark=X: abc + +/-- These are here because Perl doesn't return a mark, except for the first --/ + +/(?=(*:x))(q|)/K+ + abc + 0: + 0+ abc + 1: +MK: x + +/(?=(*:x))((*:y)q|)/K+ + abc + 0: + 0+ abc + 1: +MK: x + +/(?=(*:x))(?:(*:y)q|)/K+ + abc + 0: + 0+ abc +MK: x + +/(?=(*:x))(?>(*:y)q|)/K+ + abc + 0: + 0+ abc +MK: x + +/(?=a(*:x))(?!a(*:y)c)/K+ + ab + 0: + 0+ ab +MK: x + +/(?=a(*:x))(?=a(*:y)c|)/K+ + ab + 0: + 0+ ab +MK: x + +/(..)\1/ + ab\P +Partial match: ab + aba\P +Partial match: aba + abab\P + 0: abab + 1: ab + +/(..)\1/i + ab\P +Partial match: ab + abA\P +Partial match: abA + aBAb\P + 0: aBAb + 1: aB + +/(..)\1{2,}/ + ab\P +Partial match: ab + aba\P +Partial match: aba + abab\P +Partial match: abab + ababa\P +Partial match: ababa + ababab\P + 0: ababab + 1: ab + ababab\P\P +Partial match: ababab + abababa\P + 0: ababab + 1: ab + abababa\P\P +Partial match: abababa + +/(..)\1{2,}/i + ab\P +Partial match: ab + aBa\P +Partial match: aBa + aBAb\P +Partial match: aBAb + AbaBA\P +Partial match: AbaBA + abABAb\P + 0: abABAb + 1: ab + aBAbaB\P\P +Partial match: aBAbaB + abABabA\P + 0: abABab + 1: ab + abaBABa\P\P +Partial match: abaBABa + +/(..)\1{2,}?x/i + ab\P +Partial match: ab + abA\P +Partial match: abA + aBAb\P +Partial match: aBAb + abaBA\P +Partial match: abaBA + abAbaB\P +Partial match: abAbaB + abaBabA\P +Partial match: abaBabA + abAbABaBx\P + 0: abAbABaBx + 1: ab + +/^(..)\1/ + aba\P +Partial match: aba + +/^(..)\1{2,3}x/ + aba\P +Partial match: aba + ababa\P +Partial match: ababa + ababa\P\P +Partial match: ababa + abababx + 0: abababx + 1: ab + ababababx + 0: ababababx + 1: ab + +/^(..)\1{2,3}?x/ + aba\P +Partial match: aba + ababa\P +Partial match: ababa + ababa\P\P +Partial match: ababa + abababx + 0: abababx + 1: ab + ababababx + 0: ababababx + 1: ab + +/^(..)(\1{2,3})ab/ + abababab + 0: abababab + 1: ab + 2: abab + +/^\R/ + \r\P + 0: \x0d + \r\P\P +Partial match: \x0d + +/^\R{2,3}x/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + \r\r\P +Partial match: \x0d\x0d + \r\r\P\P +Partial match: \x0d\x0d + \r\r\r\P +Partial match: \x0d\x0d\x0d + \r\r\r\P\P +Partial match: \x0d\x0d\x0d + \r\rx + 0: \x0d\x0dx + \r\r\rx + 0: \x0d\x0d\x0dx + +/^\R{2,3}?x/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + \r\r\P +Partial match: \x0d\x0d + \r\r\P\P +Partial match: \x0d\x0d + \r\r\r\P +Partial match: \x0d\x0d\x0d + \r\r\r\P\P +Partial match: \x0d\x0d\x0d + \r\rx + 0: \x0d\x0dx + \r\r\rx + 0: \x0d\x0d\x0dx + +/^\R?x/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + x + 0: x + \rx + 0: \x0dx + +/^\R+x/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + \r\n\P +Partial match: \x0d\x0a + \r\n\P\P +Partial match: \x0d\x0a + \rx + 0: \x0dx + +/^a$/ + a\r\P +Partial match: a\x0d + a\r\P\P +Partial match: a\x0d + +/^a$/m + a\r\P +Partial match: a\x0d + a\r\P\P +Partial match: a\x0d + +/^(a$|a\r)/ + a\r\P + 0: a\x0d + 1: a\x0d + a\r\P\P +Partial match: a\x0d + +/^(a$|a\r)/m + a\r\P + 0: a\x0d + 1: a\x0d + a\r\P\P +Partial match: a\x0d + +/./ + \r\P + 0: \x0d + \r\P\P +Partial match: \x0d + +/.{2,3}/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + \r\r\P + 0: \x0d\x0d + \r\r\P\P +Partial match: \x0d\x0d + \r\r\r\P + 0: \x0d\x0d\x0d + \r\r\r\P\P +Partial match: \x0d\x0d\x0d + +/.{2,3}?/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + \r\r\P + 0: \x0d\x0d + \r\r\P\P +Partial match: \x0d\x0d + \r\r\r\P + 0: \x0d\x0d + \r\r\r\P\P + 0: \x0d\x0d + +/-- These two are here because Perl does not match: it seems to allow the +COMMIT to escape from the assertion. --/ + +/(?=a(*COMMIT)b|ac)ac|ac/ + ac + 0: ac + +/(?=a(*COMMIT)b|(ac)) ac | (a)c/x + ac + 0: ac + 1: + 2: a + +"AB(C(D))(E(F))?(?(?=\2)(?=\4))" + ABCDGHI\O03 +Matched, but too many substrings + 0: ABCD + +/-- This one is here because Perl does not confine the *COMMIT to the +assertion, and therefore fails the entire subroutine call. --/ + +/((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/ + ac + 0: ac + /-- End of testinput2 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput4 php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput4 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput4 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput4 2012-11-21 05:12:20.000000000 +0000 @@ -1,5 +1,6 @@ -/-- This set of tests if for UTF-8 support, excluding Unicode properties. It is - compatible with all versions of Perl 5. --/ +/-- This set of tests is for UTF support, excluding Unicode properties. It is + compatible with all versions of Perl >= 5.10 and both the 8-bit and 16-bit + PCRE libraries. --/ /a.b/8 acb @@ -255,46 +256,6 @@ XYZ No match -/X(\C{3})/8 - X\x{1234} - 0: X\x{1234} - 1: \x{1234} - -/X(\C{4})/8 - X\x{1234}YZ - 0: X\x{1234}Y - 1: \x{1234}Y - -/X\C*/8 - XYZabcdce - 0: XYZabcdce - -/X\C*?/8 - XYZabcde - 0: X - -/X\C{3,5}/8 - Xabcdefg - 0: Xabcde - X\x{1234} - 0: X\x{1234} - X\x{1234}YZ - 0: X\x{1234}YZ - X\x{1234}\x{512} - 0: X\x{1234}\x{512} - X\x{1234}\x{512}YZ - 0: X\x{1234}\x{512} - -/X\C{3,5}?/8 - Xabcdefg - 0: Xabc - X\x{1234} - 0: X\x{1234} - X\x{1234}YZ - 0: X\x{1234} - X\x{1234}\x{512} - 0: X\x{1234} - /[^a]+/8g bcd 0: bcd @@ -791,22 +752,6 @@ \x{200}X No match -/a\Cb/ - aXb - 0: aXb - a\nb - 0: a\x0ab - -/a\Cb/8 - aXb - 0: aXb - a\nb - 0: a\x{0a}b - -/a\C\Cb/8 - a\x{100}b - 0: a\x{100}b - /[z-\x{100}]/8i z 0: z @@ -1128,4 +1073,22 @@ 0: AA 0: +/(abc)\1/8i + abc +No match + +/(abc)\1/8 + abc +No match + +/a(*:a\x{1234}b)/8K + abc + 0: a +MK: a\x{1234}b + +/a(*:a£b)/8K + abc + 0: a +MK: a\x{a3}b + /-- End of testinput4 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput5 php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput5 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput5 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput5 2012-11-21 05:12:20.000000000 +0000 @@ -1,113 +1,9 @@ -/-- This set of tests checks the API, internals, and non-Perl stuff for UTF-8 - support, excluding Unicode properties. --/ +/-- This set of tests checks the API, internals, and non-Perl stuff for UTF + support, excluding Unicode properties. However, tests that give different + results in 8-bit and 16-bit modes are excluded (see tests 16 and 17). --/ -/\x{100}/8DZ ------------------------------------------------------------------- - Bra - \x{100} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 196 -Need char = 128 - -/\x{1000}/8DZ ------------------------------------------------------------------- - Bra - \x{1000} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 225 -Need char = 128 - -/\x{10000}/8DZ ------------------------------------------------------------------- - Bra - \x{10000} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 240 -Need char = 128 - -/\x{100000}/8DZ ------------------------------------------------------------------- - Bra - \x{100000} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 244 -Need char = 128 - -/\x{1000000}/8DZ ------------------------------------------------------------------- - Bra - \x{1000000} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 249 -Need char = 128 - -/\x{4000000}/8DZ ------------------------------------------------------------------- - Bra - \x{4000000} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 252 -Need char = 128 - -/\x{7fffFFFF}/8DZ ------------------------------------------------------------------- - Bra - \x{7fffffff} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 253 -Need char = 191 - -/[\x{ff}]/8DZ ------------------------------------------------------------------- - Bra - \x{ff} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 195 -Need char = 191 - -/[\x{100}]/8DZ ------------------------------------------------------------------- - Bra - [\x{100}] - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char +/\x{110000}/8DZ +Failed: character value in \x{...} sequence is too large at offset 9 /\x{ffffffff}/8 Failed: character value in \x{...} sequence is too large at offset 11 @@ -115,34 +11,20 @@ /\x{100000000}/8 Failed: character value in \x{...} sequence is too large at offset 12 +/\x{d800}/8 +Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7 + +/\x{dfff}/8 +Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7 + +/\x{d7ff}/8 + +/\x{e000}/8 + /^\x{100}a\x{1234}/8 \x{100}a\x{1234}bcd 0: \x{100}a\x{1234} -/\x80/8DZ ------------------------------------------------------------------- - Bra - \x{80} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 194 -Need char = 128 - -/\xff/8DZ ------------------------------------------------------------------- - Bra - \x{ff} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 195 -Need char = 191 - /\x{0041}\x{2262}\x{0391}\x{002e}/DZ8 ------------------------------------------------------------------ Bra @@ -151,100 +33,12 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf First char = 'A' Need char = '.' \x{0041}\x{2262}\x{0391}\x{002e} 0: A\x{2262}\x{391}. -/\x{D55c}\x{ad6d}\x{C5B4}/DZ8 ------------------------------------------------------------------- - Bra - \x{d55c}\x{ad6d}\x{c5b4} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 237 -Need char = 180 - \x{D55c}\x{ad6d}\x{C5B4} - 0: \x{d55c}\x{ad6d}\x{c5b4} - -/\x{65e5}\x{672c}\x{8a9e}/DZ8 ------------------------------------------------------------------- - Bra - \x{65e5}\x{672c}\x{8a9e} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 230 -Need char = 158 - \x{65e5}\x{672c}\x{8a9e} - 0: \x{65e5}\x{672c}\x{8a9e} - -/\x{80}/DZ8 ------------------------------------------------------------------- - Bra - \x{80} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 194 -Need char = 128 - -/\x{084}/DZ8 ------------------------------------------------------------------- - Bra - \x{84} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 194 -Need char = 132 - -/\x{104}/DZ8 ------------------------------------------------------------------- - Bra - \x{104} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 196 -Need char = 132 - -/\x{861}/DZ8 ------------------------------------------------------------------- - Bra - \x{861} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 224 -Need char = 161 - -/\x{212ab}/DZ8 ------------------------------------------------------------------- - Bra - \x{212ab} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 240 -Need char = 171 - /.{3,5}X/DZ8 ------------------------------------------------------------------ Bra @@ -255,13 +49,12 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char Need char = 'X' \x{212ab}\x{212ab}\x{212ab}\x{861}X 0: \x{212ab}\x{212ab}\x{212ab}\x{861}X - /.{3,5}?/DZ8 ------------------------------------------------------------------ Bra @@ -271,7 +64,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char No need char \x{212ab}\x{212ab}\x{212ab}\x{861} @@ -280,20 +73,6 @@ /(?<=\C)X/8 Failed: \C not allowed in lookbehind assertion at offset 6 -/-- This one is here not because it's different to Perl, but because the way -the captured single-byte is displayed. (In Perl it becomes a character, and you -can't tell the difference.) --/ - -/X(\C)(.*)/8 - X\x{1234} - 0: X\x{1234} - 1: \xe1 - 2: \x88\xb4 - X\nabc - 0: X\x{0a}abc - 1: \x{0a} - 2: abc - /^[ab]/8DZ ------------------------------------------------------------------ Bra @@ -303,7 +82,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: anchored utf8 +Options: anchored utf No first char No need char bar @@ -326,7 +105,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: anchored utf8 +Options: anchored utf No first char No need char c @@ -340,136 +119,6 @@ aaa No match -/[^ab\xC0-\xF0]/8SDZ ------------------------------------------------------------------- - Bra - [\x00-`c-\xbf\xf1-\xff] (neg) - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char -Subject length lower bound = 1 -Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a - \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 - \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 - 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y - Z [ \ ] ^ _ ` c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f - \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 - \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf - \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee - \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd - \xfe \xff - \x{f1} - 0: \x{f1} - \x{bf} - 0: \x{bf} - \x{100} - 0: \x{100} - \x{1000} - 0: \x{1000} - *** Failers - 0: * - \x{c0} -No match - \x{f0} -No match - -/Ā{3,4}/8SDZ ------------------------------------------------------------------- - Bra - \x{100}{3} - \x{100}? - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 196 -Need char = 128 -Subject length lower bound = 3 -No set of starting bytes - \x{100}\x{100}\x{100}\x{100\x{100} - 0: \x{100}\x{100}\x{100} - -/(\x{100}+|x)/8SDZ ------------------------------------------------------------------- - Bra - CBra 1 - \x{100}+ - Alt - x - Ket - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Options: utf8 -No first char -No need char -Subject length lower bound = 1 -Starting byte set: x \xc4 - -/(\x{100}*a|x)/8SDZ ------------------------------------------------------------------- - Bra - CBra 1 - \x{100}*+ - a - Alt - x - Ket - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Options: utf8 -No first char -No need char -Subject length lower bound = 1 -Starting byte set: a x \xc4 - -/(\x{100}{0,2}a|x)/8SDZ ------------------------------------------------------------------- - Bra - CBra 1 - \x{100}{0,2} - a - Alt - x - Ket - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Options: utf8 -No first char -No need char -Subject length lower bound = 1 -Starting byte set: a x \xc4 - -/(\x{100}{1,2}a|x)/8SDZ ------------------------------------------------------------------- - Bra - CBra 1 - \x{100} - \x{100}{0,1} - a - Alt - x - Ket - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Options: utf8 -No first char -No need char -Subject length lower bound = 1 -Starting byte set: x \xc4 - /\x{100}*(\d+|"(?1)")/8 1234 0: 1234 @@ -494,18 +143,6 @@ \x{100}\x{100}abcd No match -/\x{100}/8DZ ------------------------------------------------------------------- - Bra - \x{100} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 196 -Need char = 128 - /\x{100}*/8DZ ------------------------------------------------------------------ Bra @@ -514,7 +151,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char No need char @@ -527,7 +164,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf First char = 'a' No need char @@ -540,36 +177,10 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf First char = 'a' Need char = 'b' -/a\x{100}\x{101}*/8DZ ------------------------------------------------------------------- - Bra - a\x{100} - \x{101}* - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 'a' -Need char = 128 - -/a\x{100}\x{101}+/8DZ ------------------------------------------------------------------- - Bra - a\x{100} - \x{101}+ - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 'a' -Need char = 129 - /\x{100}*A/8DZ ------------------------------------------------------------------ Bra @@ -579,7 +190,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char Need char = 'A' A @@ -590,60 +201,14 @@ Bra \x{100}*+ \d - Once Recurse Ket - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - -/[^\x{c4}]/DZ ------------------------------------------------------------------- - Bra - [^\xc4] - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -No options -No first char -No need char - -/[^\x{c4}]/8DZ ------------------------------------------------------------------- - Bra - [\x00-\xc3\xc5-\xff] (neg) - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - -/[\x{100}]/8DZ ------------------------------------------------------------------- - Bra - [\x{100}] - Ket End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char -No need char - \x{100} - 0: \x{100} - Z\x{100} - 0: \x{100} - \x{100}Z - 0: \x{100} - *** Failers -No match +No need char /[Z\x{100}]/8DZ ------------------------------------------------------------------ @@ -653,7 +218,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char No need char Z\x{100} @@ -688,7 +253,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char No need char @@ -700,7 +265,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char No need char \x{100} @@ -717,25 +282,11 @@ ------------------------------------------------------------------ Capturing subpattern count = 0 No options -First char = 255 +First char = \xff No need char >\xff< 0: \xff -/[\xff]/DZ8 ------------------------------------------------------------------- - Bra - \x{ff} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 195 -Need char = 191 - >\x{ff}< - 0: \x{ff} - /[^\xFF]/DZ ------------------------------------------------------------------ Bra @@ -748,18 +299,6 @@ No first char No need char -/[^\xff]/8DZ ------------------------------------------------------------------- - Bra - [\x00-\xfe] (neg) - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char - /[Ä-Ü]/8 Ö # Matches without Study 0: \x{d6} @@ -784,99 +323,6 @@ \x{d6} 0: \x{d6} -/[]/8 -Failed: invalid UTF-8 string at offset 2 - -//8 -Failed: invalid UTF-8 string at offset 0 - -/xxx/8 -Failed: invalid UTF-8 string at offset 1 - -/xxx/8?DZ ------------------------------------------------------------------- - Bra - \X{c0}\X{c0}\X{c0}xxx - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 no_utf8_check -First char = 195 -Need char = 'x' - -/abc/8 - ] -Error -10 - -Error -10 - -Error -10 - \? -No match - -/anything/8 - \xc0\x80 -Error -10 - \xc1\x8f -Error -10 - \xe0\x9f\x80 -Error -10 - \xf0\x8f\x80\x80 -Error -10 - \xf8\x87\x80\x80\x80 -Error -10 - \xfc\x83\x80\x80\x80\x80 -Error -10 - \xfe\x80\x80\x80\x80\x80 -Error -10 - \xff\x80\x80\x80\x80\x80 -Error -10 - \xc3\x8f -No match - \xe0\xaf\x80 -No match - \xe1\x80\x80 -No match - \xf0\x9f\x80\x80 -No match - \xf1\x8f\x80\x80 -No match - \xf8\x88\x80\x80\x80 -Error -10 - \xf9\x87\x80\x80\x80 -Error -10 - \xfc\x84\x80\x80\x80\x80 -Error -10 - \xfd\x83\x80\x80\x80\x80 -Error -10 - \?\xf8\x88\x80\x80\x80 -No match - \?\xf9\x87\x80\x80\x80 -No match - \?\xfc\x84\x80\x80\x80\x80 -No match - \?\xfd\x83\x80\x80\x80\x80 -No match - -/\x{100}abc(xyz(?1))/8DZ ------------------------------------------------------------------- - Bra - \x{100}abc - CBra 1 - xyz - Once - Recurse - Ket - Ket - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 1 -Options: utf8 -First char = 196 -Need char = 'z' - /[^\x{100}]abc(xyz(?1))/8DZ ------------------------------------------------------------------ Bra @@ -884,15 +330,13 @@ abc CBra 1 xyz - Once Recurse Ket Ket - Ket End ------------------------------------------------------------------ Capturing subpattern count = 1 -Options: utf8 +Options: utf No first char Need char = 'z' @@ -903,15 +347,13 @@ abc CBra 1 xyz - Once Recurse Ket Ket - Ket End ------------------------------------------------------------------ Capturing subpattern count = 1 -Options: utf8 +Options: utf No first char Need char = 'z' @@ -923,9 +365,7 @@ \x{100} CBra 2 b - Once Recurse - Ket c Ket Ket @@ -933,7 +373,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 2 -Options: utf8 +Options: utf No first char No need char @@ -946,9 +386,7 @@ \x{100} CBra 2 b - Once Recurse - Ket c Ket Ket @@ -957,9 +395,7 @@ \x{100} CBra 2 b - Once Recurse - Ket c Ket Ket @@ -968,7 +404,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 2 -Options: utf8 +Options: utf No first char No need char @@ -980,9 +416,7 @@ \x{100} CBra 2 b - Once Recurse - Ket c Ket Ket @@ -990,7 +424,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 2 -Options: utf8 +Options: utf No first char No need char @@ -1003,9 +437,7 @@ \x{100} CBra 2 b - Once Recurse - Ket c Ket Ket @@ -1014,9 +446,7 @@ \x{100} CBra 2 b - Once Recurse - Ket c Ket Ket @@ -1025,7 +455,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 2 -Options: utf8 +Options: utf No first char No need char @@ -1039,10 +469,6 @@ \x{100}X 0: X -/a\x{1234}b/P8 - a\x{1234}b - 0: a\x{1234}b - /^\ሴ/8DZ ------------------------------------------------------------------ Bra @@ -1052,23 +478,10 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: anchored utf8 +Options: anchored utf No first char No need char -/\777/I -Failed: octal value is greater than \377 (not in UTF-8 mode) at offset 3 - -/\777/8I -Capturing subpattern count = 0 -Options: utf8 -First char = 199 -Need char = 191 - \x{1ff} - 0: \x{1ff} - \777 - 0: \x{1ff} - /\x{100}*\d/8DZ ------------------------------------------------------------------ Bra @@ -1078,7 +491,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char No need char @@ -1091,7 +504,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char No need char @@ -1104,7 +517,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char No need char @@ -1117,7 +530,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char No need char @@ -1130,7 +543,7 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char No need char @@ -1143,49 +556,10 @@ End ------------------------------------------------------------------ Capturing subpattern count = 0 -Options: utf8 +Options: utf No first char No need char -/\x{100}+\x{200}/8DZ ------------------------------------------------------------------- - Bra - \x{100}++ - \x{200} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 196 -Need char = 128 - -/\x{100}+X/8DZ ------------------------------------------------------------------- - Bra - \x{100}++ - X - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 196 -Need char = 'X' - -/X+\x{200}/8DZ ------------------------------------------------------------------- - Bra - X++ - \x{200} - Ket - End ------------------------------------------------------------------- -Capturing subpattern count = 0 -Options: utf8 -First char = 'X' -Need char = 128 - /()()()()()()()()()() ()()()()()()()()()() ()()()()()()()()()() @@ -1227,9 +601,6 @@ End ------------------------------------------------------------------ -/^[\QĀ\E-\QŐ\E/BZ8 -Failed: missing terminating ] for character class at offset 15 - /^abc./mgx8 abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x{0085}abc7 \x{2028}abc8 \x{2029}abc9 JUNK 0: abc1 @@ -1415,7 +786,7 @@ /[\H]/8BZ ------------------------------------------------------------------ Bra - [\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff\x{100}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{7fffffff}] + [\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff\x{100}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}] Ket End ------------------------------------------------------------------ @@ -1423,7 +794,7 @@ /[\V]/8BZ ------------------------------------------------------------------ Bra - [\x00-\x09\x0e-\x84\x86-\xff\x{100}-\x{2027}\x{2029}-\x{7fffffff}] + [\x00-\x09\x0e-\x84\x86-\xff\x{100}-\x{2027}\x{202a}-\x{10ffff}] Ket End ------------------------------------------------------------------ @@ -1432,39 +803,9 @@ \x{1ec5} 0: \x{1ec5} -/-- This tests the stricter UTF-8 check according to RFC 3629. --/ - -/X/8 - \x{0}\x{d7ff}\x{e000}\x{10ffff} -No match - \x{d800} -Error -10 - \x{d800}\? -No match - \x{da00} -Error -10 - \x{da00}\? -No match - \x{dfff} -Error -10 - \x{dfff}\? -No match - \x{110000} -Error -10 - \x{110000}\? -No match - \x{2000000} -Error -10 - \x{2000000}\? -No match - \x{7fffffff} -Error -10 - \x{7fffffff}\? -No match - /a\Rb/I8 Capturing subpattern count = 0 -Options: bsr_anycrlf utf8 +Options: bsr_anycrlf utf First char = 'a' Need char = 'b' a\rb @@ -1482,7 +823,7 @@ /a\Rb/I8 Capturing subpattern count = 0 -Options: bsr_unicode utf8 +Options: bsr_unicode utf First char = 'a' Need char = 'b' a\rb @@ -1504,7 +845,7 @@ /a\R?b/I8 Capturing subpattern count = 0 -Options: bsr_anycrlf utf8 +Options: bsr_anycrlf utf First char = 'a' Need char = 'b' a\rb @@ -1522,7 +863,7 @@ /a\R?b/I8 Capturing subpattern count = 0 -Options: bsr_unicode utf8 +Options: bsr_unicode utf First char = 'a' Need char = 'b' a\rb @@ -1579,26 +920,11 @@ \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 A\x{1ec5}ABCXYZ 0: X -/(*UTF8)\x{1234}/ - abcd\x{1234}pqr - 0: \x{1234} - -/(*CRLF)(*UTF8)(*BSR_UNICODE)a\Rb/I -Capturing subpattern count = 0 -Options: bsr_unicode utf8 -Forced newline sequence: CRLF -First char = 'a' -Need char = 'b' - /Xa{2,4}b/8 X\P Partial match: X @@ -2076,150 +1402,448 @@ \PX Partial match: X -/\h/SI -Capturing subpattern count = 0 -No options -No first char -No need char -Subject length lower bound = 1 -Starting byte set: \x09 \x20 \xa0 +/\sxxx\s/8T1 + AB\x{85}xxx\x{a0}XYZ + 0: \x{85}xxx\x{a0} + AB\x{a0}xxx\x{85}XYZ + 0: \x{a0}xxx\x{85} + +/\S \S/8T1 + \x{a2} \x{84} + 0: \x{a2} \x{84} + +'A#хц'8xBZ +------------------------------------------------------------------ + Bra + A + Ket + End +------------------------------------------------------------------ + +'A#хц + PQ'8xBZ +------------------------------------------------------------------ + Bra + APQ + Ket + End +------------------------------------------------------------------ + +/a+#хaa + z#XX?/8xBZ +------------------------------------------------------------------ + Bra + a++ + z + Ket + End +------------------------------------------------------------------ + +/a+#хaa + z#х?/8xBZ +------------------------------------------------------------------ + Bra + a++ + z + Ket + End +------------------------------------------------------------------ + +/\g{A}xxx#bXX(?'A'123) (?'A'456)/8xBZ +------------------------------------------------------------------ + Bra + \1 + xxx + CBra 1 + 456 + Ket + Ket + End +------------------------------------------------------------------ + +/\g{A}xxx#bх(?'A'123) (?'A'456)/8xBZ +------------------------------------------------------------------ + Bra + \1 + xxx + CBra 1 + 456 + Ket + Ket + End +------------------------------------------------------------------ + +/^\cģ/8 +Failed: \c must be followed by an ASCII character at offset 3 + +/(\R*)(.)/s8 + \r\n + 0: \x{0d} + 1: + 2: \x{0d} + \r\r\n\n\r + 0: \x{0d}\x{0d}\x{0a}\x{0a}\x{0d} + 1: \x{0d}\x{0d}\x{0a}\x{0a} + 2: \x{0d} + \r\r\n\n\r\n + 0: \x{0d}\x{0d}\x{0a}\x{0a}\x{0d} + 1: \x{0d}\x{0d}\x{0a}\x{0a} + 2: \x{0d} + +/(\R)*(.)/s8 + \r\n + 0: \x{0d} + 1: + 2: \x{0d} + \r\r\n\n\r + 0: \x{0d}\x{0d}\x{0a}\x{0a}\x{0d} + 1: \x{0a} + 2: \x{0d} + \r\r\n\n\r\n + 0: \x{0d}\x{0d}\x{0a}\x{0a}\x{0d} + 1: \x{0a} + 2: \x{0d} -/\h/SI8 +/[^\x{1234}]+/iS8I Capturing subpattern count = 0 -Options: utf8 +Options: caseless utf No first char No need char Subject length lower bound = 1 -Starting byte set: \x09 \x20 \xc2 \xe1 \xe2 \xe3 - ABC\x{09} - 0: \x{09} - ABC\x{20} - 0: - ABC\x{a0} - 0: \x{a0} - ABC\x{1680} - 0: \x{1680} - ABC\x{180e} - 0: \x{180e} - ABC\x{2000} - 0: \x{2000} - ABC\x{202f} - 0: \x{202f} - ABC\x{205f} - 0: \x{205f} - ABC\x{3000} - 0: \x{3000} +No set of starting bytes -/\v/SI +/[^\x{1234}]+?/iS8I Capturing subpattern count = 0 -No options +Options: caseless utf No first char No need char Subject length lower bound = 1 -Starting byte set: \x0a \x0b \x0c \x0d \x85 +No set of starting bytes -/\v/SI8 +/[^\x{1234}]++/iS8I Capturing subpattern count = 0 -Options: utf8 +Options: caseless utf No first char No need char Subject length lower bound = 1 -Starting byte set: \x0a \x0b \x0c \x0d \xc2 \xe2 - ABC\x{0a} - 0: \x{0a} - ABC\x{0b} - 0: \x{0b} - ABC\x{0c} - 0: \x{0c} - ABC\x{0d} - 0: \x{0d} - ABC\x{85} - 0: \x{85} - ABC\x{2028} - 0: \x{2028} +No set of starting bytes -/\R/SI +/[^\x{1234}]{2}/iS8I Capturing subpattern count = 0 -No options +Options: caseless utf No first char No need char Subject length lower bound = 2 -Starting byte set: \x0a \x0b \x0c \x0d \x85 +No set of starting bytes -/\R/SI8 -Capturing subpattern count = 0 -Options: utf8 -No first char -No need char -Subject length lower bound = 2 -Starting byte set: \x0a \x0b \x0c \x0d \xc2 \xe2 +// +Failed: inconsistent NEWLINE options at offset 0 -/\h*A/SI8 -Capturing subpattern count = 0 -Options: utf8 -No first char -Need char = 'A' -Subject length lower bound = 1 -Starting byte set: \x09 \x20 A \xc2 \xe1 \xe2 \xe3 - CDBABC - 0: A - -/\v+A/SI8 -Capturing subpattern count = 0 -Options: utf8 -No first char -Need char = 'A' -Subject length lower bound = 2 -Starting byte set: \x0a \x0b \x0c \x0d \xc2 \xe2 +/f.*/ + \P\Pfor +Partial match: for + +/f.*/s + \P\Pfor +Partial match: for + +/f.*/8 + \P\Pfor +Partial match: for + +/f.*/8s + \P\Pfor +Partial match: for + +/\x{d7ff}\x{e000}/8 + +/\x{d800}/8 +Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7 + +/\x{dfff}/8 +Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7 + +/\h+/8 + \x{1681}\x{200b}\x{1680}\x{2000}\x{202f}\x{3000} + 0: \x{1680}\x{2000}\x{202f}\x{3000} + \x{3001}\x{2fff}\x{200a}\x{a0}\x{2000} + 0: \x{200a}\x{a0}\x{2000} + +/[\h\x{e000}]+/8BZ +------------------------------------------------------------------ + Bra + [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}\x{e000}]+ + Ket + End +------------------------------------------------------------------ + \x{1681}\x{200b}\x{1680}\x{2000}\x{202f}\x{3000} + 0: \x{1680}\x{2000}\x{202f}\x{3000} + \x{3001}\x{2fff}\x{200a}\x{a0}\x{2000} + 0: \x{200a}\x{a0}\x{2000} + +/\H+/8 + \x{1680}\x{180e}\x{167f}\x{1681}\x{180d}\x{180f} + 0: \x{167f}\x{1681}\x{180d}\x{180f} + \x{2000}\x{200a}\x{1fff}\x{200b} + 0: \x{1fff}\x{200b} + \x{202f}\x{205f}\x{202e}\x{2030}\x{205e}\x{2060} + 0: \x{202e}\x{2030}\x{205e}\x{2060} + \x{a0}\x{3000}\x{9f}\x{a1}\x{2fff}\x{3001} + 0: \x{9f}\x{a1}\x{2fff}\x{3001} + +/[\H\x{d7ff}]+/8BZ +------------------------------------------------------------------ + Bra + [\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff\x{100}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}\x{d7ff}]+ + Ket + End +------------------------------------------------------------------ + \x{1680}\x{180e}\x{167f}\x{1681}\x{180d}\x{180f} + 0: \x{167f}\x{1681}\x{180d}\x{180f} + \x{2000}\x{200a}\x{1fff}\x{200b} + 0: \x{1fff}\x{200b} + \x{202f}\x{205f}\x{202e}\x{2030}\x{205e}\x{2060} + 0: \x{202e}\x{2030}\x{205e}\x{2060} + \x{a0}\x{3000}\x{9f}\x{a1}\x{2fff}\x{3001} + 0: \x{9f}\x{a1}\x{2fff}\x{3001} + +/\v+/8 + \x{2027}\x{2030}\x{2028}\x{2029} + 0: \x{2028}\x{2029} + \x09\x0e\x{84}\x{86}\x{85}\x0a\x0b\x0c\x0d + 0: \x{85}\x{0a}\x{0b}\x{0c}\x{0d} + +/[\v\x{e000}]+/8BZ +------------------------------------------------------------------ + Bra + [\x0a-\x0d\x85\x{2028}-\x{2029}\x{e000}]+ + Ket + End +------------------------------------------------------------------ + \x{2027}\x{2030}\x{2028}\x{2029} + 0: \x{2028}\x{2029} + \x09\x0e\x{84}\x{86}\x{85}\x0a\x0b\x0c\x0d + 0: \x{85}\x{0a}\x{0b}\x{0c}\x{0d} + +/\V+/8 + \x{2028}\x{2029}\x{2027}\x{2030} + 0: \x{2027}\x{2030} + \x{85}\x0a\x0b\x0c\x0d\x09\x0e\x{84}\x{86} + 0: \x{09}\x{0e}\x{84}\x{86} + +/[\V\x{d7ff}]+/8BZ +------------------------------------------------------------------ + Bra + [\x00-\x09\x0e-\x84\x86-\xff\x{100}-\x{2027}\x{202a}-\x{10ffff}\x{d7ff}]+ + Ket + End +------------------------------------------------------------------ + \x{2028}\x{2029}\x{2027}\x{2030} + 0: \x{2027}\x{2030} + \x{85}\x0a\x0b\x0c\x0d\x09\x0e\x{84}\x{86} + 0: \x{09}\x{0e}\x{84}\x{86} + +/\R+/8 + \x{2027}\x{2030}\x{2028}\x{2029} + 0: \x{2028}\x{2029} + \x09\x0e\x{84}\x{86}\x{85}\x0a\x0b\x0c\x0d + 0: \x{85}\x{0a}\x{0b}\x{0c}\x{0d} + +/(..)\1/8 + ab\P +Partial match: ab + aba\P +Partial match: aba + abab\P + 0: abab + 1: ab + +/(..)\1/8i + ab\P +Partial match: ab + abA\P +Partial match: abA + aBAb\P + 0: aBAb + 1: aB + +/(..)\1{2,}/8 + ab\P +Partial match: ab + aba\P +Partial match: aba + abab\P +Partial match: abab + ababa\P +Partial match: ababa + ababab\P + 0: ababab + 1: ab + ababab\P\P +Partial match: ababab + abababa\P + 0: ababab + 1: ab + abababa\P\P +Partial match: abababa + +/(..)\1{2,}/8i + ab\P +Partial match: ab + aBa\P +Partial match: aBa + aBAb\P +Partial match: aBAb + AbaBA\P +Partial match: AbaBA + abABAb\P + 0: abABAb + 1: ab + aBAbaB\P\P +Partial match: aBAbaB + abABabA\P + 0: abABab + 1: ab + abaBABa\P\P +Partial match: abaBABa + +/(..)\1{2,}?x/8i + ab\P +Partial match: ab + abA\P +Partial match: abA + aBAb\P +Partial match: aBAb + abaBA\P +Partial match: abaBA + abAbaB\P +Partial match: abAbaB + abaBabA\P +Partial match: abaBabA + abAbABaBx\P + 0: abAbABaBx + 1: ab -/\s?xxx\s/8SI -Capturing subpattern count = 0 -Options: utf8 -No first char -Need char = 'x' -Subject length lower bound = 4 -Starting byte set: \x09 \x0a \x0c \x0d \x20 x +/./8 + \r\P + 0: \x{0d} + \r\P\P +Partial match: \x{0d} + +/.{2,3}/8 + \r\P +Partial match: \x{0d} + \r\P\P +Partial match: \x{0d} + \r\r\P + 0: \x{0d}\x{0d} + \r\r\P\P +Partial match: \x{0d}\x{0d} + \r\r\r\P + 0: \x{0d}\x{0d}\x{0d} + \r\r\r\P\P +Partial match: \x{0d}\x{0d}\x{0d} + +/.{2,3}?/8 + \r\P +Partial match: \x{0d} + \r\P\P +Partial match: \x{0d} + \r\r\P + 0: \x{0d}\x{0d} + \r\r\P\P +Partial match: \x{0d}\x{0d} + \r\r\r\P + 0: \x{0d}\x{0d} + \r\r\r\P\P + 0: \x{0d}\x{0d} -/\sxxx\s/8T1 - AB\x{85}xxx\x{a0}XYZ - 0: \x{85}xxx\x{a0} - AB\x{a0}xxx\x{85}XYZ - 0: \x{a0}xxx\x{85} +/[^\x{100}][^\x{1234}][^\x{ffff}][^\x{10000}][^\x{10ffff}]/8BZ +------------------------------------------------------------------ + Bra + [^\x{100}] + [^\x{1234}] + [^\x{ffff}] + [^\x{10000}] + [^\x{10ffff}] + Ket + End +------------------------------------------------------------------ -/\sxxx\s/I8ST1 -Capturing subpattern count = 0 -Options: utf8 -No first char -Need char = 'x' -Subject length lower bound = 5 -Starting byte set: \x09 \x0a \x0c \x0d \x20 \xc2 - AB\x{85}xxx\x{a0}XYZ - 0: \x{85}xxx\x{a0} - AB\x{a0}xxx\x{85}XYZ - 0: \x{a0}xxx\x{85} +/[^\x{100}][^\x{1234}][^\x{ffff}][^\x{10000}][^\x{10ffff}]/8BZi +------------------------------------------------------------------ + Bra + /i [^\x{100}] + /i [^\x{1234}] + /i [^\x{ffff}] + /i [^\x{10000}] + /i [^\x{10ffff}] + Ket + End +------------------------------------------------------------------ -/\S \S/8T1 - \x{a2} \x{84} - 0: \x{a2} \x{84} +/[^\x{100}]*[^\x{10000}]+[^\x{10ffff}]??[^\x{8000}]{4,}[^\x{7fff}]{2,9}?[^\x{fffff}]{5,6}+/8BZ +------------------------------------------------------------------ + Bra + [^\x{100}]* + [^\x{10000}]+ + [^\x{10ffff}]?? + [^\x{8000}]{4} + [^\x{8000}]* + [^\x{7fff}]{2} + [^\x{7fff}]{0,7}? + [^\x{fffff}]{5} + [^\x{fffff}]?+ + Ket + End +------------------------------------------------------------------ + +/[^\x{100}]*[^\x{10000}]+[^\x{10ffff}]??[^\x{8000}]{4,}[^\x{7fff}]{2,9}?[^\x{fffff}]{5,6}+/8BZi +------------------------------------------------------------------ + Bra + /i [^\x{100}]* + /i [^\x{10000}]+ + /i [^\x{10ffff}]?? + /i [^\x{8000}]{4} + /i [^\x{8000}]* + /i [^\x{7fff}]{2} + /i [^\x{7fff}]{0,7}? + Once + /i [^\x{fffff}]{5} + /i [^\x{fffff}]? + Ket + Ket + End +------------------------------------------------------------------ -/\S \S/I8ST1 +/(?<=\x{1234}\x{1234})\bxy/I8 Capturing subpattern count = 0 -Options: utf8 -No first char -Need char = ' ' -Subject length lower bound = 3 -Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0b \x0e - \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d - \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ - A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e - f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \xc0 \xc1 \xc2 \xc3 - \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 - \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 - \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 - \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff - \x{a2} \x{84} - 0: \x{a2} \x{84} - A Z - 0: A Z +Options: utf +First char = 'x' +Need char = 'y' +Max lookbehind = 2 + +/(?8BZ +------------------------------------------------------------------ + Bra + \x{100} + Ket + End +------------------------------------------------------------------ + +/[\u0100-\u0200]/8BZ +------------------------------------------------------------------ + Bra + [\x{100}-\x{200}] + Ket + End +------------------------------------------------------------------ + +/\ud800/8 +Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 5 /-- End of testinput5 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput6 php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput6 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput6 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput6 2012-11-21 05:12:20.000000000 +0000 @@ -1114,6 +1114,8 @@ 0: A\x80 /^[\p{Arabic}]/8 + \x{604} + 0: \x{604} \x{60e} 0: \x{60e} \x{656} @@ -1144,8 +1146,6 @@ 0: \x{6fa} ** Failers No match - \x{600} -No match \x{650} No match \x{651} @@ -1176,8 +1176,6 @@ 0: \x{964} \x{965} 0: \x{965} - \x{970} - 0: \x{970} /^\p{Inherited}/8 \x{64b} @@ -1353,4 +1351,26 @@ a\xFCb No match +/ⱥ/8i + ⱥ + 0: \x{2c65} + Ⱥx + 0: \x{23a} + Ⱥ + 0: \x{23a} + +/[ⱥ]/8i + ⱥ + 0: \x{2c65} + Ⱥx + 0: \x{23a} + Ⱥ + 0: \x{23a} + +/Ⱥ/8i + Ⱥ + 0: \x{23a} + ⱥ + 0: \x{2c65} + /-- End of testinput6 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput7 php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput7 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput7 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput7 2012-11-21 05:12:20.000000000 +0000 @@ -1,7700 +1,1316 @@ -/-- This set of tests check the DFA matching functionality of pcre_dfa_exec(). - The -dfa flag must be used with pcretest when running it. --/ - -/abc/ - abc - 0: abc - -/ab*c/ - abc - 0: abc - abbbbc - 0: abbbbc - ac - 0: ac - -/ab+c/ - abc - 0: abc - abbbbbbc - 0: abbbbbbc - *** Failers -No match - ac -No match - ab -No match - -/a*/ - a - 0: a - 1: - aaaaaaaaaaaaaaaaa - 0: aaaaaaaaaaaaaaaaa - 1: aaaaaaaaaaaaaaaa - 2: aaaaaaaaaaaaaaa - 3: aaaaaaaaaaaaaa - 4: aaaaaaaaaaaaa - 5: aaaaaaaaaaaa - 6: aaaaaaaaaaa - 7: aaaaaaaaaa - 8: aaaaaaaaa - 9: aaaaaaaa -10: aaaaaaa -11: aaaaaa -12: aaaaa -13: aaaa -14: aaa -15: aa -16: a -17: - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Matched, but too many subsidiary matches - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaa - 3: aaaaaaaaaaaaaaaaaaaaaaaaaaa - 4: aaaaaaaaaaaaaaaaaaaaaaaaaa - 5: aaaaaaaaaaaaaaaaaaaaaaaaa - 6: aaaaaaaaaaaaaaaaaaaaaaaa - 7: aaaaaaaaaaaaaaaaaaaaaaa - 8: aaaaaaaaaaaaaaaaaaaaaa - 9: aaaaaaaaaaaaaaaaaaaaa -10: aaaaaaaaaaaaaaaaaaaa -11: aaaaaaaaaaaaaaaaaaa -12: aaaaaaaaaaaaaaaaaa -13: aaaaaaaaaaaaaaaaa -14: aaaaaaaaaaaaaaaa -15: aaaaaaaaaaaaaaa -16: aaaaaaaaaaaaaa -17: aaaaaaaaaaaaa -18: aaaaaaaaaaaa -19: aaaaaaaaaaa -20: aaaaaaaaaa -21: aaaaaaaaa - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\F - 0: - -/(a|abcd|african)/ - a - 0: a - abcd - 0: abcd - 1: a - african - 0: african - 1: a - -/^abc/ - abcdef - 0: abc - *** Failers -No match - xyzabc -No match - xyz\nabc -No match - -/^abc/m - abcdef - 0: abc - xyz\nabc - 0: abc - *** Failers -No match - xyzabc -No match - -/\Aabc/ - abcdef - 0: abc - *** Failers -No match - xyzabc -No match - xyz\nabc -No match - -/\Aabc/m - abcdef - 0: abc - *** Failers -No match - xyzabc -No match - xyz\nabc -No match - -/\Gabc/ - abcdef - 0: abc - xyzabc\>3 - 0: abc - *** Failers -No match - xyzabc -No match - xyzabc\>2 -No match - -/x\dy\Dz/ - x9yzz - 0: x9yzz - x0y+z - 0: x0y+z - *** Failers -No match - xyz -No match - xxy0z -No match - -/x\sy\Sz/ - x yzz - 0: x yzz - x y+z - 0: x y+z - *** Failers -No match - xyz -No match - xxyyz -No match - -/x\wy\Wz/ - xxy+z - 0: xxy+z - *** Failers -No match - xxy0z -No match - x+y+z -No match - -/x.y/ - x+y - 0: x+y - x-y - 0: x-y - *** Failers -No match - x\ny -No match - -/x.y/s - x+y - 0: x+y - x-y - 0: x-y - x\ny - 0: x\x0ay - -/(a.b(?s)c.d|x.y)p.q/ - a+bc+dp+q - 0: a+bc+dp+q - a+bc\ndp+q - 0: a+bc\x0adp+q - x\nyp+q - 0: x\x0ayp+q - *** Failers -No match - a\nbc\ndp+q -No match - a+bc\ndp\nq -No match - x\nyp\nq -No match - -/a\d\z/ - ba0 - 0: a0 - *** Failers -No match - ba0\n -No match - ba0\ncd -No match - -/a\d\z/m - ba0 - 0: a0 - *** Failers -No match - ba0\n -No match - ba0\ncd -No match - -/a\d\Z/ - ba0 - 0: a0 - ba0\n - 0: a0 - *** Failers -No match - ba0\ncd -No match - -/a\d\Z/m - ba0 - 0: a0 - ba0\n - 0: a0 - *** Failers -No match - ba0\ncd -No match - -/a\d$/ - ba0 - 0: a0 - ba0\n - 0: a0 - *** Failers -No match - ba0\ncd -No match - -/a\d$/m - ba0 - 0: a0 - ba0\n - 0: a0 - ba0\ncd - 0: a0 - *** Failers -No match - -/abc/i - abc - 0: abc - aBc - 0: aBc - ABC - 0: ABC - -/[^a]/ - abcd - 0: b - -/ab?\w/ - abz - 0: abz - 1: ab - abbz - 0: abb - 1: ab - azz - 0: az - -/x{0,3}yz/ - ayzq - 0: yz - axyzq - 0: xyz - axxyz - 0: xxyz - axxxyzq - 0: xxxyz - axxxxyzq - 0: xxxyz - *** Failers -No match - ax -No match - axx -No match - -/x{3}yz/ - axxxyzq - 0: xxxyz - axxxxyzq - 0: xxxyz - *** Failers -No match - ax -No match - axx -No match - ayzq -No match - axyzq -No match - axxyz -No match - -/x{2,3}yz/ - axxyz - 0: xxyz - axxxyzq - 0: xxxyz - axxxxyzq - 0: xxxyz - *** Failers -No match - ax -No match - axx -No match - ayzq -No match - axyzq -No match - -/[^a]+/ - bac - 0: b - bcdefax - 0: bcdef - 1: bcde - 2: bcd - 3: bc - 4: b - *** Failers - 0: *** F - 1: *** - 2: *** - 3: ** - 4: * - aaaaa -No match - -/[^a]*/ - bac - 0: b - 1: - bcdefax - 0: bcdef - 1: bcde - 2: bcd - 3: bc - 4: b - 5: - *** Failers - 0: *** F - 1: *** - 2: *** - 3: ** - 4: * - 5: - aaaaa - 0: - -/[^a]{3,5}/ - xyz - 0: xyz - awxyza - 0: wxyz - 1: wxy - abcdefa - 0: bcdef - 1: bcde - 2: bcd - abcdefghijk - 0: bcdef - 1: bcde - 2: bcd - *** Failers - 0: *** F - 1: *** - 2: *** - axya -No match - axa -No match - aaaaa -No match - -/\d*/ - 1234b567 - 0: 1234 - 1: 123 - 2: 12 - 3: 1 - 4: - xyz - 0: - -/\D*/ - a1234b567 - 0: a - 1: - xyz - 0: xyz - 1: xy - 2: x - 3: - -/\d+/ - ab1234c56 - 0: 1234 - 1: 123 - 2: 12 - 3: 1 - *** Failers -No match - xyz -No match - -/\D+/ - ab123c56 - 0: ab - 1: a - *** Failers - 0: *** Failers - 1: *** Failer - 2: *** Faile - 3: *** Fail - 4: *** Fai - 5: *** Fa - 6: *** F - 7: *** - 8: *** - 9: ** -10: * - 789 -No match - -/\d?A/ - 045ABC - 0: 5A - ABC - 0: A - *** Failers -No match - XYZ -No match - -/\D?A/ - ABC - 0: A - BAC - 0: BA - 9ABC - 0: A - *** Failers -No match - -/a+/ - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - -/^.*xyz/ - xyz - 0: xyz - ggggggggxyz - 0: ggggggggxyz - -/^.+xyz/ - abcdxyz - 0: abcdxyz - axyz - 0: axyz - *** Failers -No match - xyz -No match - -/^.?xyz/ - xyz - 0: xyz - cxyz - 0: cxyz - -/^\d{2,3}X/ - 12X - 0: 12X - 123X - 0: 123X - *** Failers -No match - X -No match - 1X -No match - 1234X -No match - -/^[abcd]\d/ - a45 - 0: a4 - b93 - 0: b9 - c99z - 0: c9 - d04 - 0: d0 - *** Failers -No match - e45 -No match - abcd -No match - abcd1234 -No match - 1234 -No match - -/^[abcd]*\d/ - a45 - 0: a4 - b93 - 0: b9 - c99z - 0: c9 - d04 - 0: d0 - abcd1234 - 0: abcd1 - 1234 - 0: 1 - *** Failers -No match - e45 -No match - abcd -No match - -/^[abcd]+\d/ - a45 - 0: a4 - b93 - 0: b9 - c99z - 0: c9 - d04 - 0: d0 - abcd1234 - 0: abcd1 - *** Failers -No match - 1234 -No match - e45 -No match - abcd -No match - -/^a+X/ - aX - 0: aX - aaX - 0: aaX - -/^[abcd]?\d/ - a45 - 0: a4 - b93 - 0: b9 - c99z - 0: c9 - d04 - 0: d0 - 1234 - 0: 1 - *** Failers -No match - abcd1234 -No match - e45 -No match - -/^[abcd]{2,3}\d/ - ab45 - 0: ab4 - bcd93 - 0: bcd9 - *** Failers -No match - 1234 -No match - a36 -No match - abcd1234 -No match - ee45 -No match - -/^(abc)*\d/ - abc45 - 0: abc4 - abcabcabc45 - 0: abcabcabc4 - 42xyz - 0: 4 - *** Failers -No match - -/^(abc)+\d/ - abc45 - 0: abc4 - abcabcabc45 - 0: abcabcabc4 - *** Failers -No match - 42xyz -No match - -/^(abc)?\d/ - abc45 - 0: abc4 - 42xyz - 0: 4 - *** Failers -No match - abcabcabc45 -No match - -/^(abc){2,3}\d/ - abcabc45 - 0: abcabc4 - abcabcabc45 - 0: abcabcabc4 - *** Failers -No match - abcabcabcabc45 -No match - abc45 -No match - 42xyz -No match - -/1(abc|xyz)2(?1)3/ - 1abc2abc3456 - 0: 1abc2abc3 - 1abc2xyz3456 - 0: 1abc2xyz3 - -/^(a*\w|ab)=(a*\w|ab)/ - ab=ab - 0: ab=ab - 1: ab=a - -/^(a*\w|ab)=(?1)/ - ab=ab - 0: ab=ab - -/^([^()]|\((?1)*\))*$/ - abc - 0: abc - a(b)c - 0: a(b)c - a(b(c))d - 0: a(b(c))d - *** Failers) -No match - a(b(c)d -No match - -/^>abc>([^()]|\((?1)*\))*abc>123abc>123abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(1(2)3)a*)\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876 - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9 - *** Failers -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x - <> - 0: <> - - 0: - hij> - 0: hij> - hij> - 0: - def> - 0: def> - - 0: <> - *** Failers -No match - abcxyz - 1 ^ ^ x - 0: abcxyz - 123abcxyz999 ---->123abcxyz999 - 1 ^ ^ x - 0: abcxyz - -/(ab|cd){3,4}/C - ababab ---->ababab - +0 ^ (ab|cd){3,4} - +1 ^ a - +4 ^ c - +2 ^^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c - +2 ^ ^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c - +2 ^ ^ b - +3 ^ ^ | -+12 ^ ^ - +1 ^ ^ a - +4 ^ ^ c - 0: ababab - abcdabcd ---->abcdabcd - +0 ^ (ab|cd){3,4} - +1 ^ a - +4 ^ c - +2 ^^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) - +1 ^ ^ a - +4 ^ ^ c - +2 ^ ^ b - +3 ^ ^ | -+12 ^ ^ - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) -+12 ^ ^ - 0: abcdabcd - 1: abcdab - abcdcdcdcdcd ---->abcdcdcdcdcd - +0 ^ (ab|cd){3,4} - +1 ^ a - +4 ^ c - +2 ^^ b - +3 ^ ^ | - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) -+12 ^ ^ - +1 ^ ^ a - +4 ^ ^ c - +5 ^ ^ d - +6 ^ ^ ) -+12 ^ ^ - 0: abcdcdcd - 1: abcdcd - -/^abc/ - abcdef - 0: abc - *** Failers -No match - abcdef\B -No match - -/^(a*|xyz)/ - bcd - 0: - aaabcd - 0: aaa - 1: aa - 2: a - 3: - xyz - 0: xyz - 1: - xyz\N - 0: xyz - *** Failers - 0: - bcd\N -No match - -/xyz$/ - xyz - 0: xyz - xyz\n - 0: xyz - *** Failers -No match - xyz\Z -No match - xyz\n\Z -No match - -/xyz$/m - xyz - 0: xyz - xyz\n - 0: xyz - abcxyz\npqr - 0: xyz - abcxyz\npqr\Z - 0: xyz - xyz\n\Z - 0: xyz - *** Failers -No match - xyz\Z -No match - -/\Gabc/ - abcdef - 0: abc - defabcxyz\>3 - 0: abc - *** Failers -No match - defabcxyz -No match - -/^abcdef/ - ab\P -Partial match: ab - abcde\P -Partial match: abcde - abcdef\P - 0: abcdef - *** Failers -No match - abx\P -No match - -/^a{2,4}\d+z/ - a\P -Partial match: a - aa\P -Partial match: aa - aa2\P -Partial match: aa2 - aaa\P -Partial match: aaa - aaa23\P -Partial match: aaa23 - aaaa12345\P -Partial match: aaaa12345 - aa0z\P - 0: aa0z - aaaa4444444444444z\P - 0: aaaa4444444444444z - *** Failers -No match - az\P -No match - aaaaa\P -No match - a56\P -No match - -/^abcdef/ - abc\P -Partial match: abc - def\R - 0: def - -/(?<=foo)bar/ - xyzfo\P -No match - foob\P\>2 -Partial match: foob - foobar...\R\P\>4 - 0: ar - xyzfo\P -No match - foobar\>2 - 0: bar - *** Failers -No match - xyzfo\P -No match - obar\R -No match - -/(ab*(cd|ef))+X/ - adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\P\Z -No match - lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\P\B\Z -Partial match: abbbbbbcdaefabbbbbbbefa - cdabbbbbbbb\P\R\B\Z -Partial match: cdabbbbbbbb - efabbbbbbbbbbbbbbbb\P\R\B\Z -Partial match: efabbbbbbbbbbbbbbbb - bbbbbbbbbbbbcdXyasdfadf\P\R\B\Z - 0: bbbbbbbbbbbbcdX - -/(a|b)/SF>testsavedregex -Compiled regex written to testsavedregex -Study data written to testsavedregex ->>aaabxyzpqrrrabbxyyyypqAzz - 0: aaabxyzpqrrrabbxyyyypqAzz - >aaaabxyzpqrrrabbxyyyypqAzz - 0: aaaabxyzpqrrrabbxyyyypqAzz - >>>>abcxyzpqrrrabbxyyyypqAzz - 0: abcxyzpqrrrabbxyyyypqAzz - *** Failers -No match - abxyzpqrrabbxyyyypqAzz -No match - abxyzpqrrrrabbxyyyypqAzz -No match - abxyzpqrrrabxyyyypqAzz -No match - aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz -No match - aaaabcxyzzzzpqrrrabbbxyyypqAzz -No match - aaabcxyzpqrrrabbxyyyypqqqqqqqAzz -No match - -/^(abc){1,2}zz/ - abczz - 0: abczz - abcabczz - 0: abcabczz - *** Failers -No match - zz -No match - abcabcabczz -No match - >>abczz -No match - -/^(b+?|a){1,2}?c/ - bc - 0: bc - bbc - 0: bbc - bbbc - 0: bbbc - bac - 0: bac - bbac - 0: bbac - aac - 0: aac - abbbbbbbbbbbc - 0: abbbbbbbbbbbc - bbbbbbbbbbbac - 0: bbbbbbbbbbbac - *** Failers -No match - aaac -No match - abbbbbbbbbbbac -No match - -/^(b+|a){1,2}c/ - bc - 0: bc - bbc - 0: bbc - bbbc - 0: bbbc - bac - 0: bac - bbac - 0: bbac - aac - 0: aac - abbbbbbbbbbbc - 0: abbbbbbbbbbbc - bbbbbbbbbbbac - 0: bbbbbbbbbbbac - *** Failers -No match - aaac -No match - abbbbbbbbbbbac -No match - -/^(b+|a){1,2}?bc/ - bbc - 0: bbc - -/^(b*|ba){1,2}?bc/ - babc - 0: babc - bbabc - 0: bbabc - bababc - 0: bababc - *** Failers -No match - bababbc -No match - babababc -No match - -/^(ba|b*){1,2}?bc/ - babc - 0: babc - bbabc - 0: bbabc - bababc - 0: bababc - *** Failers -No match - bababbc -No match - babababc -No match - -/^\ca\cA\c[\c{\c:/ - \x01\x01\e;z - 0: \x01\x01\x1b;z - -/^[ab\]cde]/ - athing - 0: a - bthing - 0: b - ]thing - 0: ] - cthing - 0: c - dthing - 0: d - ething - 0: e - *** Failers -No match - fthing -No match - [thing -No match - \\thing -No match - -/^[]cde]/ - ]thing - 0: ] - cthing - 0: c - dthing - 0: d - ething - 0: e - *** Failers -No match - athing -No match - fthing -No match - -/^[^ab\]cde]/ - fthing - 0: f - [thing - 0: [ - \\thing - 0: \ - *** Failers - 0: * - athing -No match - bthing -No match - ]thing -No match - cthing -No match - dthing -No match - ething -No match - -/^[^]cde]/ - athing - 0: a - fthing - 0: f - *** Failers - 0: * - ]thing -No match - cthing -No match - dthing -No match - ething -No match - -/^\/ - - 0: \x81 - -/^/ - - 0: \xff - -/^[0-9]+$/ - 0 - 0: 0 - 1 - 0: 1 - 2 - 0: 2 - 3 - 0: 3 - 4 - 0: 4 - 5 - 0: 5 - 6 - 0: 6 - 7 - 0: 7 - 8 - 0: 8 - 9 - 0: 9 - 10 - 0: 10 - 100 - 0: 100 - *** Failers -No match - abc -No match - -/^.*nter/ - enter - 0: enter - inter - 0: inter - uponter - 0: uponter - -/^xxx[0-9]+$/ - xxx0 - 0: xxx0 - xxx1234 - 0: xxx1234 - *** Failers -No match - xxx -No match - -/^.+[0-9][0-9][0-9]$/ - x123 - 0: x123 - xx123 - 0: xx123 - 123456 - 0: 123456 - *** Failers -No match - 123 -No match - x1234 - 0: x1234 - -/^.+?[0-9][0-9][0-9]$/ - x123 - 0: x123 - xx123 - 0: xx123 - 123456 - 0: 123456 - *** Failers -No match - 123 -No match - x1234 - 0: x1234 - -/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ - abc!pqr=apquxz.ixr.zzz.ac.uk - 0: abc!pqr=apquxz.ixr.zzz.ac.uk - *** Failers -No match - !pqr=apquxz.ixr.zzz.ac.uk -No match - abc!=apquxz.ixr.zzz.ac.uk -No match - abc!pqr=apquxz:ixr.zzz.ac.uk -No match - abc!pqr=apquxz.ixr.zzz.ac.ukk -No match - -/:/ - Well, we need a colon: somewhere - 0: : - *** Fail if we don't -No match - -/([\da-f:]+)$/i - 0abc - 0: 0abc - abc - 0: abc - fed - 0: fed - E - 0: E - :: - 0: :: - 5f03:12C0::932e - 0: 5f03:12C0::932e - fed def - 0: def - Any old stuff - 0: ff - *** Failers -No match - 0zzz -No match - gzzz -No match - fed\x20 -No match - Any old rubbish -No match - -/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ - .1.2.3 - 0: .1.2.3 - A.12.123.0 - 0: A.12.123.0 - *** Failers -No match - .1.2.3333 -No match - 1.2.3 -No match - 1234.2.3 -No match - -/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ - 1 IN SOA non-sp1 non-sp2( - 0: 1 IN SOA non-sp1 non-sp2( - 1 IN SOA non-sp1 non-sp2 ( - 0: 1 IN SOA non-sp1 non-sp2 ( - *** Failers -No match - 1IN SOA non-sp1 non-sp2( -No match - -/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ - a. - 0: a. - Z. - 0: Z. - 2. - 0: 2. - ab-c.pq-r. - 0: ab-c.pq-r. - sxk.zzz.ac.uk. - 0: sxk.zzz.ac.uk. - x-.y-. - 0: x-.y-. - *** Failers -No match - -abc.peq. -No match - -/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ - *.a - 0: *.a - *.b0-a - 0: *.b0-a - *.c3-b.c - 0: *.c3-b.c - *.c-a.b-c - 0: *.c-a.b-c - *** Failers -No match - *.0 -No match - *.a- -No match - *.a-b.c- -No match - *.c-a.0-c -No match - -/^(?=ab(de))(abd)(e)/ - abde - 0: abde - -/^(?!(ab)de|x)(abd)(f)/ - abdf - 0: abdf - -/^(?=(ab(cd)))(ab)/ - abcd - 0: ab - -/^[\da-f](\.[\da-f])*$/i - a.b.c.d - 0: a.b.c.d - A.B.C.D - 0: A.B.C.D - a.b.c.1.2.3.C - 0: a.b.c.1.2.3.C - -/^\".*\"\s*(;.*)?$/ - \"1234\" - 0: "1234" - \"abcd\" ; - 0: "abcd" ; - \"\" ; rhubarb - 0: "" ; rhubarb - *** Failers -No match - \"1234\" : things -No match - -/^$/ - \ - 0: - *** Failers -No match - -/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x - ab c - 0: ab c - *** Failers -No match - abc -No match - ab cde -No match - -/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ - ab c - 0: ab c - *** Failers -No match - abc -No match - ab cde -No match - -/^ a\ b[c ]d $/x - a bcd - 0: a bcd - a b d - 0: a b d - *** Failers -No match - abcd -No match - ab d -No match - -/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ - abcdefhijklm - 0: abcdefhijklm - -/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ - abcdefhijklm - 0: abcdefhijklm - -/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ - a+ Z0+\x08\n\x1d\x12 - 0: a+ Z0+\x08\x0a\x1d\x12 - -/^[.^$|()*+?{,}]+/ - .^\$(*+)|{?,?} - 0: .^$(*+)|{?,?} - 1: .^$(*+)|{?,? - 2: .^$(*+)|{?, - 3: .^$(*+)|{? - 4: .^$(*+)|{ - 5: .^$(*+)| - 6: .^$(*+) - 7: .^$(*+ - 8: .^$(* - 9: .^$( -10: .^$ -11: .^ -12: . - -/^a*\w/ - z - 0: z - az - 0: az - 1: a - aaaz - 0: aaaz - 1: aaa - 2: aa - 3: a - a - 0: a - aa - 0: aa - 1: a - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - a+ - 0: a - aa+ - 0: aa - 1: a - -/^a*?\w/ - z - 0: z - az - 0: az - 1: a - aaaz - 0: aaaz - 1: aaa - 2: aa - 3: a - a - 0: a - aa - 0: aa - 1: a - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - a+ - 0: a - aa+ - 0: aa - 1: a - -/^a+\w/ - az - 0: az - aaaz - 0: aaaz - 1: aaa - 2: aa - aa - 0: aa - aaaa - 0: aaaa - 1: aaa - 2: aa - aa+ - 0: aa - -/^a+?\w/ - az - 0: az - aaaz - 0: aaaz - 1: aaa - 2: aa - aa - 0: aa - aaaa - 0: aaaa - 1: aaa - 2: aa - aa+ - 0: aa - -/^\d{8}\w{2,}/ - 1234567890 - 0: 1234567890 - 12345678ab - 0: 12345678ab - 12345678__ - 0: 12345678__ - *** Failers -No match - 1234567 -No match - -/^[aeiou\d]{4,5}$/ - uoie - 0: uoie - 1234 - 0: 1234 - 12345 - 0: 12345 - aaaaa - 0: aaaaa - *** Failers -No match - 123456 -No match - -/^[aeiou\d]{4,5}?/ - uoie - 0: uoie - 1234 - 0: 1234 - 12345 - 0: 12345 - 1: 1234 - aaaaa - 0: aaaaa - 1: aaaa - 123456 - 0: 12345 - 1: 1234 - -/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ - From abcd Mon Sep 01 12:33:02 1997 - 0: From abcd Mon Sep 01 12:33 - -/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ - From abcd Mon Sep 01 12:33:02 1997 - 0: From abcd Mon Sep 01 12:33 - From abcd Mon Sep 1 12:33:02 1997 - 0: From abcd Mon Sep 1 12:33 - *** Failers -No match - From abcd Sep 01 12:33:02 1997 -No match - -/^12.34/s - 12\n34 - 0: 12\x0a34 - 12\r34 - 0: 12\x0d34 - -/\w+(?=\t)/ - the quick brown\t fox - 0: brown - -/foo(?!bar)(.*)/ - foobar is foolish see? - 0: foolish see? - 1: foolish see - 2: foolish se - 3: foolish s - 4: foolish - 5: foolish - 6: foolis - 7: fooli - 8: fool - 9: foo - -/(?:(?!foo)...|^.{0,2})bar(.*)/ - foobar crowbar etc - 0: rowbar etc - 1: rowbar et - 2: rowbar e - 3: rowbar - 4: rowbar - barrel - 0: barrel - 1: barre - 2: barr - 3: bar - 2barrel - 0: 2barrel - 1: 2barre - 2: 2barr - 3: 2bar - A barrel - 0: A barrel - 1: A barre - 2: A barr - 3: A bar - -/^(\D*)(?=\d)(?!123)/ - abc456 - 0: abc - *** Failers -No match - abc123 -No match - -/^1234(?# test newlines - inside)/ - 1234 - 0: 1234 - -/^1234 #comment in extended re - /x - 1234 - 0: 1234 - -/#rhubarb - abcd/x - abcd - 0: abcd - -/^abcd#rhubarb/x - abcd - 0: abcd - -/(?!^)abc/ - the abc - 0: abc - *** Failers -No match - abc -No match - -/(?=^)abc/ - abc - 0: abc - *** Failers -No match - the abc -No match - -/^[ab]{1,3}(ab*|b)/ - aabbbbb - 0: aabbbbb - 1: aabbbb - 2: aabbb - 3: aabb - 4: aab - 5: aa - -/^[ab]{1,3}?(ab*|b)/ - aabbbbb - 0: aabbbbb - 1: aabbbb - 2: aabbb - 3: aabb - 4: aab - 5: aa - -/^[ab]{1,3}?(ab*?|b)/ - aabbbbb - 0: aabbbbb - 1: aabbbb - 2: aabbb - 3: aabb - 4: aab - 5: aa - -/^[ab]{1,3}(ab*?|b)/ - aabbbbb - 0: aabbbbb - 1: aabbbb - 2: aabbb - 3: aabb - 4: aab - 5: aa - -/ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional leading comment -(?: (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # one word, optionally followed by.... -(?: -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... -\( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) | # comments, or... - -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -# quoted strings -)* -< (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # leading < -(?: @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* - -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* , (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -)* # further okay, if led by comma -: # closing colon -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* )? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address spec -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* > # trailing > -# name and address -) (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional trailing comment -/x - Alan Other - 0: Alan Other - - 0: user@dom.ain - 1: user@dom - user\@dom.ain - 0: user@dom.ain - 1: user@dom - \"A. Other\" (a comment) - 0: "A. Other" (a comment) - 1: "A. Other" - 2: "A. Other" - A. Other (a comment) - 0: Other (a comment) - 1: Other - 2: Other - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay - 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re - A missing angle @,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -# leading word -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces -(?: -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -| -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -) # "special" comment or quoted string -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" -)* -< -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# < -(?: -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -(?: , -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -)* # additional domains -: -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address spec -> # > -# name and address -) -/x - Alan Other - 0: Alan Other - - 0: user@dom.ain - 1: user@dom - user\@dom.ain - 0: user@dom.ain - 1: user@dom - \"A. Other\" (a comment) - 0: "A. Other" - A. Other (a comment) - 0: Other - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay - 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re - A missing angle - a\rb - 0: a\x0db - *** Failers -No match - a\nb -No match - -/abc$/ - abc - 0: abc - abc\n - 0: abc - *** Failers -No match - abc\ndef -No match - -/(abc)\123/ - abc\x53 - 0: abcS - -/(abc)\223/ - abc\x93 - 0: abc\x93 - -/(abc)\323/ - abc\xd3 - 0: abc\xd3 - -/(abc)\100/ - abc\x40 - 0: abc@ - abc\100 - 0: abc@ - -/(abc)\1000/ - abc\x400 - 0: abc@0 - abc\x40\x30 - 0: abc@0 - abc\1000 - 0: abc@0 - abc\100\x30 - 0: abc@0 - abc\100\060 - 0: abc@0 - abc\100\60 - 0: abc@0 - -/abc\81/ - abc\081 - 0: abc\x0081 - abc\0\x38\x31 - 0: abc\x0081 - -/abc\91/ - abc\091 - 0: abc\x0091 - abc\0\x39\x31 - 0: abc\x0091 - -/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/ - abcdefghijk\12S - 0: abcdefghijk\x0aS - -/ab\idef/ - abidef - 0: abidef - -/a{0}bc/ - bc - 0: bc - -/(a|(bc)){0,0}?xyz/ - xyz - 0: xyz - -/abc[\10]de/ - abc\010de - 0: abc\x08de - -/abc[\1]de/ - abc\1de - 0: abc\x01de - -/(abc)[\1]de/ - abc\1de - 0: abc\x01de - -/(?s)a.b/ - a\nb - 0: a\x0ab - -/^([^a])([^\b])([^c]*)([^d]{3,4})/ - baNOTccccd - 0: baNOTcccc - 1: baNOTccc - 2: baNOTcc - 3: baNOTc - 4: baNOT - baNOTcccd - 0: baNOTccc - 1: baNOTcc - 2: baNOTc - 3: baNOT - baNOTccd - 0: baNOTcc - 1: baNOTc - 2: baNOT - bacccd - 0: baccc - *** Failers - 0: *** Failers - 1: *** Failer - 2: *** Faile - 3: *** Fail - 4: *** Fai - 5: *** Fa - 6: *** F - anything -No match - b\bc -No match - baccd -No match - -/[^a]/ - Abc - 0: A - -/[^a]/i - Abc - 0: b - -/[^a]+/ - AAAaAbc - 0: AAA - 1: AA - 2: A - -/[^a]+/i - AAAaAbc - 0: bc - 1: b - -/[^a]+/ - bbb\nccc - 0: bbb\x0accc - 1: bbb\x0acc - 2: bbb\x0ac - 3: bbb\x0a - 4: bbb - 5: bb - 6: b - -/[^k]$/ - abc - 0: c - *** Failers - 0: s - abk -No match - -/[^k]{2,3}$/ - abc - 0: abc - kbc - 0: bc - kabc - 0: abc - *** Failers - 0: ers - abk -No match - akb -No match - akk -No match - -/^\d{8,}\@.+[^k]$/ - 12345678\@a.b.c.d - 0: 12345678@a.b.c.d - 123456789\@x.y.z - 0: 123456789@x.y.z - *** Failers -No match - 12345678\@x.y.uk -No match - 1234567\@a.b.c.d -No match - -/[^a]/ - aaaabcd - 0: b - aaAabcd - 0: A - -/[^a]/i - aaaabcd - 0: b - aaAabcd - 0: b - -/[^az]/ - aaaabcd - 0: b - aaAabcd - 0: A - -/[^az]/i - aaaabcd - 0: b - aaAabcd - 0: b - -/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/ - \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377 - 0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff - -/P[^*]TAIRE[^*]{1,6}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - 0: PSTAIREISLL - -/P[^*]TAIRE[^*]{1,}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - 0: PSTAIREISLL - -/(\.\d\d[1-9]?)\d+/ - 1.230003938 - 0: .230003938 - 1: .23000393 - 2: .2300039 - 3: .230003 - 4: .23000 - 5: .2300 - 6: .230 - 1.875000282 - 0: .875000282 - 1: .87500028 - 2: .8750002 - 3: .875000 - 4: .87500 - 5: .8750 - 6: .875 - 1.235 - 0: .235 - -/(\.\d\d((?=0)|\d(?=\d)))/ - 1.230003938 - 0: .230 - 1: .23 - 1.875000282 - 0: .875 - *** Failers -No match - 1.235 -No match - -/a(?)b/ - ab - 0: ab - -/\b(foo)\s+(\w+)/i - Food is on the foo table - 0: foo table - 1: foo tabl - 2: foo tab - 3: foo ta - 4: foo t - -/foo(.*)bar/ - The food is under the bar in the barn. - 0: food is under the bar in the bar - 1: food is under the bar - -/foo(.*?)bar/ - The food is under the bar in the barn. - 0: food is under the bar in the bar - 1: food is under the bar - -/(.*)(\d*)/ - I have 2 numbers: 53147 -Matched, but too many subsidiary matches - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: I have 2 numbers: 531 - 3: I have 2 numbers: 53 - 4: I have 2 numbers: 5 - 5: I have 2 numbers: - 6: I have 2 numbers: - 7: I have 2 numbers - 8: I have 2 number - 9: I have 2 numbe -10: I have 2 numb -11: I have 2 num -12: I have 2 nu -13: I have 2 n -14: I have 2 -15: I have 2 -16: I have -17: I have -18: I hav -19: I ha -20: I h -21: I - -/(.*)(\d+)/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: I have 2 numbers: 531 - 3: I have 2 numbers: 53 - 4: I have 2 numbers: 5 - 5: I have 2 - -/(.*?)(\d*)/ - I have 2 numbers: 53147 -Matched, but too many subsidiary matches - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: I have 2 numbers: 531 - 3: I have 2 numbers: 53 - 4: I have 2 numbers: 5 - 5: I have 2 numbers: - 6: I have 2 numbers: - 7: I have 2 numbers - 8: I have 2 number - 9: I have 2 numbe -10: I have 2 numb -11: I have 2 num -12: I have 2 nu -13: I have 2 n -14: I have 2 -15: I have 2 -16: I have -17: I have -18: I hav -19: I ha -20: I h -21: I - -/(.*?)(\d+)/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: I have 2 numbers: 531 - 3: I have 2 numbers: 53 - 4: I have 2 numbers: 5 - 5: I have 2 - -/(.*)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - -/(.*?)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - -/(.*)\b(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - -/(.*\D)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - -/^\D*(?!123)/ - ABC123 - 0: AB - 1: A - 2: - -/^(\D*)(?=\d)(?!123)/ - ABC445 - 0: ABC - *** Failers -No match - ABC123 -No match - -/^[W-]46]/ - W46]789 - 0: W46] - -46]789 - 0: -46] - *** Failers -No match - Wall -No match - Zebra -No match - 42 -No match - [abcd] -No match - ]abcd[ -No match - -/^[W-\]46]/ - W46]789 - 0: W - Wall - 0: W - Zebra - 0: Z - Xylophone - 0: X - 42 - 0: 4 - [abcd] - 0: [ - ]abcd[ - 0: ] - \\backslash - 0: \ - *** Failers -No match - -46]789 -No match - well -No match - -/\d\d\/\d\d\/\d\d\d\d/ - 01/01/2000 - 0: 01/01/2000 - -/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark -No match - -/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope -No match - -/^(a){0,0}/ - bcd - 0: - abc - 0: - aab - 0: - -/^(a){0,1}/ - bcd - 0: - abc - 0: a - 1: - aab - 0: a - 1: - -/^(a){0,2}/ - bcd - 0: - abc - 0: a - 1: - aab - 0: aa - 1: a - 2: - -/^(a){0,3}/ - bcd - 0: - abc - 0: a - 1: - aab - 0: aa - 1: a - 2: - aaa - 0: aaa - 1: aa - 2: a - 3: - -/^(a){0,}/ - bcd - 0: - abc - 0: a - 1: - aab - 0: aa - 1: a - 2: - aaa - 0: aaa - 1: aa - 2: a - 3: - aaaaaaaa - 0: aaaaaaaa - 1: aaaaaaa - 2: aaaaaa - 3: aaaaa - 4: aaaa - 5: aaa - 6: aa - 7: a - 8: - -/^(a){1,1}/ - bcd -No match - abc - 0: a - aab - 0: a - -/^(a){1,2}/ - bcd -No match - abc - 0: a - aab - 0: aa - 1: a - -/^(a){1,3}/ - bcd -No match - abc - 0: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: aa - 2: a - -/^(a){1,}/ - bcd -No match - abc - 0: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: aa - 2: a - aaaaaaaa - 0: aaaaaaaa - 1: aaaaaaa - 2: aaaaaa - 3: aaaaa - 4: aaaa - 5: aaa - 6: aa - 7: a - -/.*\.gif/ - borfle\nbib.gif\nno - 0: bib.gif - -/.{0,}\.gif/ - borfle\nbib.gif\nno - 0: bib.gif - -/.*\.gif/m - borfle\nbib.gif\nno - 0: bib.gif - -/.*\.gif/s - borfle\nbib.gif\nno - 0: borfle\x0abib.gif - -/.*\.gif/ms - borfle\nbib.gif\nno - 0: borfle\x0abib.gif - -/.*$/ - borfle\nbib.gif\nno - 0: no - -/.*$/m - borfle\nbib.gif\nno - 0: borfle - -/.*$/s - borfle\nbib.gif\nno - 0: borfle\x0abib.gif\x0ano - -/.*$/ms - borfle\nbib.gif\nno - 0: borfle\x0abib.gif\x0ano - 1: borfle\x0abib.gif - 2: borfle - -/.*$/ - borfle\nbib.gif\nno\n - 0: no - -/.*$/m - borfle\nbib.gif\nno\n - 0: borfle - -/.*$/s - borfle\nbib.gif\nno\n - 0: borfle\x0abib.gif\x0ano\x0a - 1: borfle\x0abib.gif\x0ano - -/.*$/ms - borfle\nbib.gif\nno\n - 0: borfle\x0abib.gif\x0ano\x0a - 1: borfle\x0abib.gif\x0ano - 2: borfle\x0abib.gif - 3: borfle - -/(.*X|^B)/ - abcde\n1234Xyz - 0: 1234X - BarFoo - 0: B - *** Failers -No match - abcde\nBar -No match - -/(.*X|^B)/m - abcde\n1234Xyz - 0: 1234X - BarFoo - 0: B - abcde\nBar - 0: B - -/(.*X|^B)/s - abcde\n1234Xyz - 0: abcde\x0a1234X - BarFoo - 0: B - *** Failers -No match - abcde\nBar -No match - -/(.*X|^B)/ms - abcde\n1234Xyz - 0: abcde\x0a1234X - BarFoo - 0: B - abcde\nBar - 0: B - -/(?s)(.*X|^B)/ - abcde\n1234Xyz - 0: abcde\x0a1234X - BarFoo - 0: B - *** Failers -No match - abcde\nBar -No match - -/(?s:.*X|^B)/ - abcde\n1234Xyz - 0: abcde\x0a1234X - BarFoo - 0: B - *** Failers -No match - abcde\nBar -No match - -/^.*B/ - **** Failers -No match - abc\nB -No match - -/(?s)^.*B/ - abc\nB - 0: abc\x0aB - -/(?m)^.*B/ - abc\nB - 0: B - -/(?ms)^.*B/ - abc\nB - 0: abc\x0aB - -/(?ms)^B/ - abc\nB - 0: B - -/(?s)B$/ - B\n - 0: B - -/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ - 123456654321 - 0: 123456654321 - -/^\d\d\d\d\d\d\d\d\d\d\d\d/ - 123456654321 - 0: 123456654321 - -/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ - 123456654321 - 0: 123456654321 - -/^[abc]{12}/ - abcabcabcabc - 0: abcabcabcabc - -/^[a-c]{12}/ - abcabcabcabc - 0: abcabcabcabc - -/^(a|b|c){12}/ - abcabcabcabc - 0: abcabcabcabc - -/^[abcdefghijklmnopqrstuvwxy0123456789]/ - n - 0: n - *** Failers -No match - z -No match - -/abcde{0,0}/ - abcd - 0: abcd - *** Failers -No match - abce -No match - -/ab[cd]{0,0}e/ - abe - 0: abe - *** Failers -No match - abcde -No match - -/ab(c){0,0}d/ - abd - 0: abd - *** Failers -No match - abcd -No match - -/a(b*)/ - a - 0: a - ab - 0: ab - 1: a - abbbb - 0: abbbb - 1: abbb - 2: abb - 3: ab - 4: a - *** Failers - 0: a - bbbbb -No match - -/ab\d{0}e/ - abe - 0: abe - *** Failers -No match - ab1e -No match - -/"([^\\"]+|\\.)*"/ - the \"quick\" brown fox - 0: "quick" - \"the \\\"quick\\\" brown fox\" - 0: "the \"quick\" brown fox" - -/.*?/g+ - abc - 0: abc - 0+ - 1: ab - 2: a - 3: - 0: - 0+ - -/\b/g+ - abc - 0: - 0+ abc - 0: - 0+ - -/\b/+g - abc - 0: - 0+ abc - 0: - 0+ - -//g - abc - 0: - 0: - 0: - 0: - -/]{0,})>]{0,})>([\d]{0,}\.)(.*)((
([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is - 43.
Word Processor
(N-1286)
Lega lstaff.comCA - Statewide - 0: 43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide - -/a[^a]b/ - acb - 0: acb - a\nb - 0: a\x0ab - -/a.b/ - acb - 0: acb - *** Failers -No match - a\nb -No match - -/a[^a]b/s - acb - 0: acb - a\nb - 0: a\x0ab - -/a.b/s - acb - 0: acb - a\nb - 0: a\x0ab - -/^(b+?|a){1,2}?c/ - bac - 0: bac - bbac - 0: bbac - bbbac - 0: bbbac - bbbbac - 0: bbbbac - bbbbbac - 0: bbbbbac - -/^(b+|a){1,2}?c/ - bac - 0: bac - bbac - 0: bbac - bbbac - 0: bbbac - bbbbac - 0: bbbbac - bbbbbac - 0: bbbbbac - -/(?!\A)x/m - x\nb\n -No match - a\bx\n - 0: x - -/\x0{ab}/ - \0{ab} - 0: \x00{ab} - -/(A|B)*?CD/ - CD - 0: CD - -/(A|B)*CD/ - CD - 0: CD - -/(?.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ -No match - -"(?>.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo - 0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo - -/(?>(\.\d\d[1-9]?))\d+/ - 1.230003938 - 0: .230003938 - 1: .23000393 - 2: .2300039 - 3: .230003 - 4: .23000 - 5: .2300 - 6: .230 - 1.875000282 - 0: .875000282 - 1: .87500028 - 2: .8750002 - 3: .875000 - 4: .87500 - 5: .8750 - *** Failers -No match - 1.235 -No match - -/^((?>\w+)|(?>\s+))*$/ - now is the time for all good men to come to the aid of the party - 0: now is the time for all good men to come to the aid of the party - *** Failers -No match - this is not a line with only words and spaces! -No match - -/(\d+)(\w)/ - 12345a - 0: 12345a - 1: 12345 - 2: 1234 - 3: 123 - 4: 12 - 12345+ - 0: 12345 - 1: 1234 - 2: 123 - 3: 12 - -/((?>\d+))(\w)/ - 12345a - 0: 12345a - *** Failers -No match - 12345+ -No match - -/(?>a+)b/ - aaab - 0: aaab - -/((?>a+)b)/ - aaab - 0: aaab - -/(?>(a+))b/ - aaab - 0: aaab - -/(?>b)+/ - aaabbbccc - 0: bbb - 1: bb - 2: b - -/(?>a+|b+|c+)*c/ - aaabbbbccccd - 0: aaabbbbcccc - 1: aaabbbbc - -/(a+|b+|c+)*c/ - aaabbbbccccd - 0: aaabbbbcccc - 1: aaabbbbccc - 2: aaabbbbcc - 3: aaabbbbc - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - 0: abc(ade)ufh()()x - 1: abc(ade)ufh()() - 2: abc(ade)ufh() - 3: abc(ade)ufh - 4: abc(ade) - 5: abc - -/\(((?>[^()]+)|\([^()]+\))+\)/ - (abc) - 0: (abc) - (abc(def)xyz) - 0: (abc(def)xyz) - *** Failers -No match - ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/a(?-i)b/i - ab - 0: ab - Ab - 0: Ab - *** Failers -No match - aB -No match - AB -No match - -/(a (?x)b c)d e/ - a bcd e - 0: a bcd e - *** Failers -No match - a b cd e -No match - abcd e -No match - a bcde -No match - -/(a b(?x)c d (?-x)e f)/ - a bcde f - 0: a bcde f - *** Failers -No match - abcdef -No match - -/(a(?i)b)c/ - abc - 0: abc - aBc - 0: aBc - *** Failers -No match - abC -No match - aBC -No match - Abc -No match - ABc -No match - ABC -No match - AbC -No match - -/a(?i:b)c/ - abc - 0: abc - aBc - 0: aBc - *** Failers -No match - ABC -No match - abC -No match - aBC -No match - -/a(?i:b)*c/ - aBc - 0: aBc - aBBc - 0: aBBc - *** Failers -No match - aBC -No match - aBBC -No match - -/a(?=b(?i)c)\w\wd/ - abcd - 0: abcd - abCd - 0: abCd - *** Failers -No match - aBCd -No match - abcD -No match - -/(?s-i:more.*than).*million/i - more than million - 0: more than million - more than MILLION - 0: more than MILLION - more \n than Million - 0: more \x0a than Million - *** Failers -No match - MORE THAN MILLION -No match - more \n than \n million -No match - -/(?:(?s-i)more.*than).*million/i - more than million - 0: more than million - more than MILLION - 0: more than MILLION - more \n than Million - 0: more \x0a than Million - *** Failers -No match - MORE THAN MILLION -No match - more \n than \n million -No match - -/(?>a(?i)b+)+c/ - abc - 0: abc - aBbc - 0: aBbc - aBBc - 0: aBBc - *** Failers -No match - Abc -No match - abAb -No match - abbC -No match - -/(?=a(?i)b)\w\wc/ - abc - 0: abc - aBc - 0: aBc - *** Failers -No match - Ab -No match - abC -No match - aBC -No match - -/(?<=a(?i)b)(\w\w)c/ - abxxc - 0: xxc - aBxxc - 0: xxc - *** Failers -No match - Abxxc -No match - ABxxc -No match - abxxC -No match - -/^(?(?=abc)\w{3}:|\d\d)$/ - abc: - 0: abc: - 12 - 0: 12 - *** Failers -No match - 123 -No match - xyz -No match - -/^(?(?!abc)\d\d|\w{3}:)$/ - abc: - 0: abc: - 12 - 0: 12 - *** Failers -No match - 123 -No match - xyz -No match - -/(?(?<=foo)bar|cat)/ - foobar - 0: bar - cat - 0: cat - fcat - 0: cat - focat - 0: cat - *** Failers -No match - foocat -No match - -/(?(?a*)*/ - a - 0: a - 1: - aa - 0: aa - 1: - aaaa - 0: aaaa - 1: - -/(abc|)+/ - abc - 0: abc - 1: - abcabc - 0: abcabc - 1: abc - 2: - abcabcabc - 0: abcabcabc - 1: abcabc - 2: abc - 3: - xyz - 0: - -/([a]*)*/ - a - 0: a - 1: - aaaaa - 0: aaaaa - 1: aaaa - 2: aaa - 3: aa - 4: a - 5: - -/([ab]*)*/ - a - 0: a - 1: - b - 0: b - 1: - ababab - 0: ababab - 1: ababa - 2: abab - 3: aba - 4: ab - 5: a - 6: - aaaabcde - 0: aaaab - 1: aaaa - 2: aaa - 3: aa - 4: a - 5: - bbbb - 0: bbbb - 1: bbb - 2: bb - 3: b - 4: - -/([^a]*)*/ - b - 0: b - 1: - bbbb - 0: bbbb - 1: bbb - 2: bb - 3: b - 4: - aaa - 0: - -/([^ab]*)*/ - cccc - 0: cccc - 1: ccc - 2: cc - 3: c - 4: - abab - 0: - -/([a]*?)*/ - a - 0: a - 1: - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - 4: - -/([ab]*?)*/ - a - 0: a - 1: - b - 0: b - 1: - abab - 0: abab - 1: aba - 2: ab - 3: a - 4: - baba - 0: baba - 1: bab - 2: ba - 3: b - 4: - -/([^a]*?)*/ - b - 0: b - 1: - bbbb - 0: bbbb - 1: bbb - 2: bb - 3: b - 4: - aaa - 0: - -/([^ab]*?)*/ - c - 0: c - 1: - cccc - 0: cccc - 1: ccc - 2: cc - 3: c - 4: - baba - 0: - -/(?>a*)*/ - a - 0: a - 1: - aaabcde - 0: aaa - 1: - -/((?>a*))*/ - aaaaa - 0: aaaaa - 1: - aabbaa - 0: aa - 1: - -/((?>a*?))*/ - aaaaa - 0: aaaaa - 1: - aabbaa - 0: aa - 1: - -/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x - 12-sep-98 - 0: 12-sep-98 - 12-09-98 - 0: 12-09-98 - *** Failers -No match - sep-12-98 -No match - -/(?i:saturday|sunday)/ - saturday - 0: saturday - sunday - 0: sunday - Saturday - 0: Saturday - Sunday - 0: Sunday - SATURDAY - 0: SATURDAY - SUNDAY - 0: SUNDAY - SunDay - 0: SunDay - -/(a(?i)bc|BB)x/ - abcx - 0: abcx - aBCx - 0: aBCx - bbx - 0: bbx - BBx - 0: BBx - *** Failers -No match - abcX -No match - aBCX -No match - bbX -No match - BBX -No match - -/^([ab](?i)[cd]|[ef])/ - ac - 0: ac - aC - 0: aC - bD - 0: bD - elephant - 0: e - Europe - 0: E - frog - 0: f - France - 0: F - *** Failers -No match - Africa -No match - -/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ - ab - 0: ab - aBd - 0: aBd - xy - 0: xy - xY - 0: xY - zebra - 0: z - Zambesi - 0: Z - *** Failers -No match - aCD -No match - XY -No match - -/(?<=foo\n)^bar/m - foo\nbar - 0: bar - *** Failers -No match - bar -No match - baz\nbar -No match - -/(?<=(?]&/ - <&OUT - 0: <& - -/(?:(f)(o)(o)|(b)(a)(r))*/ - foobar - 0: foobar - 1: foo - 2: - -/(?<=a)b/ - ab - 0: b - *** Failers -No match - cb -No match - b -No match - -/(?a+)ab/ - -/(?>a+)b/ - aaab - 0: aaab - -/([[:]+)/ - a:[b]: - 0: :[ - 1: : - -/([[=]+)/ - a=[b]= - 0: =[ - 1: = - -/([[.]+)/ - a.[b]. - 0: .[ - 1: . - -/((?>a+)b)/ - aaab - 0: aaab - -/(?>(a+))b/ - aaab - 0: aaab - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - 0: abc(ade)ufh()()x - 1: abc(ade)ufh()() - 2: abc(ade)ufh() - 3: abc(ade)ufh - 4: abc(ade) - 5: abc +/[\p{^L}]/DZ +------------------------------------------------------------------ + Bra + [\P{L}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char -/a\Z/ - *** Failers -No match - aaab -No match - a\nb\n -No match +/[\P{L}]/DZ +------------------------------------------------------------------ + Bra + [\P{L}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char -/b\Z/ - a\nb\n - 0: b +/[\P{^L}]/DZ +------------------------------------------------------------------ + Bra + [\p{L}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +No options +No first char +No need char -/b\z/ +/[abc\p{L}\x{0660}]/8DZ +------------------------------------------------------------------ + Bra + [a-c\p{L}\x{660}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf +No first char +No need char -/b\Z/ - a\nb - 0: b +/[\p{Nd}]/8DZ +------------------------------------------------------------------ + Bra + [\p{Nd}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf +No first char +No need char + 1234 + 0: 1 -/b\z/ - a\nb - 0: b - *** Failers -No match - -/(?>.*)(?<=(abcd|wxyz))/ - alphabetabcd - 0: alphabetabcd - endingwxyz - 0: endingwxyz - *** Failers +/[\p{Nd}+-]+/8DZ +------------------------------------------------------------------ + Bra + [+\-\p{Nd}]+ + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf +No first char +No need char + 1234 + 0: 1234 + 12-34 + 0: 12-34 + 12+\x{661}-34 + 0: 12+\x{661}-34 + ** Failers No match - a rather long string that doesn't end with one of them + abcd No match -/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword - word cat dog elephant mussel cow horse canary baboon snake shark -No match - -/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope -No match +/[\x{105}-\x{109}]/8iDZ +------------------------------------------------------------------ + Bra + [\x{104}-\x{109}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: caseless utf +No first char +No need char + \x{104} + 0: \x{104} + \x{105} + 0: \x{105} + \x{109} + 0: \x{109} + ** Failers +No match + \x{100} +No match + \x{10a} +No match + +/[z-\x{100}]/8iDZ +------------------------------------------------------------------ + Bra + [Z\x{39c}\x{178}z-\x{101}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: caseless utf +No first char +No need char + Z + 0: Z + z + 0: z + \x{39c} + 0: \x{39c} + \x{178} + 0: \x{178} + | + 0: | + \x{80} + 0: \x{80} + \x{ff} + 0: \x{ff} + \x{100} + 0: \x{100} + \x{101} + 0: \x{101} + ** Failers +No match + \x{102} +No match + Y +No match + y +No match + +/[z-\x{100}]/8DZi +------------------------------------------------------------------ + Bra + [Z\x{39c}\x{178}z-\x{101}] + Ket + End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: caseless utf +No first char +No need char -/(?<=\d{3}(?!999))foo/ - 999foo - 0: foo - 123999foo - 0: foo - *** Failers -No match - 123abcfoo -No match - -/(?<=(?!...999)\d{3})foo/ - 999foo - 0: foo - 123999foo - 0: foo - *** Failers -No match - 123abcfoo -No match +/(?:[\PPa*]*){8,}/ -/(?<=\d{3}(?!999)...)foo/ - 123abcfoo - 0: foo - 123456foo - 0: foo - *** Failers -No match - 123999foo -No match - -/(?<=\d{3}...)(?Z)+|A)*/ - ZABCDEFG - 0: ZA - 1: Z - 2: - -/((?>)+|A)*/ - ZABCDEFG - 0: +/[\P{Any}\E]/BZ +------------------------------------------------------------------ + Bra + [\P{Any}] + Ket + End +------------------------------------------------------------------ -/a*/g - abbab - 0: a - 1: - 0: - 0: - 0: a - 1: - 0: - 0: +/(\P{Yi}+\277)/ -/^[a-\d]/ - abcde - 0: a - -things - 0: - - 0digit - 0: 0 - *** Failers -No match - bcdef -No match +/(\P{Yi}+\277)?/ -/^[\d-a]/ - abcde - 0: a - -things - 0: - - 0digit - 0: 0 - *** Failers -No match - bcdef -No match - -/[[:space:]]+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d\x0b - 1: \x09\x0a\x0c\x0d - 2: \x09\x0a\x0c - 3: \x09\x0a - 4: \x09 - 5: - -/[[:blank:]]+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09 - 1: - -/[\s]+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d - 1: \x09\x0a\x0c - 2: \x09\x0a - 3: \x09 - 4: - -/\s+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d - 1: \x09\x0a\x0c - 2: \x09\x0a - 3: \x09 - 4: - -/a b/x - ab -No match - -/(?!\A)x/m - a\nxb\n - 0: x - -/(?!^)x/m - a\nxb\n -No match - -/abc\Qabc\Eabc/ - abcabcabc - 0: abcabcabc - -/abc\Q(*+|\Eabc/ - abc(*+|abc - 0: abc(*+|abc - -/ abc\Q abc\Eabc/x - abc abcabc - 0: abc abcabc - *** Failers -No match - abcabcabc -No match - -/abc#comment - \Q#not comment - literal\E/x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/abc#comment - \Q#not comment - literal/x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/abc#comment - \Q#not comment - literal\E #more comment - /x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/abc#comment - \Q#not comment - literal\E #more comment/x - abc#not comment\n literal - 0: abc#not comment\x0a literal - -/\Qabc\$xyz\E/ - abc\\\$xyz - 0: abc\$xyz - -/\Qabc\E\$\Qxyz\E/ - abc\$xyz - 0: abc$xyz +/(?<=\P{Yi}{3}A)X/ -/\Gabc/ - abc - 0: abc - *** Failers -No match - xyzabc -No match +/\p{Yi}+(\P{Yi}+)(?1)/ -/\Gabc./g - abc1abc2xyzabc3 - 0: abc1 - 0: abc2 +/(\P{Yi}{2}\277)?/ -/abc./g - abc1abc2xyzabc3 - 0: abc1 - 0: abc2 - 0: abc3 +/[\P{Yi}A]/ -/a(?x: b c )d/ - XabcdY - 0: abcd - *** Failers -No match - Xa b c d Y -No match +/[\P{Yi}\P{Yi}\P{Yi}A]/ -/((?x)x y z | a b c)/ - XabcY - 0: abc - AxyzB - 0: xyz +/[^\P{Yi}A]/ -/(?i)AB(?-i)C/ - XabCY - 0: abC - *** Failers -No match - XabcY -No match +/[^\P{Yi}\P{Yi}\P{Yi}A]/ -/((?i)AB(?-i)C|D)E/ - abCE - 0: abCE - DE - 0: DE - *** Failers -No match - abcE -No match - abCe -No match - dE -No match - De -No match +/(\P{Yi}*\277)*/ -/[z\Qa-d]\E]/ - z - 0: z - a - 0: a - - - 0: - - d - 0: d - ] - 0: ] - *** Failers - 0: a - b -No match +/(\P{Yi}*?\277)*/ -/[\z\C]/ - z - 0: z - C - 0: C - -/\M/ - M - 0: M - -/(a+)*b/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/(?i)reg(?:ul(?:[a]|ae)r|ex)/ - REGular - 0: REGular - regulaer - 0: regulaer - Regex - 0: Regex - regulr - 0: regul\xe4r - -/[--]+/ - - 0: \xc5\xe6\xe5\xe4\xe0 - - 0: \xc5\xe6\xe5\xe4\xff - - 0: \xc5\xe6\xe5\xe4\xc0 - - 0: \xc5\xe6\xe5\xe4\xdf - -/(?<=Z)X./ - \x84XAZXB - 0: XB - -/^(?(2)a|(1)(2))+$/ - 123a -Error -17 - -/(?<=a|bbbb)c/ - ac - 0: c - bbbbc - 0: c - -/abc/>testsavedregex -Compiled regex written to testsavedregex -testsavedregex -Compiled regex written to testsavedregex -testsavedregex -Compiled regex written to testsavedregex -Study data written to testsavedregex -testsavedregex -Compiled regex written to testsavedregex -Study data written to testsavedregex - - 0: abc - xyz\r\nabc\ - 0: abc - xyz\rabc\ - 0: abc - xyz\r\nabc\ - 0: abc - ** Failers -No match - xyz\nabc\ -No match - xyz\r\nabc\ -No match - xyz\nabc\ -No match - xyz\rabc\ -No match - xyz\rabc\ -No match - -/abc$/m - xyzabc - 0: abc - xyzabc\n - 0: abc - xyzabc\npqr - 0: abc - xyzabc\r\ - 0: abc - xyzabc\rpqr\ - 0: abc - xyzabc\r\n\ - 0: abc - xyzabc\r\npqr\ - 0: abc - ** Failers -No match - xyzabc\r -No match - xyzabc\rpqr -No match - xyzabc\r\n -No match - xyzabc\r\npqr -No match +/(\P{Yi}{0,3}\277)*/ + +/(\P{Yi}{0,3}?\277)*/ + +/(\p{Yi}{0,3}+\277)*/ + +/\p{Zl}{2,3}+/8BZ +------------------------------------------------------------------ + Bra + prop Zl {2} + prop Zl ?+ + Ket + End +------------------------------------------------------------------ + \xe2\x80\xa8\xe2\x80\xa8 + 0: \x{2028}\x{2028} + \x{2028}\x{2028}\x{2028} + 0: \x{2028}\x{2028}\x{2028} -/^abc/m - xyz\rabcdef - 0: abc - xyz\nabcdef\ - 0: abc - ** Failers -No match - xyz\nabcdef +/\p{Zl}/8BZ +------------------------------------------------------------------ + Bra + prop Zl + Ket + End +------------------------------------------------------------------ + +/\p{Lu}{3}+/8BZ +------------------------------------------------------------------ + Bra + prop Lu {3} + Ket + End +------------------------------------------------------------------ + +/\pL{2}+/8BZ +------------------------------------------------------------------ + Bra + prop L {2} + Ket + End +------------------------------------------------------------------ + +/\p{Cc}{2}+/8BZ +------------------------------------------------------------------ + Bra + prop Cc {2} + Ket + End +------------------------------------------------------------------ + +/^\p{Cs}/8 + \?\x{dfff} + 0: \x{dfff} + ** Failers No match - -/^abc/m - xyz\nabcdef - 0: abc - xyz\rabcdef\ - 0: abc - ** Failers + \x{09f} No match - xyz\rabcdef + +/^\p{Sc}+/8 + $\x{a2}\x{a3}\x{a4}\x{a5}\x{a6} + 0: $\x{a2}\x{a3}\x{a4}\x{a5} + \x{9f2} + 0: \x{9f2} + ** Failers No match - -/^abc/m - xyz\r\nabcdef - 0: abc - xyz\rabcdef\ - 0: abc - ** Failers + X No match - xyz\rabcdef + \x{2c2} No match - -/.*/ - abc\ndef - 0: abc - 1: ab - 2: a - 3: - abc\rdef - 0: abc\x0ddef - 1: abc\x0dde - 2: abc\x0dd - 3: abc\x0d - 4: abc - 5: ab - 6: a - 7: - abc\r\ndef - 0: abc\x0d - 1: abc - 2: ab - 3: a - 4: - \abc\ndef - 0: abc\x0adef - 1: abc\x0ade - 2: abc\x0ad - 3: abc\x0a - 4: abc - 5: ab - 6: a - 7: - \abc\rdef - 0: abc - 1: ab - 2: a - 3: - \abc\r\ndef - 0: abc - 1: ab - 2: a - 3: - \abc\ndef - 0: abc\x0adef - 1: abc\x0ade - 2: abc\x0ad - 3: abc\x0a - 4: abc - 5: ab - 6: a - 7: - \abc\rdef - 0: abc\x0ddef - 1: abc\x0dde - 2: abc\x0dd - 3: abc\x0d - 4: abc - 5: ab - 6: a - 7: - \abc\r\ndef - 0: abc - 1: ab - 2: a - 3: - -/\w+(.)(.)?def/s - abc\ndef - 0: abc\x0adef - abc\rdef - 0: abc\x0ddef - abc\r\ndef - 0: abc\x0d\x0adef - -/^\w+=.*(\\\n.*)*/ - abc=xyz\\\npqr - 0: abc=xyz\\x0apqr - 1: abc=xyz\\x0apq - 2: abc=xyz\\x0ap - 3: abc=xyz\\x0a - 4: abc=xyz\ - 5: abc=xyz - 6: abc=xy - 7: abc=x - 8: abc= - -/^(a()*)*/ - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - 4: - -/^(?:a(?:(?:))*)*/ - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - 4: - -/^(a()+)+/ - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - -/^(?:a(?:(?:))+)+/ - aaaa - 0: aaaa - 1: aaa - 2: aa - 3: a - -/(a|)*\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - -/(?>a|)*\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - -/(?:a|)*\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - -/^a.b/ - a\rb - 0: a\x0db - a\nb\ - 0: a\x0ab + +/^\p{Zs}/8 + \ \ + 0: + \x{a0} + 0: \x{a0} + \x{1680} + 0: \x{1680} + \x{180e} + 0: \x{180e} + \x{2000} + 0: \x{2000} + \x{2001} + 0: \x{2001} ** Failers No match - a\nb -No match - a\nb\ + \x{2028} No match - a\rb\ + \x{200d} No match - a\rb\ -No match - -/^abc./mgx - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK - 0: abc1 - 0: abc2 - 0: abc3 - 0: abc4 - 0: abc5 - 0: abc6 - 0: abc7 - -/abc.$/mgx - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 - 0: abc1 - 0: abc2 - 0: abc3 - 0: abc4 - 0: abc5 - 0: abc6 - 0: abc9 - -/^a\Rb/ - a\nb - 0: a\x0ab - a\rb - 0: a\x0db - a\r\nb - 0: a\x0d\x0ab - a\x0bb - 0: a\x0bb - a\x0cb - 0: a\x0cb - a\x85b - 0: a\x85b + +/-- These four are here rather than in test 6 because Perl has problems with + the negative versions of the properties. --/ + +/\p{^Lu}/8i + 1234 + 0: 1 ** Failers -No match - a\n\rb + 0: * + ABC No match -/^a\R*b/ - ab - 0: ab - a\nb - 0: a\x0ab - a\rb - 0: a\x0db - a\r\nb - 0: a\x0d\x0ab - a\x0bb - 0: a\x0bb - a\x0cb - 0: a\x0cb - a\x85b - 0: a\x85b - a\n\rb - 0: a\x0a\x0db - a\n\r\x85\x0cb - 0: a\x0a\x0d\x85\x0cb - -/^a\R+b/ - a\nb - 0: a\x0ab - a\rb - 0: a\x0db - a\r\nb - 0: a\x0d\x0ab - a\x0bb - 0: a\x0bb - a\x0cb - 0: a\x0cb - a\x85b - 0: a\x85b - a\n\rb - 0: a\x0a\x0db - a\n\r\x85\x0cb - 0: a\x0a\x0d\x85\x0cb - ** Failers -No match - ab -No match - -/^a\R{1,3}b/ - a\nb - 0: a\x0ab - a\n\rb - 0: a\x0a\x0db - a\n\r\x85b - 0: a\x0a\x0d\x85b - a\r\n\r\nb - 0: a\x0d\x0a\x0d\x0ab - a\r\n\r\n\r\nb - 0: a\x0d\x0a\x0d\x0a\x0d\x0ab - a\n\r\n\rb - 0: a\x0a\x0d\x0a\x0db - a\n\n\r\nb - 0: a\x0a\x0a\x0d\x0ab +/\P{Lu}/8i + 1234 + 0: 1 ** Failers -No match - a\n\n\n\rb -No match - a\r + 0: * + ABC No match -/^a[\R]b/ - aRb - 0: aRb +/\p{Ll}/8i + a + 0: a + Az + 0: z ** Failers -No match - a\nb + 0: a + ABC No match -/.+foo/ - afoo - 0: afoo +/\p{Lu}/8i + A + 0: A + a\x{10a0}B + 0: \x{10a0} ** Failers + 0: F + a No match - \r\nfoo -No match - \nfoo + \x{1d00} No match -/.+foo/ - afoo - 0: afoo - \nfoo - 0: \x0afoo - ** Failers -No match - \r\nfoo -No match +/[\x{c0}\x{391}]/8i + \x{c0} + 0: \x{c0} + \x{e0} + 0: \x{e0} + +/-- The next two are special cases where the lengths of the different cases of +the same character differ. The first went wrong with heap frame storage; the +second was broken in all cases. --/ + +/^\x{023a}+?(\x{0130}+)/8i + \x{023a}\x{2c65}\x{0130} + 0: \x{23a}\x{2c65}\x{130} + 1: \x{130} + +/^\x{023a}+([^X])/8i + \x{023a}\x{2c65}X + 0: \x{23a}\x{2c65} + 1: \x{2c65} + +/\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} + +/(\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{c0}$/8i + \x{c0} + 0: \x{c0} + \x{e0} + 0: \x{e0} + +/^\x{e0}$/8i + \x{c0} + 0: \x{c0} + \x{e0} + 0: \x{e0} + +/-- The next two should be Perl-compatible, but it fails to match \x{e0}. PCRE +will match it only with UCP support, because without that it has no notion +of case for anything other than the ASCII letters. --/ + +/((?i)[\x{c0}])/8 + \x{c0} + 0: \x{c0} + 1: \x{c0} + \x{e0} + 0: \x{e0} + 1: \x{e0} + +/(?i:[\x{c0}])/8 + \x{c0} + 0: \x{c0} + \x{e0} + 0: \x{e0} -/.+foo/ - afoo - 0: afoo - ** Failers -No match - \nfoo -No match - \r\nfoo +/-- This should be Perl-compatible but Perl 5.11 gets \x{300} wrong. --/8 + +/^\X/8 + A + 0: A + A\x{300}BC + 0: A\x{300} + A\x{300}\x{301}\x{302}BC + 0: A\x{300}\x{301}\x{302} + *** Failers + 0: * + \x{300} No match + +/-- These are PCRE's extra properties to help with Unicodizing \d etc. --/ -/.+foo/s - afoo - 0: afoo - \r\nfoo - 0: \x0d\x0afoo - \nfoo - 0: \x0afoo - -/^$/mg - abc\r\rxyz - 0: - abc\n\rxyz - 0: - ** Failers +/^\p{Xan}/8 + ABCD + 0: A + 1234 + 0: 1 + \x{6ca} + 0: \x{6ca} + \x{a6c} + 0: \x{a6c} + \x{10a7} + 0: \x{10a7} + ** Failers No match - abc\r\nxyz + _ABC No match -/^X/m - XABC - 0: X - ** Failers +/^\p{Xan}+/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 0: ABCD1234\x{6ca}\x{a6c}\x{10a7} + ** Failers No match - XABC\B + _ABC No match -/(?m)^$/g+ - abc\r\n\r\n - 0: - 0+ \x0d\x0a - -/(?m)^$|^\r\n/g+ - abc\r\n\r\n - 0: \x0d\x0a - 0+ - 1: - -/(?m)$/g+ - abc\r\n\r\n - 0: - 0+ \x0d\x0a\x0d\x0a - 0: - 0+ \x0d\x0a - 0: - 0+ - -/(?|(abc)|(xyz))/ - >abc< - 0: abc - >xyz< - 0: xyz +/^\p{Xan}+?/8 + \x{6ca}\x{a6c}\x{10a7}_ + 0: \x{6ca} -/(x)(?|(abc)|(xyz))(x)/ - xabcx - 0: xabcx - xxyzx - 0: xxyzx - -/(x)(?|(abc)(pqr)|(xyz))(x)/ - xabcpqrx - 0: xabcpqrx - xxyzx - 0: xxyzx - -/(?|(abc)|(xyz))(?1)/ - abcabc - 0: abcabc - xyzabc - 0: xyzabc - ** Failers +/^\p{Xan}*/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 0: ABCD1234\x{6ca}\x{a6c}\x{10a7} + +/^\p{Xan}{2,9}/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 0: ABCD1234\x{6ca} + +/^\p{Xan}{2,9}?/8 + \x{6ca}\x{a6c}\x{10a7}_ + 0: \x{6ca}\x{a6c} + +/^[\p{Xan}]/8 + ABCD1234_ + 0: A + 1234abcd_ + 0: 1 + \x{6ca} + 0: \x{6ca} + \x{a6c} + 0: \x{a6c} + \x{10a7} + 0: \x{10a7} + ** Failers No match - xyzxyz + _ABC No match -/\H\h\V\v/ - X X\x0a - 0: X X\x0a - X\x09X\x0b - 0: X\x09X\x0b +/^[\p{Xan}]+/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 0: ABCD1234\x{6ca}\x{a6c}\x{10a7} ** Failers No match - \xa0 X\x0a -No match - -/\H*\h+\V?\v{3,4}/ - \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a - 0: \x09 \xa0X\x0a\x0b\x0c\x0d - 1: \x09 \xa0X\x0a\x0b\x0c - \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a - 0: \x09 \xa0\x0a\x0b\x0c\x0d - 1: \x09 \xa0\x0a\x0b\x0c - \x09\x20\xa0\x0a\x0b\x0c - 0: \x09 \xa0\x0a\x0b\x0c - ** Failers -No match - \x09\x20\xa0\x0a\x0b + _ABC No match - -/\H{3,4}/ - XY ABCDE - 0: ABCD - 1: ABC - XY PQR ST - 0: PQR - -/.\h{3,4}./ - XY AB PQRS - 0: B P - 1: B - -/\h*X\h?\H+Y\H?Z/ - >XNNNYZ - 0: XNNNYZ - > X NYQZ - 0: X NYQZ + +/^>\p{Xsp}/8 + >\x{1680}\x{2028}\x{0b} + 0: >\x{1680} + >\x{a0} + 0: >\x{a0} ** Failers No match - >XYZ -No match - > X NY Z + \x{0b} No match -/\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ - >XY\x0aZ\x0aA\x0bNN\x0c - 0: XY\x0aZ\x0aA\x0bNN\x0c - >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c - 0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c +/^>\p{Xsp}+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} -/.+A/ - \r\nA -No match +/^>\p{Xsp}+?/8 + >\x{1680}\x{2028}\x{0b} + 0: >\x{1680} + +/^>\p{Xsp}*/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} + +/^>\p{Xsp}{2,9}/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} + +/^>\p{Xsp}{2,9}?/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09} -/\nA/ - \r\nA - 0: \x0aA - -/[\r\n]A/ - \r\nA - 0: \x0aA - -/(\r|\n)A/ - \r\nA - 0: \x0aA +/^>[\p{Xsp}]/8 + >\x{2028}\x{0b} + 0: >\x{2028} + +/^>[\p{Xsp}]+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} -/a\Rb/I -Capturing subpattern count = 0 -Options: bsr_anycrlf -First char = 'a' -Need char = 'b' - a\rb - 0: a\x0db - a\nb - 0: a\x0ab - a\r\nb - 0: a\x0d\x0ab +/^>\p{Xps}/8 + >\x{1680}\x{2028}\x{0b} + 0: >\x{1680} + >\x{a0} + 0: >\x{a0} ** Failers No match - a\x85b -No match - a\x0bb + \x{0b} No match -/a\Rb/I -Capturing subpattern count = 0 -Options: bsr_unicode -First char = 'a' -Need char = 'b' - a\rb - 0: a\x0db - a\nb - 0: a\x0ab - a\r\nb - 0: a\x0d\x0ab - a\x85b - 0: a\x85b - a\x0bb - 0: a\x0bb - ** Failers -No match - a\x85b\ -No match - a\x0bb\ -No match - -/a\R?b/I -Capturing subpattern count = 0 -Options: bsr_anycrlf -First char = 'a' -Need char = 'b' - a\rb - 0: a\x0db - a\nb - 0: a\x0ab - a\r\nb - 0: a\x0d\x0ab - ** Failers -No match - a\x85b -No match - a\x0bb -No match +/^>\p{Xps}+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} -/a\R?b/I -Capturing subpattern count = 0 -Options: bsr_unicode -First char = 'a' -Need char = 'b' - a\rb - 0: a\x0db - a\nb - 0: a\x0ab - a\r\nb - 0: a\x0d\x0ab - a\x85b - 0: a\x85b - a\x0bb - 0: a\x0bb - ** Failers -No match - a\x85b\ -No match - a\x0bb\ -No match - -/a\R{2,4}b/I -Capturing subpattern count = 0 -Options: bsr_anycrlf -First char = 'a' -Need char = 'b' - a\r\n\nb - 0: a\x0d\x0a\x0ab - a\n\r\rb - 0: a\x0a\x0d\x0db - a\r\n\r\n\r\n\r\nb - 0: a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0ab - ** Failers -No match - a\x85\85b -No match - a\x0b\0bb -No match +/^>\p{Xps}+?/8 + >\x{1680}\x{2028}\x{0b} + 0: >\x{1680} -/a\R{2,4}b/I -Capturing subpattern count = 0 -Options: bsr_unicode -First char = 'a' -Need char = 'b' - a\r\rb - 0: a\x0d\x0db - a\n\n\nb - 0: a\x0a\x0a\x0ab - a\r\n\n\r\rb - 0: a\x0d\x0a\x0a\x0d\x0db - a\x85\85b -No match - a\x0b\0bb -No match - ** Failers -No match - a\r\r\r\r\rb -No match - a\x85\85b\ -No match - a\x0b\0bb\ -No match +/^>\p{Xps}*/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} -/a(?!)|\wbc/ - abc - 0: abc +/^>\p{Xps}{2,9}/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + +/^>\p{Xps}{2,9}?/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09} + +/^>[\p{Xps}]/8 + >\x{2028}\x{0b} + 0: >\x{2028} + +/^>[\p{Xps}]+/8 + > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} + 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} -/a[]b/ +/^\p{Xwd}/8 + ABCD + 0: A + 1234 + 0: 1 + \x{6ca} + 0: \x{6ca} + \x{a6c} + 0: \x{a6c} + \x{10a7} + 0: \x{10a7} + _ABC + 0: _ ** Failers No match - ab + [] No match -/a[]+b/ - ** Failers -No match - ab -No match +/^\p{Xwd}+/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 0: ABCD1234\x{6ca}\x{a6c}\x{10a7}_ -/a[]*+b/ - ** Failers -No match - ab -No match +/^\p{Xwd}+?/8 + \x{6ca}\x{a6c}\x{10a7}_ + 0: \x{6ca} -/a[^]b/ - aXb - 0: aXb - a\nb - 0: a\x0ab - ** Failers -No match - ab -No match +/^\p{Xwd}*/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 0: ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + +/^\p{Xwd}{2,9}/8 + A_B12\x{6ca}\x{a6c}\x{10a7} + 0: A_B12\x{6ca}\x{a6c}\x{10a7} -/a[^]+b/ - aXb - 0: aXb - a\nX\nXb - 0: a\x0aX\x0aXb +/^\p{Xwd}{2,9}?/8 + \x{6ca}\x{a6c}\x{10a7}_ + 0: \x{6ca}\x{a6c} + +/^[\p{Xwd}]/8 + ABCD1234_ + 0: A + 1234abcd_ + 0: 1 + \x{6ca} + 0: \x{6ca} + \x{a6c} + 0: \x{a6c} + \x{10a7} + 0: \x{10a7} + _ABC + 0: _ ** Failers No match - ab -No match - -/X$/E - X - 0: X - ** Failers -No match - X\n + [] No match + +/^[\p{Xwd}]+/8 + ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + 0: ABCD1234\x{6ca}\x{a6c}\x{10a7}_ + +/-- A check not in UTF-8 mode --/ + +/^[\p{Xwd}]+/ + ABCD1234_ + 0: ABCD1234_ + +/-- Some negative checks --/ + +/^[\P{Xwd}]+/8 + !.+\x{019}\x{35a}AB + 0: !.+\x{19}\x{35a} + +/^[\p{^Xwd}]+/8 + !.+\x{019}\x{35a}AB + 0: !.+\x{19}\x{35a} + +/[\D]/WBZ8 +------------------------------------------------------------------ + Bra + [\P{Nd}] + Ket + End +------------------------------------------------------------------ + 1\x{3c8}2 + 0: \x{3c8} + +/[\d]/WBZ8 +------------------------------------------------------------------ + Bra + [\p{Nd}] + Ket + End +------------------------------------------------------------------ + >\x{6f4}< + 0: \x{6f4} + +/[\S]/WBZ8 +------------------------------------------------------------------ + Bra + [\P{Xsp}] + Ket + End +------------------------------------------------------------------ + \x{1680}\x{6f4}\x{1680} + 0: \x{6f4} + +/[\s]/WBZ8 +------------------------------------------------------------------ + Bra + [\p{Xsp}] + Ket + End +------------------------------------------------------------------ + >\x{1680}< + 0: \x{1680} + +/[\W]/WBZ8 +------------------------------------------------------------------ + Bra + [\P{Xwd}] + Ket + End +------------------------------------------------------------------ + A\x{1712}B + 0: \x{1712} + +/[\w]/WBZ8 +------------------------------------------------------------------ + Bra + [\p{Xwd}] + Ket + End +------------------------------------------------------------------ + >\x{1723}< + 0: \x{1723} + +/\D/WBZ8 +------------------------------------------------------------------ + Bra + notprop Nd + Ket + End +------------------------------------------------------------------ + 1\x{3c8}2 + 0: \x{3c8} + +/\d/WBZ8 +------------------------------------------------------------------ + Bra + prop Nd + Ket + End +------------------------------------------------------------------ + >\x{6f4}< + 0: \x{6f4} + +/\S/WBZ8 +------------------------------------------------------------------ + Bra + notprop Xsp + Ket + End +------------------------------------------------------------------ + \x{1680}\x{6f4}\x{1680} + 0: \x{6f4} + +/\s/WBZ8 +------------------------------------------------------------------ + Bra + prop Xsp + Ket + End +------------------------------------------------------------------ + >\x{1680}> + 0: \x{1680} + +/\W/WBZ8 +------------------------------------------------------------------ + Bra + notprop Xwd + Ket + End +------------------------------------------------------------------ + A\x{1712}B + 0: \x{1712} + +/\w/WBZ8 +------------------------------------------------------------------ + Bra + prop Xwd + Ket + End +------------------------------------------------------------------ + >\x{1723}< + 0: \x{1723} + +/[[:alpha:]]/WBZ +------------------------------------------------------------------ + Bra + [\p{L}] + Ket + End +------------------------------------------------------------------ + +/[[:lower:]]/WBZ +------------------------------------------------------------------ + Bra + [\p{Ll}] + Ket + End +------------------------------------------------------------------ + +/[[:upper:]]/WBZ +------------------------------------------------------------------ + Bra + [\p{Lu}] + Ket + End +------------------------------------------------------------------ + +/[[:alnum:]]/WBZ +------------------------------------------------------------------ + Bra + [\p{Xan}] + Ket + End +------------------------------------------------------------------ + +/[[:ascii:]]/WBZ +------------------------------------------------------------------ + Bra + [\x00-\x7f] + Ket + End +------------------------------------------------------------------ + +/[[:cntrl:]]/WBZ +------------------------------------------------------------------ + Bra + [\x00-\x1f\x7f] + Ket + End +------------------------------------------------------------------ + +/[[:digit:]]/WBZ +------------------------------------------------------------------ + Bra + [\p{Nd}] + Ket + End +------------------------------------------------------------------ + +/[[:graph:]]/WBZ +------------------------------------------------------------------ + Bra + [!-~] + Ket + End +------------------------------------------------------------------ + +/[[:print:]]/WBZ +------------------------------------------------------------------ + Bra + [ -~] + Ket + End +------------------------------------------------------------------ + +/[[:punct:]]/WBZ +------------------------------------------------------------------ + Bra + [!-/:-@[-`{-~] + Ket + End +------------------------------------------------------------------ + +/[[:space:]]/WBZ +------------------------------------------------------------------ + Bra + [\p{Xps}] + Ket + End +------------------------------------------------------------------ + +/[[:word:]]/WBZ +------------------------------------------------------------------ + Bra + [\p{Xwd}] + Ket + End +------------------------------------------------------------------ + +/[[:xdigit:]]/WBZ +------------------------------------------------------------------ + Bra + [0-9A-Fa-f] + Ket + End +------------------------------------------------------------------ + +/-- Unicode properties for \b abd \B --/ + +/\b...\B/8W + abc_ + 0: abc + \x{37e}abc\x{376} + 0: abc + \x{37e}\x{376}\x{371}\x{393}\x{394} + 0: \x{376}\x{371}\x{393} + !\x{c0}++\x{c1}\x{c2} + 0: ++\x{c1} + !\x{c0}+++++ + 0: \x{c0}++ -/X$/ - X - 0: X - X\n - 0: X - -/xyz/C - xyz ---->xyz - +0 ^ x - +1 ^^ y - +2 ^ ^ z - +3 ^ ^ - 0: xyz - abcxyz ---->abcxyz - +0 ^ x - +1 ^^ y - +2 ^ ^ z - +3 ^ ^ - 0: xyz - abcxyz\Y ---->abcxyz - +0 ^ x - +0 ^ x - +0 ^ x - +0 ^ x - +1 ^^ y - +2 ^ ^ z - +3 ^ ^ - 0: xyz - ** Failers -No match - abc -No match - abc\Y ---->abc - +0 ^ x - +0 ^ x - +0 ^ x - +0 ^ x -No match - abcxypqr -No match - abcxypqr\Y ---->abcxypqr - +0 ^ x - +0 ^ x - +0 ^ x - +0 ^ x - +1 ^^ y - +2 ^ ^ z - +0 ^ x - +0 ^ x - +0 ^ x - +0 ^ x - +0 ^ x -No match - -/(*NO_START_OPT)xyz/C - abcxyz ---->abcxyz -+15 ^ x -+15 ^ x -+15 ^ x -+15 ^ x -+16 ^^ y -+17 ^ ^ z -+18 ^ ^ - 0: xyz - -/(?C)ab/ - ab ---->ab - 0 ^ a - 0: ab - \C-ab - 0: ab - -/ab/C - ab ---->ab - +0 ^ a - +1 ^^ b - +2 ^ ^ - 0: ab - \C-ab - 0: ab - -/^"((?(?=[a])[^"])|b)*"$/C - "ab" ---->"ab" - +0 ^ ^ - +1 ^ " - +2 ^^ ((?(?=[a])[^"])|b)* -+21 ^^ " - +3 ^^ (?(?=[a])[^"]) -+18 ^^ b - +5 ^^ (?=[a]) - +8 ^ [a] -+11 ^^ ) -+12 ^^ [^"] -+16 ^ ^ ) -+17 ^ ^ | -+21 ^ ^ " - +3 ^ ^ (?(?=[a])[^"]) -+18 ^ ^ b - +5 ^ ^ (?=[a]) - +8 ^ [a] -+19 ^ ^ ) -+21 ^ ^ " - +3 ^ ^ (?(?=[a])[^"]) -+18 ^ ^ b - +5 ^ ^ (?=[a]) - +8 ^ [a] -+17 ^ ^ | -+22 ^ ^ $ -+23 ^ ^ - 0: "ab" - \C-"ab" - 0: "ab" - -/\d+X|9+Y/ - ++++123999\P -Partial match: 123999 - ++++123999Y\P - 0: 999Y +/-- Without PCRE_UCP, non-ASCII always fail, even if < 256 --/ -/Z(*F)/ - Z\P +/\b...\B/8 + abc_ + 0: abc + ** Failers + 0: Fai + \x{37e}abc\x{376} No match - ZA\P + \x{37e}\x{376}\x{371}\x{393}\x{394} No match - -/Z(?!)/ - Z\P + !\x{c0}++\x{c1}\x{c2} No match - ZA\P + !\x{c0}+++++ No match -/dog(sbody)?/ - dogs\P - 0: dog - dogs\P\P -Partial match: dogs - -/dog(sbody)??/ - dogs\P - 0: dog - dogs\P\P -Partial match: dogs - -/dog|dogsbody/ - dogs\P - 0: dog - dogs\P\P -Partial match: dogs - -/dogsbody|dog/ - dogs\P - 0: dog - dogs\P\P -Partial match: dogs - -/Z(*F)Q|ZXY/ - Z\P -Partial match: Z - ZA\P -No match - X\P -No match - -/\bthe cat\b/ - the cat\P - 0: the cat - the cat\P\P -Partial match: the cat - -/dog(sbody)?/ - dogs\D\P - 0: dog - body\D\R - 0: body - -/dog(sbody)?/ - dogs\D\P\P -Partial match: dogs - body\D\R - 0: body +/-- With PCRE_UCP, non-UTF8 chars that are < 256 still check properties --/ -/abc/ - abc\P - 0: abc - abc\P\P +/\b...\B/W + abc_ 0: abc + !\x{c0}++\x{c1}\x{c2} + 0: ++\xc1 + !\x{c0}+++++ + 0: \xc0++ -/abc\K123/ - xyzabc123pqr -Error -16 - -/(?<=abc)123/ - xyzabc123pqr - 0: 123 - xyzabc12\P -Partial match: abc12 - xyzabc12\P\P -Partial match: abc12 +/-- Some of these are silly, but they check various combinations --/ -/\babc\b/ - +++abc+++ +/[[:^alpha:][:^cntrl:]]+/8WBZ +------------------------------------------------------------------ + Bra + [ -~\x80-\xff\P{L}]+ + Ket + End +------------------------------------------------------------------ + 123 + 0: 123 + abc 0: abc - +++ab\P -Partial match: +ab - +++ab\P\P -Partial match: +ab - -/(?=C)/g+ - ABCDECBA - 0: - 0+ CDECBA - 0: - 0+ CBA -/(abc|def|xyz)/I -Capturing subpattern count = 1 -No options -No first char -No need char - terhjk;abcdaadsfe +/[[:^cntrl:][:^alpha:]]+/8WBZ +------------------------------------------------------------------ + Bra + [ -~\x80-\xff\P{L}]+ + Ket + End +------------------------------------------------------------------ + 123 + 0: 123 + abc 0: abc - the quick xyz brown fox - 0: xyz - \Yterhjk;abcdaadsfe + +/[[:alpha:]]+/8WBZ +------------------------------------------------------------------ + Bra + [\p{L}]+ + Ket + End +------------------------------------------------------------------ + abc 0: abc - \Ythe quick xyz brown fox - 0: xyz - ** Failers -No match - thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd -No match - \Ythejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd -No match -/(abc|def|xyz)/SI -Capturing subpattern count = 1 -No options -No first char -No need char -Subject length lower bound = 3 -Starting byte set: a d x - terhjk;abcdaadsfe +/[[:^alpha:]\S]+/8WBZ +------------------------------------------------------------------ + Bra + [\P{L}\P{Xsp}]+ + Ket + End +------------------------------------------------------------------ + 123 + 0: 123 + abc 0: abc - the quick xyz brown fox - 0: xyz - \Yterhjk;abcdaadsfe + +/[^\d]+/8WBZ +------------------------------------------------------------------ + Bra + [^\p{Nd}]+ + Ket + End +------------------------------------------------------------------ + abc123 0: abc - \Ythe quick xyz brown fox - 0: xyz - ** Failers + abc\x{123} + 0: abc\x{123} + \x{660}abc + 0: abc + +/\p{Lu}+9\p{Lu}+B\p{Lu}+b/BZ +------------------------------------------------------------------ + Bra + prop Lu ++ + 9 + prop Lu + + B + prop Lu ++ + b + Ket + End +------------------------------------------------------------------ + +/\p{^Lu}+9\p{^Lu}+B\p{^Lu}+b/BZ +------------------------------------------------------------------ + Bra + notprop Lu + + 9 + notprop Lu ++ + B + notprop Lu + + b + Ket + End +------------------------------------------------------------------ + +/\P{Lu}+9\P{Lu}+B\P{Lu}+b/BZ +------------------------------------------------------------------ + Bra + notprop Lu + + 9 + notprop Lu ++ + B + notprop Lu + + b + Ket + End +------------------------------------------------------------------ + +/\p{Han}+X\p{Greek}+\x{370}/BZ8 +------------------------------------------------------------------ + Bra + prop Han ++ + X + prop Greek + + \x{370} + Ket + End +------------------------------------------------------------------ + +/\p{Xan}+!\p{Xan}+A/BZ +------------------------------------------------------------------ + Bra + prop Xan ++ + ! + prop Xan + + A + Ket + End +------------------------------------------------------------------ + +/\p{Xsp}+!\p{Xsp}\t/BZ +------------------------------------------------------------------ + Bra + prop Xsp ++ + ! + prop Xsp + \x09 + Ket + End +------------------------------------------------------------------ + +/\p{Xps}+!\p{Xps}\t/BZ +------------------------------------------------------------------ + Bra + prop Xps ++ + ! + prop Xps + \x09 + Ket + End +------------------------------------------------------------------ + +/\p{Xwd}+!\p{Xwd}_/BZ +------------------------------------------------------------------ + Bra + prop Xwd ++ + ! + prop Xwd + _ + Ket + End +------------------------------------------------------------------ + +/A+\p{N}A+\dB+\p{N}*B+\d*/WBZ +------------------------------------------------------------------ + Bra + A++ + prop N + A++ + prop Nd + B+ + prop N *+ + B+ + prop Nd * + Ket + End +------------------------------------------------------------------ + +/-- These behaved oddly in Perl, so they are kept in this test --/ + +/(\x{23a}\x{23a}\x{23a})?\1/8i + \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65} +No match + +/(ȺȺȺ)?\1/8i + ȺȺȺⱥⱥ +No match + +/(\x{23a}\x{23a}\x{23a})?\1/8i + \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65} + 0: \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65} + 1: \x{23a}\x{23a}\x{23a} + +/(ȺȺȺ)?\1/8i + ȺȺȺⱥⱥⱥ + 0: \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65} + 1: \x{23a}\x{23a}\x{23a} + +/(\x{23a}\x{23a}\x{23a})\1/8i + \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65} +No match + +/(ȺȺȺ)\1/8i + ȺȺȺⱥⱥ +No match + +/(\x{23a}\x{23a}\x{23a})\1/8i + \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65} + 0: \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65} + 1: \x{23a}\x{23a}\x{23a} + +/(ȺȺȺ)\1/8i + ȺȺȺⱥⱥⱥ + 0: \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65} + 1: \x{23a}\x{23a}\x{23a} + +/(\x{2c65}\x{2c65})\1/8i + \x{2c65}\x{2c65}\x{23a}\x{23a} + 0: \x{2c65}\x{2c65}\x{23a}\x{23a} + 1: \x{2c65}\x{2c65} + +/(ⱥⱥ)\1/8i + ⱥⱥȺȺ + 0: \x{2c65}\x{2c65}\x{23a}\x{23a} + 1: \x{2c65}\x{2c65} + +/(\x{23a}\x{23a}\x{23a})\1Y/8i + X\x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65}YZ + 0: \x{23a}\x{23a}\x{23a}\x{2c65}\x{2c65}\x{2c65}Y + 1: \x{23a}\x{23a}\x{23a} + +/(\x{2c65}\x{2c65})\1Y/8i + X\x{2c65}\x{2c65}\x{23a}\x{23a}YZ + 0: \x{2c65}\x{2c65}\x{23a}\x{23a}Y + 1: \x{2c65}\x{2c65} + +/-- --/ + +/-- These scripts weren't yet in Perl when I added Unicode 6.0.0 to PCRE --/ + +/^[\p{Batak}]/8 + \x{1bc0} + 0: \x{1bc0} + \x{1bff} + 0: \x{1bff} + ** Failers +No match + \x{1bf4} +No match + +/^[\p{Brahmi}]/8 + \x{11000} + 0: \x{11000} + \x{1106f} + 0: \x{1106f} + ** Failers +No match + \x{1104e} +No match + +/^[\p{Mandaic}]/8 + \x{840} + 0: \x{840} + \x{85e} + 0: \x{85e} + ** Failers +No match + \x{85c} No match - thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd -No match - \Ythejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd + \x{85d} No match -/abcd*/+ - xxxxabcd\P - 0: abcd - 0+ - 1: abc - xxxxabcd\P\P -Partial match: abcd - dddxxx\R - 0: ddd - 0+ xxx - 1: dd - 2: d - 3: - xxxxabcd\P\P -Partial match: abcd - xxx\R - 0: - 0+ xxx - -/abcd*/i - xxxxabcd\P - 0: abcd - 1: abc - xxxxabcd\P\P -Partial match: abcd - XXXXABCD\P - 0: ABCD - 1: ABC - XXXXABCD\P\P -Partial match: ABCD - -/abc\d*/ - xxxxabc1\P - 0: abc1 - 1: abc - xxxxabc1\P\P -Partial match: abc1 - -/abc[de]*/ - xxxxabcde\P - 0: abcde - 1: abcd - 2: abc - xxxxabcde\P\P -Partial match: abcde +/-- --/ -/(?:(?1)|B)(A(*F)|C)/ - ABCD - 0: BC - CCD - 0: CC - ** Failers -No match - CAD -No match +/(\X*)(.)/s8 + A\x{300} + 0: A + 1: + 2: A -/^(?:(?1)|B)(A(*F)|C)/ - CCD - 0: CC - BCD - 0: BC - ** Failers -No match - ABCD -No match - CAD +/^S(\X*)e(\X*)$/8 + Stéréo No match - BAD + +/^\X/8 + ́réo No match -/^(?!a(*SKIP)b)/ - ac -Error -16 - -/^(?=a(*SKIP)b|ac)/ - ** Failers +/^a\X41z/ + aX41z + 0: aX41z + *** Failers No match - ac -Error -16 - -/^(?=a(*THEN)b|ac)/ - ac -Error -16 - -/^(?=a(*PRUNE)b)/ - ab -Error -16 - ** Failers + aAz No match - ac -Error -16 -/^(?(?!a(*SKIP)b))/ - ac -Error -16 - -/(?<=abc)def/ - abc\P\P -Partial match: abc +/(?<=ab\Cde)X/8 +Failed: \C not allowed in lookbehind assertion at offset 10 -/abc$/ - abc - 0: abc - abc\P - 0: abc - abc\P\P -Partial match: abc +/\X/ + a\P + 0: a + a\P\P +Partial match: a -/abc$/m - abc - 0: abc - abc\n - 0: abc - abc\P\P -Partial match: abc - abc\n\P\P - 0: abc - abc\P - 0: abc - abc\n\P - 0: abc +/\Xa/ + aa\P + 0: aa + aa\P\P + 0: aa -/abc\z/ - abc - 0: abc - abc\P - 0: abc - abc\P\P -Partial match: abc +/\X{2}/ + aa\P + 0: aa + aa\P\P +Partial match: aa -/abc\Z/ - abc - 0: abc - abc\P - 0: abc - abc\P\P -Partial match: abc +/\X+a/ + a\P +Partial match: a + aa\P + 0: aa + aa\P\P +Partial match: aa -/abc\b/ - abc - 0: abc - abc\P - 0: abc - abc\P\P -Partial match: abc +/\X+?a/ + a\P +Partial match: a + ab\P +Partial match: ab + aa\P + 0: aa + aa\P\P + 0: aa + aba\P + 0: aba + +/-- These Unicode 6.1.0 scripts are not known to Perl. --/ -/abc\B/ - abc -No match - abc\P -Partial match: abc - abc\P\P -Partial match: abc +/\p{Chakma}\d/8W + \x{11100}\x{1113c} + 0: \x{11100}\x{1113c} + +/\p{Takri}\d/8W + \x{11680}\x{116c0} + 0: \x{11680}\x{116c0} -/.+/ - abc\>0 - 0: abc - 1: ab - 2: a - abc\>1 - 0: bc - 1: b - abc\>2 - 0: c - abc\>3 -No match - abc\>4 -Error -24 - abc\>-4 -Error -24 +/^\X/8 + A\P + 0: A + A\P\P +Partial match: A + A\x{300}\x{301}\P + 0: A\x{300}\x{301} + A\x{300}\x{301}\P\P +Partial match: A\x{300}\x{301} + A\x{301}\P + 0: A\x{301} + A\x{301}\P\P +Partial match: A\x{301} + +/^\X{2,3}/8 + A\P +Partial match: A + A\P\P +Partial match: A + AA\P + 0: AA + AA\P\P +Partial match: AA + A\x{300}\x{301}\P +Partial match: A\x{300}\x{301} + A\x{300}\x{301}\P\P +Partial match: A\x{300}\x{301} + A\x{300}\x{301}A\x{300}\x{301}\P + 0: A\x{300}\x{301}A\x{300}\x{301} + A\x{300}\x{301}A\x{300}\x{301}\P\P +Partial match: A\x{300}\x{301}A\x{300}\x{301} + +/^\X{2}/8 + AA\P + 0: AA + AA\P\P +Partial match: AA + A\x{300}\x{301}A\x{300}\x{301}\P + 0: A\x{300}\x{301}A\x{300}\x{301} + A\x{300}\x{301}A\x{300}\x{301}\P\P +Partial match: A\x{300}\x{301}A\x{300}\x{301} + +/^\X+/8 + AA\P + 0: AA + AA\P\P +Partial match: AA + +/^\X+?Z/8 + AA\P +Partial match: AA + AA\P\P +Partial match: AA /-- End of testinput7 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput8 php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput8 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput8 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput8 2012-11-21 05:12:20.000000000 +0000 @@ -1,531 +1,445 @@ -/-- This set of tests checks UTF-8 support with the DFA matching functionality - of pcre_dfa_exec(). The -dfa flag must be used with pcretest when running - it. --/ - -/\x{100}ab/8 - \x{100}ab - 0: \x{100}ab - -/a\x{100}*b/8 - ab - 0: ab - a\x{100}b - 0: a\x{100}b - a\x{100}\x{100}b - 0: a\x{100}\x{100}b - -/a\x{100}+b/8 - a\x{100}b - 0: a\x{100}b - a\x{100}\x{100}b - 0: a\x{100}\x{100}b +/-- This set of tests check the DFA matching functionality of pcre_dfa_exec(). + The -dfa flag must be used with pcretest when running it. --/ + +/abc/ + abc + 0: abc + +/ab*c/ + abc + 0: abc + abbbbc + 0: abbbbc + ac + 0: ac + +/ab+c/ + abc + 0: abc + abbbbbbc + 0: abbbbbbc *** Failers No match + ac +No match ab No match - -/\bX/8 - Xoanon - 0: X - +Xoanon - 0: X - \x{300}Xoanon - 0: X - *** Failers + +/a*/ + a + 0: a + 1: + aaaaaaaaaaaaaaaaa + 0: aaaaaaaaaaaaaaaaa + 1: aaaaaaaaaaaaaaaa + 2: aaaaaaaaaaaaaaa + 3: aaaaaaaaaaaaaa + 4: aaaaaaaaaaaaa + 5: aaaaaaaaaaaa + 6: aaaaaaaaaaa + 7: aaaaaaaaaa + 8: aaaaaaaaa + 9: aaaaaaaa +10: aaaaaaa +11: aaaaaa +12: aaaaa +13: aaaa +14: aaa +15: aa +16: a +17: + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +Matched, but too many subsidiary matches + 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa + 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaa + 3: aaaaaaaaaaaaaaaaaaaaaaaaaaa + 4: aaaaaaaaaaaaaaaaaaaaaaaaaa + 5: aaaaaaaaaaaaaaaaaaaaaaaaa + 6: aaaaaaaaaaaaaaaaaaaaaaaa + 7: aaaaaaaaaaaaaaaaaaaaaaa + 8: aaaaaaaaaaaaaaaaaaaaaa + 9: aaaaaaaaaaaaaaaaaaaaa +10: aaaaaaaaaaaaaaaaaaaa +11: aaaaaaaaaaaaaaaaaaa +12: aaaaaaaaaaaaaaaaaa +13: aaaaaaaaaaaaaaaaa +14: aaaaaaaaaaaaaaaa +15: aaaaaaaaaaaaaaa +16: aaaaaaaaaaaaaa +17: aaaaaaaaaaaaa +18: aaaaaaaaaaaa +19: aaaaaaaaaaa +20: aaaaaaaaaa +21: aaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\F + 0: + +/(a|abcd|african)/ + a + 0: a + abcd + 0: abcd + 1: a + african + 0: african + 1: a + +/^abc/ + abcdef + 0: abc + *** Failers +No match + xyzabc No match - YXoanon + xyz\nabc No match -/\BX/8 - YXoanon - 0: X +/^abc/m + abcdef + 0: abc + xyz\nabc + 0: abc *** Failers No match - Xoanon + xyzabc No match - +Xoanon + +/\Aabc/ + abcdef + 0: abc + *** Failers No match - \x{300}Xoanon + xyzabc No match - -/X\b/8 - X+oanon - 0: X - ZX\x{300}oanon - 0: X - FAX - 0: X - *** Failers + xyz\nabc +No match + +/\Aabc/m + abcdef + 0: abc + *** Failers +No match + xyzabc No match - Xoanon + xyz\nabc No match -/X\B/8 - Xoanon - 0: X +/\Gabc/ + abcdef + 0: abc + xyzabc\>3 + 0: abc *** Failers No match - X+oanon + xyzabc +No match + xyzabc\>2 +No match + +/x\dy\Dz/ + x9yzz + 0: x9yzz + x0y+z + 0: x0y+z + *** Failers No match - ZX\x{300}oanon + xyz No match - FAX + xxy0z No match -/[^a]/8 - abcd - 0: b - a\x{100} - 0: \x{100} - -/^[abc\x{123}\x{400}-\x{402}]{2,3}\d/8 - ab99 - 0: ab9 - \x{123}\x{123}45 - 0: \x{123}\x{123}4 - \x{400}\x{401}\x{402}6 - 0: \x{400}\x{401}\x{402}6 +/x\sy\Sz/ + x yzz + 0: x yzz + x y+z + 0: x y+z *** Failers No match - d99 + xyz No match - \x{123}\x{122}4 + xxyyz No match - \x{400}\x{403}6 + +/x\wy\Wz/ + xxy+z + 0: xxy+z + *** Failers No match - \x{400}\x{401}\x{402}\x{402}6 + xxy0z No match - -/abc/8 - ] -Error -10 - -Error -10 - -Error -10 - \? + x+y+z No match - \xe1\x88 -Error -10 - \P\xe1\x88 -Error -10 - \P\P\xe1\x88 -Error -25 - -/a.b/8 - acb - 0: acb - a\x7fb - 0: a\x{7f}b - a\x{100}b - 0: a\x{100}b + +/x.y/ + x+y + 0: x+y + x-y + 0: x-y *** Failers No match - a\nb + x\ny +No match + +/x.y/s + x+y + 0: x+y + x-y + 0: x-y + x\ny + 0: x\x0ay + +/(a.b(?s)c.d|x.y)p.q/ + a+bc+dp+q + 0: a+bc+dp+q + a+bc\ndp+q + 0: a+bc\x0adp+q + x\nyp+q + 0: x\x0ayp+q + *** Failers +No match + a\nbc\ndp+q +No match + a+bc\ndp\nq +No match + x\nyp\nq No match -/a(.{3})b/8 - a\x{4000}xyb - 0: a\x{4000}xyb - a\x{4000}\x7fyb - 0: a\x{4000}\x{7f}yb - a\x{4000}\x{100}yb - 0: a\x{4000}\x{100}yb +/a\d\z/ + ba0 + 0: a0 *** Failers No match - a\x{4000}b + ba0\n No match - ac\ncb + ba0\ncd No match -/a(.*?)(.)/ - a\xc0\x88b - 0: a\xc0\x88b - 1: a\xc0\x88 - 2: a\xc0 - -/a(.*?)(.)/8 - a\x{100}b - 0: a\x{100}b - 1: a\x{100} - -/a(.*)(.)/ - a\xc0\x88b - 0: a\xc0\x88b - 1: a\xc0\x88 - 2: a\xc0 - -/a(.*)(.)/8 - a\x{100}b - 0: a\x{100}b - 1: a\x{100} - -/a(.)(.)/ - a\xc0\x92bcd - 0: a\xc0\x92 - -/a(.)(.)/8 - a\x{240}bcd - 0: a\x{240}b - -/a(.?)(.)/ - a\xc0\x92bcd - 0: a\xc0\x92 - 1: a\xc0 - -/a(.?)(.)/8 - a\x{240}bcd - 0: a\x{240}b - 1: a\x{240} - -/a(.??)(.)/ - a\xc0\x92bcd - 0: a\xc0\x92 - 1: a\xc0 - -/a(.??)(.)/8 - a\x{240}bcd - 0: a\x{240}b - 1: a\x{240} - -/a(.{3})b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b +/a\d\z/m + ba0 + 0: a0 *** Failers No match - a\x{1234}b + ba0\n No match - ac\ncb + ba0\ncd No match -/a(.{3,})b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - 0: axxxxbcdefghijb - 1: axxxxb - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b +/a\d\Z/ + ba0 + 0: a0 + ba0\n + 0: a0 *** Failers No match - a\x{1234}b + ba0\ncd No match -/a(.{3,}?)b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - 0: axxxxbcdefghijb - 1: axxxxb - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b +/a\d\Z/m + ba0 + 0: a0 + ba0\n + 0: a0 *** Failers No match - a\x{1234}b + ba0\ncd No match -/a(.{3,5})b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - 0: axxxxb - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b - axbxxbcdefghijb - 0: axbxxb - axxxxxbcdefghijb - 0: axxxxxb +/a\d$/ + ba0 + 0: a0 + ba0\n + 0: a0 *** Failers No match - a\x{1234}b + ba0\ncd No match - axxxxxxbcdefghijb + +/a\d$/m + ba0 + 0: a0 + ba0\n + 0: a0 + ba0\ncd + 0: a0 + *** Failers No match -/a(.{3,5}?)b/8 - a\x{1234}xyb - 0: a\x{1234}xyb - a\x{1234}\x{4321}yb - 0: a\x{1234}\x{4321}yb - a\x{1234}\x{4321}\x{3412}b - 0: a\x{1234}\x{4321}\x{3412}b - axxxxbcdefghijb - 0: axxxxb - a\x{1234}\x{4321}\x{3412}\x{3421}b - 0: a\x{1234}\x{4321}\x{3412}\x{3421}b - axbxxbcdefghijb - 0: axbxxb - axxxxxbcdefghijb - 0: axxxxxb +/abc/i + abc + 0: abc + aBc + 0: aBc + ABC + 0: ABC + +/[^a]/ + abcd + 0: b + +/ab?\w/ + abz + 0: abz + 1: ab + abbz + 0: abb + 1: ab + azz + 0: az + +/x{0,3}yz/ + ayzq + 0: yz + axyzq + 0: xyz + axxyz + 0: xxyz + axxxyzq + 0: xxxyz + axxxxyzq + 0: xxxyz *** Failers No match - a\x{1234}b + ax No match - axxxxxxbcdefghijb + axx No match - -/^[a\x{c0}]/8 + +/x{3}yz/ + axxxyzq + 0: xxxyz + axxxxyzq + 0: xxxyz *** Failers No match - \x{100} + ax No match - -/(?<=aXb)cd/8 - aXbcd - 0: cd - -/(?<=a\x{100}b)cd/8 - a\x{100}bcd - 0: cd - -/(?<=a\x{100000}b)cd/8 - a\x{100000}bcd - 0: cd - -/(?:\x{100}){3}b/8 - \x{100}\x{100}\x{100}b - 0: \x{100}\x{100}\x{100}b - *** Failers + axx No match - \x{100}\x{100}b + ayzq No match - -/\x{ab}/8 - \x{ab} - 0: \x{ab} - \xc2\xab - 0: \x{ab} - *** Failers + axyzq No match - \x00{ab} + axxyz No match - -/(?<=(.))X/8 - WXYZ - 0: X - \x{256}XYZ - 0: X + +/x{2,3}yz/ + axxyz + 0: xxyz + axxxyzq + 0: xxxyz + axxxxyzq + 0: xxxyz *** Failers No match - XYZ + ax +No match + axx +No match + ayzq +No match + axyzq +No match + +/[^a]+/ + bac + 0: b + bcdefax + 0: bcdef + 1: bcde + 2: bcd + 3: bc + 4: b + *** Failers + 0: *** F + 1: *** + 2: *** + 3: ** + 4: * + aaaaa No match -/[^a]+/8g - bcd - 0: bcd - 1: bc - 2: b - \x{100}aY\x{256}Z - 0: \x{100} - 0: Y\x{256}Z - 1: Y\x{256} - 2: Y - -/^[^a]{2}/8 - \x{100}bc - 0: \x{100}b - -/^[^a]{2,}/8 - \x{100}bcAa - 0: \x{100}bcA - 1: \x{100}bc - 2: \x{100}b - -/^[^a]{2,}?/8 - \x{100}bca - 0: \x{100}bc - 1: \x{100}b - -/[^a]+/8ig - bcd - 0: bcd - 1: bc - 2: b - \x{100}aY\x{256}Z - 0: \x{100} - 0: Y\x{256}Z - 1: Y\x{256} - 2: Y - -/^[^a]{2}/8i - \x{100}bc - 0: \x{100}b - -/^[^a]{2,}/8i - \x{100}bcAa - 0: \x{100}bc - 1: \x{100}b - -/^[^a]{2,}?/8i - \x{100}bca - 0: \x{100}bc - 1: \x{100}b - -/\x{100}{0,0}/8 - abcd - 0: - -/\x{100}?/8 - abcd - 0: - \x{100}\x{100} - 0: \x{100} +/[^a]*/ + bac + 0: b 1: - -/\x{100}{0,3}/8 - \x{100}\x{100} - 0: \x{100}\x{100} - 1: \x{100} - 2: - \x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100} - 1: \x{100}\x{100} - 2: \x{100} - 3: - -/\x{100}*/8 - abce + bcdefax + 0: bcdef + 1: bcde + 2: bcd + 3: bc + 4: b + 5: + *** Failers + 0: *** F + 1: *** + 2: *** + 3: ** + 4: * + 5: + aaaaa 0: - \x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100}\x{100} - 1: \x{100}\x{100}\x{100} - 2: \x{100}\x{100} - 3: \x{100} + +/[^a]{3,5}/ + xyz + 0: xyz + awxyza + 0: wxyz + 1: wxy + abcdefa + 0: bcdef + 1: bcde + 2: bcd + abcdefghijk + 0: bcdef + 1: bcde + 2: bcd + *** Failers + 0: *** F + 1: *** + 2: *** + axya +No match + axa +No match + aaaaa +No match + +/\d*/ + 1234b567 + 0: 1234 + 1: 123 + 2: 12 + 3: 1 4: - -/\x{100}{1,1}/8 - abcd\x{100}\x{100}\x{100}\x{100} - 0: \x{100} - -/\x{100}{1,3}/8 - abcd\x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100} - 1: \x{100}\x{100} - 2: \x{100} - -/\x{100}+/8 - abcd\x{100}\x{100}\x{100}\x{100} - 0: \x{100}\x{100}\x{100}\x{100} - 1: \x{100}\x{100}\x{100} - 2: \x{100}\x{100} - 3: \x{100} - -/\x{100}{3}/8 - abcd\x{100}\x{100}\x{100}XX - 0: \x{100}\x{100}\x{100} - -/\x{100}{3,5}/8 - abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX - 0: \x{100}\x{100}\x{100}\x{100}\x{100} - 1: \x{100}\x{100}\x{100}\x{100} - 2: \x{100}\x{100}\x{100} - -/\x{100}{3,}/8 - abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX - 0: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 1: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 2: \x{100}\x{100}\x{100}\x{100}\x{100} - 3: \x{100}\x{100}\x{100}\x{100} - 4: \x{100}\x{100}\x{100} - -/(?<=a\x{100}{2}b)X/8 - Xyyya\x{100}\x{100}bXzzz - 0: X - -/\D*/8 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Matched, but too many subsidiary matches - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 3: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 4: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 6: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 7: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 8: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 9: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -10: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -11: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -12: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -14: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -15: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -16: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -17: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -18: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -19: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -20: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -21: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -/\D*/8 - \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -Matched, but too many subsidiary matches - 0: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 1: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 2: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 3: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 4: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 5: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 6: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 7: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 8: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - 9: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -10: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -11: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -12: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -13: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -14: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -15: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -16: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -17: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -18: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -19: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -20: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} -21: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} - -/\D/8 - 1X2 - 0: X - 1\x{100}2 - 0: \x{100} - -/>\S/8 - > >X Y - 0: >X - > >\x{100} Y - 0: >\x{100} - -/\d/8 - \x{100}3 - 0: 3 + xyz + 0: -/\s/8 - \x{100} X - 0: +/\D*/ + a1234b567 + 0: a + 1: + xyz + 0: xyz + 1: xy + 2: x + 3: + +/\d+/ + ab1234c56 + 0: 1234 + 1: 123 + 2: 12 + 3: 1 + *** Failers +No match + xyz +No match -/\D+/8 - 12abcd34 - 0: abcd - 1: abc - 2: ab - 3: a +/\D+/ + ab123c56 + 0: ab + 1: a *** Failers 0: *** Failers 1: *** Failer @@ -538,502 +452,6362 @@ 8: *** 9: ** 10: * - 1234 -No match - -/\D{2,3}/8 - 12abcd34 - 0: abc - 1: ab - 12ab34 - 0: ab - *** Failers - 0: *** - 1: ** - 1234 + 789 No match - 12a34 + +/\d?A/ + 045ABC + 0: 5A + ABC + 0: A + *** Failers No match - -/\D{2,3}?/8 - 12abcd34 - 0: abc - 1: ab - 12ab34 - 0: ab - *** Failers - 0: *** - 1: ** - 1234 + XYZ No match - 12a34 + +/\D?A/ + ABC + 0: A + BAC + 0: BA + 9ABC + 0: A + *** Failers No match -/\d+/8 - 12abcd34 - 0: 12 - 1: 1 +/a+/ + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + +/^.*xyz/ + xyz + 0: xyz + ggggggggxyz + 0: ggggggggxyz + +/^.+xyz/ + abcdxyz + 0: abcdxyz + axyz + 0: axyz *** Failers No match - -/\d{2,3}/8 - 12abcd34 - 0: 12 - 1234abcd - 0: 123 - 1: 12 - *** Failers + xyz No match - 1.4 + +/^.?xyz/ + xyz + 0: xyz + cxyz + 0: cxyz + +/^\d{2,3}X/ + 12X + 0: 12X + 123X + 0: 123X + *** Failers No match - -/\d{2,3}?/8 - 12abcd34 - 0: 12 - 1234abcd - 0: 123 - 1: 12 - *** Failers + X No match - 1.4 + 1X +No match + 1234X No match -/\S+/8 - 12abcd34 - 0: 12abcd34 - 1: 12abcd3 - 2: 12abcd - 3: 12abc - 4: 12ab - 5: 12a - 6: 12 - 7: 1 - *** Failers - 0: *** - 1: ** - 2: * - \ \ -No match - -/\S{2,3}/8 - 12abcd34 - 0: 12a - 1: 12 - 1234abcd - 0: 123 - 1: 12 +/^[abcd]\d/ + a45 + 0: a4 + b93 + 0: b9 + c99z + 0: c9 + d04 + 0: d0 *** Failers - 0: *** - 1: ** - \ \ +No match + e45 +No match + abcd +No match + abcd1234 +No match + 1234 No match -/\S{2,3}?/8 - 12abcd34 - 0: 12a - 1: 12 - 1234abcd - 0: 123 - 1: 12 +/^[abcd]*\d/ + a45 + 0: a4 + b93 + 0: b9 + c99z + 0: c9 + d04 + 0: d0 + abcd1234 + 0: abcd1 + 1234 + 0: 1 *** Failers - 0: *** - 1: ** - \ \ +No match + e45 +No match + abcd No match -/>\s+ <34 - 0: > < +/^[abcd]+\d/ + a45 + 0: a4 + b93 + 0: b9 + c99z + 0: c9 + d04 + 0: d0 + abcd1234 + 0: abcd1 *** Failers No match + 1234 +No match + e45 +No match + abcd +No match -/>\s{2,3} < - ab> < +/^a+X/ + aX + 0: aX + aaX + 0: aaX + +/^[abcd]?\d/ + a45 + 0: a4 + b93 + 0: b9 + c99z + 0: c9 + d04 + 0: d0 + 1234 + 0: 1 *** Failers No match - ab> \s{2,3}? < - ab> < +/^[abcd]{2,3}\d/ + ab45 + 0: ab4 + bcd93 + 0: bcd9 *** Failers No match - ab> abc>([^()]|\((?1)*\))*abc>123abc>123abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(1(2)3)a*)\d/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876 + 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9 + *** Failers No match - X + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa No match -/(?<=[Q\x{100}\x{200}])X/8 - abc\x{200}X - 0: X - abc\x{100}X - 0: X - abQX - 0: X +/< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x + <> + 0: <> + + 0: + hij> + 0: hij> + hij> + 0: + def> + 0: def> + + 0: <> *** Failers No match - X + \xff< - 0: \xff - -/[\xff]/8 - >\x{ff}< - 0: \x{ff} +/(?abcxyz + 1 ^ ^ x + 0: abcxyz + 123abcxyz999 +--->123abcxyz999 + 1 ^ ^ x + 0: abcxyz + +/(ab|cd){3,4}/C + ababab +--->ababab + +0 ^ (ab|cd){3,4} + +1 ^ a + +4 ^ c + +2 ^^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c + +2 ^ ^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c + +2 ^ ^ b + +3 ^ ^ | ++12 ^ ^ + +1 ^ ^ a + +4 ^ ^ c + 0: ababab + abcdabcd +--->abcdabcd + +0 ^ (ab|cd){3,4} + +1 ^ a + +4 ^ c + +2 ^^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) + +1 ^ ^ a + +4 ^ ^ c + +2 ^ ^ b + +3 ^ ^ | ++12 ^ ^ + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) ++12 ^ ^ + 0: abcdabcd + 1: abcdab + abcdcdcdcdcd +--->abcdcdcdcdcd + +0 ^ (ab|cd){3,4} + +1 ^ a + +4 ^ c + +2 ^^ b + +3 ^ ^ | + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) ++12 ^ ^ + +1 ^ ^ a + +4 ^ ^ c + +5 ^ ^ d + +6 ^ ^ ) ++12 ^ ^ + 0: abcdcdcd + 1: abcdcd + +/^abc/ + abcdef + 0: abc + *** Failers +No match + abcdef\B +No match + +/^(a*|xyz)/ + bcd + 0: + aaabcd + 0: aaa + 1: aa + 2: a + 3: + xyz + 0: xyz + 1: + xyz\N + 0: xyz + *** Failers + 0: + bcd\N +No match + +/xyz$/ + xyz + 0: xyz + xyz\n + 0: xyz + *** Failers +No match + xyz\Z +No match + xyz\n\Z +No match + +/xyz$/m + xyz + 0: xyz + xyz\n + 0: xyz + abcxyz\npqr + 0: xyz + abcxyz\npqr\Z + 0: xyz + xyz\n\Z + 0: xyz + *** Failers +No match + xyz\Z +No match + +/\Gabc/ + abcdef + 0: abc + defabcxyz\>3 + 0: abc + *** Failers +No match + defabcxyz +No match + +/^abcdef/ + ab\P +Partial match: ab + abcde\P +Partial match: abcde + abcdef\P + 0: abcdef + *** Failers +No match + abx\P +No match + +/^a{2,4}\d+z/ + a\P +Partial match: a + aa\P +Partial match: aa + aa2\P +Partial match: aa2 + aaa\P +Partial match: aaa + aaa23\P +Partial match: aaa23 + aaaa12345\P +Partial match: aaaa12345 + aa0z\P + 0: aa0z + aaaa4444444444444z\P + 0: aaaa4444444444444z + *** Failers +No match + az\P +No match + aaaaa\P +No match + a56\P +No match + +/^abcdef/ + abc\P +Partial match: abc + def\R + 0: def + +/(?<=foo)bar/ + xyzfo\P +No match + foob\P\>2 +Partial match: foob + foobar...\R\P\>4 + 0: ar + xyzfo\P +No match + foobar\>2 + 0: bar + *** Failers +No match + xyzfo\P +No match + obar\R +No match + +/(ab*(cd|ef))+X/ + adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\P\Z +No match + lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\P\B\Z +Partial match: abbbbbbcdaefabbbbbbbefa + cdabbbbbbbb\P\R\B\Z +Partial match: cdabbbbbbbb + efabbbbbbbbbbbbbbbb\P\R\B\Z +Partial match: efabbbbbbbbbbbbbbbb + bbbbbbbbbbbbcdXyasdfadf\P\R\B\Z + 0: bbbbbbbbbbbbcdX + +/(a|b)/SF>testsavedregex +Compiled pattern written to testsavedregex +Study data written to testsavedregex +>>aaabxyzpqrrrabbxyyyypqAzz + 0: aaabxyzpqrrrabbxyyyypqAzz + >aaaabxyzpqrrrabbxyyyypqAzz + 0: aaaabxyzpqrrrabbxyyyypqAzz + >>>>abcxyzpqrrrabbxyyyypqAzz + 0: abcxyzpqrrrabbxyyyypqAzz + *** Failers +No match + abxyzpqrrabbxyyyypqAzz +No match + abxyzpqrrrrabbxyyyypqAzz +No match + abxyzpqrrrabxyyyypqAzz +No match + aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz +No match + aaaabcxyzzzzpqrrrabbbxyyypqAzz +No match + aaabcxyzpqrrrabbxyyyypqqqqqqqAzz +No match + +/^(abc){1,2}zz/ + abczz + 0: abczz + abcabczz + 0: abcabczz + *** Failers +No match + zz +No match + abcabcabczz +No match + >>abczz +No match + +/^(b+?|a){1,2}?c/ + bc + 0: bc + bbc + 0: bbc + bbbc + 0: bbbc + bac + 0: bac + bbac + 0: bbac + aac + 0: aac + abbbbbbbbbbbc + 0: abbbbbbbbbbbc + bbbbbbbbbbbac + 0: bbbbbbbbbbbac + *** Failers +No match + aaac +No match + abbbbbbbbbbbac +No match + +/^(b+|a){1,2}c/ + bc + 0: bc + bbc + 0: bbc + bbbc + 0: bbbc + bac + 0: bac + bbac + 0: bbac + aac + 0: aac + abbbbbbbbbbbc + 0: abbbbbbbbbbbc + bbbbbbbbbbbac + 0: bbbbbbbbbbbac + *** Failers +No match + aaac +No match + abbbbbbbbbbbac +No match + +/^(b+|a){1,2}?bc/ + bbc + 0: bbc + +/^(b*|ba){1,2}?bc/ + babc + 0: babc + bbabc + 0: bbabc + bababc + 0: bababc + *** Failers +No match + bababbc +No match + babababc +No match + +/^(ba|b*){1,2}?bc/ + babc + 0: babc + bbabc + 0: bbabc + bababc + 0: bababc + *** Failers +No match + bababbc +No match + babababc +No match + +/^\ca\cA\c[\c{\c:/ + \x01\x01\e;z + 0: \x01\x01\x1b;z + +/^[ab\]cde]/ + athing + 0: a + bthing + 0: b + ]thing + 0: ] + cthing + 0: c + dthing + 0: d + ething + 0: e + *** Failers +No match + fthing +No match + [thing +No match + \\thing +No match + +/^[]cde]/ + ]thing + 0: ] + cthing + 0: c + dthing + 0: d + ething + 0: e + *** Failers +No match + athing +No match + fthing +No match + +/^[^ab\]cde]/ + fthing + 0: f + [thing + 0: [ + \\thing + 0: \ + *** Failers + 0: * + athing +No match + bthing +No match + ]thing +No match + cthing +No match + dthing +No match + ething +No match + +/^[^]cde]/ + athing + 0: a + fthing + 0: f + *** Failers + 0: * + ]thing +No match + cthing +No match + dthing +No match + ething +No match + +/^\/ + + 0: \x81 + +/^/ + + 0: \xff + +/^[0-9]+$/ + 0 + 0: 0 + 1 + 0: 1 + 2 + 0: 2 + 3 + 0: 3 + 4 + 0: 4 + 5 + 0: 5 + 6 + 0: 6 + 7 + 0: 7 + 8 + 0: 8 + 9 + 0: 9 + 10 + 0: 10 + 100 + 0: 100 + *** Failers +No match + abc +No match + +/^.*nter/ + enter + 0: enter + inter + 0: inter + uponter + 0: uponter + +/^xxx[0-9]+$/ + xxx0 + 0: xxx0 + xxx1234 + 0: xxx1234 + *** Failers +No match + xxx +No match + +/^.+[0-9][0-9][0-9]$/ + x123 + 0: x123 + xx123 + 0: xx123 + 123456 + 0: 123456 + *** Failers +No match + 123 +No match + x1234 + 0: x1234 + +/^.+?[0-9][0-9][0-9]$/ + x123 + 0: x123 + xx123 + 0: xx123 + 123456 + 0: 123456 + *** Failers +No match + 123 +No match + x1234 + 0: x1234 + +/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ + abc!pqr=apquxz.ixr.zzz.ac.uk + 0: abc!pqr=apquxz.ixr.zzz.ac.uk + *** Failers +No match + !pqr=apquxz.ixr.zzz.ac.uk +No match + abc!=apquxz.ixr.zzz.ac.uk +No match + abc!pqr=apquxz:ixr.zzz.ac.uk +No match + abc!pqr=apquxz.ixr.zzz.ac.ukk +No match + +/:/ + Well, we need a colon: somewhere + 0: : + *** Fail if we don't +No match + +/([\da-f:]+)$/i + 0abc + 0: 0abc + abc + 0: abc + fed + 0: fed + E + 0: E + :: + 0: :: + 5f03:12C0::932e + 0: 5f03:12C0::932e + fed def + 0: def + Any old stuff + 0: ff + *** Failers +No match + 0zzz +No match + gzzz +No match + fed\x20 +No match + Any old rubbish +No match + +/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ + .1.2.3 + 0: .1.2.3 + A.12.123.0 + 0: A.12.123.0 + *** Failers +No match + .1.2.3333 +No match + 1.2.3 +No match + 1234.2.3 +No match + +/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ + 1 IN SOA non-sp1 non-sp2( + 0: 1 IN SOA non-sp1 non-sp2( + 1 IN SOA non-sp1 non-sp2 ( + 0: 1 IN SOA non-sp1 non-sp2 ( + *** Failers +No match + 1IN SOA non-sp1 non-sp2( +No match + +/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ + a. + 0: a. + Z. + 0: Z. + 2. + 0: 2. + ab-c.pq-r. + 0: ab-c.pq-r. + sxk.zzz.ac.uk. + 0: sxk.zzz.ac.uk. + x-.y-. + 0: x-.y-. + *** Failers +No match + -abc.peq. +No match + +/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ + *.a + 0: *.a + *.b0-a + 0: *.b0-a + *.c3-b.c + 0: *.c3-b.c + *.c-a.b-c + 0: *.c-a.b-c + *** Failers +No match + *.0 +No match + *.a- +No match + *.a-b.c- +No match + *.c-a.0-c +No match + +/^(?=ab(de))(abd)(e)/ + abde + 0: abde + +/^(?!(ab)de|x)(abd)(f)/ + abdf + 0: abdf + +/^(?=(ab(cd)))(ab)/ + abcd + 0: ab + +/^[\da-f](\.[\da-f])*$/i + a.b.c.d + 0: a.b.c.d + A.B.C.D + 0: A.B.C.D + a.b.c.1.2.3.C + 0: a.b.c.1.2.3.C + +/^\".*\"\s*(;.*)?$/ + \"1234\" + 0: "1234" + \"abcd\" ; + 0: "abcd" ; + \"\" ; rhubarb + 0: "" ; rhubarb + *** Failers +No match + \"1234\" : things +No match + +/^$/ + \ + 0: + *** Failers +No match + +/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x + ab c + 0: ab c + *** Failers +No match + abc +No match + ab cde +No match + +/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ + ab c + 0: ab c + *** Failers +No match + abc +No match + ab cde +No match + +/^ a\ b[c ]d $/x + a bcd + 0: a bcd + a b d + 0: a b d + *** Failers +No match + abcd +No match + ab d +No match + +/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ + abcdefhijklm + 0: abcdefhijklm + +/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ + abcdefhijklm + 0: abcdefhijklm + +/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ + a+ Z0+\x08\n\x1d\x12 + 0: a+ Z0+\x08\x0a\x1d\x12 + +/^[.^$|()*+?{,}]+/ + .^\$(*+)|{?,?} + 0: .^$(*+)|{?,?} + 1: .^$(*+)|{?,? + 2: .^$(*+)|{?, + 3: .^$(*+)|{? + 4: .^$(*+)|{ + 5: .^$(*+)| + 6: .^$(*+) + 7: .^$(*+ + 8: .^$(* + 9: .^$( +10: .^$ +11: .^ +12: . + +/^a*\w/ + z + 0: z + az + 0: az + 1: a + aaaz + 0: aaaz + 1: aaa + 2: aa + 3: a + a + 0: a + aa + 0: aa + 1: a + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + a+ + 0: a + aa+ + 0: aa + 1: a + +/^a*?\w/ + z + 0: z + az + 0: az + 1: a + aaaz + 0: aaaz + 1: aaa + 2: aa + 3: a + a + 0: a + aa + 0: aa + 1: a + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + a+ + 0: a + aa+ + 0: aa + 1: a + +/^a+\w/ + az + 0: az + aaaz + 0: aaaz + 1: aaa + 2: aa + aa + 0: aa + aaaa + 0: aaaa + 1: aaa + 2: aa + aa+ + 0: aa + +/^a+?\w/ + az + 0: az + aaaz + 0: aaaz + 1: aaa + 2: aa + aa + 0: aa + aaaa + 0: aaaa + 1: aaa + 2: aa + aa+ + 0: aa + +/^\d{8}\w{2,}/ + 1234567890 + 0: 1234567890 + 12345678ab + 0: 12345678ab + 12345678__ + 0: 12345678__ + *** Failers +No match + 1234567 +No match + +/^[aeiou\d]{4,5}$/ + uoie + 0: uoie + 1234 + 0: 1234 + 12345 + 0: 12345 + aaaaa + 0: aaaaa + *** Failers +No match + 123456 +No match + +/^[aeiou\d]{4,5}?/ + uoie + 0: uoie + 1234 + 0: 1234 + 12345 + 0: 12345 + 1: 1234 + aaaaa + 0: aaaaa + 1: aaaa + 123456 + 0: 12345 + 1: 1234 + +/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ + From abcd Mon Sep 01 12:33:02 1997 + 0: From abcd Mon Sep 01 12:33 + +/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ + From abcd Mon Sep 01 12:33:02 1997 + 0: From abcd Mon Sep 01 12:33 + From abcd Mon Sep 1 12:33:02 1997 + 0: From abcd Mon Sep 1 12:33 + *** Failers +No match + From abcd Sep 01 12:33:02 1997 +No match + +/^12.34/s + 12\n34 + 0: 12\x0a34 + 12\r34 + 0: 12\x0d34 + +/\w+(?=\t)/ + the quick brown\t fox + 0: brown + +/foo(?!bar)(.*)/ + foobar is foolish see? + 0: foolish see? + 1: foolish see + 2: foolish se + 3: foolish s + 4: foolish + 5: foolish + 6: foolis + 7: fooli + 8: fool + 9: foo + +/(?:(?!foo)...|^.{0,2})bar(.*)/ + foobar crowbar etc + 0: rowbar etc + 1: rowbar et + 2: rowbar e + 3: rowbar + 4: rowbar + barrel + 0: barrel + 1: barre + 2: barr + 3: bar + 2barrel + 0: 2barrel + 1: 2barre + 2: 2barr + 3: 2bar + A barrel + 0: A barrel + 1: A barre + 2: A barr + 3: A bar + +/^(\D*)(?=\d)(?!123)/ + abc456 + 0: abc + *** Failers +No match + abc123 +No match + +/^1234(?# test newlines + inside)/ + 1234 + 0: 1234 + +/^1234 #comment in extended re + /x + 1234 + 0: 1234 + +/#rhubarb + abcd/x + abcd + 0: abcd + +/^abcd#rhubarb/x + abcd + 0: abcd + +/(?!^)abc/ + the abc + 0: abc + *** Failers +No match + abc +No match + +/(?=^)abc/ + abc + 0: abc + *** Failers +No match + the abc +No match + +/^[ab]{1,3}(ab*|b)/ + aabbbbb + 0: aabbbbb + 1: aabbbb + 2: aabbb + 3: aabb + 4: aab + 5: aa + +/^[ab]{1,3}?(ab*|b)/ + aabbbbb + 0: aabbbbb + 1: aabbbb + 2: aabbb + 3: aabb + 4: aab + 5: aa + +/^[ab]{1,3}?(ab*?|b)/ + aabbbbb + 0: aabbbbb + 1: aabbbb + 2: aabbb + 3: aabb + 4: aab + 5: aa + +/^[ab]{1,3}(ab*?|b)/ + aabbbbb + 0: aabbbbb + 1: aabbbb + 2: aabbb + 3: aabb + 4: aab + 5: aa + +/ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional leading comment +(?: (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # one word, optionally followed by.... +(?: +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... +\( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) | # comments, or... + +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +# quoted strings +)* +< (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # leading < +(?: @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* + +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* , (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +)* # further okay, if led by comma +: # closing colon +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* )? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) # initial word +(?: (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +" (?: # opening quote... +[^\\\x80-\xff\n\015"] # Anything except backslash and quote +| # or +\\ [^\x80-\xff] # Escaped something (something != CR) +)* " # closing quote +) )* # further okay, if led by a period +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* @ (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # initial subdomain +(?: # +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* \. # if led by a period... +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* (?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| \[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) # ...further okay +)* +# address spec +(?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* > # trailing > +# name and address +) (?: [\040\t] | \( +(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* +\) )* # optional trailing comment +/x + Alan Other + 0: Alan Other + + 0: user@dom.ain + 1: user@dom + user\@dom.ain + 0: user@dom.ain + 1: user@dom + \"A. Other\" (a comment) + 0: "A. Other" (a comment) + 1: "A. Other" + 2: "A. Other" + A. Other (a comment) + 0: Other (a comment) + 1: Other + 2: Other + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay + 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re + A missing angle @,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address +| # or +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +# leading word +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces +(?: +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +| +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +) # "special" comment or quoted string +[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" +)* +< +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# < +(?: +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +(?: , +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +)* # additional domains +: +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)? # optional route +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +# Atom +| # or +" # " +[^\\\x80-\xff\n\015"] * # normal +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* +" # " +# Quoted string +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# additional words +)* +@ +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +(?: +\. +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +(?: +[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... +(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom +| +\[ # [ +(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff +\] # ] +) +[\040\t]* # Nab whitespace. +(?: +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: # ( +(?: \\ [^\x80-\xff] | +\( # ( +[^\\\x80-\xff\n\015()] * # normal* +(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* +\) # ) +) # special +[^\\\x80-\xff\n\015()] * # normal* +)* # )* +\) # ) +[\040\t]* )* # If comment found, allow more spaces. +# optional trailing comments +)* +# address spec +> # > +# name and address +) +/x + Alan Other + 0: Alan Other + + 0: user@dom.ain + 1: user@dom + user\@dom.ain + 0: user@dom.ain + 1: user@dom + \"A. Other\" (a comment) + 0: "A. Other" + A. Other (a comment) + 0: Other + \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay + 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay + 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re + A missing angle + a\rb + 0: a\x0db + *** Failers +No match + a\nb +No match + +/abc$/ + abc + 0: abc + abc\n + 0: abc + *** Failers +No match + abc\ndef +No match + +/(abc)\123/ + abc\x53 + 0: abcS + +/(abc)\223/ + abc\x93 + 0: abc\x93 + +/(abc)\323/ + abc\xd3 + 0: abc\xd3 + +/(abc)\100/ + abc\x40 + 0: abc@ + abc\100 + 0: abc@ + +/(abc)\1000/ + abc\x400 + 0: abc@0 + abc\x40\x30 + 0: abc@0 + abc\1000 + 0: abc@0 + abc\100\x30 + 0: abc@0 + abc\100\060 + 0: abc@0 + abc\100\60 + 0: abc@0 + +/abc\81/ + abc\081 + 0: abc\x0081 + abc\0\x38\x31 + 0: abc\x0081 + +/abc\91/ + abc\091 + 0: abc\x0091 + abc\0\x39\x31 + 0: abc\x0091 + +/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/ + abcdefghijk\12S + 0: abcdefghijk\x0aS + +/ab\idef/ + abidef + 0: abidef + +/a{0}bc/ + bc + 0: bc + +/(a|(bc)){0,0}?xyz/ + xyz + 0: xyz + +/abc[\10]de/ + abc\010de + 0: abc\x08de + +/abc[\1]de/ + abc\1de + 0: abc\x01de + +/(abc)[\1]de/ + abc\1de + 0: abc\x01de + +/(?s)a.b/ + a\nb + 0: a\x0ab + +/^([^a])([^\b])([^c]*)([^d]{3,4})/ + baNOTccccd + 0: baNOTcccc + 1: baNOTccc + 2: baNOTcc + 3: baNOTc + 4: baNOT + baNOTcccd + 0: baNOTccc + 1: baNOTcc + 2: baNOTc + 3: baNOT + baNOTccd + 0: baNOTcc + 1: baNOTc + 2: baNOT + bacccd + 0: baccc + *** Failers + 0: *** Failers + 1: *** Failer + 2: *** Faile + 3: *** Fail + 4: *** Fai + 5: *** Fa + 6: *** F + anything +No match + b\bc +No match + baccd +No match + +/[^a]/ + Abc + 0: A + +/[^a]/i + Abc + 0: b + +/[^a]+/ + AAAaAbc + 0: AAA + 1: AA + 2: A + +/[^a]+/i + AAAaAbc + 0: bc + 1: b + +/[^a]+/ + bbb\nccc + 0: bbb\x0accc + 1: bbb\x0acc + 2: bbb\x0ac + 3: bbb\x0a + 4: bbb + 5: bb + 6: b + +/[^k]$/ + abc + 0: c + *** Failers + 0: s + abk +No match + +/[^k]{2,3}$/ + abc + 0: abc + kbc + 0: bc + kabc + 0: abc + *** Failers + 0: ers + abk +No match + akb +No match + akk +No match + +/^\d{8,}\@.+[^k]$/ + 12345678\@a.b.c.d + 0: 12345678@a.b.c.d + 123456789\@x.y.z + 0: 123456789@x.y.z + *** Failers +No match + 12345678\@x.y.uk +No match + 1234567\@a.b.c.d +No match + +/[^a]/ + aaaabcd + 0: b + aaAabcd + 0: A + +/[^a]/i + aaaabcd + 0: b + aaAabcd + 0: b + +/[^az]/ + aaaabcd + 0: b + aaAabcd + 0: A + +/[^az]/i + aaaabcd + 0: b + aaAabcd + 0: b + +/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/ + \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377 + 0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff + +/P[^*]TAIRE[^*]{1,6}?LL/ + xxxxxxxxxxxPSTAIREISLLxxxxxxxxx + 0: PSTAIREISLL + +/P[^*]TAIRE[^*]{1,}?LL/ + xxxxxxxxxxxPSTAIREISLLxxxxxxxxx + 0: PSTAIREISLL + +/(\.\d\d[1-9]?)\d+/ + 1.230003938 + 0: .230003938 + 1: .23000393 + 2: .2300039 + 3: .230003 + 4: .23000 + 5: .2300 + 6: .230 + 1.875000282 + 0: .875000282 + 1: .87500028 + 2: .8750002 + 3: .875000 + 4: .87500 + 5: .8750 + 6: .875 + 1.235 + 0: .235 + +/(\.\d\d((?=0)|\d(?=\d)))/ + 1.230003938 + 0: .230 + 1: .23 + 1.875000282 + 0: .875 + *** Failers +No match + 1.235 +No match + +/a(?)b/ + ab + 0: ab + +/\b(foo)\s+(\w+)/i + Food is on the foo table + 0: foo table + 1: foo tabl + 2: foo tab + 3: foo ta + 4: foo t + +/foo(.*)bar/ + The food is under the bar in the barn. + 0: food is under the bar in the bar + 1: food is under the bar + +/foo(.*?)bar/ + The food is under the bar in the barn. + 0: food is under the bar in the bar + 1: food is under the bar + +/(.*)(\d*)/ + I have 2 numbers: 53147 +Matched, but too many subsidiary matches + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: 5314 + 2: I have 2 numbers: 531 + 3: I have 2 numbers: 53 + 4: I have 2 numbers: 5 + 5: I have 2 numbers: + 6: I have 2 numbers: + 7: I have 2 numbers + 8: I have 2 number + 9: I have 2 numbe +10: I have 2 numb +11: I have 2 num +12: I have 2 nu +13: I have 2 n +14: I have 2 +15: I have 2 +16: I have +17: I have +18: I hav +19: I ha +20: I h +21: I + +/(.*)(\d+)/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: 5314 + 2: I have 2 numbers: 531 + 3: I have 2 numbers: 53 + 4: I have 2 numbers: 5 + 5: I have 2 + +/(.*?)(\d*)/ + I have 2 numbers: 53147 +Matched, but too many subsidiary matches + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: 5314 + 2: I have 2 numbers: 531 + 3: I have 2 numbers: 53 + 4: I have 2 numbers: 5 + 5: I have 2 numbers: + 6: I have 2 numbers: + 7: I have 2 numbers + 8: I have 2 number + 9: I have 2 numbe +10: I have 2 numb +11: I have 2 num +12: I have 2 nu +13: I have 2 n +14: I have 2 +15: I have 2 +16: I have +17: I have +18: I hav +19: I ha +20: I h +21: I + +/(.*?)(\d+)/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + 1: I have 2 numbers: 5314 + 2: I have 2 numbers: 531 + 3: I have 2 numbers: 53 + 4: I have 2 numbers: 5 + 5: I have 2 + +/(.*)(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + +/(.*?)(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + +/(.*)\b(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + +/(.*\D)(\d+)$/ + I have 2 numbers: 53147 + 0: I have 2 numbers: 53147 + +/^\D*(?!123)/ + ABC123 + 0: AB + 1: A + 2: + +/^(\D*)(?=\d)(?!123)/ + ABC445 + 0: ABC + *** Failers +No match + ABC123 +No match + +/^[W-]46]/ + W46]789 + 0: W46] + -46]789 + 0: -46] + *** Failers +No match + Wall +No match + Zebra +No match + 42 +No match + [abcd] +No match + ]abcd[ +No match + +/^[W-\]46]/ + W46]789 + 0: W + Wall + 0: W + Zebra + 0: Z + Xylophone + 0: X + 42 + 0: 4 + [abcd] + 0: [ + ]abcd[ + 0: ] + \\backslash + 0: \ + *** Failers +No match + -46]789 +No match + well +No match + +/\d\d\/\d\d\/\d\d\d\d/ + 01/01/2000 + 0: 01/01/2000 + +/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark otherword + 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword + word cat dog elephant mussel cow horse canary baboon snake shark +No match + +/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope +No match + +/^(a){0,0}/ + bcd + 0: + abc + 0: + aab + 0: + +/^(a){0,1}/ + bcd + 0: + abc + 0: a + 1: + aab + 0: a + 1: + +/^(a){0,2}/ + bcd + 0: + abc + 0: a + 1: + aab + 0: aa + 1: a + 2: + +/^(a){0,3}/ + bcd + 0: + abc + 0: a + 1: + aab + 0: aa + 1: a + 2: + aaa + 0: aaa + 1: aa + 2: a + 3: + +/^(a){0,}/ + bcd + 0: + abc + 0: a + 1: + aab + 0: aa + 1: a + 2: + aaa + 0: aaa + 1: aa + 2: a + 3: + aaaaaaaa + 0: aaaaaaaa + 1: aaaaaaa + 2: aaaaaa + 3: aaaaa + 4: aaaa + 5: aaa + 6: aa + 7: a + 8: + +/^(a){1,1}/ + bcd +No match + abc + 0: a + aab + 0: a + +/^(a){1,2}/ + bcd +No match + abc + 0: a + aab + 0: aa + 1: a + +/^(a){1,3}/ + bcd +No match + abc + 0: a + aab + 0: aa + 1: a + aaa + 0: aaa + 1: aa + 2: a + +/^(a){1,}/ + bcd +No match + abc + 0: a + aab + 0: aa + 1: a + aaa + 0: aaa + 1: aa + 2: a + aaaaaaaa + 0: aaaaaaaa + 1: aaaaaaa + 2: aaaaaa + 3: aaaaa + 4: aaaa + 5: aaa + 6: aa + 7: a + +/.*\.gif/ + borfle\nbib.gif\nno + 0: bib.gif + +/.{0,}\.gif/ + borfle\nbib.gif\nno + 0: bib.gif + +/.*\.gif/m + borfle\nbib.gif\nno + 0: bib.gif + +/.*\.gif/s + borfle\nbib.gif\nno + 0: borfle\x0abib.gif + +/.*\.gif/ms + borfle\nbib.gif\nno + 0: borfle\x0abib.gif + +/.*$/ + borfle\nbib.gif\nno + 0: no + +/.*$/m + borfle\nbib.gif\nno + 0: borfle + +/.*$/s + borfle\nbib.gif\nno + 0: borfle\x0abib.gif\x0ano + +/.*$/ms + borfle\nbib.gif\nno + 0: borfle\x0abib.gif\x0ano + 1: borfle\x0abib.gif + 2: borfle + +/.*$/ + borfle\nbib.gif\nno\n + 0: no + +/.*$/m + borfle\nbib.gif\nno\n + 0: borfle + +/.*$/s + borfle\nbib.gif\nno\n + 0: borfle\x0abib.gif\x0ano\x0a + 1: borfle\x0abib.gif\x0ano + +/.*$/ms + borfle\nbib.gif\nno\n + 0: borfle\x0abib.gif\x0ano\x0a + 1: borfle\x0abib.gif\x0ano + 2: borfle\x0abib.gif + 3: borfle + +/(.*X|^B)/ + abcde\n1234Xyz + 0: 1234X + BarFoo + 0: B + *** Failers +No match + abcde\nBar +No match + +/(.*X|^B)/m + abcde\n1234Xyz + 0: 1234X + BarFoo + 0: B + abcde\nBar + 0: B + +/(.*X|^B)/s + abcde\n1234Xyz + 0: abcde\x0a1234X + BarFoo + 0: B + *** Failers +No match + abcde\nBar +No match + +/(.*X|^B)/ms + abcde\n1234Xyz + 0: abcde\x0a1234X + BarFoo + 0: B + abcde\nBar + 0: B + +/(?s)(.*X|^B)/ + abcde\n1234Xyz + 0: abcde\x0a1234X + BarFoo + 0: B + *** Failers +No match + abcde\nBar +No match + +/(?s:.*X|^B)/ + abcde\n1234Xyz + 0: abcde\x0a1234X + BarFoo + 0: B + *** Failers +No match + abcde\nBar +No match + +/^.*B/ + **** Failers +No match + abc\nB +No match + +/(?s)^.*B/ + abc\nB + 0: abc\x0aB + +/(?m)^.*B/ + abc\nB + 0: B + +/(?ms)^.*B/ + abc\nB + 0: abc\x0aB + +/(?ms)^B/ + abc\nB + 0: B + +/(?s)B$/ + B\n + 0: B + +/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ + 123456654321 + 0: 123456654321 + +/^\d\d\d\d\d\d\d\d\d\d\d\d/ + 123456654321 + 0: 123456654321 + +/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ + 123456654321 + 0: 123456654321 + +/^[abc]{12}/ + abcabcabcabc + 0: abcabcabcabc + +/^[a-c]{12}/ + abcabcabcabc + 0: abcabcabcabc + +/^(a|b|c){12}/ + abcabcabcabc + 0: abcabcabcabc + +/^[abcdefghijklmnopqrstuvwxy0123456789]/ + n + 0: n + *** Failers +No match + z +No match + +/abcde{0,0}/ + abcd + 0: abcd + *** Failers +No match + abce +No match + +/ab[cd]{0,0}e/ + abe + 0: abe + *** Failers +No match + abcde +No match + +/ab(c){0,0}d/ + abd + 0: abd + *** Failers +No match + abcd +No match + +/a(b*)/ + a + 0: a + ab + 0: ab + 1: a + abbbb + 0: abbbb + 1: abbb + 2: abb + 3: ab + 4: a + *** Failers + 0: a + bbbbb +No match + +/ab\d{0}e/ + abe + 0: abe + *** Failers +No match + ab1e +No match + +/"([^\\"]+|\\.)*"/ + the \"quick\" brown fox + 0: "quick" + \"the \\\"quick\\\" brown fox\" + 0: "the \"quick\" brown fox" + +/.*?/g+ + abc + 0: abc + 0+ + 1: ab + 2: a + 3: + 0: + 0+ + +/\b/g+ + abc + 0: + 0+ abc + 0: + 0+ + +/\b/+g + abc + 0: + 0+ abc + 0: + 0+ + +//g + abc + 0: + 0: + 0: + 0: + +/]{0,})>]{0,})>([\d]{0,}\.)(.*)((
([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is + 43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide + 0: 43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide + +/a[^a]b/ + acb + 0: acb + a\nb + 0: a\x0ab + +/a.b/ + acb + 0: acb + *** Failers +No match + a\nb +No match + +/a[^a]b/s + acb + 0: acb + a\nb + 0: a\x0ab + +/a.b/s + acb + 0: acb + a\nb + 0: a\x0ab + +/^(b+?|a){1,2}?c/ + bac + 0: bac + bbac + 0: bbac + bbbac + 0: bbbac + bbbbac + 0: bbbbac + bbbbbac + 0: bbbbbac + +/^(b+|a){1,2}?c/ + bac + 0: bac + bbac + 0: bbac + bbbac + 0: bbbac + bbbbac + 0: bbbbac + bbbbbac + 0: bbbbbac + +/(?!\A)x/m + x\nb\n +No match + a\bx\n + 0: x + +/\x0{ab}/ + \0{ab} + 0: \x00{ab} + +/(A|B)*?CD/ + CD + 0: CD + +/(A|B)*CD/ + CD + 0: CD + +/(?.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ +No match + +"(?>.*/)foo" + /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo + 0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo + +/(?>(\.\d\d[1-9]?))\d+/ + 1.230003938 + 0: .230003938 + 1: .23000393 + 2: .2300039 + 3: .230003 + 4: .23000 + 5: .2300 + 6: .230 + 1.875000282 + 0: .875000282 + 1: .87500028 + 2: .8750002 + 3: .875000 + 4: .87500 + 5: .8750 + *** Failers +No match + 1.235 +No match + +/^((?>\w+)|(?>\s+))*$/ + now is the time for all good men to come to the aid of the party + 0: now is the time for all good men to come to the aid of the party + *** Failers +No match + this is not a line with only words and spaces! +No match + +/(\d+)(\w)/ + 12345a + 0: 12345a + 1: 12345 + 2: 1234 + 3: 123 + 4: 12 + 12345+ + 0: 12345 + 1: 1234 + 2: 123 + 3: 12 + +/((?>\d+))(\w)/ + 12345a + 0: 12345a + *** Failers +No match + 12345+ +No match + +/(?>a+)b/ + aaab + 0: aaab + +/((?>a+)b)/ + aaab + 0: aaab + +/(?>(a+))b/ + aaab + 0: aaab + +/(?>b)+/ + aaabbbccc + 0: bbb + 1: bb + 2: b + +/(?>a+|b+|c+)*c/ + aaabbbbccccd + 0: aaabbbbcccc + 1: aaabbbbc + +/(a+|b+|c+)*c/ + aaabbbbccccd + 0: aaabbbbcccc + 1: aaabbbbccc + 2: aaabbbbcc + 3: aaabbbbc + +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + 0: abc(ade)ufh()()x + 1: abc(ade)ufh()() + 2: abc(ade)ufh() + 3: abc(ade)ufh + 4: abc(ade) + 5: abc + +/\(((?>[^()]+)|\([^()]+\))+\)/ + (abc) + 0: (abc) + (abc(def)xyz) + 0: (abc(def)xyz) + *** Failers +No match + ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + +/a(?-i)b/i + ab + 0: ab + Ab + 0: Ab + *** Failers +No match + aB +No match + AB +No match + +/(a (?x)b c)d e/ + a bcd e + 0: a bcd e + *** Failers +No match + a b cd e +No match + abcd e +No match + a bcde +No match + +/(a b(?x)c d (?-x)e f)/ + a bcde f + 0: a bcde f + *** Failers +No match + abcdef +No match + +/(a(?i)b)c/ + abc + 0: abc + aBc + 0: aBc + *** Failers +No match + abC +No match + aBC +No match + Abc +No match + ABc +No match + ABC +No match + AbC +No match + +/a(?i:b)c/ + abc + 0: abc + aBc + 0: aBc + *** Failers +No match + ABC +No match + abC +No match + aBC +No match + +/a(?i:b)*c/ + aBc + 0: aBc + aBBc + 0: aBBc + *** Failers +No match + aBC +No match + aBBC +No match + +/a(?=b(?i)c)\w\wd/ + abcd + 0: abcd + abCd + 0: abCd + *** Failers +No match + aBCd +No match + abcD +No match + +/(?s-i:more.*than).*million/i + more than million + 0: more than million + more than MILLION + 0: more than MILLION + more \n than Million + 0: more \x0a than Million + *** Failers +No match + MORE THAN MILLION +No match + more \n than \n million +No match + +/(?:(?s-i)more.*than).*million/i + more than million + 0: more than million + more than MILLION + 0: more than MILLION + more \n than Million + 0: more \x0a than Million + *** Failers +No match + MORE THAN MILLION +No match + more \n than \n million +No match + +/(?>a(?i)b+)+c/ + abc + 0: abc + aBbc + 0: aBbc + aBBc + 0: aBBc + *** Failers +No match + Abc +No match + abAb +No match + abbC +No match + +/(?=a(?i)b)\w\wc/ + abc + 0: abc + aBc + 0: aBc + *** Failers +No match + Ab +No match + abC +No match + aBC +No match + +/(?<=a(?i)b)(\w\w)c/ + abxxc + 0: xxc + aBxxc + 0: xxc + *** Failers +No match + Abxxc +No match + ABxxc +No match + abxxC +No match + +/^(?(?=abc)\w{3}:|\d\d)$/ + abc: + 0: abc: + 12 + 0: 12 + *** Failers +No match + 123 +No match + xyz +No match + +/^(?(?!abc)\d\d|\w{3}:)$/ + abc: + 0: abc: + 12 + 0: 12 + *** Failers +No match + 123 +No match + xyz +No match + +/(?(?<=foo)bar|cat)/ + foobar + 0: bar + cat + 0: cat + fcat + 0: cat + focat + 0: cat + *** Failers +No match + foocat +No match + +/(?(?a*)*/ + a + 0: a + 1: + aa + 0: aa + 1: + aaaa + 0: aaaa + 1: + +/(abc|)+/ + abc + 0: abc + 1: + abcabc + 0: abcabc + 1: abc + 2: + abcabcabc + 0: abcabcabc + 1: abcabc + 2: abc + 3: + xyz + 0: + +/([a]*)*/ + a + 0: a + 1: + aaaaa + 0: aaaaa + 1: aaaa + 2: aaa + 3: aa + 4: a + 5: + +/([ab]*)*/ + a + 0: a + 1: + b + 0: b + 1: + ababab + 0: ababab + 1: ababa + 2: abab + 3: aba + 4: ab + 5: a + 6: + aaaabcde + 0: aaaab + 1: aaaa + 2: aaa + 3: aa + 4: a + 5: + bbbb + 0: bbbb + 1: bbb + 2: bb + 3: b + 4: + +/([^a]*)*/ + b + 0: b + 1: + bbbb + 0: bbbb + 1: bbb + 2: bb + 3: b + 4: + aaa + 0: + +/([^ab]*)*/ + cccc + 0: cccc + 1: ccc + 2: cc + 3: c + 4: + abab + 0: + +/([a]*?)*/ + a + 0: a + 1: + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + 4: + +/([ab]*?)*/ + a + 0: a + 1: + b + 0: b + 1: + abab + 0: abab + 1: aba + 2: ab + 3: a + 4: + baba + 0: baba + 1: bab + 2: ba + 3: b + 4: + +/([^a]*?)*/ + b + 0: b + 1: + bbbb + 0: bbbb + 1: bbb + 2: bb + 3: b + 4: + aaa + 0: + +/([^ab]*?)*/ + c + 0: c + 1: + cccc + 0: cccc + 1: ccc + 2: cc + 3: c + 4: + baba + 0: + +/(?>a*)*/ + a + 0: a + 1: + aaabcde + 0: aaa + 1: + +/((?>a*))*/ + aaaaa + 0: aaaaa + 1: + aabbaa + 0: aa + 1: + +/((?>a*?))*/ + aaaaa + 0: aaaaa + 1: + aabbaa + 0: aa + 1: + +/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x + 12-sep-98 + 0: 12-sep-98 + 12-09-98 + 0: 12-09-98 + *** Failers +No match + sep-12-98 +No match + +/(?i:saturday|sunday)/ + saturday + 0: saturday + sunday + 0: sunday + Saturday + 0: Saturday + Sunday + 0: Sunday + SATURDAY + 0: SATURDAY + SUNDAY + 0: SUNDAY + SunDay + 0: SunDay + +/(a(?i)bc|BB)x/ + abcx + 0: abcx + aBCx + 0: aBCx + bbx + 0: bbx + BBx + 0: BBx + *** Failers +No match + abcX +No match + aBCX +No match + bbX +No match + BBX +No match + +/^([ab](?i)[cd]|[ef])/ + ac + 0: ac + aC + 0: aC + bD + 0: bD + elephant + 0: e + Europe + 0: E + frog + 0: f + France + 0: F + *** Failers +No match + Africa +No match + +/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ + ab + 0: ab + aBd + 0: aBd + xy + 0: xy + xY + 0: xY + zebra + 0: z + Zambesi + 0: Z + *** Failers +No match + aCD +No match + XY +No match + +/(?<=foo\n)^bar/m + foo\nbar + 0: bar + *** Failers +No match + bar +No match + baz\nbar +No match + +/(?<=(?]&/ + <&OUT + 0: <& + +/(?:(f)(o)(o)|(b)(a)(r))*/ + foobar + 0: foobar + 1: foo + 2: + +/(?<=a)b/ + ab + 0: b + *** Failers +No match + cb +No match + b +No match + +/(?a+)ab/ + +/(?>a+)b/ + aaab + 0: aaab + +/([[:]+)/ + a:[b]: + 0: :[ + 1: : + +/([[=]+)/ + a=[b]= + 0: =[ + 1: = + +/([[.]+)/ + a.[b]. + 0: .[ + 1: . + +/((?>a+)b)/ + aaab + 0: aaab + +/(?>(a+))b/ + aaab + 0: aaab + +/((?>[^()]+)|\([^()]*\))+/ + ((abc(ade)ufh()()x + 0: abc(ade)ufh()()x + 1: abc(ade)ufh()() + 2: abc(ade)ufh() + 3: abc(ade)ufh + 4: abc(ade) + 5: abc + +/a\Z/ + *** Failers +No match + aaab +No match + a\nb\n +No match + +/b\Z/ + a\nb\n + 0: b -/[^\xff]/8 - XYZ - 0: X - \x{123} - 0: \x{123} +/b\z/ + +/b\Z/ + a\nb + 0: b -/^[ac]*b/8 - xb +/b\z/ + a\nb + 0: b + *** Failers +No match + +/(?>.*)(?<=(abcd|wxyz))/ + alphabetabcd + 0: alphabetabcd + endingwxyz + 0: endingwxyz + *** Failers +No match + a rather long string that doesn't end with one of them No match -/^[ac\x{100}]*b/8 - xb +/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark otherword + 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword + word cat dog elephant mussel cow horse canary baboon snake shark +No match + +/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ + word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope No match -/^[^x]*b/8i - xb +/(?<=\d{3}(?!999))foo/ + 999foo + 0: foo + 123999foo + 0: foo + *** Failers +No match + 123abcfoo +No match + +/(?<=(?!...999)\d{3})foo/ + 999foo + 0: foo + 123999foo + 0: foo + *** Failers +No match + 123abcfoo No match -/^[^x]*b/8 - xb +/(?<=\d{3}(?!999)...)foo/ + 123abcfoo + 0: foo + 123456foo + 0: foo + *** Failers No match - -/^\d*b/8 - xb + 123999foo +No match + +/(?<=\d{3}...)(?Z)+|A)*/ + ZABCDEFG + 0: ZA + 1: Z + 2: + +/((?>)+|A)*/ + ZABCDEFG 0: + +/a*/g + abbab 0: a 1: 0: + 0: 0: a 1: 0: 0: - a\x{256}a + +/^[a-\d]/ + abcde 0: a - 1: - 0: + -things + 0: - + 0digit + 0: 0 + *** Failers +No match + bcdef +No match + +/^[\d-a]/ + abcde 0: a - 1: + -things + 0: - + 0digit + 0: 0 + *** Failers +No match + bcdef +No match + +/[[:space:]]+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09\x0a\x0c\x0d\x0b + 1: \x09\x0a\x0c\x0d + 2: \x09\x0a\x0c + 3: \x09\x0a + 4: \x09 + 5: + +/[[:blank:]]+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09 + 1: + +/[\s]+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09\x0a\x0c\x0d + 1: \x09\x0a\x0c + 2: \x09\x0a + 3: \x09 + 4: + +/\s+/ + > \x09\x0a\x0c\x0d\x0b< + 0: \x09\x0a\x0c\x0d + 1: \x09\x0a\x0c + 2: \x09\x0a + 3: \x09 + 4: + +/a b/x + ab +No match + +/(?!\A)x/m + a\nxb\n + 0: x + +/(?!^)x/m + a\nxb\n +No match + +/abc\Qabc\Eabc/ + abcabcabc + 0: abcabcabc + +/abc\Q(*+|\Eabc/ + abc(*+|abc + 0: abc(*+|abc + +/ abc\Q abc\Eabc/x + abc abcabc + 0: abc abcabc + *** Failers +No match + abcabcabc +No match + +/abc#comment + \Q#not comment + literal\E/x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/abc#comment + \Q#not comment + literal/x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/abc#comment + \Q#not comment + literal\E #more comment + /x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/abc#comment + \Q#not comment + literal\E #more comment/x + abc#not comment\n literal + 0: abc#not comment\x0a literal + +/\Qabc\$xyz\E/ + abc\\\$xyz + 0: abc\$xyz + +/\Qabc\E\$\Qxyz\E/ + abc\$xyz + 0: abc$xyz + +/\Gabc/ + abc + 0: abc + *** Failers +No match + xyzabc +No match + +/\Gabc./g + abc1abc2xyzabc3 + 0: abc1 + 0: abc2 + +/abc./g + abc1abc2xyzabc3 + 0: abc1 + 0: abc2 + 0: abc3 + +/a(?x: b c )d/ + XabcdY + 0: abcd + *** Failers +No match + Xa b c d Y +No match + +/((?x)x y z | a b c)/ + XabcY + 0: abc + AxyzB + 0: xyz + +/(?i)AB(?-i)C/ + XabCY + 0: abC + *** Failers +No match + XabcY +No match + +/((?i)AB(?-i)C|D)E/ + abCE + 0: abCE + DE + 0: DE + *** Failers +No match + abcE +No match + abCe +No match + dE +No match + De +No match + +/[z\Qa-d]\E]/ + z + 0: z + a + 0: a + - + 0: - + d + 0: d + ] + 0: ] + *** Failers + 0: a + b +No match + +/[\z\C]/ + z + 0: z + C + 0: C + +/\M/ + M + 0: M + +/(a+)*b/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + +/(?i)reg(?:ul(?:[a]|ae)r|ex)/ + REGular + 0: REGular + regulaer + 0: regulaer + Regex + 0: Regex + regulr + 0: regul\xe4r + +/[--]+/ + + 0: \xc5\xe6\xe5\xe4\xe0 + + 0: \xc5\xe6\xe5\xe4\xff + + 0: \xc5\xe6\xe5\xe4\xc0 + + 0: \xc5\xe6\xe5\xe4\xdf + +/(?<=Z)X./ + \x84XAZXB + 0: XB + +/^(?(2)a|(1)(2))+$/ + 123a +Error -17 (backreference condition or recursion test not supported for DFA matching) + +/(?<=a|bbbb)c/ + ac + 0: c + bbbbc + 0: c + +/abc/SS>testsavedregex +Compiled pattern written to testsavedregex +testsavedregex +Compiled pattern written to testsavedregex +testsavedregex +Compiled pattern written to testsavedregex +Study data written to testsavedregex +testsavedregex +Compiled pattern written to testsavedregex +Study data written to testsavedregex + + 0: abc + xyz\r\nabc\ + 0: abc + xyz\rabc\ + 0: abc + xyz\r\nabc\ + 0: abc + ** Failers +No match + xyz\nabc\ +No match + xyz\r\nabc\ +No match + xyz\nabc\ +No match + xyz\rabc\ +No match + xyz\rabc\ +No match + +/abc$/m + xyzabc + 0: abc + xyzabc\n + 0: abc + xyzabc\npqr + 0: abc + xyzabc\r\ + 0: abc + xyzabc\rpqr\ + 0: abc + xyzabc\r\n\ + 0: abc + xyzabc\r\npqr\ + 0: abc + ** Failers +No match + xyzabc\r +No match + xyzabc\rpqr +No match + xyzabc\r\n +No match + xyzabc\r\npqr +No match + +/^abc/m + xyz\rabcdef + 0: abc + xyz\nabcdef\ + 0: abc + ** Failers +No match + xyz\nabcdef +No match + +/^abc/m + xyz\nabcdef + 0: abc + xyz\rabcdef\ + 0: abc + ** Failers +No match + xyz\rabcdef +No match + +/^abc/m + xyz\r\nabcdef + 0: abc + xyz\rabcdef\ + 0: abc + ** Failers +No match + xyz\rabcdef +No match + +/.*/ + abc\ndef + 0: abc + 1: ab + 2: a + 3: + abc\rdef + 0: abc\x0ddef + 1: abc\x0dde + 2: abc\x0dd + 3: abc\x0d + 4: abc + 5: ab + 6: a + 7: + abc\r\ndef + 0: abc\x0d + 1: abc + 2: ab + 3: a + 4: + \abc\ndef + 0: abc\x0adef + 1: abc\x0ade + 2: abc\x0ad + 3: abc\x0a + 4: abc + 5: ab + 6: a + 7: + \abc\rdef + 0: abc + 1: ab + 2: a + 3: + \abc\r\ndef + 0: abc + 1: ab + 2: a + 3: + \abc\ndef + 0: abc\x0adef + 1: abc\x0ade + 2: abc\x0ad + 3: abc\x0a + 4: abc + 5: ab + 6: a + 7: + \abc\rdef + 0: abc\x0ddef + 1: abc\x0dde + 2: abc\x0dd + 3: abc\x0d + 4: abc + 5: ab + 6: a + 7: + \abc\r\ndef + 0: abc + 1: ab + 2: a + 3: + +/\w+(.)(.)?def/s + abc\ndef + 0: abc\x0adef + abc\rdef + 0: abc\x0ddef + abc\r\ndef + 0: abc\x0d\x0adef + +/^\w+=.*(\\\n.*)*/ + abc=xyz\\\npqr + 0: abc=xyz\\x0apqr + 1: abc=xyz\\x0apq + 2: abc=xyz\\x0ap + 3: abc=xyz\\x0a + 4: abc=xyz\ + 5: abc=xyz + 6: abc=xy + 7: abc=x + 8: abc= + +/^(a()*)*/ + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + 4: + +/^(?:a(?:(?:))*)*/ + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + 4: + +/^(a()+)+/ + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + +/^(?:a(?:(?:))+)+/ + aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + +/(a|)*\d/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 + 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 + +/(?>a|)*\d/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 + 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 + +/(?:a|)*\d/ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +No match + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 + 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 -/^\x{85}$/8i - \x{85} - 0: \x{85} +/^a.b/ + a\rb + 0: a\x0db + a\nb\ + 0: a\x0ab + ** Failers +No match + a\nb +No match + a\nb\ +No match + a\rb\ +No match + a\rb\ +No match -/^abc./mgx8 - abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x{0085}abc7 \x{2028}abc8 \x{2029}abc9 JUNK +/^abc./mgx + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK 0: abc1 0: abc2 0: abc3 @@ -1041,265 +6815,738 @@ 0: abc5 0: abc6 0: abc7 - 0: abc8 - 0: abc9 -/abc.$/mgx8 - abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x{0085} abc7\x{2028} abc8\x{2029} abc9 +/abc.$/mgx + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 0: abc1 0: abc2 0: abc3 0: abc4 0: abc5 0: abc6 - 0: abc7 - 0: abc8 0: abc9 -/^a\Rb/8 +/^a\Rb/ a\nb - 0: a\x{0a}b + 0: a\x0ab a\rb - 0: a\x{0d}b + 0: a\x0db a\r\nb - 0: a\x{0d}\x{0a}b + 0: a\x0d\x0ab a\x0bb - 0: a\x{0b}b + 0: a\x0bb a\x0cb - 0: a\x{0c}b - a\x{85}b - 0: a\x{85}b - a\x{2028}b - 0: a\x{2028}b - a\x{2029}b - 0: a\x{2029}b + 0: a\x0cb + a\x85b + 0: a\x85b ** Failers No match a\n\rb No match -/^a\R*b/8 +/^a\R*b/ ab 0: ab a\nb - 0: a\x{0a}b + 0: a\x0ab a\rb - 0: a\x{0d}b + 0: a\x0db a\r\nb - 0: a\x{0d}\x{0a}b + 0: a\x0d\x0ab a\x0bb - 0: a\x{0b}b - a\x0c\x{2028}\x{2029}b - 0: a\x{0c}\x{2028}\x{2029}b - a\x{85}b - 0: a\x{85}b + 0: a\x0bb + a\x0cb + 0: a\x0cb + a\x85b + 0: a\x85b a\n\rb - 0: a\x{0a}\x{0d}b - a\n\r\x{85}\x0cb - 0: a\x{0a}\x{0d}\x{85}\x{0c}b + 0: a\x0a\x0db + a\n\r\x85\x0cb + 0: a\x0a\x0d\x85\x0cb -/^a\R+b/8 +/^a\R+b/ a\nb - 0: a\x{0a}b + 0: a\x0ab a\rb - 0: a\x{0d}b + 0: a\x0db a\r\nb - 0: a\x{0d}\x{0a}b + 0: a\x0d\x0ab a\x0bb - 0: a\x{0b}b - a\x0c\x{2028}\x{2029}b - 0: a\x{0c}\x{2028}\x{2029}b - a\x{85}b - 0: a\x{85}b + 0: a\x0bb + a\x0cb + 0: a\x0cb + a\x85b + 0: a\x85b a\n\rb - 0: a\x{0a}\x{0d}b - a\n\r\x{85}\x0cb - 0: a\x{0a}\x{0d}\x{85}\x{0c}b + 0: a\x0a\x0db + a\n\r\x85\x0cb + 0: a\x0a\x0d\x85\x0cb + ** Failers +No match + ab +No match + +/^a\R{1,3}b/ + a\nb + 0: a\x0ab + a\n\rb + 0: a\x0a\x0db + a\n\r\x85b + 0: a\x0a\x0d\x85b + a\r\n\r\nb + 0: a\x0d\x0a\x0d\x0ab + a\r\n\r\n\r\nb + 0: a\x0d\x0a\x0d\x0a\x0d\x0ab + a\n\r\n\rb + 0: a\x0a\x0d\x0a\x0db + a\n\n\r\nb + 0: a\x0a\x0a\x0d\x0ab ** Failers No match - ab + a\n\n\n\rb +No match + a\r +No match + +/^a[\R]b/ + aRb + 0: aRb + ** Failers +No match + a\nb +No match + +/.+foo/ + afoo + 0: afoo + ** Failers +No match + \r\nfoo +No match + \nfoo +No match + +/.+foo/ + afoo + 0: afoo + \nfoo + 0: \x0afoo + ** Failers +No match + \r\nfoo No match -/^a\R{1,3}b/8 - a\nb - 0: a\x{0a}b - a\n\rb - 0: a\x{0a}\x{0d}b - a\n\r\x{85}b - 0: a\x{0a}\x{0d}\x{85}b - a\r\n\r\nb - 0: a\x{0d}\x{0a}\x{0d}\x{0a}b - a\r\n\r\n\r\nb - 0: a\x{0d}\x{0a}\x{0d}\x{0a}\x{0d}\x{0a}b - a\n\r\n\rb - 0: a\x{0a}\x{0d}\x{0a}\x{0d}b - a\n\n\r\nb - 0: a\x{0a}\x{0a}\x{0d}\x{0a}b - ** Failers +/.+foo/ + afoo + 0: afoo + ** Failers No match - a\n\n\n\rb + \nfoo No match - a\r + \r\nfoo +No match + +/.+foo/s + afoo + 0: afoo + \r\nfoo + 0: \x0d\x0afoo + \nfoo + 0: \x0afoo + +/^$/mg + abc\r\rxyz + 0: + abc\n\rxyz + 0: + ** Failers +No match + abc\r\nxyz +No match + +/^X/m + XABC + 0: X + ** Failers +No match + XABC\B No match -/\h+\V?\v{3,4}/8 - \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a - 0: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c}\x{0d} - 1: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c} - -/\V?\v{3,4}/8 - \x20\x{a0}X\x0a\x0b\x0c\x0d\x0a - 0: X\x{0a}\x{0b}\x{0c}\x{0d} - 1: X\x{0a}\x{0b}\x{0c} - -/\h+\V?\v{3,4}/8 - >\x09\x20\x{a0}X\x0a\x0a\x0a< - 0: \x{09} \x{a0}X\x{0a}\x{0a}\x{0a} - -/\V?\v{3,4}/8 - >\x09\x20\x{a0}X\x0a\x0a\x0a< - 0: X\x{0a}\x{0a}\x{0a} +/(?m)^$/g+ + abc\r\n\r\n + 0: + 0+ \x0d\x0a + +/(?m)^$|^\r\n/g+ + abc\r\n\r\n + 0: \x0d\x0a + 0+ + 1: + +/(?m)$/g+ + abc\r\n\r\n + 0: + 0+ \x0d\x0a\x0d\x0a + 0: + 0+ \x0d\x0a + 0: + 0+ + +/(?|(abc)|(xyz))/ + >abc< + 0: abc + >xyz< + 0: xyz -/\H\h\V\v/8 +/(x)(?|(abc)|(xyz))(x)/ + xabcx + 0: xabcx + xxyzx + 0: xxyzx + +/(x)(?|(abc)(pqr)|(xyz))(x)/ + xabcpqrx + 0: xabcpqrx + xxyzx + 0: xxyzx + +/(?|(abc)|(xyz))(?1)/ + abcabc + 0: abcabc + xyzabc + 0: xyzabc + ** Failers +No match + xyzxyz +No match + +/\H\h\V\v/ X X\x0a - 0: X X\x{0a} + 0: X X\x0a X\x09X\x0b - 0: X\x{09}X\x{0b} + 0: X\x09X\x0b ** Failers No match - \x{a0} X\x0a + \xa0 X\x0a No match -/\H*\h+\V?\v{3,4}/8 - \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a - 0: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c}\x{0d} - 1: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c} - \x09\x20\x{a0}\x0a\x0b\x0c\x0d\x0a - 0: \x{09} \x{a0}\x{0a}\x{0b}\x{0c}\x{0d} - 1: \x{09} \x{a0}\x{0a}\x{0b}\x{0c} - \x09\x20\x{a0}\x0a\x0b\x0c - 0: \x{09} \x{a0}\x{0a}\x{0b}\x{0c} +/\H*\h+\V?\v{3,4}/ + \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a + 0: \x09 \xa0X\x0a\x0b\x0c\x0d + 1: \x09 \xa0X\x0a\x0b\x0c + \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a + 0: \x09 \xa0\x0a\x0b\x0c\x0d + 1: \x09 \xa0\x0a\x0b\x0c + \x09\x20\xa0\x0a\x0b\x0c + 0: \x09 \xa0\x0a\x0b\x0c ** Failers No match - \x09\x20\x{a0}\x0a\x0b + \x09\x20\xa0\x0a\x0b No match -/\H\h\V\v/8 - \x{3001}\x{3000}\x{2030}\x{2028} - 0: \x{3001}\x{3000}\x{2030}\x{2028} - X\x{180e}X\x{85} - 0: X\x{180e}X\x{85} - ** Failers -No match - \x{2009} X\x0a -No match - -/\H*\h+\V?\v{3,4}/8 - \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x0c\x0d\x0a - 0: \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x{0c}\x{0d} - 1: \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x{0c} - \x09\x{205f}\x{a0}\x0a\x{2029}\x0c\x{2028}\x0a - 0: \x{09}\x{205f}\x{a0}\x{0a}\x{2029}\x{0c}\x{2028} - 1: \x{09}\x{205f}\x{a0}\x{0a}\x{2029}\x{0c} - \x09\x20\x{202f}\x0a\x0b\x0c - 0: \x{09} \x{202f}\x{0a}\x{0b}\x{0c} - ** Failers +/\H{3,4}/ + XY ABCDE + 0: ABCD + 1: ABC + XY PQR ST + 0: PQR + +/.\h{3,4}./ + XY AB PQRS + 0: B P + 1: B + +/\h*X\h?\H+Y\H?Z/ + >XNNNYZ + 0: XNNNYZ + > X NYQZ + 0: X NYQZ + ** Failers No match - \x09\x{200a}\x{a0}\x{2028}\x0b + >XYZ No match - -/a\Rb/I8 + > X NY Z +No match + +/\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ + >XY\x0aZ\x0aA\x0bNN\x0c + 0: XY\x0aZ\x0aA\x0bNN\x0c + >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c + 0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c + +/.+A/ + \r\nA +No match + +/\nA/ + \r\nA + 0: \x0aA + +/[\r\n]A/ + \r\nA + 0: \x0aA + +/(\r|\n)A/ + \r\nA + 0: \x0aA + +/a\Rb/I Capturing subpattern count = 0 -Options: bsr_anycrlf utf8 +Options: bsr_anycrlf First char = 'a' Need char = 'b' a\rb - 0: a\x{0d}b + 0: a\x0db a\nb - 0: a\x{0a}b + 0: a\x0ab a\r\nb - 0: a\x{0d}\x{0a}b + 0: a\x0d\x0ab ** Failers No match - a\x{85}b + a\x85b No match a\x0bb No match -/a\Rb/I8 +/a\Rb/I Capturing subpattern count = 0 -Options: bsr_unicode utf8 +Options: bsr_unicode First char = 'a' Need char = 'b' a\rb - 0: a\x{0d}b + 0: a\x0db a\nb - 0: a\x{0a}b + 0: a\x0ab a\r\nb - 0: a\x{0d}\x{0a}b - a\x{85}b - 0: a\x{85}b + 0: a\x0d\x0ab + a\x85b + 0: a\x85b a\x0bb - 0: a\x{0b}b + 0: a\x0bb ** Failers No match - a\x{85}b\ + a\x85b\ No match a\x0bb\ No match -/a\R?b/I8 +/a\R?b/I Capturing subpattern count = 0 -Options: bsr_anycrlf utf8 +Options: bsr_anycrlf First char = 'a' Need char = 'b' a\rb - 0: a\x{0d}b + 0: a\x0db a\nb - 0: a\x{0a}b + 0: a\x0ab a\r\nb - 0: a\x{0d}\x{0a}b + 0: a\x0d\x0ab ** Failers No match - a\x{85}b + a\x85b No match a\x0bb No match -/a\R?b/I8 +/a\R?b/I Capturing subpattern count = 0 -Options: bsr_unicode utf8 +Options: bsr_unicode First char = 'a' Need char = 'b' a\rb - 0: a\x{0d}b + 0: a\x0db a\nb - 0: a\x{0a}b + 0: a\x0ab a\r\nb - 0: a\x{0d}\x{0a}b - a\x{85}b - 0: a\x{85}b + 0: a\x0d\x0ab + a\x85b + 0: a\x85b a\x0bb - 0: a\x{0b}b + 0: a\x0bb ** Failers No match - a\x{85}b\ + a\x85b\ No match a\x0bb\ No match - -/X/8f - A\x{1ec5}ABCXYZ + +/a\R{2,4}b/I +Capturing subpattern count = 0 +Options: bsr_anycrlf +First char = 'a' +Need char = 'b' + a\r\n\nb + 0: a\x0d\x0a\x0ab + a\n\r\rb + 0: a\x0a\x0d\x0db + a\r\n\r\n\r\n\r\nb + 0: a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0ab + ** Failers +No match + a\x85\85b +No match + a\x0b\0bb +No match + +/a\R{2,4}b/I +Capturing subpattern count = 0 +Options: bsr_unicode +First char = 'a' +Need char = 'b' + a\r\rb + 0: a\x0d\x0db + a\n\n\nb + 0: a\x0a\x0a\x0ab + a\r\n\n\r\rb + 0: a\x0d\x0a\x0a\x0d\x0db + a\x85\85b +No match + a\x0b\0bb +No match + ** Failers +No match + a\r\r\r\r\rb +No match + a\x85\85b\ +No match + a\x0b\0bb\ +No match + +/a(?!)|\wbc/ + abc + 0: abc + +/a[]b/ + ** Failers +No match + ab +No match + +/a[]+b/ + ** Failers +No match + ab +No match + +/a[]*+b/ + ** Failers +No match + ab +No match + +/a[^]b/ + aXb + 0: aXb + a\nb + 0: a\x0ab + ** Failers +No match + ab +No match + +/a[^]+b/ + aXb + 0: aXb + a\nX\nXb + 0: a\x0aX\x0aXb + ** Failers +No match + ab +No match + +/X$/E + X + 0: X + ** Failers +No match + X\n +No match + +/X$/ + X 0: X + X\n + 0: X + +/xyz/C + xyz +--->xyz + +0 ^ x + +1 ^^ y + +2 ^ ^ z + +3 ^ ^ + 0: xyz + abcxyz +--->abcxyz + +0 ^ x + +1 ^^ y + +2 ^ ^ z + +3 ^ ^ + 0: xyz + abcxyz\Y +--->abcxyz + +0 ^ x + +0 ^ x + +0 ^ x + +0 ^ x + +1 ^^ y + +2 ^ ^ z + +3 ^ ^ + 0: xyz + ** Failers +No match + abc +No match + abc\Y +--->abc + +0 ^ x + +0 ^ x + +0 ^ x + +0 ^ x +No match + abcxypqr +No match + abcxypqr\Y +--->abcxypqr + +0 ^ x + +0 ^ x + +0 ^ x + +0 ^ x + +1 ^^ y + +2 ^ ^ z + +0 ^ x + +0 ^ x + +0 ^ x + +0 ^ x + +0 ^ x +No match + +/(*NO_START_OPT)xyz/C + abcxyz +--->abcxyz ++15 ^ x ++15 ^ x ++15 ^ x ++15 ^ x ++16 ^^ y ++17 ^ ^ z ++18 ^ ^ + 0: xyz + +/(?C)ab/ + ab +--->ab + 0 ^ a + 0: ab + \C-ab + 0: ab + +/ab/C + ab +--->ab + +0 ^ a + +1 ^^ b + +2 ^ ^ + 0: ab + \C-ab + 0: ab + +/^"((?(?=[a])[^"])|b)*"$/C + "ab" +--->"ab" + +0 ^ ^ + +1 ^ " + +2 ^^ ((?(?=[a])[^"])|b)* ++21 ^^ " + +3 ^^ (?(?=[a])[^"]) ++18 ^^ b + +5 ^^ (?=[a]) + +8 ^ [a] ++11 ^^ ) ++12 ^^ [^"] ++16 ^ ^ ) ++17 ^ ^ | ++21 ^ ^ " + +3 ^ ^ (?(?=[a])[^"]) ++18 ^ ^ b + +5 ^ ^ (?=[a]) + +8 ^ [a] ++19 ^ ^ ) ++21 ^ ^ " + +3 ^ ^ (?(?=[a])[^"]) ++18 ^ ^ b + +5 ^ ^ (?=[a]) + +8 ^ [a] ++17 ^ ^ | ++22 ^ ^ $ ++23 ^ ^ + 0: "ab" + \C-"ab" + 0: "ab" + +/\d+X|9+Y/ + ++++123999\P +Partial match: 123999 + ++++123999Y\P + 0: 999Y + +/Z(*F)/ + Z\P +No match + ZA\P +No match + +/Z(?!)/ + Z\P +No match + ZA\P +No match + +/dog(sbody)?/ + dogs\P + 0: dog + dogs\P\P +Partial match: dogs + +/dog(sbody)??/ + dogs\P + 0: dog + dogs\P\P +Partial match: dogs + +/dog|dogsbody/ + dogs\P + 0: dog + dogs\P\P +Partial match: dogs + +/dogsbody|dog/ + dogs\P + 0: dog + dogs\P\P +Partial match: dogs + +/Z(*F)Q|ZXY/ + Z\P +Partial match: Z + ZA\P +No match + X\P +No match + +/\bthe cat\b/ + the cat\P + 0: the cat + the cat\P\P +Partial match: the cat + +/dog(sbody)?/ + dogs\D\P + 0: dog + body\D\R + 0: body + +/dog(sbody)?/ + dogs\D\P\P +Partial match: dogs + body\D\R + 0: body + +/abc/ + abc\P + 0: abc + abc\P\P + 0: abc + +/abc\K123/ + xyzabc123pqr +Error -16 (item unsupported for DFA matching) + +/(?<=abc)123/ + xyzabc123pqr + 0: 123 + xyzabc12\P +Partial match: abc12 + xyzabc12\P\P +Partial match: abc12 + +/\babc\b/ + +++abc+++ + 0: abc + +++ab\P +Partial match: +ab + +++ab\P\P +Partial match: +ab + +/(?=C)/g+ + ABCDECBA + 0: + 0+ CDECBA + 0: + 0+ CBA + +/(abc|def|xyz)/I +Capturing subpattern count = 1 +No options +No first char +No need char + terhjk;abcdaadsfe + 0: abc + the quick xyz brown fox + 0: xyz + \Yterhjk;abcdaadsfe + 0: abc + \Ythe quick xyz brown fox + 0: xyz + ** Failers +No match + thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd +No match + \Ythejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd +No match + +/(abc|def|xyz)/SI +Capturing subpattern count = 1 +No options +No first char +No need char +Subject length lower bound = 3 +Starting byte set: a d x + terhjk;abcdaadsfe + 0: abc + the quick xyz brown fox + 0: xyz + \Yterhjk;abcdaadsfe + 0: abc + \Ythe quick xyz brown fox + 0: xyz + ** Failers +No match + thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd +No match + \Ythejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd +No match -/abcd*/8 +/abcd*/+ xxxxabcd\P 0: abcd + 0+ 1: abc xxxxabcd\P\P Partial match: abcd + dddxxx\R + 0: ddd + 0+ xxx + 1: dd + 2: d + 3: + xxxxabcd\P\P +Partial match: abcd + xxx\R + 0: + 0+ xxx -/abcd*/i8 +/abcd*/i xxxxabcd\P 0: abcd 1: abc @@ -1311,14 +7558,14 @@ XXXXABCD\P\P Partial match: ABCD -/abc\d*/8 +/abc\d*/ xxxxabc1\P 0: abc1 1: abc xxxxabc1\P\P Partial match: abc1 -/abc[de]*/8 +/abc[de]*/ xxxxabcde\P 0: abcde 1: abcd @@ -1326,26 +7573,447 @@ xxxxabcde\P\P Partial match: abcde -/\bthe cat\b/8 - the cat\P - 0: the cat - the cat\P\P -Partial match: the cat +/(?:(?1)|B)(A(*F)|C)/ + ABCD + 0: BC + CCD + 0: CC + ** Failers +No match + CAD +No match -/a+/8 - a\x{123}aa\>1 - 0: aa - 1: a - a\x{123}aa\>2 -Error -11 - a\x{123}aa\>3 +/^(?:(?1)|B)(A(*F)|C)/ + CCD + 0: CC + BCD + 0: BC + ** Failers +No match + ABCD +No match + CAD +No match + BAD +No match + +/^(?!a(*SKIP)b)/ + ac +Error -16 (item unsupported for DFA matching) + +/^(?=a(*SKIP)b|ac)/ + ** Failers +No match + ac +Error -16 (item unsupported for DFA matching) + +/^(?=a(*THEN)b|ac)/ + ac +Error -16 (item unsupported for DFA matching) + +/^(?=a(*PRUNE)b)/ + ab +Error -16 (item unsupported for DFA matching) + ** Failers +No match + ac +Error -16 (item unsupported for DFA matching) + +/^(?(?!a(*SKIP)b))/ + ac +Error -16 (item unsupported for DFA matching) + +/(?<=abc)def/ + abc\P\P +Partial match: abc + +/abc$/ + abc + 0: abc + abc\P + 0: abc + abc\P\P +Partial match: abc + +/abc$/m + abc + 0: abc + abc\n + 0: abc + abc\P\P +Partial match: abc + abc\n\P\P + 0: abc + abc\P + 0: abc + abc\n\P + 0: abc + +/abc\z/ + abc + 0: abc + abc\P + 0: abc + abc\P\P +Partial match: abc + +/abc\Z/ + abc + 0: abc + abc\P + 0: abc + abc\P\P +Partial match: abc + +/abc\b/ + abc + 0: abc + abc\P + 0: abc + abc\P\P +Partial match: abc + +/abc\B/ + abc +No match + abc\P +Partial match: abc + abc\P\P +Partial match: abc + +/.+/ + abc\>0 + 0: abc + 1: ab + 2: a + abc\>1 + 0: bc + 1: b + abc\>2 + 0: c + abc\>3 +No match + abc\>4 +Error -24 (bad offset value) + abc\>-4 +Error -24 (bad offset value) + +/^(?:a)++\w/ + aaaab + 0: aaaab + ** Failers +No match + aaaa +No match + bbb +No match + +/^(?:aa|(?:a)++\w)/ + aaaab + 0: aaaab + 1: aa + aaaa 0: aa - 1: a - a\x{123}aa\>4 - 0: a - a\x{123}aa\>5 + ** Failers +No match + bbb +No match + +/^(?:a)*+\w/ + aaaab + 0: aaaab + bbb + 0: b + ** Failers +No match + aaaa +No match + +/^(a)++\w/ + aaaab + 0: aaaab + ** Failers +No match + aaaa +No match + bbb +No match + +/^(a|)++\w/ + aaaab + 0: aaaab + ** Failers +No match + aaaa +No match + bbb +No match + +/(?=abc){3}abc/+ + abcabcabc + 0: abc + 0+ abcabc + ** Failers +No match + xyz +No match + +/(?=abc)+abc/+ + abcabcabc + 0: abc + 0+ abcabc + ** Failers +No match + xyz +No match + +/(?=abc)++abc/+ + abcabcabc + 0: abc + 0+ abcabc + ** Failers No match - a\x{123}aa\>6 -Error -24 + xyz +No match + +/(?=abc){0}xyz/ + xyz + 0: xyz + +/(?=abc){1}xyz/ + ** Failers +No match + xyz +No match + +/(?=(a))?./ + ab + 0: a + bc + 0: b + +/(?=(a))??./ + ab + 0: a + bc + 0: b + +/^(?=(a)){0}b(?1)/ + backgammon + 0: ba + +/^(?=(?1))?[az]([abc])d/ + abd + 0: abd + zcdxx + 0: zcd + +/^(?!a){0}\w+/ + aaaaa + 0: aaaaa + 1: aaaa + 2: aaa + 3: aa + 4: a + +/(?<=(abc))?xyz/ + abcxyz + 0: xyz + pqrxyz + 0: xyz + +/((?2))((?1))/ + abc +Error -26 (nested recursion at the same subject position) + +/(?(R)a+|(?R)b)/ + aaaabcde + 0: aaaab + +/(?(R)a+|((?R))b)/ + aaaabcde + 0: aaaab + +/((?(R)a+|(?1)b))/ + aaaabcde + 0: aaaab + +/((?(R2)a+|(?1)b))/ + aaaabcde +Error -17 (backreference condition or recursion test not supported for DFA matching) + +/(?(R)a*(?1)|((?R))b)/ + aaaabcde +Error -26 (nested recursion at the same subject position) + +/(a+)/ + \O6aaaa +Matched, but too many subsidiary matches + 0: aaaa + 1: aaa + 2: aa + \O8aaaa + 0: aaaa + 1: aaa + 2: aa + 3: a + +/ab\Cde/ + abXde + 0: abXde + +/(?<=ab\Cde)X/ + abZdeX + 0: X + +/^\R/ + \r\P + 0: \x0d + \r\P\P +Partial match: \x0d + +/^\R{2,3}x/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + \r\r\P +Partial match: \x0d\x0d + \r\r\P\P +Partial match: \x0d\x0d + \r\r\r\P +Partial match: \x0d\x0d\x0d + \r\r\r\P\P +Partial match: \x0d\x0d\x0d + \r\rx + 0: \x0d\x0dx + \r\r\rx + 0: \x0d\x0d\x0dx + +/^\R{2,3}?x/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + \r\r\P +Partial match: \x0d\x0d + \r\r\P\P +Partial match: \x0d\x0d + \r\r\r\P +Partial match: \x0d\x0d\x0d + \r\r\r\P\P +Partial match: \x0d\x0d\x0d + \r\rx + 0: \x0d\x0dx + \r\r\rx + 0: \x0d\x0d\x0dx + +/^\R?x/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + x + 0: x + \rx + 0: \x0dx + +/^\R+x/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + \r\n\P +Partial match: \x0d\x0a + \r\n\P\P +Partial match: \x0d\x0a + \rx + 0: \x0dx + +/^a$/ + a\r\P +Partial match: a\x0d + a\r\P\P +Partial match: a\x0d + +/^a$/m + a\r\P +Partial match: a\x0d + a\r\P\P +Partial match: a\x0d + +/^(a$|a\r)/ + a\r\P + 0: a\x0d + a\r\P\P +Partial match: a\x0d + +/^(a$|a\r)/m + a\r\P + 0: a\x0d + a\r\P\P +Partial match: a\x0d + +/./ + \r\P + 0: \x0d + \r\P\P +Partial match: \x0d + +/.{2,3}/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + \r\r\P + 0: \x0d\x0d + \r\r\P\P +Partial match: \x0d\x0d + \r\r\r\P + 0: \x0d\x0d\x0d + 1: \x0d\x0d + \r\r\r\P\P +Partial match: \x0d\x0d\x0d + +/.{2,3}?/ + \r\P +Partial match: \x0d + \r\P\P +Partial match: \x0d + \r\r\P + 0: \x0d\x0d + \r\r\P\P +Partial match: \x0d\x0d + \r\r\r\P + 0: \x0d\x0d\x0d + 1: \x0d\x0d + \r\r\r\P\P +Partial match: \x0d\x0d\x0d + +/-- Test simple validity check for restarts --/ + +/abcdef/ + abc\R +Error -30 (invalid data in workspace for DFA restart) + +/)(.)|(?R))++)*F>/ + text text xxxxx text F> text2 more text. + 0: text xxxxx text F> + +/^(?>.{4})abc|^\w\w.xabcd/ + xxxxabcd + 0: xxxxabcd + 1: xxxxabc + xx\xa0xabcd + 0: xx\xa0xabcd + 1: xx\xa0xabc + +/^(.{4}){2}+abc|^\w\w.x\w\w\w\wabcd/ + xxxxxxxxabcd + 0: xxxxxxxxabcd + 1: xxxxxxxxabc + xx\xa0xxxxxabcd + 0: xx\xa0xxxxxabcd + 1: xx\xa0xxxxxabc -/-- End of testinput8 --/ +/-- End of testinput8 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput9 php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput9 --- php5-5.4.4/ext/pcre/pcrelib/testdata/testoutput9 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/testdata/testoutput9 2012-11-21 05:12:20.000000000 +0000 @@ -1,2037 +1,1371 @@ -/-- This set of tests check Unicode property support with the DFA matching - functionality of pcre_dfa_exec(). The -dfa flag must be used with pcretest - when running it. --/ - -/\pL\P{Nd}/8 - AB - 0: AB - *** Failers - 0: Fa - A0 +/-- This set of tests checks UTF-8 support with the DFA matching functionality + of pcre_dfa_exec(). The -dfa flag must be used with pcretest when running + it. --/ + +/\x{100}ab/8 + \x{100}ab + 0: \x{100}ab + +/a\x{100}*b/8 + ab + 0: ab + a\x{100}b + 0: a\x{100}b + a\x{100}\x{100}b + 0: a\x{100}\x{100}b + +/a\x{100}+b/8 + a\x{100}b + 0: a\x{100}b + a\x{100}\x{100}b + 0: a\x{100}\x{100}b + *** Failers No match - 00 + ab No match - -/\X./8 - AB - 0: AB - A\x{300}BC - 0: A\x{300}B - A\x{300}\x{301}\x{302}BC - 0: A\x{300}\x{301}\x{302}B - *** Failers - 0: ** - \x{300} + +/\bX/8 + Xoanon + 0: X + +Xoanon + 0: X + \x{300}Xoanon + 0: X + *** Failers No match - -/\X\X/8 - ABC - 0: AB - A\x{300}B\x{300}\x{301}C - 0: A\x{300}B\x{300}\x{301} - A\x{300}\x{301}\x{302}BC - 0: A\x{300}\x{301}\x{302}B + YXoanon +No match + +/\BX/8 + YXoanon + 0: X *** Failers - 0: ** - \x{300} No match - -/^\pL+/8 - abcd - 0: abcd - 1: abc - 2: ab - 3: a - a - 0: a - *** Failers + Xoanon No match - -/^\PL+/8 - 1234 - 0: 1234 - 1: 123 - 2: 12 - 3: 1 - = - 0: = - *** Failers - 0: *** - 1: *** - 2: ** - 3: * - abcd + +Xoanon +No match + \x{300}Xoanon No match -/^\X+/8 - abcdA\x{300}\x{301}\x{302} - 0: abcdA\x{300}\x{301}\x{302} - 1: abcd - 2: abc - 3: ab - 4: a - A\x{300}\x{301}\x{302} - 0: A\x{300}\x{301}\x{302} - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} - 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302} - 1: A\x{300}\x{301}\x{302} - a - 0: a +/X\b/8 + X+oanon + 0: X + ZX\x{300}oanon + 0: X + FAX + 0: X *** Failers - 0: *** Failers - 1: *** Failer - 2: *** Faile - 3: *** Fail - 4: *** Fai - 5: *** Fa - 6: *** F - 7: *** - 8: *** - 9: ** -10: * - \x{300}\x{301}\x{302} No match - -/\X?abc/8 - abc - 0: abc - A\x{300}abc - 0: A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - 0: A\x{300}abc - \x{300}abc - 0: abc - *** Failers + Xoanon No match - -/^\X?abc/8 - abc - 0: abc - A\x{300}abc - 0: A\x{300}abc + +/X\B/8 + Xoanon + 0: X *** Failers No match - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz + X+oanon No match - \x{300}abc + ZX\x{300}oanon No match - -/\X*abc/8 - abc - 0: abc - A\x{300}abc - 0: A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - 0: A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abc - \x{300}abc - 0: abc - *** Failers + FAX No match + +/[^a]/8 + abcd + 0: b + a\x{100} + 0: \x{100} -/^\X*abc/8 - abc - 0: abc - A\x{300}abc - 0: A\x{300}abc - A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abcxyz - 0: A\x{300}\x{301}\x{302}A\x{300}A\x{300}A\x{300}abc +/^[abc\x{123}\x{400}-\x{402}]{2,3}\d/8 + ab99 + 0: ab9 + \x{123}\x{123}45 + 0: \x{123}\x{123}4 + \x{400}\x{401}\x{402}6 + 0: \x{400}\x{401}\x{402}6 *** Failers No match - \x{300}abc + d99 No match - -/^\pL?=./8 - A=b - 0: A=b - =c - 0: =c - *** Failers + \x{123}\x{122}4 No match - 1=2 + \x{400}\x{403}6 No match - AAAA=b + \x{400}\x{401}\x{402}\x{402}6 No match -/^\pL*=./8 - AAAA=b - 0: AAAA=b - =c - 0: =c +/a.b/8 + acb + 0: acb + a\x7fb + 0: a\x{7f}b + a\x{100}b + 0: a\x{100}b *** Failers No match - 1=2 + a\nb No match -/^\X{2,3}X/8 - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X - 0: A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X +/a(.{3})b/8 + a\x{4000}xyb + 0: a\x{4000}xyb + a\x{4000}\x7fyb + 0: a\x{4000}\x{7f}yb + a\x{4000}\x{100}yb + 0: a\x{4000}\x{100}yb *** Failers No match - X -No match - A\x{300}\x{301}\x{302}X + a\x{4000}b No match - A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}A\x{300}\x{301}\x{302}X + ac\ncb No match -/^\pC\pL\pM\pN\pP\pS\pZ\S/8 + > >X Y + 0: >X + > >\x{100} Y + 0: >\x{100} + +/\d/8 + \x{100}3 + 0: 3 -/^\p{Han}+/8 - \x{2e81}\x{3007}\x{2f804}\x{31a0} - 0: \x{2e81}\x{3007}\x{2f804} - 1: \x{2e81}\x{3007} - 2: \x{2e81} - ** Failers -No match - \x{2e7f} +/\s/8 + \x{100} X + 0: + +/\D+/8 + 12abcd34 + 0: abcd + 1: abc + 2: ab + 3: a + *** Failers + 0: *** Failers + 1: *** Failer + 2: *** Faile + 3: *** Fail + 4: *** Fai + 5: *** Fa + 6: *** F + 7: *** + 8: *** + 9: ** +10: * + 1234 No match -/^\P{Katakana}+/8 - \x{3105} - 0: \x{3105} - ** Failers - 0: ** Failers - 1: ** Failer - 2: ** Faile - 3: ** Fail - 4: ** Fai - 5: ** Fa - 6: ** F - 7: ** - 8: ** - 9: * - \x{30ff} -No match - -/^[\p{Arabic}]/8 - \x{06e9} - 0: \x{6e9} - \x{060b} - 0: \x{60b} - ** Failers +/\D{2,3}/8 + 12abcd34 + 0: abc + 1: ab + 12ab34 + 0: ab + *** Failers + 0: *** + 1: ** + 1234 No match - X\x{06e9} + 12a34 No match -/^[\P{Yi}]/8 - \x{2f800} - 0: \x{2f800} - ** Failers - 0: * - \x{a014} +/\D{2,3}?/8 + 12abcd34 + 0: abc + 1: ab + 12ab34 + 0: ab + *** Failers + 0: *** + 1: ** + 1234 No match - \x{a4c6} + 12a34 No match -/^\p{Any}X/8 - AXYZ - 0: AX - \x{1234}XYZ - 0: \x{1234}X - ** Failers -No match - X -No match - -/^\P{Any}X/8 - ** Failers -No match - AX -No match - -/^\p{Any}?X/8 - XYZ - 0: X - AXYZ - 0: AX - \x{1234}XYZ - 0: \x{1234}X - ** Failers -No match - ABXYZ +/\d+/8 + 12abcd34 + 0: 12 + 1: 1 + *** Failers No match -/^\P{Any}?X/8 - XYZ - 0: X - ** Failers -No match - AXYZ -No match - \x{1234}XYZ -No match - ABXYZ +/\d{2,3}/8 + 12abcd34 + 0: 12 + 1234abcd + 0: 123 + 1: 12 + *** Failers +No match + 1.4 +No match + +/\d{2,3}?/8 + 12abcd34 + 0: 12 + 1234abcd + 0: 123 + 1: 12 + *** Failers +No match + 1.4 +No match + +/\S+/8 + 12abcd34 + 0: 12abcd34 + 1: 12abcd3 + 2: 12abcd + 3: 12abc + 4: 12ab + 5: 12a + 6: 12 + 7: 1 + *** Failers + 0: *** + 1: ** + 2: * + \ \ No match -/^\p{Any}+X/8 - AXYZ - 0: AX - \x{1234}XYZ - 0: \x{1234}X - A\x{1234}XYZ - 0: A\x{1234}X - ** Failers -No match - XYZ +/\S{2,3}/8 + 12abcd34 + 0: 12a + 1: 12 + 1234abcd + 0: 123 + 1: 12 + *** Failers + 0: *** + 1: ** + \ \ No match -/^\P{Any}+X/8 - ** Failers -No match - AXYZ -No match - \x{1234}XYZ -No match - A\x{1234}XYZ -No match - XYZ +/\S{2,3}?/8 + 12abcd34 + 0: 12a + 1: 12 + 1234abcd + 0: 123 + 1: 12 + *** Failers + 0: *** + 1: ** + \ \ No match -/^\p{Any}*X/8 - XYZ - 0: X - AXYZ - 0: AX - \x{1234}XYZ - 0: \x{1234}X - A\x{1234}XYZ - 0: A\x{1234}X - ** Failers +/>\s+ <34 + 0: > < + *** Failers No match -/^\P{Any}*X/8 - XYZ - 0: X - ** Failers -No match - AXYZ -No match - \x{1234}XYZ +/>\s{2,3} < + ab> < + *** Failers No match - A\x{1234}XYZ + ab> \s{2,3}? < + ab> < + *** Failers No match - ABXYZ + ab> \xff< + 0: \xff -/^\x{023a}+?(\x{0130}+)/8i - \x{023a}\x{2c65}\x{0130} - 0: \x{23a}\x{2c65}\x{130} - -/^\x{023a}+([^X])/8i - \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} +/[\xff]/8 + >\x{ff}< + 0: \x{ff} -/Check property support in non-UTF-8 mode/ - -/\p{L}{4}/ - 123abcdefg - 0: abcd - 123abc\xc4\xc5zz - 0: abc\xc4 +/[^\xFF]/ + XYZ + 0: X -/\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} +/[^\xff]/8 + XYZ + 0: X + \x{123} + 0: \x{123} + +/^[ac]*b/8 + xb No match -/^\p{Xan}/8 - ABCD - 0: A - 1234 - 0: 1 - \x{6ca} - 0: \x{6ca} - \x{a6c} - 0: \x{a6c} - \x{10a7} - 0: \x{10a7} - ** Failers +/^[ac\x{100}]*b/8 + xb No match - _ABC + +/^[^x]*b/8i + xb No match -/^\p{Xan}+/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - 0: ABCD1234\x{6ca}\x{a6c}\x{10a7} - 1: ABCD1234\x{6ca}\x{a6c} - 2: ABCD1234\x{6ca} - 3: ABCD1234 - 4: ABCD123 - 5: ABCD12 - 6: ABCD1 - 7: ABCD - 8: ABC - 9: AB -10: A - ** Failers +/^[^x]*b/8 + xb No match - _ABC + +/^\d*b/8 + xb No match -/^\p{Xan}*/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - 0: ABCD1234\x{6ca}\x{a6c}\x{10a7} - 1: ABCD1234\x{6ca}\x{a6c} - 2: ABCD1234\x{6ca} - 3: ABCD1234 - 4: ABCD123 - 5: ABCD12 - 6: ABCD1 - 7: ABCD - 8: ABC - 9: AB -10: A -11: - -/^\p{Xan}{2,9}/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - 0: ABCD1234\x{6ca} - 1: ABCD1234 - 2: ABCD123 - 3: ABCD12 - 4: ABCD1 - 5: ABCD - 6: ABC - 7: AB - -/^[\p{Xan}]/8 - ABCD1234_ - 0: A - 1234abcd_ - 0: 1 - \x{6ca} - 0: \x{6ca} - \x{a6c} - 0: \x{a6c} - \x{10a7} - 0: \x{10a7} +/(|a)/g8 + catac + 0: + 0: a + 1: + 0: + 0: a + 1: + 0: + 0: + a\x{256}a + 0: a + 1: + 0: + 0: a + 1: + 0: + +/^\x{85}$/8i + \x{85} + 0: \x{85} + +/^abc./mgx8 + abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x{0085}abc7 \x{2028}abc8 \x{2029}abc9 JUNK + 0: abc1 + 0: abc2 + 0: abc3 + 0: abc4 + 0: abc5 + 0: abc6 + 0: abc7 + 0: abc8 + 0: abc9 + +/abc.$/mgx8 + abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x{0085} abc7\x{2028} abc8\x{2029} abc9 + 0: abc1 + 0: abc2 + 0: abc3 + 0: abc4 + 0: abc5 + 0: abc6 + 0: abc7 + 0: abc8 + 0: abc9 + +/^a\Rb/8 + a\nb + 0: a\x{0a}b + a\rb + 0: a\x{0d}b + a\r\nb + 0: a\x{0d}\x{0a}b + a\x0bb + 0: a\x{0b}b + a\x0cb + 0: a\x{0c}b + a\x{85}b + 0: a\x{85}b + a\x{2028}b + 0: a\x{2028}b + a\x{2029}b + 0: a\x{2029}b + ** Failers +No match + a\n\rb +No match + +/^a\R*b/8 + ab + 0: ab + a\nb + 0: a\x{0a}b + a\rb + 0: a\x{0d}b + a\r\nb + 0: a\x{0d}\x{0a}b + a\x0bb + 0: a\x{0b}b + a\x0c\x{2028}\x{2029}b + 0: a\x{0c}\x{2028}\x{2029}b + a\x{85}b + 0: a\x{85}b + a\n\rb + 0: a\x{0a}\x{0d}b + a\n\r\x{85}\x0cb + 0: a\x{0a}\x{0d}\x{85}\x{0c}b + +/^a\R+b/8 + a\nb + 0: a\x{0a}b + a\rb + 0: a\x{0d}b + a\r\nb + 0: a\x{0d}\x{0a}b + a\x0bb + 0: a\x{0b}b + a\x0c\x{2028}\x{2029}b + 0: a\x{0c}\x{2028}\x{2029}b + a\x{85}b + 0: a\x{85}b + a\n\rb + 0: a\x{0a}\x{0d}b + a\n\r\x{85}\x0cb + 0: a\x{0a}\x{0d}\x{85}\x{0c}b + ** Failers +No match + ab +No match + +/^a\R{1,3}b/8 + a\nb + 0: a\x{0a}b + a\n\rb + 0: a\x{0a}\x{0d}b + a\n\r\x{85}b + 0: a\x{0a}\x{0d}\x{85}b + a\r\n\r\nb + 0: a\x{0d}\x{0a}\x{0d}\x{0a}b + a\r\n\r\n\r\nb + 0: a\x{0d}\x{0a}\x{0d}\x{0a}\x{0d}\x{0a}b + a\n\r\n\rb + 0: a\x{0a}\x{0d}\x{0a}\x{0d}b + a\n\n\r\nb + 0: a\x{0a}\x{0a}\x{0d}\x{0a}b + ** Failers +No match + a\n\n\n\rb +No match + a\r +No match + +/\h+\V?\v{3,4}/8 + \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a + 0: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c}\x{0d} + 1: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c} + +/\V?\v{3,4}/8 + \x20\x{a0}X\x0a\x0b\x0c\x0d\x0a + 0: X\x{0a}\x{0b}\x{0c}\x{0d} + 1: X\x{0a}\x{0b}\x{0c} + +/\h+\V?\v{3,4}/8 + >\x09\x20\x{a0}X\x0a\x0a\x0a< + 0: \x{09} \x{a0}X\x{0a}\x{0a}\x{0a} + +/\V?\v{3,4}/8 + >\x09\x20\x{a0}X\x0a\x0a\x0a< + 0: X\x{0a}\x{0a}\x{0a} + +/\H\h\V\v/8 + X X\x0a + 0: X X\x{0a} + X\x09X\x0b + 0: X\x{09}X\x{0b} ** Failers No match - _ABC + \x{a0} X\x0a No match - -/^[\p{Xan}]+/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - 0: ABCD1234\x{6ca}\x{a6c}\x{10a7} - 1: ABCD1234\x{6ca}\x{a6c} - 2: ABCD1234\x{6ca} - 3: ABCD1234 - 4: ABCD123 - 5: ABCD12 - 6: ABCD1 - 7: ABCD - 8: ABC - 9: AB -10: A - ** Failers + +/\H*\h+\V?\v{3,4}/8 + \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a + 0: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c}\x{0d} + 1: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c} + \x09\x20\x{a0}\x0a\x0b\x0c\x0d\x0a + 0: \x{09} \x{a0}\x{0a}\x{0b}\x{0c}\x{0d} + 1: \x{09} \x{a0}\x{0a}\x{0b}\x{0c} + \x09\x20\x{a0}\x0a\x0b\x0c + 0: \x{09} \x{a0}\x{0a}\x{0b}\x{0c} + ** Failers No match - _ABC + \x09\x20\x{a0}\x0a\x0b No match - -/^>\p{Xsp}/8 - >\x{1680}\x{2028}\x{0b} - 0: >\x{1680} + +/\H\h\V\v/8 + \x{3001}\x{3000}\x{2030}\x{2028} + 0: \x{3001}\x{3000}\x{2030}\x{2028} + X\x{180e}X\x{85} + 0: X\x{180e}X\x{85} ** Failers No match - \x{0b} + \x{2009} X\x0a No match - -/^>\p{Xsp}+/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} - 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} - 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} - 3: > \x{09}\x{0a}\x{0c}\x{0d} - 4: > \x{09}\x{0a}\x{0c} - 5: > \x{09}\x{0a} - 6: > \x{09} - 7: > - -/^>\p{Xsp}*/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} - 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} - 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} - 3: > \x{09}\x{0a}\x{0c}\x{0d} - 4: > \x{09}\x{0a}\x{0c} - 5: > \x{09}\x{0a} - 6: > \x{09} - 7: > - 8: > - -/^>\p{Xsp}{2,9}/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} - 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} - 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} - 3: > \x{09}\x{0a}\x{0c}\x{0d} - 4: > \x{09}\x{0a}\x{0c} - 5: > \x{09}\x{0a} - 6: > \x{09} -/^>[\p{Xsp}]/8 - >\x{2028}\x{0b} - 0: >\x{2028} - -/^>[\p{Xsp}]+/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} - 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} - 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} - 3: > \x{09}\x{0a}\x{0c}\x{0d} - 4: > \x{09}\x{0a}\x{0c} - 5: > \x{09}\x{0a} - 6: > \x{09} - 7: > - -/^>\p{Xps}/8 - >\x{1680}\x{2028}\x{0b} - 0: >\x{1680} - >\x{a0} - 0: >\x{a0} - ** Failers +/\H*\h+\V?\v{3,4}/8 + \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x0c\x0d\x0a + 0: \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x{0c}\x{0d} + 1: \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x{0c} + \x09\x{205f}\x{a0}\x0a\x{2029}\x0c\x{2028}\x0a + 0: \x{09}\x{205f}\x{a0}\x{0a}\x{2029}\x{0c}\x{2028} + 1: \x{09}\x{205f}\x{a0}\x{0a}\x{2029}\x{0c} + \x09\x20\x{202f}\x0a\x0b\x0c + 0: \x{09} \x{202f}\x{0a}\x{0b}\x{0c} + ** Failers No match - \x{0b} + \x09\x{200a}\x{a0}\x{2028}\x0b No match - -/^>\p{Xps}+/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} - 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} - 3: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} - 4: > \x{09}\x{0a}\x{0c}\x{0d} - 5: > \x{09}\x{0a}\x{0c} - 6: > \x{09}\x{0a} - 7: > \x{09} - 8: > - -/^>\p{Xps}+?/8 - >\x{1680}\x{2028}\x{0b} - 0: >\x{1680}\x{2028}\x{0b} - 1: >\x{1680}\x{2028} - 2: >\x{1680} - -/^>\p{Xps}*/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} - 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} - 3: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} - 4: > \x{09}\x{0a}\x{0c}\x{0d} - 5: > \x{09}\x{0a}\x{0c} - 6: > \x{09}\x{0a} - 7: > \x{09} - 8: > - 9: > - -/^>\p{Xps}{2,9}/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} - 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} - 3: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} - 4: > \x{09}\x{0a}\x{0c}\x{0d} - 5: > \x{09}\x{0a}\x{0c} - 6: > \x{09}\x{0a} - 7: > \x{09} - -/^>\p{Xps}{2,9}?/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} - 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} - 3: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} - 4: > \x{09}\x{0a}\x{0c}\x{0d} - 5: > \x{09}\x{0a}\x{0c} - 6: > \x{09}\x{0a} - 7: > \x{09} - -/^>[\p{Xps}]/8 - >\x{2028}\x{0b} - 0: >\x{2028} - -/^>[\p{Xps}]+/8 - > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b} - 1: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028} - 2: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680} - 3: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0} - 4: > \x{09}\x{0a}\x{0c}\x{0d} - 5: > \x{09}\x{0a}\x{0c} - 6: > \x{09}\x{0a} - 7: > \x{09} - 8: > - -/^\p{Xwd}/8 - ABCD - 0: A - 1234 - 0: 1 - \x{6ca} - 0: \x{6ca} - \x{a6c} - 0: \x{a6c} - \x{10a7} - 0: \x{10a7} - _ABC - 0: _ - ** Failers + +/a\Rb/I8 +Capturing subpattern count = 0 +Options: bsr_anycrlf utf +First char = 'a' +Need char = 'b' + a\rb + 0: a\x{0d}b + a\nb + 0: a\x{0a}b + a\r\nb + 0: a\x{0d}\x{0a}b + ** Failers +No match + a\x{85}b +No match + a\x0bb +No match + +/a\Rb/I8 +Capturing subpattern count = 0 +Options: bsr_unicode utf +First char = 'a' +Need char = 'b' + a\rb + 0: a\x{0d}b + a\nb + 0: a\x{0a}b + a\r\nb + 0: a\x{0d}\x{0a}b + a\x{85}b + 0: a\x{85}b + a\x0bb + 0: a\x{0b}b + ** Failers No match - [] + a\x{85}b\ +No match + a\x0bb\ No match - -/^\p{Xwd}+/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - 0: ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - 1: ABCD1234\x{6ca}\x{a6c}\x{10a7} - 2: ABCD1234\x{6ca}\x{a6c} - 3: ABCD1234\x{6ca} - 4: ABCD1234 - 5: ABCD123 - 6: ABCD12 - 7: ABCD1 - 8: ABCD - 9: ABC -10: AB -11: A - -/^\p{Xwd}*/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - 0: ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - 1: ABCD1234\x{6ca}\x{a6c}\x{10a7} - 2: ABCD1234\x{6ca}\x{a6c} - 3: ABCD1234\x{6ca} - 4: ABCD1234 - 5: ABCD123 - 6: ABCD12 - 7: ABCD1 - 8: ABCD - 9: ABC -10: AB -11: A -12: - -/^\p{Xwd}{2,9}/8 - A_12\x{6ca}\x{a6c}\x{10a7} - 0: A_12\x{6ca}\x{a6c}\x{10a7} - 1: A_12\x{6ca}\x{a6c} - 2: A_12\x{6ca} - 3: A_12 - 4: A_1 - 5: A_ -/^[\p{Xwd}]/8 - ABCD1234_ - 0: A - 1234abcd_ - 0: 1 - \x{6ca} - 0: \x{6ca} - \x{a6c} - 0: \x{a6c} - \x{10a7} - 0: \x{10a7} - _ABC - 0: _ - ** Failers +/a\R?b/I8 +Capturing subpattern count = 0 +Options: bsr_anycrlf utf +First char = 'a' +Need char = 'b' + a\rb + 0: a\x{0d}b + a\nb + 0: a\x{0a}b + a\r\nb + 0: a\x{0d}\x{0a}b + ** Failers +No match + a\x{85}b +No match + a\x0bb +No match + +/a\R?b/I8 +Capturing subpattern count = 0 +Options: bsr_unicode utf +First char = 'a' +Need char = 'b' + a\rb + 0: a\x{0d}b + a\nb + 0: a\x{0a}b + a\r\nb + 0: a\x{0d}\x{0a}b + a\x{85}b + 0: a\x{85}b + a\x0bb + 0: a\x{0b}b + ** Failers +No match + a\x{85}b\ No match - [] + a\x0bb\ No match -/^[\p{Xwd}]+/8 - ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - 0: ABCD1234\x{6ca}\x{a6c}\x{10a7}_ - 1: ABCD1234\x{6ca}\x{a6c}\x{10a7} - 2: ABCD1234\x{6ca}\x{a6c} - 3: ABCD1234\x{6ca} - 4: ABCD1234 - 5: ABCD123 - 6: ABCD12 - 7: ABCD1 - 8: ABCD - 9: ABC -10: AB -11: A +/X/8f + A\x{1ec5}ABCXYZ + 0: X -/-- Unicode properties for \b abd \B --/ +/abcd*/8 + xxxxabcd\P + 0: abcd + 1: abc + xxxxabcd\P\P +Partial match: abcd -/\b...\B/8W - abc_ - 0: abc - \x{37e}abc\x{376} - 0: abc - \x{37e}\x{376}\x{371}\x{393}\x{394} - 0: \x{376}\x{371}\x{393} - !\x{c0}++\x{c1}\x{c2} - 0: ++\x{c1} - !\x{c0}+++++ - 0: \x{c0}++ +/abcd*/i8 + xxxxabcd\P + 0: abcd + 1: abc + xxxxabcd\P\P +Partial match: abcd + XXXXABCD\P + 0: ABCD + 1: ABC + XXXXABCD\P\P +Partial match: ABCD + +/abc\d*/8 + xxxxabc1\P + 0: abc1 + 1: abc + xxxxabc1\P\P +Partial match: abc1 -/-- Without PCRE_UCP, non-ASCII always fail, even if < 256 --/ +/abc[de]*/8 + xxxxabcde\P + 0: abcde + 1: abcd + 2: abc + xxxxabcde\P\P +Partial match: abcde -/\b...\B/8 - abc_ - 0: abc - ** Failers - 0: Fai - \x{37e}abc\x{376} -No match - \x{37e}\x{376}\x{371}\x{393}\x{394} -No match - !\x{c0}++\x{c1}\x{c2} -No match - !\x{c0}+++++ -No match +/\bthe cat\b/8 + the cat\P + 0: the cat + the cat\P\P +Partial match: the cat + +/ab\Cde/8 + abXde +Error -16 (item unsupported for DFA matching) + +/(?<=ab\Cde)X/8 +Failed: \C not allowed in lookbehind assertion at offset 10 + +/./8 + \r\P + 0: \x{0d} + \r\P\P +Partial match: \x{0d} + +/.{2,3}/8 + \r\P +Partial match: \x{0d} + \r\P\P +Partial match: \x{0d} + \r\r\P + 0: \x{0d}\x{0d} + \r\r\P\P +Partial match: \x{0d}\x{0d} + \r\r\r\P + 0: \x{0d}\x{0d}\x{0d} + 1: \x{0d}\x{0d} + \r\r\r\P\P +Partial match: \x{0d}\x{0d}\x{0d} + +/.{2,3}?/8 + \r\P +Partial match: \x{0d} + \r\P\P +Partial match: \x{0d} + \r\r\P + 0: \x{0d}\x{0d} + \r\r\P\P +Partial match: \x{0d}\x{0d} + \r\r\r\P + 0: \x{0d}\x{0d}\x{0d} + 1: \x{0d}\x{0d} + \r\r\r\P\P +Partial match: \x{0d}\x{0d}\x{0d} -/-- With PCRE_UCP, non-UTF8 chars that are < 256 still check properties --/ +/[^\x{100}]/8 + \x{100}\x{101}X + 0: \x{101} -/\b...\B/W - abc_ - 0: abc - !\x{c0}++\x{c1}\x{c2} - 0: ++\xc1 - !\x{c0}+++++ - 0: \xc0++ +/[^\x{100}]+/8 + \x{100}\x{101}X + 0: \x{101}X + 1: \x{101} /-- End of testinput9 --/ diff -Nru php5-5.4.4/ext/pcre/pcrelib/ucp.h php5-5.4.9/ext/pcre/pcrelib/ucp.h --- php5-5.4.4/ext/pcre/pcrelib/ucp.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/pcrelib/ucp.h 2012-11-21 05:12:20.000000000 +0000 @@ -153,7 +153,19 @@ ucp_Old_Turkic, ucp_Samaritan, ucp_Tai_Tham, - ucp_Tai_Viet + ucp_Tai_Viet, + /* New for Unicode 6.0.0: */ + ucp_Batak, + ucp_Brahmi, + ucp_Mandaic, + /* New for Unicode 6.1.0: */ + ucp_Chakma, + ucp_Meroitic_Cursive, + ucp_Meroitic_Hieroglyphs, + ucp_Miao, + ucp_Sharada, + ucp_Sora_Sompeng, + ucp_Takri }; #endif diff -Nru php5-5.4.4/ext/pcre/php_pcre.c php5-5.4.9/ext/pcre/php_pcre.c --- php5-5.4.4/ext/pcre/php_pcre.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pcre/php_pcre.c 2012-11-21 05:12:20.000000000 +0000 @@ -248,6 +248,7 @@ #endif pcre_cache_entry *pce; pcre_cache_entry new_entry; + char *tmp = NULL; /* Try to lookup the cached regex entry, and if successful, just pass back the compiled pattern, otherwise go on and compile it. */ @@ -275,7 +276,8 @@ get to the end without encountering a delimiter. */ while (isspace((int)*(unsigned char *)p)) p++; if (*p == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, + p < regex + regex_len ? "Null byte in regex" : "Empty regular expression"); return NULL; } @@ -292,21 +294,18 @@ delimiter = pp[5]; end_delimiter = delimiter; + pp = p; + if (start_delimiter == end_delimiter) { /* We need to iterate through the pattern, searching for the ending delimiter, but skipping the backslashed delimiters. If the ending delimiter is not found, display a warning. */ - pp = p; while (*pp != 0) { if (*pp == '\\' && pp[1] != 0) pp++; else if (*pp == delimiter) break; pp++; } - if (*pp == 0) { - php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending delimiter '%c' found", delimiter); - return NULL; - } } else { /* We iterate through the pattern, searching for the matching ending * delimiter. For each matching starting delimiter, we increment nesting @@ -314,7 +313,6 @@ * reach the end of the pattern without matching, display a warning. */ int brackets = 1; /* brackets nesting level */ - pp = p; while (*pp != 0) { if (*pp == '\\' && pp[1] != 0) pp++; else if (*pp == end_delimiter && --brackets <= 0) @@ -323,10 +321,17 @@ brackets++; pp++; } - if (*pp == 0) { - php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending matching delimiter '%c' found", end_delimiter); - return NULL; + } + + if (*pp == 0) { + if (pp < regex + regex_len) { + php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex"); + } else if (start_delimiter == end_delimiter) { + php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending delimiter '%c' found", delimiter); + } else { + php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending matching delimiter '%c' found", delimiter); } + return NULL; } /* Make a copy of the actual pattern. */ @@ -337,7 +342,7 @@ /* Parse through the options, setting appropriate flags. Display a warning if we encounter an unknown modifier. */ - while (*pp != 0) { + while (pp < regex + regex_len) { switch (*pp++) { /* Perl compatible options */ case 'i': coptions |= PCRE_CASELESS; break; @@ -368,7 +373,11 @@ break; default: - php_error_docref(NULL TSRMLS_CC,E_WARNING, "Unknown modifier '%c'", pp[-1]); + if (pp[-1]) { + php_error_docref(NULL TSRMLS_CC,E_WARNING, "Unknown modifier '%c'", pp[-1]); + } else { + php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex"); + } efree(pattern); return NULL; } @@ -430,9 +439,26 @@ new_entry.locale = pestrdup(locale, 1); new_entry.tables = tables; #endif + + /* + * Interned strings are not duplicated when stored in HashTable, + * but all the interned strings created during HTTP request are removed + * at end of request. However PCRE_G(pcre_cache) must be consistent + * on the next request as well. So we disable usage of interned strings + * as hash keys especually for this table. + * See bug #63180 + */ + if (IS_INTERNED(regex)) { + regex = tmp = estrndup(regex, regex_len); + } + zend_hash_update(&PCRE_G(pcre_cache), regex, regex_len+1, (void *)&new_entry, sizeof(pcre_cache_entry), (void**)&pce); + if (tmp) { + efree(tmp); + } + return pce; } /* }}} */ diff -Nru php5-5.4.4/ext/pcre/tests/bug63055.phpt php5-5.4.9/ext/pcre/tests/bug63055.phpt --- php5-5.4.4/ext/pcre/tests/bug63055.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/pcre/tests/bug63055.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,23 @@ +--TEST-- +Bug #63055 (Segfault in zend_gc with SF2 testsuite) +--FILE-- + "bar"); /* this bucket will trigger the segfault */ +$dummy = array("dummy"); /* used to trigger gc_collect_cycles */ +$dummy[1] = &$dummy; + +$matches[1] = &$matches; +$matches[2] = $dummy; + +preg_match_all("/(\d)+/", "foo123456bar", $matches); +echo "okey"; +?> +--EXPECTF-- +okey diff -Nru php5-5.4.4/ext/pcre/tests/null_bytes.phpt php5-5.4.9/ext/pcre/tests/null_bytes.phpt --- php5-5.4.4/ext/pcre/tests/null_bytes.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/pcre/tests/null_bytes.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,42 @@ +--TEST-- +Zero byte test +--FILE-- + +--EXPECTF-- +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 3 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 4 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 5 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 6 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 7 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 9 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 10 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 11 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 12 + +Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 13 + +Warning: preg_replace(): Null byte in regex in %snull_bytes.php on line 15 diff -Nru php5-5.4.4/ext/pdo/pdo_dbh.c php5-5.4.9/ext/pdo/pdo_dbh.c --- php5-5.4.4/ext/pdo/pdo_dbh.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo/pdo_dbh.c 2012-11-21 05:12:20.000000000 +0000 @@ -700,7 +700,7 @@ RETURN_BOOL(dbh->in_txn); } - RETURN_LONG(dbh->methods->in_transaction(dbh TSRMLS_CC)); + RETURN_BOOL(dbh->methods->in_transaction(dbh TSRMLS_CC)); } /* }}} */ diff -Nru php5-5.4.4/ext/pdo/tests/bug_43130.phpt php5-5.4.9/ext/pdo/tests/bug_43130.phpt --- php5-5.4.4/ext/pdo/tests/bug_43130.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo/tests/bug_43130.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -8,6 +8,7 @@ if (!strncasecmp(getenv('PDOTEST_DSN'), 'sqlite', strlen('sqlite'))) die('skip not relevant for sqlite driver'); if (!strncasecmp(getenv('PDOTEST_DSN'), 'pgsql', strlen('pgsql'))) die('skip not relevant for pgsql driver'); if (!strncasecmp(getenv('PDOTEST_DSN'), 'oci', strlen('oci'))) die('skip not relevant for oci driver - Hyphen is not legal for bind names in Oracle DB'); +if (!strncasecmp(getenv('PDOTEST_DSN'), 'firebird', strlen('firebird'))) die('skip not relevant for firebird driver'); require_once $dir . 'pdo_test.inc'; PDOTest::skip(); ?> diff -Nru php5-5.4.4/ext/pdo/tests/pdo_test.inc php5-5.4.9/ext/pdo/tests/pdo_test.inc --- php5-5.4.4/ext/pdo/tests/pdo_test.inc 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo/tests/pdo_test.inc 2012-11-21 05:12:20.000000000 +0000 @@ -66,13 +66,19 @@ } static function test_factory($file) { - $data = file_get_contents($file); - $data = preg_replace('/^.*--REDIRECTTEST--/s', '', $data); - $config = eval($data); + $config = self::get_config($file); foreach ($config['ENV'] as $k => $v) { putenv("$k=$v"); } return self::factory(); } + + static function get_config($file) { + $data = file_get_contents($file); + $data = preg_replace('/^.*--REDIRECTTEST--/s', '', $data); + $config = eval($data); + + return $config; + } } ?> diff -Nru php5-5.4.4/ext/pdo_dblib/dblib_driver.c php5-5.4.9/ext/pdo_dblib/dblib_driver.c --- php5-5.4.4/ext/pdo_dblib/dblib_driver.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_dblib/dblib_driver.c 2012-11-21 05:12:20.000000000 +0000 @@ -315,7 +315,7 @@ DBSETOPT(H->link, DBTEXTSIZE, "2147483647"); /* allow double quoted indentifiers */ - DBSETOPT(H->link, DBQUOTEDIDENT, 1); + DBSETOPT(H->link, DBQUOTEDIDENT, NULL); if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) { goto cleanup; diff -Nru php5-5.4.4/ext/pdo_firebird/firebird_driver.c php5-5.4.9/ext/pdo_firebird/firebird_driver.c --- php5-5.4.4/ext/pdo_firebird/firebird_driver.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_firebird/firebird_driver.c 2012-11-21 05:12:20.000000000 +0000 @@ -401,7 +401,7 @@ long l, pindex = -1; /* Firebird allows SQL statements up to 64k, so bail if it doesn't fit */ - if (sql_len > SHORT_MAX) { + if (sql_len > 65536) { strcpy(dbh->error_code, "01004"); return 0; } diff -Nru php5-5.4.4/ext/pdo_firebird/tests/bug_47415.phpt php5-5.4.9/ext/pdo_firebird/tests/bug_47415.phpt --- php5-5.4.4/ext/pdo_firebird/tests/bug_47415.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_firebird/tests/bug_47415.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -2,6 +2,7 @@ Bug #47415 PDO_Firebird segfaults when passing lowercased column name to bindColumn() --SKIPIF-- + --FILE-- + --FILE-- + --FILE-- + --FILE-- + --FILE-- + --INI-- ibase.timestampformat=%Y-%m-%d %H:%M:%S --FILE-- diff -Nru php5-5.4.4/ext/pdo_firebird/tests/rowCount.phpt php5-5.4.9/ext/pdo_firebird/tests/rowCount.phpt --- php5-5.4.4/ext/pdo_firebird/tests/rowCount.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_firebird/tests/rowCount.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -2,6 +2,7 @@ PDO_Firebird: rowCount --SKIPIF-- + --FILE-- in_length); } - if (S->bound_result) + if (S->bound_result) { int i; for (i = 0; i < stmt->column_count; i++) { pdo_free_bound_result(S->bound_result[i]); } - + efree(S->bound_result); efree(S->out_null); efree(S->out_length); @@ -95,7 +95,7 @@ if (mysql_next_result(S->H->server) != 0) { break; } - + res = mysql_store_result(S->H->server); if (res) { mysql_free_result(res); @@ -134,7 +134,7 @@ row_count = mysql_affected_rows(H->server); if (row_count == (my_ulonglong)-1) { - /* we either have a query that returned a result set or an error occured + /* we either have a query that returned a result set or an error occurred lets see if we have access to a result set */ if (!H->buffered) { S->result = mysql_use_result(H->server); @@ -180,23 +180,23 @@ } if (!S->result) { - int i; + int i; - /* figure out the result set format, if any */ - S->result = mysql_stmt_result_metadata(S->stmt); - if (S->result) { - int calc_max_length = H->buffered && S->max_length == 1; - S->fields = mysql_fetch_fields(S->result); - if (S->bound_result) { - int i; - for (i = 0; i < stmt->column_count; i++) { - efree(S->bound_result[i].buffer); - } - efree(S->bound_result); - efree(S->out_null); - efree(S->out_length); + /* figure out the result set format, if any */ + S->result = mysql_stmt_result_metadata(S->stmt); + if (S->result) { + int calc_max_length = H->buffered && S->max_length == 1; + S->fields = mysql_fetch_fields(S->result); + if (S->bound_result) { + int i; + for (i = 0; i < stmt->column_count; i++) { + efree(S->bound_result[i].buffer); + } + efree(S->bound_result); + efree(S->out_null); + efree(S->out_length); } - + stmt->column_count = (int)mysql_num_fields(S->result); S->bound_result = ecalloc(stmt->column_count, sizeof(MYSQL_BIND)); S->out_null = ecalloc(stmt->column_count, sizeof(my_bool)); @@ -262,7 +262,7 @@ } } } - + pdo_mysql_stmt_set_row_count(stmt TSRMLS_CC); PDO_DBG_RETURN(1); } @@ -275,9 +275,9 @@ pdo_mysql_stmt *S = stmt->driver_data; pdo_mysql_db_handle *H = S->H; int i; - + PDO_DBG_ENTER("pdo_mysql_stmt_execute_prepared_mysqlnd"); - + if (mysql_stmt_execute(S->stmt)) { pdo_mysql_error_stmt(stmt); PDO_DBG_RETURN(0); @@ -305,7 +305,7 @@ } } } - + pdo_mysql_stmt_set_row_count(stmt TSRMLS_CC); PDO_DBG_RETURN(1); } @@ -322,7 +322,7 @@ if (S->stmt) { PDO_DBG_RETURN(pdo_mysql_stmt_execute_prepared(stmt)); } - + /* ensure that we free any previous unfetched results */ if (S->result) { mysql_free_result(S->result); @@ -357,8 +357,8 @@ } if (!mysqlnd_stmt_more_results(S->stmt)) { - /* - MySQL gives us n + 1 result sets for + /* + MySQL gives us n + 1 result sets for CALL proc() and n result sets returned by the proc itself. Result set n + 1 is about the procedure call itself. As the PDO emulation does not return it, we skip it as well @@ -413,7 +413,19 @@ } ret = mysql_next_result(H->server); - +#if PDO_USE_MYSQLND + /* for whatever reason mysqlnd breaks with libmysql compatibility at the C level, no -1 */ + if (PASS != ret) { + pdo_mysql_error_stmt(stmt); + PDO_DBG_RETURN(0); + } + if (mysql_more_results(H->server)) { + PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC)); + } else { + /* No more results */ + PDO_DBG_RETURN(0); + } +#else if (ret > 0) { pdo_mysql_error_stmt(stmt); PDO_DBG_RETURN(0); @@ -423,6 +435,7 @@ } else { PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC)); } +#endif } /* }}} */ @@ -444,7 +457,7 @@ #ifndef PDO_USE_MYSQLND PDO_MYSQL_PARAM_BIND *b; #endif - pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; + pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; PDO_DBG_ENTER("pdo_mysql_stmt_param_hook"); PDO_DBG_INF_FMT("stmt=%p", S->stmt); @@ -484,18 +497,18 @@ } #else b = (PDO_MYSQL_PARAM_BIND*)param->driver_data; - *b->is_null = 0; - if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL || - Z_TYPE_P(param->parameter) == IS_NULL) { - *b->is_null = 1; - b->buffer_type = MYSQL_TYPE_STRING; - b->buffer = NULL; - b->buffer_length = 0; - *b->length = 0; + *b->is_null = 0; + if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL || + Z_TYPE_P(param->parameter) == IS_NULL) { + *b->is_null = 1; + b->buffer_type = MYSQL_TYPE_STRING; + b->buffer = NULL; + b->buffer_length = 0; + *b->length = 0; PDO_DBG_RETURN(1); - } + } #endif /* PDO_USE_MYSQLND */ - + switch (PDO_PARAM_TYPE(param->param_type)) { case PDO_PARAM_STMT: PDO_DBG_RETURN(0); @@ -519,7 +532,7 @@ default: ; } - + #if PDO_USE_MYSQLND /* Is it really correct to check the zval's type? - But well, that's what the old code below does, too */ PDO_DBG_INF_FMT("param->parameter->type=%d", Z_TYPE_P(param->parameter)); @@ -540,9 +553,9 @@ default: PDO_DBG_RETURN(0); } - + PDO_DBG_RETURN(1); -#else +#else PDO_DBG_INF_FMT("param->parameter->type=%d", Z_TYPE_P(param->parameter)); switch (Z_TYPE_P(param->parameter)) { case IS_STRING: @@ -597,7 +610,7 @@ } #else int ret; - + if (S->stmt) { ret = mysql_stmt_fetch(S->stmt); @@ -617,7 +630,7 @@ PDO_DBG_RETURN(1); } #endif /* PDO_USE_MYSQLND */ - + if (!S->result) { strcpy(stmt->error_code, "HY000"); PDO_DBG_RETURN(0); @@ -637,7 +650,7 @@ pdo_mysql_error_stmt(stmt); } PDO_DBG_RETURN(0); - } + } S->current_lengths = mysql_fetch_lengths(S->result); PDO_DBG_RETURN(1); @@ -661,8 +674,8 @@ PDO_DBG_RETURN(0); } - /* fetch all on demand, this seems easiest - ** if we've been here before bail out + /* fetch all on demand, this seems easiest + ** if we've been here before bail out */ if (cols[0].name) { PDO_DBG_RETURN(1); @@ -678,10 +691,10 @@ cols[i].namelen = namelen; cols[i].name = estrndup(S->fields[i].name, namelen); } - + cols[i].precision = S->fields[i].decimals; cols[i].maxlen = S->fields[i].length; - + #ifdef PDO_USE_MYSQLND if (S->stmt) { cols[i].param_type = PDO_PARAM_ZVAL; @@ -799,7 +812,7 @@ const MYSQL_FIELD *F; zval *flags; char *str; - + PDO_DBG_ENTER("pdo_mysql_stmt_col_meta"); PDO_DBG_INF_FMT("stmt=%p", S->stmt); if (!S->result) { @@ -857,7 +870,7 @@ break; } #endif - + add_assoc_zval(return_value, "flags", flags); add_assoc_string(return_value, "table", (char *) (F->table?F->table:""), 1); PDO_DBG_RETURN(SUCCESS); diff -Nru php5-5.4.4/ext/pdo_mysql/pdo_mysql.c php5-5.4.9/ext/pdo_mysql/pdo_mysql.c --- php5-5.4.4/ext/pdo_mysql/pdo_mysql.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_mysql/pdo_mysql.c 2012-11-21 05:12:20.000000000 +0000 @@ -35,7 +35,7 @@ ZEND_GET_MODULE(pdo_mysql) #endif -ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql); +ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql) /* The default socket location is sometimes defined by configure. diff -Nru php5-5.4.4/ext/pdo_mysql/tests/bug_41997.phpt php5-5.4.9/ext/pdo_mysql/tests/bug_41997.phpt --- php5-5.4.4/ext/pdo_mysql/tests/bug_41997.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_mysql/tests/bug_41997.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -2,12 +2,11 @@ PDO MySQL Bug #41997 (stored procedure call returning single rowset blocks future queries) --SKIPIF-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) @@ -20,9 +19,8 @@ ?> --FILE-- exec('DROP PROCEDURE IF EXISTS p'); $db->exec('CREATE PROCEDURE p() BEGIN SELECT 1 AS "one"; END'); diff -Nru php5-5.4.4/ext/pdo_mysql/tests/bug_61207.phpt php5-5.4.9/ext/pdo_mysql/tests/bug_61207.phpt --- php5-5.4.4/ext/pdo_mysql/tests/bug_61207.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_mysql/tests/bug_61207.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -2,27 +2,27 @@ PDO MySQL Bug #61207 (PDO::nextRowset() after a multi-statement query doesn't always work) --SKIPIF-- --FILE-- query('DROP TABLE IF EXISTS test'); +$db->query('create table `test`( `id` int )'); -$link->query('create table `bug61207`( `id` int )'); +$handle1 = $db->prepare('insert into test(id) values(1); + select * from test where id = ?; + update test set id = 2 where id = ?;'); -$handle1 = $link->prepare('insert into bug61207(id) values(1); - select * from bug61207 where id = ?; - update bug61207 set id = 2 where id = ?;'); - $handle1->bindValue('1', '1'); $handle1->bindValue('2', '1'); - -$handle1->execute(); + +$handle1->execute(); $i = 1; print("Handle 1:\n"); do { @@ -31,9 +31,9 @@ print("Results detected\n"); } while($handle1->nextRowset()); -$handle2 = $link->prepare('select * from bug61207 where id = ?; - update bug61207 set id = 1 where id = ?;'); - +$handle2 = $db->prepare('select * from test where id = ?; + update test set id = 1 where id = ?;'); + $handle2->bindValue('1', '2'); $handle2->bindValue('2', '2'); @@ -47,9 +47,9 @@ print("Results detected\n"); } while($handle2->nextRowset()); -$handle3 = $link->prepare('update bug61207 set id = 2 where id = ?; - select * from bug61207 where id = ?;'); - +$handle3 = $db->prepare('update test set id = 2 where id = ?; + select * from test where id = ?;'); + $handle3->bindValue('1', '1'); $handle3->bindValue('2', '2'); @@ -63,15 +63,15 @@ print("Results detected\n"); } while($handle3->nextRowset()); -$handle4 = $link->prepare('insert into bug61207(id) values(3); - update bug61207 set id = 2 where id = ?; - select * from bug61207 where id = ?;'); - +$handle4 = $db->prepare('insert into test(id) values(3); + update test set id = 2 where id = ?; + select * from test where id = ?;'); + $handle4->bindValue('1', '3'); $handle4->bindValue('2', '2'); - + $handle4->execute(); - + $i = 1; print("Handle 4:\n"); do { @@ -80,7 +80,12 @@ print("Results detected\n"); } while($handle1->nextRowset()); -$link->query("DROP TABLE bug61207"); +$db->query("DROP TABLE test"); +?> +--CLEAN-- + --EXPECT-- Handle 1: diff -Nru php5-5.4.4/ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt php5-5.4.9/ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt --- php5-5.4.4/ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -23,7 +23,7 @@ printf("[002] Wonderful, I can change the client version!\n"); $new_info = $db->getAttribute(PDO::ATTR_SERVER_INFO); - if ($new_info !== $info) + if (soundex($new_info) != soundex($info)) printf("[003] Did we change it from '%s' to '%s'?\n", $info, $info); // lets hope we always run this in the same second as we did run the server info request... diff -Nru php5-5.4.4/ext/pdo_odbc/odbc_driver.c php5-5.4.9/ext/pdo_odbc/odbc_driver.c --- php5-5.4.4/ext/pdo_odbc/odbc_driver.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_odbc/odbc_driver.c 2012-11-21 05:12:20.000000000 +0000 @@ -114,7 +114,7 @@ * diagnostic records (which can be generated by PRINT statements * in the query, for instance). */ while (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) { - char discard_state[5]; + char discard_state[6]; char discard_buf[1024]; SQLINTEGER code; rc = SQLGetDiagRec(htype, eh, recno++, discard_state, &code, diff -Nru php5-5.4.4/ext/pdo_odbc/odbc_stmt.c php5-5.4.9/ext/pdo_odbc/odbc_stmt.c --- php5-5.4.4/ext/pdo_odbc/odbc_stmt.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_odbc/odbc_stmt.c 2012-11-21 05:12:20.000000000 +0000 @@ -633,58 +633,49 @@ } if (rc == SQL_SUCCESS_WITH_INFO) { - /* promote up to a bigger buffer */ - - if (C->fetched_len != SQL_NO_TOTAL) { - /* use size suggested by the driver, if it knows it */ - buf = emalloc(C->fetched_len + 1); - memcpy(buf, C->data, C->fetched_len); - buf[C->fetched_len] = 0; - used = C->fetched_len; - } else { - buf = estrndup(C->data, 256); - used = 255; /* not 256; the driver NUL terminated the buffer */ - } - + /* this is a 'long column' + + read the column in 255 byte blocks until the end of the column is reached, reassembling those blocks + in order into the output buffer + + this loop has to work whether or not SQLGetData() provides the total column length. + calling SQLDescribeCol() or other, specifically to get the column length, then doing a single read + for that size would be slower except maybe for extremely long columns.*/ + char *buf2; + + buf2 = emalloc(256); + buf = estrndup(C->data, 256); + used = 255; /* not 256; the driver NUL terminated the buffer */ + do { C->fetched_len = 0; - rc = SQLGetData(S->stmt, colno+1, SQL_C_CHAR, - buf + used, alloced - used, - &C->fetched_len); - - if (rc == SQL_NO_DATA) { - /* we got the lot */ - break; - } else if (rc != SQL_SUCCESS) { - pdo_odbc_stmt_error("SQLGetData"); - if (rc != SQL_SUCCESS_WITH_INFO) { - break; - } - } - - if (C->fetched_len == SQL_NO_TOTAL) { - used += alloced - used; + /* read block. 256 bytes => 255 bytes are actually read, the last 1 is NULL */ + rc = SQLGetData(S->stmt, colno+1, SQL_C_CHAR, buf2, 256, &C->fetched_len); + + /* resize output buffer and reassemble block */ + if (rc==SQL_SUCCESS_WITH_INFO) { + /* point 5, in section "Retrieving Data with SQLGetData" in http://msdn.microsoft.com/en-us/library/windows/desktop/ms715441(v=vs.85).aspx + states that if SQL_SUCCESS_WITH_INFO, fetched_len will be > 255 (greater than buf2's size) + (if a driver fails to follow that and wrote less than 255 bytes to buf2, this will AV or read garbage into buf) */ + buf = erealloc(buf, used + 255+1); + memcpy(buf + used, buf2, 255); + used = used + 255; + } else if (rc==SQL_SUCCESS) { + buf = erealloc(buf, used + C->fetched_len+1); + memcpy(buf + used, buf2, C->fetched_len); + used = used + C->fetched_len; } else { - used += C->fetched_len; - } - - if (rc == SQL_SUCCESS) { - /* this was the final fetch */ + /* includes SQL_NO_DATA */ break; } - - /* we need to fetch another chunk; resize the - * buffer */ - alloced *= 2; - buf = erealloc(buf, alloced); + } while (1); - - /* size down */ - if (used < alloced - 1024) { - alloced = used+1; - buf = erealloc(buf, used+1); - } + + efree(buf2); + + /* NULL terminate the buffer once, when finished, for use with the rest of PHP */ buf[used] = '\0'; + *ptr = buf; *caller_frees = 1; *len = used; diff -Nru php5-5.4.4/ext/pdo_odbc/tests/common.phpt php5-5.4.9/ext/pdo_odbc/tests/common.phpt --- php5-5.4.4/ext/pdo_odbc/tests/common.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_odbc/tests/common.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -2,17 +2,40 @@ ODBC --SKIPIF-- +if (!extension_loaded('pdo_odbc')) print 'skip'; +if (substr(PHP_OS, 0, 3) == 'WIN' && + false === getenv('PDOTEST_DSN') && + false === getenv('PDO_ODBC_TEST_DSN') && + !extension_loaded('com_dotnet')) { + die('skip - either PDOTEST_DSN or com_dotnet extension is needed to setup the connection'); +} --REDIRECTTEST-- # magic auto-configuration $config = array( - 'TESTS' => 'ext/pdo/tests' + 'TESTS' => 'ext/pdo/tests', + 'ENV' => array() ); - -if (false !== getenv('PDO_ODBC_TEST_DSN')) { - # user set them from their shell +// try loading PDO driver using ENV vars and if none given, and on Windows, try using MS Access +// and if not, skip the test +// +// try to use common PDO env vars, instead of PDO_ODBC specific +if (false !== getenv('PDOTEST_DSN')) { + // user should have to set PDOTEST_DSN so that: + // 1. test is skipped if user doesn't want to test it, even if they have MS Access installed + // 2. it detects if ODBC driver is not installed - to avoid test bug + // 3. it detects if ODBC driver is installed - so test will be run + // 4. so a specific ODBC driver can be tested - if system has multiple ODBC drivers + + $config['ENV']['PDOTEST_DSN'] = getenv('PDOTEST_DSN'); + $config['ENV']['PDOTEST_USER'] = getenv('PDOTEST_USER'); + $config['ENV']['PDOTEST_PASS'] = getenv('PDOTEST_PASS'); + if (false !== getenv('PDOTEST_ATTR')) { + $config['ENV']['PDOTEST_ATTR'] = getenv('PDOTEST_ATTR'); + } +} else if (false !== getenv('PDO_ODBC_TEST_DSN')) { + // user set these from their shell instead $config['ENV']['PDOTEST_DSN'] = getenv('PDO_ODBC_TEST_DSN'); $config['ENV']['PDOTEST_USER'] = getenv('PDO_ODBC_TEST_USER'); $config['ENV']['PDOTEST_PASS'] = getenv('PDO_ODBC_TEST_PASS'); @@ -20,10 +43,13 @@ $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_ODBC_TEST_ATTR'); } } elseif (preg_match('/^WIN/i', PHP_OS)) { - # on windows, try to create a temporary MS access database + // on Windows and user didn't set PDOTEST_DSN, try this as a fallback: + // check if MS Access DB is installed, and if yes, try using it. create a temporary MS access database. + // $path = realpath(dirname(__FILE__)) . '\pdo_odbc.mdb'; if (!file_exists($path)) { try { + // try to create database $adox = new COM('ADOX.Catalog'); $adox->Create('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' . $path); $adox = null; @@ -32,9 +58,12 @@ } } if (file_exists($path)) { + // database was created and written to file system $config['ENV']['PDOTEST_DSN'] = "odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=$path;Uid=Admin"; - } -} + } // else: $config['ENV']['PDOTEST_DSN'] not set +} // else: $config['ENV']['PDOTEST_DSN'] not set +// test will be skipped. see SKIPIF section of long_columns.phpt + # other magic autodetection here, eg: for DB2 by inspecting env /* $USER = 'db2inst1'; diff -Nru php5-5.4.4/ext/pdo_odbc/tests/long_columns.phpt php5-5.4.9/ext/pdo_odbc/tests/long_columns.phpt --- php5-5.4.4/ext/pdo_odbc/tests/long_columns.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_odbc/tests/long_columns.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -3,9 +3,44 @@ --SKIPIF-- --FILE-- " ex: SET PDOTEST_DSN=odbc:accdb12 +// -note: on Windows, " is included in environment variable +// +// easy way to compile: +// configure --disable-all --enable-cli --enable-zts --enable-pdo --with-pdo-odbc --enable-debug +// configure --disable-all --eanble-cli --enable-pdo --with-pdo-odbc=unixODBC,/usr,/usr --with-unixODBC=/usr --enable-debug +// + require 'ext/pdo/tests/pdo_test.inc'; $db = PDOTest::test_factory('ext/pdo_odbc/tests/common.phpt'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); @@ -20,27 +55,86 @@ $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); -$sizes = array(32, 64, 128, 253, 254, 255, 256, 257, 258, 512, 1024, 2048, 3998, 3999, 4000); +// the driver reads columns in blocks of 255 bytes and then reassembles those blocks into a single buffer. +// test sizes around 255 to make sure that the reassembly works (and that the column is split into 255 byte blocks by the database) +// also, test sizes below 255 to make sure that they work - and are not treated as a long column (should be read in a single read) +$sizes = array(32, 53, 64, 79, 128, 253, 254, 255, 256, 257, 258, 1022, 1023, 1024, 1025, 1026, 510, 511, 512, 513, 514, 1278, 1279, 1280, 1281, 1282, 2046, 2047, 2048, 2049, 2050, 1534, 1535, 1536, 1537, 1538, 3070, 3071, 3072, 3073, 3074, 3998, 3999, 4000); + +function alpha_repeat($len) { + // use the alphabet instead of 'i' characters to make sure the blocks don't overlap when they are reassembled + $out = ""; + while (strlen($out) < $len) { + $out .= "abcdefghijklmnopqrstuvwxyz"; + } + return substr($out, 0, $len); +} -$db->beginTransaction(); -$insert = $db->prepare('INSERT INTO TEST VALUES (?, ?)'); +// don't use Prepared Statements. that fails on MS SQL server (works with Access, MyODBC), which is a separate failure, feature/code-path from what +// this test does - nice to be able to test using MS SQL server foreach ($sizes as $num) { - $insert->execute(array($num, str_repeat('i', $num))); + $text = alpha_repeat($num); + $db->exec("INSERT INTO TEST VALUES($num, '$text')"); } -$insert = null; -$db->commit(); +// verify data foreach ($db->query('SELECT id, data from TEST') as $row) { - $expect = str_repeat('i', $row[0]); + $expect = alpha_repeat($row[0]); if (strcmp($expect, $row[1])) { echo "Failed on size $row[id]:\n"; printf("Expected %d bytes, got %d\n", strlen($expect), strlen($row['data'])); - echo bin2hex($expect) . "\n"; - echo bin2hex($row['data']) . "\n"; + echo ($expect) . "\n"; + echo ($row['data']) . "\n"; + } else { + echo "Passed on size $row[id]\n"; } } echo "Finished\n"; --EXPECT-- +Passed on size 32 +Passed on size 53 +Passed on size 64 +Passed on size 79 +Passed on size 128 +Passed on size 253 +Passed on size 254 +Passed on size 255 +Passed on size 256 +Passed on size 257 +Passed on size 258 +Passed on size 1022 +Passed on size 1023 +Passed on size 1024 +Passed on size 1025 +Passed on size 1026 +Passed on size 510 +Passed on size 511 +Passed on size 512 +Passed on size 513 +Passed on size 514 +Passed on size 1278 +Passed on size 1279 +Passed on size 1280 +Passed on size 1281 +Passed on size 1282 +Passed on size 2046 +Passed on size 2047 +Passed on size 2048 +Passed on size 2049 +Passed on size 2050 +Passed on size 1534 +Passed on size 1535 +Passed on size 1536 +Passed on size 1537 +Passed on size 1538 +Passed on size 3070 +Passed on size 3071 +Passed on size 3072 +Passed on size 3073 +Passed on size 3074 +Passed on size 3998 +Passed on size 3999 +Passed on size 4000 Finished + diff -Nru php5-5.4.4/ext/pdo_pgsql/pgsql_statement.c php5-5.4.9/ext/pdo_pgsql/pgsql_statement.c --- php5-5.4.4/ext/pdo_pgsql/pgsql_statement.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_pgsql/pgsql_statement.c 2012-11-21 05:12:20.000000000 +0000 @@ -362,8 +362,20 @@ } break; } + } else { +#endif + if (param->is_param) { + /* We need to manually convert to a pg native boolean value */ + if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL && + ((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) { + SEPARATE_ZVAL(¶m->parameter); + param->param_type = PDO_PARAM_STR; + ZVAL_STRINGL(param->parameter, Z_BVAL_P(param->parameter) ? "t" : "f", 1, 1); + } + } +#if HAVE_PQPREPARE } -#endif +#endif return 1; } diff -Nru php5-5.4.4/ext/pdo_pgsql/tests/bug62593.phpt php5-5.4.9/ext/pdo_pgsql/tests/bug62593.phpt --- php5-5.4.4/ext/pdo_pgsql/tests/bug62593.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/pdo_pgsql/tests/bug62593.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,51 @@ +--TEST-- +PDO PgSQL Bug #62593 (Emulate prepares behave strangely with PARAM_BOOL) +--SKIPIF-- + +--FILE-- +setAttribute(PDO::ATTR_EMULATE_PREPARES, true); +$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); +$errors = array(); + +$value = true; +$query = $db->prepare('SELECT :foo IS FALSE as val_is_false'); +$query->bindValue(':foo', $value, PDO::PARAM_BOOL); +$query->execute(); +$errors[] = $query->errorInfo(); +var_dump($value); + +$query->bindValue(':foo', 0, PDO::PARAM_BOOL); +$query->execute(); +$errors[] = $query->errorInfo(); + +// Verify bindParam maintains reference and only passes when execute is called +$value = true; +$query->bindParam(':foo', $value, PDO::PARAM_BOOL); +$value = false; +$query->execute(); +$errors[] = $query->errorInfo(); +var_dump($value); + +$expect = 'No errors found'; + +foreach ($errors as $error) +{ + if (strpos('Invalid text representation', $error[2]) !== false) + { + $expect = 'Invalid boolean found'; + } +} +echo $expect; +?> +--EXPECTF-- +bool(true) +bool(false) +No errors found diff -Nru php5-5.4.4/ext/pdo_sqlite/sqlite_driver.c php5-5.4.9/ext/pdo_sqlite/sqlite_driver.c --- php5-5.4.4/ext/pdo_sqlite/sqlite_driver.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/pdo_sqlite/sqlite_driver.c 2012-11-21 05:12:20.000000000 +0000 @@ -760,7 +760,7 @@ static char *make_filename_safe(const char *filename TSRMLS_DC) { - if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) { + if (*filename && memcmp(filename, ":memory:", sizeof(":memory:"))) { char *fullpath = expand_filepath(filename, NULL TSRMLS_CC); if (!fullpath) { diff -Nru php5-5.4.4/ext/phar/cgidebug php5-5.4.9/ext/phar/cgidebug --- php5-5.4.4/ext/phar/cgidebug 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/phar/cgidebug 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#!/bin/sh -export SCRIPT_NAME=/front.phar.php -export PATH_INFO=/index.php -export SCRIPT_FILENAME=/home/cellog/workspace/php5/ext/phar/tests/front.phar.php -export PATH_TRANSLATED=/home/cellog/workspace/php5/ext/phar/tests/front.phar.php -export REDIRECT_STATUS=1 -export REQUEST_METHOD=GET -export REQUEST_URI=/front.phar.php/index.php -cd /home/cellog/workspace/php5 -ddd sapi/cgi/php-cgi & -cd /home/cellog/workspace/php5/ext/phar diff -Nru php5-5.4.4/ext/phar/package.php php5-5.4.9/ext/phar/package.php --- php5-5.4.4/ext/phar/package.php 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/phar/package.php 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -compress()/decompress(). - * phar.extract_list and Phar::getExtractList() are removed - -Major feature functionality release - * phar.cache_list allows web-based phar applications to run at equal or faster than - their on-disk equivalent [Greg] - * new default stub allows running of phar-based phars without phar extension [Greg/Steph] - * add support for tar-based and zip-based phar archives [Greg] - * add support for OpenSSL-based true signatures [Greg] - * add support for signatures to tar-based phar archives [Greg] - * add Phar::isFileFormat() [Greg] - * add Phar::convertToExecutable(), Phar::convertToData() [Greg] - * add Phar::compress() [Greg] - * rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to - decompressFiles() [Greg] - * conversion to compressed or to other file formats automatically copies the archive - to a new extension (i.e. ".phar" to ".phar.tar" or ".tar" to ".tar.gz") [Steph] - * add Phar::webPhar() for running a web-based application unmodified - directly from a phar archive [Greg] - * file functions (fopen-based and stat-based) can be instructed to only look for - relative paths within a phar via Phar::interceptFileFuncs() - * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph] - non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg] - * paths with . and .. work (phar://blah.phar/a/../b.php => phar://blah.phar/b.php) [Greg] - * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg] - * add option to compress the entire phar file for phar/tar file format [Greg] - * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg] - * implement Phar::copy(string $from, string $to) [Greg] - * implement Phar::running(), returns path or URL to currently executed phar - * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg] - * implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph] - * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg] - * add Phar::delete() [Greg] - * implement Phar::unlinkArchive() [Greg] - -Security addition - * aliases are validated so that they contain no directory separators as intended - * on conversion to other formats, user-supplied aliases are validated - -Changes since 2.0.0RC2: - fixed PHP Bug #49021: phar tar signature algorithm reports as Unknown (0) in - getSignature() call - fixed PHP Bug #49020: phar misinterprets ustar long filename standard - fixed PHP Bug #49018: phar tar stores long filenames with prefix/name reversed - fixed PHP Bug #48791: open office files always reported as corrupted - fixed PHP Bug #48783: make install will fail saying phar file exists - fixed PHP Bug #48740: PHAR install fails when INSTALL_ROOT is not the final install location - fixed PHP Bug #48681: openssl signature verification for tar archives broken - fixed PHP Bug #48377: error message unclear on converting phar with existing file - fixed isset() on sub-directories (isset("blah") if file "blah/foo.php" exists) - - make phar work in PHP 6 -Changes since 2.0.0RC1: - security vulnerability in handling of long tar filenames fixed - fixed PECL Bug #14646: phar error message unclear with php stream wrappers - fixed PECL Bug #16338: php_stream_copy_to_stream{,_ex}() - fixed PHP Bug #48257: PharData throws an exception with non-phar tar - fixed PHP Bug #47085: rename() returns true even if the file in PHAR does not exist - fixed PHP Bug #46032: PharData::__construct() - wrong memory read - fixed PHP Bug #46060: Phar::addEmptyDir() breaks - fixed PHP Bug #45907: undefined reference to \'PHP_SHA512Init\' - fixed PHP Bug #45726: PHP_Archive / Archive.php missing -Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored, - conversion API refactored -Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes - implement OpenSSL asynchronous true package signing - add support for package signing to tar-based archives - require PHP 5.2.1+ -'; - -if (!class_exists("Phar") && !extension_loaded("Phar")) { - die("Extension phar not present"); -} -error_reporting(E_ALL & ~E_DEPRECATED); - -require_once 'PEAR/PackageFileManager2.php'; - -PEAR::setErrorHandling(PEAR_ERROR_DIE); - -$options = array( - 'filelistgenerator' => 'svn', - 'changelogoldtonew' => false, - 'simpleoutput' => true, - 'baseinstalldir' => '/', - 'packagedirectory' => dirname(__FILE__), - 'packagefile' => 'package.xml', - 'clearcontents' => true, - 'ignore' => array('package*.php', 'package*.xml'), - 'dir_roles' => array( - 'docs' => 'doc', - 'examples' => 'doc', - 'tests' => 'test', - 'phar' => 'src', - ), - 'exceptions' => array( - 'CREDITS' => 'doc', - 'EXPERIMENTAL' => 'doc', - 'LICENSE' => 'doc', - 'Makefile.frag' => 'src', - 'phar_path_check.re' => 'src', - 'TODO' => 'doc', - 'phar.phar' => 'script', - ), -); - -$package = PEAR_PackageFileManager2::importOptions(dirname(__FILE__) . '/package.xml', $options); - -$package->clearDeps(); -$package->setPhpDep('5.2.1'); -$package->setPearInstallerDep('1.4.3'); -$package->addPackageDepWithChannel('optional', 'bz2', 'pecl.php.net', false, false, false, false, 'bz2'); -// all this false business sets the tag that allows us to have hash built -// in statically -$package->addPackageDepWithChannel('optional', 'hash', 'pecl.php.net', false, false, false, false, 'hash'); -$package->addExtensionDep('optional', 'spl'); -$package->addExtensionDep('optional', 'zlib'); -$package->setPackageType('extsrc'); -$package->addRelease(); -$package->setReleaseVersion(phpversion('phar')); -$package->setAPIVersion(Phar::apiVersion()); -$package->setReleaseStability('stable'); -$package->setAPIStability('stable'); -$package->setNotes("\n$notes\n"); -//$package->addGlobalReplacement('package-info', '@package_version@', 'version'); -$package->generateContents(); - -if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) { - $package->writePackageFile(); -} else { - $package->debugPackageFile(); -} - -?> diff -Nru php5-5.4.4/ext/phar/package.xml php5-5.4.9/ext/phar/package.xml --- php5-5.4.4/ext/phar/package.xml 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/phar/package.xml 2012-11-21 05:12:20.000000000 +0000 @@ -941,7 +941,6 @@
- diff -Nru php5-5.4.4/ext/phar/phar/pharcommand.inc php5-5.4.9/ext/phar/phar/pharcommand.inc --- php5-5.4.4/ext/phar/phar/pharcommand.inc 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/phar/phar/pharcommand.inc 2012-11-21 05:12:20.000000000 +0000 @@ -91,7 +91,7 @@ 'h' => array( 'typ' => 'select', 'val' => NULL, - 'inf' => ' Selects the hash algorithmn.', + 'inf' => ' Selects the hash algorithm.', 'select' => array('md5' => 'MD5','sha1' => 'SHA1') ), 'i' => array( @@ -107,7 +107,7 @@ 'l' => array( 'typ' => 'int', 'val' => 0, - 'inf' => ' Number of preceeding subdirectories to strip from file entries', + 'inf' => ' Number of preceding subdirectories to strip from file entries', ), 'm' => array( 'typ' => 'any', @@ -461,7 +461,7 @@ 'typ' => 'any', 'val' => NULL, 'required' => 1, - 'inf' => ' Any number of input files and directories. If -i is in use then ONLY files and matching thegiven regular expression are being packed. If -x is given then files matching that regular expression are NOT being packed.', + 'inf' => ' Any number of input files and directories. If -i is in use then ONLY files and matching the given regular expression are being packed. If -x is given then files matching that regular expression are NOT being packed.', ); return $args; @@ -981,7 +981,7 @@ 'type' => 'any', 'val' => NULL, 'required' => 1, - 'inf' => ' Any number of input files and directories. If -i is in use then ONLY files and matching thegiven regular expression are being packed. If -x is given then files matching that regular expression are NOT being packed.', + 'inf' => ' Any number of input files and directories. If -i is in use then ONLY files and matching the given regular expression are being packed. If -x is given then files matching that regular expression are NOT being packed.', ); return $args; } @@ -1566,7 +1566,7 @@ $use_ext = extension_loaded('phar'); $version = array( 'PHP Version' => phpversion(), - 'phar.phar version' => '$Id: 9e968694c3f62cb89989bcfa2fe021ec4b3c47a0 $', + 'phar.phar version' => '$Id: cb343675b557b02dd09d0f1902d0ec50f5f482ee $', 'Phar EXT version' => $use_ext ? phpversion('phar') : 'Not available', 'Phar API version' => Phar::apiVersion(), 'Phar-based phar archives' => true, diff -Nru php5-5.4.4/ext/phar/phar.c php5-5.4.9/ext/phar/phar.c --- php5-5.4.4/ext/phar/phar.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/phar/phar.c 2012-11-21 05:12:20.000000000 +0000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: 2a47d3d0354109d8077e34d59f1228ccfd021d59 $ */ +/* $Id: cc7eac717db60fe3deade794d4ae082fe97279ed $ */ #define PHAR_MAIN 1 #include "phar_internal.h" @@ -2647,11 +2647,8 @@ len = -len; } user_stub = 0; -#if PHP_MAJOR_VERSION >= 6 - if (!(len = php_stream_copy_to_mem(stubfile, (void **) &user_stub, len, 0)) || !user_stub) { -#else + if (!(len = php_stream_copy_to_mem(stubfile, &user_stub, len, 0)) || !user_stub) { -#endif if (closeoldfile) { php_stream_close(oldfile); } @@ -3667,7 +3664,7 @@ php_info_print_table_header(2, "Phar: PHP Archive support", "enabled"); php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION); php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION); - php_info_print_table_row(2, "SVN revision", "$Id: 2a47d3d0354109d8077e34d59f1228ccfd021d59 $"); + php_info_print_table_row(2, "SVN revision", "$Id: cc7eac717db60fe3deade794d4ae082fe97279ed $"); php_info_print_table_row(2, "Phar-based phar archives", "enabled"); php_info_print_table_row(2, "Tar-based phar archives", "enabled"); php_info_print_table_row(2, "ZIP-based phar archives", "enabled"); diff -Nru php5-5.4.4/ext/phar/phar_object.c php5-5.4.9/ext/phar/phar_object.c --- php5-5.4.4/ext/phar/phar_object.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/phar/phar_object.c 2012-11-21 05:12:20.000000000 +0000 @@ -58,9 +58,6 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char *basename, int request_uri_len TSRMLS_DC) /* {{{ */ { -#if PHP_MAJOR_VERSION >= 6 - int is_unicode = 0; -#endif HashTable *_SERVER; zval **stuff; char *path_info; @@ -76,18 +73,7 @@ _SERVER = Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]); /* PATH_INFO and PATH_TRANSLATED should always be munged */ -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "PATH_INFO", sizeof("PATH_INFO"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "PATH_INFO", sizeof("PATH_INFO"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); @@ -96,38 +82,19 @@ MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_PATH_INFO", sizeof("PHAR_PATH_INFO"), &temp, sizeof(zval **), NULL); } } -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); Z_STRLEN_PP(stuff) = spprintf(&(Z_STRVAL_PP(stuff)), 4096, "phar://%s%s", fname, entry); MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_PATH_TRANSLATED", sizeof("PHAR_PATH_TRANSLATED"), (void *) &temp, sizeof(zval **), NULL); } @@ -136,18 +103,7 @@ } if (PHAR_GLOBALS->phar_SERVER_mung_list & PHAR_MUNG_REQUEST_URI) { -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "REQUEST_URI", sizeof("REQUEST_URI"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "REQUEST_URI", sizeof("REQUEST_URI"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); @@ -156,29 +112,14 @@ MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_REQUEST_URI", sizeof("PHAR_REQUEST_URI"), (void *) &temp, sizeof(zval **), NULL); } } } if (PHAR_GLOBALS->phar_SERVER_mung_list & PHAR_MUNG_PHP_SELF) { -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "PHP_SELF", sizeof("PHP_SELF"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "PHP_SELF", sizeof("PHP_SELF"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); @@ -187,68 +128,34 @@ MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_PHP_SELF", sizeof("PHAR_PHP_SELF"), (void *) &temp, sizeof(zval **), NULL); } } } if (PHAR_GLOBALS->phar_SERVER_mung_list & PHAR_MUNG_SCRIPT_NAME) { -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "SCRIPT_NAME", sizeof("SCRIPT_NAME"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "SCRIPT_NAME", sizeof("SCRIPT_NAME"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); ZVAL_STRINGL(*stuff, entry, entry_len, 1); MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_SCRIPT_NAME", sizeof("PHAR_SCRIPT_NAME"), (void *) &temp, sizeof(zval **), NULL); } } if (PHAR_GLOBALS->phar_SERVER_mung_list & PHAR_MUNG_SCRIPT_FILENAME) { -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(_SERVER, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &stuff TSRMLS_CC)) { - if (Z_TYPE_PP(stuff) == IS_UNICODE) { - is_unicode = 1; - zval_unicode_to_string(*stuff TSRMLS_CC); - } else { - is_unicode = 0; - } -#else if (SUCCESS == zend_hash_find(_SERVER, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &stuff)) { -#endif - path_info = Z_STRVAL_PP(stuff); code = Z_STRLEN_PP(stuff); Z_STRLEN_PP(stuff) = spprintf(&(Z_STRVAL_PP(stuff)), 4096, "phar://%s%s", fname, entry); MAKE_STD_ZVAL(temp); ZVAL_STRINGL(temp, path_info, code, 0); -#if PHP_MAJOR_VERSION >= 6 - if (is_unicode) { - zval_string_to_unicode(*stuff TSRMLS_CC); - } -#endif + zend_hash_update(_SERVER, "PHAR_SCRIPT_FILENAME", sizeof("PHAR_SCRIPT_FILENAME"), (void *) &temp, sizeof(zval **), NULL); } } @@ -942,11 +849,7 @@ if (ext) { ++ext; -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(Z_ARRVAL_P(mimeoverride), ext, strlen(ext)+1, (void **) &val TSRMLS_CC)) { -#else if (SUCCESS == zend_hash_find(Z_ARRVAL_P(mimeoverride), ext, strlen(ext)+1, (void **) &val)) { -#endif switch (Z_TYPE_PP(val)) { case IS_LONG: if (Z_LVAL_PP(val) == PHAR_MIME_PHP || Z_LVAL_PP(val) == PHAR_MIME_PHPS) { @@ -960,11 +863,6 @@ RETURN_FALSE; } break; -#if PHP_MAJOR_VERSION >= 6 - case IS_UNICODE: - zval_unicode_to_string(*(val) TSRMLS_CC); - /* break intentionally omitted */ -#endif case IS_STRING: mime_type = Z_STRVAL_PP(val); code = PHAR_MIME_OTHER; @@ -1015,26 +913,12 @@ for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(mungvalues)); SUCCESS == zend_hash_has_more_elements(Z_ARRVAL_P(mungvalues)); zend_hash_move_forward(Z_ARRVAL_P(mungvalues))) { zval **data = NULL; -#if PHP_MAJOR_VERSION >= 6 - zval *unicopy = NULL; -#endif if (SUCCESS != zend_hash_get_current_data(Z_ARRVAL_P(mungvalues), (void **) &data)) { zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to retrieve array value in Phar::mungServer()"); return; } -#if PHP_MAJOR_VERSION >= 6 - if (Z_TYPE_PP(data) == IS_UNICODE) { - MAKE_STD_ZVAL(unicopy); - *unicopy = **data; - zval_copy_ctor(unicopy); - INIT_PZVAL(unicopy); - zval_unicode_to_string(unicopy TSRMLS_CC); - data = &unicopy; - } -#endif - if (Z_TYPE_PP(data) != IS_STRING) { zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME"); return; @@ -1056,11 +940,6 @@ if (Z_STRLEN_PP(data) == sizeof("SCRIPT_FILENAME")-1 && !strncmp(Z_STRVAL_PP(data), "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME")-1)) { PHAR_GLOBALS->phar_SERVER_mung_list |= PHAR_MUNG_SCRIPT_FILENAME; } -#if PHP_MAJOR_VERSION >= 6 - if (unicopy) { - zval_ptr_dtor(&unicopy); - } -#endif } } /* }}} */ @@ -5037,11 +4916,7 @@ phar_seek_efp(link, 0, SEEK_SET, 0, 0 TSRMLS_CC); Z_TYPE_P(return_value) = IS_STRING; -#if PHP_MAJOR_VERSION >= 6 - Z_STRLEN_P(return_value) = php_stream_copy_to_mem(fp, (void **) &(Z_STRVAL_P(return_value)), link->uncompressed_filesize, 0); -#else Z_STRLEN_P(return_value) = php_stream_copy_to_mem(fp, &(Z_STRVAL_P(return_value)), link->uncompressed_filesize, 0); -#endif if (!Z_STRVAL_P(return_value)) { Z_STRVAL_P(return_value) = estrndup("", 0); diff -Nru php5-5.4.4/ext/phar/stream.c php5-5.4.9/ext/phar/stream.c --- php5-5.4.4/ext/phar/stream.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/phar/stream.c 2012-11-21 05:12:20.000000000 +0000 @@ -207,30 +207,19 @@ fpf = php_stream_alloc(&phar_ops, idata, NULL, mode); php_url_free(resource); efree(internal_file); -#if PHP_MAJOR_VERSION >= 6 - if (context && context->options && phar_find_key(HASH_OF(context->options), "phar", sizeof("phar"), (void**)&pzoption TSRMLS_CC)) { -#else + if (context && context->options && zend_hash_find(HASH_OF(context->options), "phar", sizeof("phar"), (void**)&pzoption) == SUCCESS) { -#endif pharcontext = HASH_OF(*pzoption); if (idata->internal_file->uncompressed_filesize == 0 && idata->internal_file->compressed_filesize == 0 -#if PHP_MAJOR_VERSION >= 6 - && phar_find_key(pharcontext, "compress", sizeof("compress"), (void**)&pzoption TSRMLS_CC) -#else && zend_hash_find(pharcontext, "compress", sizeof("compress"), (void**)&pzoption) == SUCCESS -#endif && Z_TYPE_PP(pzoption) == IS_LONG && (Z_LVAL_PP(pzoption) & ~PHAR_ENT_COMPRESSION_MASK) == 0 ) { idata->internal_file->flags &= ~PHAR_ENT_COMPRESSION_MASK; idata->internal_file->flags |= Z_LVAL_PP(pzoption); } -#if PHP_MAJOR_VERSION >= 6 - if (phar_find_key(pharcontext, "metadata", sizeof("metadata"), (void**)&pzoption TSRMLS_CC)) { -#else if (zend_hash_find(pharcontext, "metadata", sizeof("metadata"), (void**)&pzoption) == SUCCESS) { -#endif if (idata->internal_file->metadata) { zval_ptr_dtor(&idata->internal_file->metadata); idata->internal_file->metadata = NULL; diff -Nru php5-5.4.4/ext/phar/tar.c php5-5.4.9/ext/phar/tar.c --- php5-5.4.4/ext/phar/tar.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/phar/tar.c 2012-11-21 05:12:20.000000000 +0000 @@ -986,11 +986,8 @@ len = -len; } user_stub = 0; -#if PHP_MAJOR_VERSION >= 6 - if (!(len = php_stream_copy_to_mem(stubfile, (void **) &user_stub, len, 0)) || !user_stub) { -#else + if (!(len = php_stream_copy_to_mem(stubfile, &user_stub, len, 0)) || !user_stub) { -#endif if (error) { spprintf(error, 0, "unable to read resource to copy stub to new tar-based phar \"%s\"", phar->fname); } diff -Nru php5-5.4.4/ext/phar/tests/fatal_error_webphar.phpt php5-5.4.9/ext/phar/tests/fatal_error_webphar.phpt --- php5-5.4.4/ext/phar/tests/fatal_error_webphar.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/phar/tests/fatal_error_webphar.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -15,4 +15,4 @@ --EXPECTF-- string(9) "\Web\View" -Parse error: syntax error, unexpected %s, expecting %s in phar:///%sfatal_error_webphar.php/Web/View.php on line 380 +Parse error: syntax error, unexpected %s, expecting %s in phar://%r([A-Za-z]:)?%r/%sfatal_error_webphar.php/Web/View.php on line 380 diff -Nru php5-5.4.4/ext/phar/util.c php5-5.4.9/ext/phar/util.c --- php5-5.4.4/ext/phar/util.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/phar/util.c 2012-11-21 05:12:20.000000000 +0000 @@ -210,8 +210,6 @@ return FAILURE; } #endif - - filename_len = strlen(entry.tmp); filename = entry.tmp; /* only check openbasedir for files, not for phar streams */ @@ -2120,8 +2118,7 @@ #ifdef PHAR_HAVE_OPENSSL BIO *in; EVP_PKEY *key; - EVP_MD *mdtype = (EVP_MD *) EVP_sha1(); - EVP_MD_CTX md_ctx; + EVP_MD_CTX *md_ctx; in = BIO_new_mem_buf(PHAR_G(openssl_privatekey), PHAR_G(openssl_privatekey_len)); @@ -2142,15 +2139,30 @@ return FAILURE; } + md_ctx = EVP_MD_CTX_create(); + siglen = EVP_PKEY_size(key); sigbuf = emalloc(siglen + 1); - EVP_SignInit(&md_ctx, mdtype); + + if (!EVP_SignInit(md_ctx, EVP_sha1())) { + efree(sigbuf); + if (error) { + spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname); + } + return FAILURE; + } while ((sig_len = php_stream_read(fp, (char*)buf, sizeof(buf))) > 0) { - EVP_SignUpdate(&md_ctx, buf, sig_len); + if (!EVP_SignUpdate(md_ctx, buf, sig_len)) { + efree(sigbuf); + if (error) { + spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname); + } + return FAILURE; + } } - if (!EVP_SignFinal (&md_ctx, sigbuf,(unsigned int *)&siglen, key)) { + if (!EVP_SignFinal (md_ctx, sigbuf,(unsigned int *)&siglen, key)) { efree(sigbuf); if (error) { spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname); @@ -2159,7 +2171,7 @@ } sigbuf[siglen] = '\0'; - EVP_MD_CTX_cleanup(&md_ctx); + EVP_MD_CTX_destroy(md_ctx); #else sigbuf = NULL; siglen = 0; diff -Nru php5-5.4.4/ext/phar/zip.c php5-5.4.9/ext/phar/zip.c --- php5-5.4.4/ext/phar/zip.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/phar/zip.c 2012-11-21 05:12:20.000000000 +0000 @@ -603,11 +603,7 @@ php_stream_filter_append(&fp->readfilters, filter); -#if PHP_MAJOR_VERSION >= 6 - if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, (void **) &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#else if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#endif pefree(entry.filename, entry.is_persistent); #if PHP_VERSION_ID < 50207 PHAR_ZIP_FAIL("unable to read in alias, truncated (PHP 5.2.7 and newer has a potential fix for this problem)"); @@ -628,11 +624,7 @@ php_stream_filter_append(&fp->readfilters, filter); -#if PHP_MAJOR_VERSION >= 6 - if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, (void **) &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#else if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#endif pefree(entry.filename, entry.is_persistent); #if PHP_VERSION_ID < 50207 PHAR_ZIP_FAIL("unable to read in alias, truncated (PHP 5.2.7 and newer has a potential fix for this problem)"); @@ -643,11 +635,7 @@ php_stream_filter_flush(filter, 1); php_stream_filter_remove(filter, 1 TSRMLS_CC); } else { -#if PHP_MAJOR_VERSION >= 6 - if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, (void **) &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#else if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_filesize, 0)) || !actual_alias) { -#endif pefree(entry.filename, entry.is_persistent); PHAR_ZIP_FAIL("unable to read in alias, truncated"); } @@ -1252,11 +1240,7 @@ user_stub = 0; -#if PHP_MAJOR_VERSION >= 6 - if (!(len = php_stream_copy_to_mem(stubfile, (void **) &user_stub, len, 0)) || !user_stub) { -#else if (!(len = php_stream_copy_to_mem(stubfile, &user_stub, len, 0)) || !user_stub) { -#endif if (error) { spprintf(error, 0, "unable to read resource to copy stub to new zip-based phar \"%s\"", phar->fname); } diff -Nru php5-5.4.4/ext/posix/tests/posix_getegid_basic.phpt php5-5.4.9/ext/posix/tests/posix_getegid_basic.phpt --- php5-5.4.4/ext/posix/tests/posix_getegid_basic.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/posix/tests/posix_getegid_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,15 @@ +--TEST-- +Test function posix_getegid() by calling it with its expected arguments +--CREDITS-- +Michelangelo van Dam dragonbe@gmail.com +#PHPTestFest Dutch PHP Conference 2012 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +int(%d) diff -Nru php5-5.4.4/ext/readline/readline.c php5-5.4.9/ext/readline/readline.c --- php5-5.4.4/ext/readline/readline.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/readline/readline.c 2012-11-21 05:12:20.000000000 +0000 @@ -198,7 +198,7 @@ PHP_MINFO_FUNCTION(readline) { - return PHP_MINFO(cli_readline)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); + PHP_MINFO(cli_readline)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); } /* }}} */ diff -Nru php5-5.4.4/ext/recode/recode.c php5-5.4.9/ext/recode/recode.c --- php5-5.4.4/ext/recode/recode.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/recode/recode.c 2012-11-21 05:12:20.000000000 +0000 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: e17429b238eb22d028af0d49b193d3f6c40aaf9f $ */ +/* $Id: a1a74deff322390c36b36bdea5e043f3a914b99c $ */ /* {{{ includes & prototypes */ @@ -63,7 +63,7 @@ # define ReSG(v) (recode_globals.v) #endif -ZEND_DECLARE_MODULE_GLOBALS(recode); +ZEND_DECLARE_MODULE_GLOBALS(recode) static PHP_GINIT_FUNCTION(recode); /* {{{ arginfo */ @@ -135,7 +135,7 @@ { php_info_print_table_start(); php_info_print_table_row(2, "Recode Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Id: e17429b238eb22d028af0d49b193d3f6c40aaf9f $"); + php_info_print_table_row(2, "Revision", "$Id: a1a74deff322390c36b36bdea5e043f3a914b99c $"); php_info_print_table_end(); } diff -Nru php5-5.4.4/ext/reflection/php_reflection.c php5-5.4.9/ext/reflection/php_reflection.c --- php5-5.4.4/ext/reflection/php_reflection.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/reflection/php_reflection.c 2012-11-21 05:12:20.000000000 +0000 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: 1cf65cee164ed57874ce2d29e5c46b82f6139524 $ */ +/* $Id: 53b2389d638795fa66862d453ff1abfd89e0aa13 $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1457,6 +1457,49 @@ } /* }}} */ +/* {{{ _reflection_param_get_default_param */ +static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAMETERS) +{ + reflection_object *intern; + parameter_reference *param; + + intern = (reflection_object *) zend_object_store_get_object(getThis() TSRMLS_CC); + if (intern == NULL || intern->ptr == NULL) { + if (EG(exception) && Z_OBJCE_P(EG(exception)) == reflection_exception_ptr) { + return NULL; + } + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the reflection object"); + } + + param = intern->ptr; + if (param->fptr->type != ZEND_USER_FUNCTION) { + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions"); + return NULL; + } + + return param; +} +/* }}} */ + +/* {{{ _reflection_param_get_default_precv */ +static zend_op *_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS, parameter_reference *param) +{ + zend_op *precv; + + if (param == NULL) { + return NULL; + } + + precv = _get_recv_op((zend_op_array*)param->fptr, param->offset); + if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) { + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error: Failed to retrieve the default value"); + return NULL; + } + + return precv; +} +/* }}} */ + /* {{{ Preventing __clone from being called */ ZEND_METHOD(reflection, __clone) { @@ -2520,9 +2563,7 @@ { RETURN_FALSE; } - if (param->offset < param->required) { - RETURN_FALSE; - } + precv = _get_recv_op((zend_op_array*)param->fptr, param->offset); if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) { RETURN_FALSE; @@ -2535,39 +2576,81 @@ Returns the default value of this parameter or throws an exception */ ZEND_METHOD(reflection_parameter, getDefaultValue) { - reflection_object *intern; parameter_reference *param; zend_op *precv; if (zend_parse_parameters_none() == FAILURE) { return; } - GET_REFLECTION_OBJECT_PTR(param); - if (param->fptr->type != ZEND_USER_FUNCTION) - { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions"); + param = _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU); + if (!param) { return; } - if (param->offset < param->required) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional"); - return; - } - precv = _get_recv_op((zend_op_array*)param->fptr, param->offset); - if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error"); + + precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param); + if (!precv) { return; } *return_value = *precv->op2.zv; INIT_PZVAL(return_value); - if (Z_TYPE_P(return_value) != IS_CONSTANT && Z_TYPE_P(return_value) != IS_CONSTANT_ARRAY) { + if ((Z_TYPE_P(return_value) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT + && (Z_TYPE_P(return_value) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT_ARRAY) { zval_copy_ctor(return_value); } zval_update_constant_ex(&return_value, (void*)0, param->fptr->common.scope TSRMLS_CC); } /* }}} */ +/* {{{ proto public bool ReflectionParameter::isDefaultValueConstant() + Returns whether the default value of this parameter is constant */ +ZEND_METHOD(reflection_parameter, isDefaultValueConstant) +{ + zend_op *precv; + parameter_reference *param; + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + param = _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU); + if (!param) { + RETURN_FALSE; + } + + precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param); + if (precv && (Z_TYPE_P(precv->op2.zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { + RETURN_TRUE; + } + + RETURN_FALSE; +} +/* }}} */ + +/* {{{ proto public mixed ReflectionParameter::getDefaultValueConstantName() + Returns the default value's constant name if default value is constant or null */ +ZEND_METHOD(reflection_parameter, getDefaultValueConstantName) +{ + zend_op *precv; + parameter_reference *param; + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + param = _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU); + if (!param) { + return; + } + + precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param); + if (precv && (Z_TYPE_P(precv->op2.zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { + RETURN_STRINGL(Z_STRVAL_P(precv->op2.zv), Z_STRLEN_P(precv->op2.zv), 1); + } +} +/* }}} */ + /* {{{ proto public static mixed ReflectionMethod::export(mixed class, string name [, bool return]) throws ReflectionException Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ ZEND_METHOD(reflection_method, export) @@ -2922,6 +3005,14 @@ fcc.calling_scope = obj_ce; fcc.called_scope = intern->ce; fcc.object_ptr = object; + + /* + * Copy the zend_function when calling via handler (e.g. Closure::__invoke()) + */ + if (mptr->type == ZEND_INTERNAL_FUNCTION && + (mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0) { + fcc.function_handler = _copy_function(mptr TSRMLS_CC); + } result = zend_call_function(&fci, &fcc TSRMLS_CC); @@ -4373,8 +4464,10 @@ int method_name_len; zend_trait_method_reference *cur_ref = ce->trait_aliases[i]->trait_method; - method_name_len = spprintf(&method_name, 0, "%s::%s", cur_ref->class_name, cur_ref->method_name); - add_assoc_stringl_ex(return_value, ce->trait_aliases[i]->alias, ce->trait_aliases[i]->alias_len + 1, method_name, method_name_len, 0); + if (ce->trait_aliases[i]->alias) { + method_name_len = spprintf(&method_name, 0, "%s::%s", cur_ref->ce->name, cur_ref->method_name); + add_assoc_stringl_ex(return_value, ce->trait_aliases[i]->alias, ce->trait_aliases[i]->alias_len + 1, method_name, method_name_len, 0); + } i++; } } @@ -5903,6 +5996,8 @@ ZEND_ME(reflection_parameter, isOptional, arginfo_reflection__void, 0) ZEND_ME(reflection_parameter, isDefaultValueAvailable, arginfo_reflection__void, 0) ZEND_ME(reflection_parameter, getDefaultValue, arginfo_reflection__void, 0) + ZEND_ME(reflection_parameter, isDefaultValueConstant, arginfo_reflection__void, 0) + ZEND_ME(reflection_parameter, getDefaultValueConstantName, arginfo_reflection__void, 0) PHP_FE_END }; @@ -6072,7 +6167,7 @@ php_info_print_table_start(); php_info_print_table_header(2, "Reflection", "enabled"); - php_info_print_table_row(2, "Version", "$Id: 1cf65cee164ed57874ce2d29e5c46b82f6139524 $"); + php_info_print_table_row(2, "Version", "$Id: 53b2389d638795fa66862d453ff1abfd89e0aa13 $"); php_info_print_table_end(); } /* }}} */ @@ -6086,7 +6181,7 @@ NULL, NULL, PHP_MINFO(reflection), - "$Id: 1cf65cee164ed57874ce2d29e5c46b82f6139524 $", + "$Id: 53b2389d638795fa66862d453ff1abfd89e0aa13 $", STANDARD_MODULE_PROPERTIES }; /* }}} */ diff -Nru php5-5.4.4/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt php5-5.4.9/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt --- php5-5.4.4/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,52 @@ +--TEST-- +ReflectionParameter::isDefaultValueConstant() && getDefaultValueConstantName() +--FILE-- +getParameters() as $param) { + if($param->getName() == 'test1') { + var_dump($param->isDefaultValueConstant()); + } + if($param->getName() == 'test2') { + var_dump($param->isDefaultValueConstant()); + } + if($param->isDefaultValueAvailable() && $param->isDefaultValueConstant()) { + var_dump($param->getDefaultValueConstantName()); + } +} + +class Foo2 { + const bar = 'Foo2::bar'; +} + +class Foo { + const bar = 'Foo::bar'; + + public function baz($param1 = self::bar, $param2=Foo2::bar, $param3=CONST_TEST_1) { + } +} + +$method = new ReflectionMethod('Foo', 'baz'); +$params = $method->getParameters(); + +foreach ($params as $param) { + if ($param->isDefaultValueConstant()) { + var_dump($param->getDefaultValueConstantName()); + } +} +?> +==DONE== +--EXPECT-- +bool(false) +bool(true) +string(12) "CONST_TEST_1" +string(9) "self::bar" +string(9) "Foo2::bar" +string(12) "CONST_TEST_1" +==DONE== diff -Nru php5-5.4.4/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt php5-5.4.9/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt --- php5-5.4.4/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +ReflectionParameter::isDefaultValueConstant() && getDefaultValueConstantName() for namespace +--FILE-- +getParameters() as $param) { + if($param->isDefaultValueAvailable() && $param->isDefaultValueConstant()) { + echo $param->getDefaultValueConstantName() . "\n"; + } + } + echo "==DONE=="; +} +?> +--EXPECT-- +ReflectionTestNamespace\TestClass::TEST_CONST_2 +ReflectionTestNamespace\CONST_TEST_1 +==DONE== diff -Nru php5-5.4.4/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt php5-5.4.9/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt --- php5-5.4.4/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,23 @@ +--TEST-- +ReflectionParameter::getDefaultValueConstant() should raise exception on non optional parameter +--FILE-- +getParameters() as $param) { + try { + echo $param->getDefaultValueConstantName() . "\n"; + } + catch(ReflectionException $e) { + echo $e->getMessage() . "\n"; + } +} +?> +--EXPECT-- +Internal error: Failed to retrieve the default value +CONST_TEST_1 diff -Nru php5-5.4.4/ext/reflection/tests/bug62384.phpt php5-5.4.9/ext/reflection/tests/bug62384.phpt --- php5-5.4.4/ext/reflection/tests/bug62384.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/reflection/tests/bug62384.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,21 @@ +--TEST-- +Bug #62384 (Attempting to invoke a Closure more than once causes segfaul) +--FILE-- +getMethod('__invoke'); + +$arguments1 = array('hello'); +$arguments2 = array('world'); + +var_dump($reflection_method->invokeArgs($closure1, $arguments1)); +var_dump($reflection_method->invokeArgs($closure2, $arguments2)); + +?> +--EXPECT-- +string(5) "hello" +string(5) "world" diff -Nru php5-5.4.4/ext/reflection/tests/bug62715.phpt php5-5.4.9/ext/reflection/tests/bug62715.phpt --- php5-5.4.4/ext/reflection/tests/bug62715.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/reflection/tests/bug62715.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,24 @@ +--TEST-- +Bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong result) +--FILE-- +getParameters() as $p) { + var_dump($p->isDefaultValueAvailable()); +} + +foreach ($r->getParameters() as $p) { + if ($p->isDefaultValueAvailable()) { + var_dump($p->getDefaultValue()); + } +} +?> +--EXPECT-- +bool(true) +bool(true) +bool(false) +NULL +int(0) diff -Nru php5-5.4.4/ext/reflection/tests/bug63399.phpt php5-5.4.9/ext/reflection/tests/bug63399.phpt --- php5-5.4.4/ext/reflection/tests/bug63399.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/reflection/tests/bug63399.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,49 @@ +--TEST-- +Bug #63399 (ReflectionClass::getTraitAliases() incorrectly resolves traitnames) +--FILE-- +getTraitAliases()); +print_r($ref->getTraits()); + +?> +--EXPECT-- +Array +( + [execute] => Trait1::run + [talk] => Trait2::say +) +Array +( + [Trait1] => ReflectionClass Object + ( + [name] => Trait1 + ) + + [Trait2] => ReflectionClass Object + ( + [name] => Trait2 + ) + +) diff -Nru php5-5.4.4/ext/reflection/tests/traits005.phpt php5-5.4.9/ext/reflection/tests/traits005.phpt --- php5-5.4.4/ext/reflection/tests/traits005.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/reflection/tests/traits005.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -28,14 +28,14 @@ class C3: array(1) { ["a1"]=> - string(10) "(null)::m1" + string(6) "T1::m1" } class C4: array(2) { ["a1"]=> - string(10) "(null)::m1" + string(6) "T1::m1" ["a2"]=> - string(10) "(null)::m2" + string(6) "T1::m2" } diff -Nru php5-5.4.4/ext/session/mod_user.c php5-5.4.9/ext/session/mod_user.c --- php5-5.4.4/ext/session/mod_user.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/session/mod_user.c 2012-11-21 05:12:20.000000000 +0000 @@ -63,7 +63,7 @@ } #define STDVARS \ - zval *retval; \ + zval *retval = NULL; \ int ret = FAILURE #define PSF(a) PS(mod_user_names).name.ps_##a @@ -99,6 +99,7 @@ PS_CLOSE_FUNC(user) { + zend_bool bailout = 0; STDVARS; if (!PS(mod_user_implemented)) { @@ -106,9 +107,21 @@ return SUCCESS; } - retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC); + zend_try { + retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC); + } zend_catch { + bailout = 1; + } zend_end_try(); + PS(mod_user_implemented) = 0; + if (bailout) { + if (retval) { + zval_ptr_dtor(&retval); + } + zend_bailout(); + } + FINISH; } diff -Nru php5-5.4.4/ext/session/session.c php5-5.4.9/ext/session/session.c --- php5-5.4.4/ext/session/session.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/session/session.c 2012-11-21 05:12:20.000000000 +0000 @@ -59,7 +59,7 @@ #include "mod_mm.h" #endif -PHPAPI ZEND_DECLARE_MODULE_GLOBALS(ps); +PHPAPI ZEND_DECLARE_MODULE_GLOBALS(ps) static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra TSRMLS_DC); static int (*php_session_rfc1867_orig_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC); diff -Nru php5-5.4.4/ext/session/tests/bug60634_error_5.phpt php5-5.4.9/ext/session/tests/bug60634_error_5.phpt --- php5-5.4.4/ext/session/tests/bug60634_error_5.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/session/tests/bug60634_error_5.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,7 +1,5 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in close during exec ---XFAIL-- -Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID diff -Nru php5-5.4.4/ext/simplexml/simplexml.c php5-5.4.9/ext/simplexml/simplexml.c --- php5-5.4.4/ext/simplexml/simplexml.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/simplexml/simplexml.c 2012-11-21 05:12:20.000000000 +0000 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: 455280fc74f9f002b7314def7a456f6c3080eb92 $ */ +/* $Id: 5514f0fc897197ca9a199fb93b8b5d9135ad711a $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1417,7 +1417,11 @@ xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding); xmlOutputBufferFlush(outbuf); +#ifdef LIBXML2_NEW_BUFFER + RETVAL_STRINGL((char *)xmlOutputBufferGetContent(outbuf), xmlOutputBufferGetSize(outbuf), 1); +#else RETVAL_STRINGL((char *)outbuf->buffer->content, outbuf->buffer->use, 1); +#endif xmlOutputBufferClose(outbuf); } } else { @@ -1513,22 +1517,28 @@ } /* }}} */ -/* {{{ proto string SimpleXMLElement::getDocNamespaces([bool recursive]) +/* {{{ proto string SimpleXMLElement::getDocNamespaces([bool recursive [, bool from_root]) Return all namespaces registered with document */ SXE_METHOD(getDocNamespaces) { - zend_bool recursive = 0; + zend_bool recursive = 0, from_root = 1; php_sxe_object *sxe; + xmlNodePtr node; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &recursive) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bb", &recursive, &from_root) == FAILURE) { return; } array_init(return_value); sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); + if(from_root){ + node = xmlDocGetRootElement((xmlDocPtr)sxe->document->ptr); + }else{ + GET_NODE(sxe, node); + } - sxe_add_registered_namespaces(sxe, xmlDocGetRootElement((xmlDocPtr)sxe->document->ptr), recursive, return_value TSRMLS_CC); + sxe_add_registered_namespaces(sxe, node, recursive, return_value TSRMLS_CC); } /* }}} */ @@ -2518,6 +2528,11 @@ ZEND_ARG_INFO(0, recursve) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_simplexmlelement_getdocnamespaces, 0, 0, 0) + ZEND_ARG_INFO(0, recursve) + ZEND_ARG_INFO(0, from_root) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_simplexmlelement_children, 0, 0, 0) ZEND_ARG_INFO(0, ns) ZEND_ARG_INFO(0, is_prefix) @@ -2586,7 +2601,7 @@ SXE_ME(attributes, arginfo_simplexmlelement_children, ZEND_ACC_PUBLIC) SXE_ME(children, arginfo_simplexmlelement_children, ZEND_ACC_PUBLIC) SXE_ME(getNamespaces, arginfo_simplexmlelement_getnamespaces, ZEND_ACC_PUBLIC) - SXE_ME(getDocNamespaces, arginfo_simplexmlelement_getnamespaces, ZEND_ACC_PUBLIC) + SXE_ME(getDocNamespaces, arginfo_simplexmlelement_getdocnamespaces, ZEND_ACC_PUBLIC) SXE_ME(getName, arginfo_simplexmlelement__void, ZEND_ACC_PUBLIC) SXE_ME(addChild, arginfo_simplexmlelement_addchild, ZEND_ACC_PUBLIC) SXE_ME(addAttribute, arginfo_simplexmlelement_addchild, ZEND_ACC_PUBLIC) @@ -2638,7 +2653,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "Simplexml support", "enabled"); - php_info_print_table_row(2, "Revision", "$Id: 455280fc74f9f002b7314def7a456f6c3080eb92 $"); + php_info_print_table_row(2, "Revision", "$Id: 5514f0fc897197ca9a199fb93b8b5d9135ad711a $"); php_info_print_table_row(2, "Schema support", #ifdef LIBXML_SCHEMAS_ENABLED "enabled"); diff -Nru php5-5.4.4/ext/simplexml/tests/bug48601.phpt php5-5.4.9/ext/simplexml/tests/bug48601.phpt --- php5-5.4.4/ext/simplexml/tests/bug48601.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/simplexml/tests/bug48601.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -10,7 +10,7 @@ $nodes = $sxe->xpath("/root/node2/@test"); if (! is_array($nodes)) { - echo "An error occured\n"; + echo "An error occurred\n"; } else { echo "Result Count: " . count($nodes) . "\n"; } diff -Nru php5-5.4.4/ext/simplexml/tests/feature55218.phpt php5-5.4.9/ext/simplexml/tests/feature55218.phpt --- php5-5.4.4/ext/simplexml/tests/feature55218.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/simplexml/tests/feature55218.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,117 @@ +--TEST-- +Bug #55218 getDocNamespaces from current element and not root +--SKIPIF-- + +--FILE-- + + + + John Doe + + Susie Q. Public + + jdslkfjsldk jskdfjsmlkjfkldjkjflskj kljfslkjf sldk + +'); + +echo "getDocNamespaces\n"; +echo "\nBackwards Compatibility:\n"; +echo "recursion:\n"; + +var_dump ( $x->getDocNamespaces(true) ) ; +var_dump( $x->person[0]->getDocNamespaces(true) ); +var_dump( $x->person[1]->getDocNamespaces(true) ); + +echo "\nnon recursive:\n"; + +var_dump( $x->getDocNamespaces(false) ); +var_dump( $x->person[0]->getDocNamespaces(false) ); +var_dump( $x->person[1]->getDocNamespaces(false) ); + +echo "\n\nUsing new 'from_root' bool set to false:\n"; +echo "recursion:\n"; + +var_dump ( $x->getDocNamespaces(true, false) ) ; +var_dump( $x->person[0]->getDocNamespaces(true, false) ); +var_dump( $x->person[1]->getDocNamespaces(true, false) ); + +echo "\nnon recursive:\n"; + +var_dump( $x->getDocNamespaces(false, false) ); +var_dump( $x->person[0]->getDocNamespaces(false, false) ); +var_dump( $x->person[1]->getDocNamespaces(false, false) ); + +?> +===DONE=== +--EXPECTF-- +getDocNamespaces + +Backwards Compatibility: +recursion: +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} + +non recursive: +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} + + +Using new 'from_root' bool set to false: +recursion: +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} +array(1) { + ["t"]=> + string(20) "http://example.org/t" +} +array(0) { +} + +non recursive: +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} +array(1) { + ["t"]=> + string(20) "http://example.org/t" +} +array(0) { +} +===DONE=== \ No newline at end of file diff -Nru php5-5.4.4/ext/soap/php_encoding.c php5-5.4.9/ext/soap/php_encoding.c --- php5-5.4.4/ext/soap/php_encoding.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/soap/php_encoding.c 2012-11-21 05:12:20.000000000 +0000 @@ -1818,11 +1818,12 @@ zend_hash_internal_pointer_reset_ex(model->u.content, &pos); while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) { - if (!model_to_xml_object(node, *tmp, object, style, (*tmp)->min_occurs > 0 TSRMLS_CC)) { - if ((*tmp)->min_occurs > 0) { + if (!model_to_xml_object(node, *tmp, object, style, strict && ((*tmp)->min_occurs > 0) TSRMLS_CC)) { + if (!strict || (*tmp)->min_occurs > 0) { return 0; } } + strict = 1; zend_hash_move_forward_ex(model->u.content, &pos); } return 1; @@ -1845,7 +1846,7 @@ return ret; } case XSD_CONTENT_GROUP: { - return model_to_xml_object(node, model->u.group->model, object, style, model->min_occurs > 0 TSRMLS_CC); + return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0 TSRMLS_CC); } default: break; diff -Nru php5-5.4.4/ext/soap/tests/bugs/bug50997.phpt php5-5.4.9/ext/soap/tests/bugs/bug50997.phpt --- php5-5.4.4/ext/soap/tests/bugs/bug50997.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/soap/tests/bugs/bug50997.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,16 @@ +--TEST-- +Bug #50997 (SOAP Error when trying to submit 2nd Element of a choice) +--SKIPIF-- + +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- + 1, 'exceptions'=>0)); +$params = array('code'=>'foo'); +$soapClient->newOperation($params); +echo $soapClient->__getLastRequest(); +?> +--EXPECT-- + +foo diff -Nru php5-5.4.4/ext/soap/tests/bugs/bug50997.wsdl php5-5.4.9/ext/soap/tests/bugs/bug50997.wsdl --- php5-5.4.4/ext/soap/tests/bugs/bug50997.wsdl 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/soap/tests/bugs/bug50997.wsdl 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru php5-5.4.4/ext/sockets/config.m4 php5-5.4.9/ext/sockets/config.m4 --- php5-5.4.4/ext/sockets/config.m4 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/sockets/config.m4 2012-11-21 05:12:20.000000000 +0000 @@ -27,6 +27,21 @@ [AC_DEFINE(MISSING_MSGHDR_MSGFLAGS, 1, [ ])] ) AC_DEFINE([HAVE_SOCKETS], 1, [ ]) + + dnl Check for fied ss_family in sockaddr_storage (missing in AIX until 5.3) + AC_CACHE_CHECK([for field ss_family in struct sockaddr_storage], ac_cv_ss_family, + [ + AC_TRY_COMPILE([ +#include +#include +#include + ], [struct sockaddr_storage sa_store; sa_store.ss_family = AF_INET6;], + ac_cv_ss_family=yes, ac_cv_ss_family=no) + ]) + + if test "$ac_cv_ss_family" = yes; then + AC_DEFINE(HAVE_SA_SS_FAMILY,1,[Whether you have sockaddr_storage.ss_family]) + fi PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c], [$ext_shared]) PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h]) diff -Nru php5-5.4.4/ext/sockets/multicast.h php5-5.4.9/ext/sockets/multicast.h --- php5-5.4.4/ext/sockets/multicast.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/sockets/multicast.h 2012-11-21 05:12:20.000000000 +0000 @@ -19,11 +19,12 @@ /* $Id$ */ #if defined(MCAST_JOIN_GROUP) && \ - (!defined(PHP_WIN32) || (_WIN32_WINNT >= 0x600 && SOCKETS_ENABLE_VISTA_API)) + (!defined(PHP_WIN32) || (_WIN32_WINNT >= 0x600 && SOCKETS_ENABLE_VISTA_API)) && \ + !defined(__APPLE__) #define RFC3678_API 1 /* has block/unblock and source membership, in this case for both IPv4 and IPv6 */ #define HAS_MCAST_EXT 1 -#elif defined(IP_ADD_SOURCE_MEMBERSHIP) +#elif defined(IP_ADD_SOURCE_MEMBERSHIP) && !defined(__APPLE__) /* has block/unblock and source membership, but only for IPv4 */ #define HAS_MCAST_EXT 1 #endif diff -Nru php5-5.4.4/ext/sockets/sockets.c php5-5.4.9/ext/sockets/sockets.c --- php5-5.4.4/ext/sockets/sockets.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/sockets/sockets.c 2012-11-21 05:12:20.000000000 +0000 @@ -77,6 +77,9 @@ # define IS_INVALID_SOCKET(a) (a->bsd_socket < 0) # define set_errno(a) (errno = a) # include "php_sockets.h" +# if defined(_AIX) && !defined(HAVE_SA_SS_FAMILY) +# define ss_family __ss_family +# endif # if HAVE_IF_NAMETOINDEX # include # endif diff -Nru php5-5.4.4/ext/sockets/tests/bug63000.phpt php5-5.4.9/ext/sockets/tests/bug63000.phpt --- php5-5.4.4/ext/sockets/tests/bug63000.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/sockets/tests/bug63000.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,22 @@ +--TEST-- +Bug #63000: Multicast on OSX +--SKIPIF-- + '224.0.0.251', + "interface" => 0, +)); +var_dump($so); +--EXPECTF-- +bool(true) diff -Nru php5-5.4.4/ext/sockets/tests/socket_import_stream-4-win.phpt php5-5.4.9/ext/sockets/tests/socket_import_stream-4-win.phpt --- php5-5.4.4/ext/sockets/tests/socket_import_stream-4-win.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/sockets/tests/socket_import_stream-4-win.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,106 @@ +--TEST-- +socket_import_stream: effects of closing +--SKIPIF-- +fptr_offset_get) { - return zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", NULL, offset); - }*/ - if (!offset) { return &EG(uninitialized_zval_ptr); } if ((type == BP_VAR_W || type == BP_VAR_RW) && (ht->nApplyCount > 0)) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); - return &EG(uninitialized_zval_ptr);; + return &EG(error_zval_ptr);; } switch(Z_TYPE_P(offset)) { + case IS_NULL: + Z_STRVAL_P(offset) = ""; + Z_STRLEN_P(offset) = 0; case IS_STRING: if (zend_symtable_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) == FAILURE) { - if (type == BP_VAR_W || type == BP_VAR_RW) { - zval *value; - ALLOC_INIT_ZVAL(value); - zend_symtable_update(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), NULL); - if (zend_symtable_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) != FAILURE) { - return retval; - } else { - return &EG(uninitialized_zval_ptr); + switch (type) { + case BP_VAR_R: + zend_error(E_NOTICE, "Undefined index: %s", Z_STRVAL_P(offset)); + case BP_VAR_UNSET: + case BP_VAR_IS: + retval = &EG(uninitialized_zval_ptr); + break; + case BP_VAR_RW: + zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); + case BP_VAR_W: { + zval *value; + ALLOC_INIT_ZVAL(value); + zend_symtable_update(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), (void **)&retval); } - } else { - zend_error(E_NOTICE, "Undefined index: %s", Z_STRVAL_P(offset)); - return &EG(uninitialized_zval_ptr); } - } else { - return retval; } - case IS_DOUBLE: + return retval; case IS_RESOURCE: + zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(offset), Z_LVAL_P(offset)); + case IS_DOUBLE: case IS_BOOL: case IS_LONG: if (offset->type == IS_DOUBLE) { @@ -345,26 +349,27 @@ index = Z_LVAL_P(offset); } if (zend_hash_index_find(ht, index, (void **) &retval) == FAILURE) { - if (type == BP_VAR_W || type == BP_VAR_RW) { - zval *value; - ALLOC_INIT_ZVAL(value); - zend_hash_index_update(ht, index, (void**)&value, sizeof(void*), NULL); - if (zend_hash_index_find(ht, index, (void **) &retval) != FAILURE) { - return retval; - } else { - return &EG(uninitialized_zval_ptr); - } - } else { - zend_error(E_NOTICE, "Undefined offset: %ld", index); - return &EG(uninitialized_zval_ptr); + switch (type) { + case BP_VAR_R: + zend_error(E_NOTICE, "Undefined offset: %ld", index); + case BP_VAR_UNSET: + case BP_VAR_IS: + retval = &EG(uninitialized_zval_ptr); + break; + case BP_VAR_RW: + zend_error(E_NOTICE, "Undefined offset: %ld", index); + case BP_VAR_W: { + zval *value; + ALLOC_INIT_ZVAL(value); + zend_hash_index_update(ht, index, (void**)&value, sizeof(void*), (void **)&retval); + } } - } else { - return retval; } - break; + return retval; default: zend_error(E_WARNING, "Illegal offset type"); - return &EG(uninitialized_zval_ptr); + return (type == BP_VAR_W || type == BP_VAR_RW) ? + &EG(error_zval_ptr) : &EG(uninitialized_zval_ptr); } } /* }}} */ @@ -515,11 +520,11 @@ } if (ht == &EG(symbol_table)) { if (zend_delete_global_variable(Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC)) { - zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); + zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); } } else { if (zend_symtable_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1) == FAILURE) { - zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); + zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); } else { spl_array_object *obj = intern; @@ -565,7 +570,7 @@ return; } if (zend_hash_index_del(ht, index) == FAILURE) { - zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset)); + zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset)); } break; default: @@ -650,6 +655,28 @@ return spl_array_has_dimension_ex(1, object, offset, check_empty TSRMLS_CC); } /* }}} */ +/* {{{ spl_array_object_verify_pos_ex */ +static inline int spl_array_object_verify_pos_ex(spl_array_object *object, HashTable *ht, const char *msg_prefix TSRMLS_DC) +{ + if (!ht) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%sArray was modified outside object and is no longer an array", msg_prefix); + return FAILURE; + } + + if (object->pos && (object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, ht TSRMLS_CC) == FAILURE) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%sArray was modified outside object and internal position is no longer valid", msg_prefix); + return FAILURE; + } + + return SUCCESS; +} /* }}} */ + +/* {{{ spl_array_object_verify_pos */ +static inline int spl_array_object_verify_pos(spl_array_object *object, HashTable *ht TSRMLS_DC) +{ + return spl_array_object_verify_pos_ex(object, ht, "" TSRMLS_CC); +} /* }}} */ + /* {{{ proto bool ArrayObject::offsetExists(mixed $index) proto bool ArrayIterator::offsetExists(mixed $index) Returns whether the requested $index exists. */ @@ -687,7 +714,6 @@ spl_array_write_dimension_ex(0, getThis(), index, value TSRMLS_CC); } /* }}} */ - void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC) /* {{{ */ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); @@ -963,17 +989,11 @@ if (object->ar_flags & SPL_ARRAY_OVERLOADED_VALID) { return zend_user_it_valid(iter TSRMLS_CC); } else { - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::valid(): Array was modified outside object and is no longer an array"); - return FAILURE; - } - - if (object->pos && (object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::valid(): Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::valid(): " TSRMLS_CC) == FAILURE) { return FAILURE; - } else { - return zend_hash_has_more_elements_ex(aht, &object->pos); } + + return zend_hash_has_more_elements_ex(aht, &object->pos); } } /* }}} */ @@ -1003,13 +1023,7 @@ if (object->ar_flags & SPL_ARRAY_OVERLOADED_KEY) { return zend_user_it_get_current_key(iter, str_key, str_key_len, int_key TSRMLS_CC); } else { - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and is no longer an array"); - return HASH_KEY_NON_EXISTANT; - } - - if ((object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::current(): " TSRMLS_CC) == FAILURE) { return HASH_KEY_NON_EXISTANT; } @@ -1416,26 +1430,36 @@ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(getThis() TSRMLS_CC); HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - zval *tmp, *arg; + zval *tmp, *arg = NULL; zval *retval_ptr = NULL; MAKE_STD_ZVAL(tmp); Z_TYPE_P(tmp) = IS_ARRAY; Z_ARRVAL_P(tmp) = aht; - if (use_arg) { - if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + if (!use_arg) { + aht->nApplyCount++; + zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval_ptr, 1, tmp, NULL TSRMLS_CC); + aht->nApplyCount--; + } else if (use_arg == SPL_ARRAY_METHOD_MAY_USER_ARG) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) { Z_TYPE_P(tmp) = IS_NULL; zval_ptr_dtor(&tmp); - zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0 TSRMLS_CC); + zend_throw_exception(spl_ce_BadMethodCallException, "Function expects one argument at most", 0 TSRMLS_CC); return; } aht->nApplyCount++; - zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval_ptr, 2, tmp, arg TSRMLS_CC); + zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval_ptr, arg? 2 : 1, tmp, arg TSRMLS_CC); aht->nApplyCount--; } else { + if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { + Z_TYPE_P(tmp) = IS_NULL; + zval_ptr_dtor(&tmp); + zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0 TSRMLS_CC); + return; + } aht->nApplyCount++; - zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval_ptr, 1, tmp, NULL TSRMLS_CC); + zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval_ptr, 2, tmp, arg TSRMLS_CC); aht->nApplyCount--; } Z_TYPE_P(tmp) = IS_NULL; /* we want to destroy the zval, not the hashtable */ @@ -1451,35 +1475,35 @@ spl_array_method(INTERNAL_FUNCTION_PARAM_PASSTHRU, #fname, sizeof(#fname)-1, use_arg); \ } -/* {{{ proto int ArrayObject::asort() - proto int ArrayIterator::asort() +/* {{{ proto int ArrayObject::asort([int $sort_flags = SORT_REGULAR ]) + proto int ArrayIterator::asort([int $sort_flags = SORT_REGULAR ]) Sort the entries by values. */ -SPL_ARRAY_METHOD(Array, asort, 0) /* }}} */ +SPL_ARRAY_METHOD(Array, asort, SPL_ARRAY_METHOD_MAY_USER_ARG) /* }}} */ -/* {{{ proto int ArrayObject::ksort() - proto int ArrayIterator::ksort() +/* {{{ proto int ArrayObject::ksort([int $sort_flags = SORT_REGULAR ]) + proto int ArrayIterator::ksort([int $sort_flags = SORT_REGULAR ]) Sort the entries by key. */ -SPL_ARRAY_METHOD(Array, ksort, 0) /* }}} */ +SPL_ARRAY_METHOD(Array, ksort, SPL_ARRAY_METHOD_MAY_USER_ARG) /* }}} */ /* {{{ proto int ArrayObject::uasort(callback cmp_function) proto int ArrayIterator::uasort(callback cmp_function) Sort the entries by values user defined function. */ -SPL_ARRAY_METHOD(Array, uasort, 1) /* }}} */ +SPL_ARRAY_METHOD(Array, uasort, SPL_ARRAY_METHOD_USE_ARG) /* }}} */ /* {{{ proto int ArrayObject::uksort(callback cmp_function) proto int ArrayIterator::uksort(callback cmp_function) Sort the entries by key using user defined function. */ -SPL_ARRAY_METHOD(Array, uksort, 1) /* }}} */ +SPL_ARRAY_METHOD(Array, uksort, SPL_ARRAY_METHOD_USE_ARG) /* }}} */ /* {{{ proto int ArrayObject::natsort() proto int ArrayIterator::natsort() Sort the entries by values using "natural order" algorithm. */ -SPL_ARRAY_METHOD(Array, natsort, 0) /* }}} */ +SPL_ARRAY_METHOD(Array, natsort, SPL_ARRAY_METHOD_NO_ARG) /* }}} */ /* {{{ proto int ArrayObject::natcasesort() proto int ArrayIterator::natcasesort() Sort the entries by key using case insensitive "natural order" algorithm. */ -SPL_ARRAY_METHOD(Array, natcasesort, 0) /* }}} */ +SPL_ARRAY_METHOD(Array, natcasesort, SPL_ARRAY_METHOD_NO_ARG) /* }}} */ /* {{{ proto mixed|NULL ArrayIterator::current() Return current array entry */ @@ -1494,13 +1518,7 @@ return; } - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { return; } @@ -1530,13 +1548,7 @@ ulong num_key; HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { return; } @@ -1564,13 +1576,12 @@ if (zend_parse_parameters_none() == FAILURE) { return; } - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); + + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { return; } - spl_array_next_ex(intern, aht TSRMLS_CC); + spl_array_next_no_verify(intern, aht TSRMLS_CC); } /* }}} */ @@ -1585,14 +1596,8 @@ if (zend_parse_parameters_none() == FAILURE) { return; } - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - if (intern->pos && (intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { RETURN_FALSE; } else { RETURN_BOOL(zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS); @@ -1611,14 +1616,8 @@ if (zend_parse_parameters_none() == FAILURE) { return; } - - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - RETURN_FALSE; - } - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { RETURN_FALSE; } @@ -1642,13 +1641,7 @@ return; } - if (!aht) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array"); - return; - } - - if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); + if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) { return; } @@ -1943,6 +1936,7 @@ REGISTER_SPL_IMPLEMENTS(ArrayObject, Aggregate); REGISTER_SPL_IMPLEMENTS(ArrayObject, ArrayAccess); REGISTER_SPL_IMPLEMENTS(ArrayObject, Serializable); + REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable); memcpy(&spl_handler_ArrayObject, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); spl_handler_ArrayObject.clone_obj = spl_array_object_clone; @@ -1967,6 +1961,7 @@ REGISTER_SPL_IMPLEMENTS(ArrayIterator, ArrayAccess); REGISTER_SPL_IMPLEMENTS(ArrayIterator, SeekableIterator); REGISTER_SPL_IMPLEMENTS(ArrayIterator, Serializable); + REGISTER_SPL_IMPLEMENTS(ArrayIterator, Countable); memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayObject, sizeof(zend_object_handlers)); spl_ce_ArrayIterator->get_iterator = spl_array_get_iterator; @@ -1974,9 +1969,6 @@ REGISTER_SPL_IMPLEMENTS(RecursiveArrayIterator, RecursiveIterator); spl_ce_RecursiveArrayIterator->get_iterator = spl_array_get_iterator; - REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable); - REGISTER_SPL_IMPLEMENTS(ArrayIterator, Countable); - REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST); REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS); diff -Nru php5-5.4.4/ext/spl/spl_directory.c php5-5.4.9/ext/spl/spl_directory.c --- php5-5.4.4/ext/spl/spl_directory.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/spl_directory.c 2012-11-21 05:12:20.000000000 +0000 @@ -433,7 +433,6 @@ if (file_path && !use_copy) { efree(file_path); } - use_copy = 1; file_path_len = 1; file_path = "/"; #endif @@ -1432,6 +1431,7 @@ SPL_METHOD(FilesystemIterator, rewind) { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + int skip_dots = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_SKIPDOTS); if (zend_parse_parameters_none() == FAILURE) { return; @@ -1443,7 +1443,7 @@ } do { spl_filesystem_dir_read(intern TSRMLS_CC); - } while (spl_filesystem_is_dot(intern->u.dir.entry.d_name)); + } while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name)); } /* }}} */ diff -Nru php5-5.4.4/ext/spl/spl_fixedarray.c php5-5.4.9/ext/spl/spl_fixedarray.c --- php5-5.4.4/ext/spl/spl_fixedarray.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/spl_fixedarray.c 2012-11-21 05:12:20.000000000 +0000 @@ -223,10 +223,14 @@ if (orig && clone_orig) { spl_fixedarray_object *other = (spl_fixedarray_object*)zend_object_store_get_object(orig TSRMLS_CC); intern->ce_get_iterator = other->ce_get_iterator; - - intern->array = emalloc(sizeof(spl_fixedarray)); - spl_fixedarray_init(intern->array, other->array->size TSRMLS_CC); - spl_fixedarray_copy(intern->array, other->array TSRMLS_CC); + if (!other->array) { + /* leave a empty object, will be dtor later by CLONE handler */ + zend_throw_exception(spl_ce_RuntimeException, "The instance wasn't initialized properly", 0 TSRMLS_CC); + } else { + intern->array = emalloc(sizeof(spl_fixedarray)); + spl_fixedarray_init(intern->array, other->array->size TSRMLS_CC); + spl_fixedarray_copy(intern->array, other->array TSRMLS_CC); + } } while (parent) { diff -Nru php5-5.4.4/ext/spl/spl_heap.c php5-5.4.9/ext/spl/spl_heap.c --- php5-5.4.4/ext/spl/spl_heap.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/spl_heap.c 2012-11-21 05:12:20.000000000 +0000 @@ -953,7 +953,7 @@ { spl_heap_it *iterator = (spl_heap_it *)iter; - *int_key = (ulong) iterator->object->heap->count; + *int_key = (ulong) iterator->object->heap->count - 1; return HASH_KEY_IS_LONG; } /* }}} */ diff -Nru php5-5.4.4/ext/spl/spl_iterators.c php5-5.4.9/ext/spl/spl_iterators.c --- php5-5.4.4/ext/spl/spl_iterators.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/spl_iterators.c 2012-11-21 05:12:20.000000000 +0000 @@ -1289,6 +1289,8 @@ *object_ptr = intern->inner.zobject; function_handler = Z_OBJ_HT_P(*object_ptr)->get_method(object_ptr, method, method_len, key TSRMLS_CC); } + } else { + *object_ptr = intern->inner.zobject; } } return function_handler; @@ -2818,7 +2820,7 @@ } if (zend_symtable_find(HASH_OF(intern->u.caching.zcache), arKey, nKeyLength+1, (void**)&value) == FAILURE) { - zend_error(E_NOTICE, "Undefined index: %s", arKey); + zend_error(E_NOTICE, "Undefined index: %s", arKey); return; } diff -Nru php5-5.4.4/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt php5-5.4.9/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt --- php5-5.4.4/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,50 @@ +--TEST-- +RecursiveDirectoryIterator::getBasePath() - basic test +--CREDITS-- +Pawel Krynicki +#testfest AmsterdamPHP 2012-06-23 +--FILE-- +valid()) { + $list[] = $it->getSubPath(); + $it->next(); +} +asort($list); +foreach ($list as $item) { + echo $item . "\n"; +} +?> +--CLEAN-- + + +--EXPECTF-- +depth1 +depth1 +depth1%cdepth2 +depth1%cdepth2 +depth1%cdepth2 diff -Nru php5-5.4.4/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt php5-5.4.9/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt --- php5-5.4.4/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,56 @@ +--TEST-- +RecursiveDirectoryIterator::getBasePathname() - basic test +--CREDITS-- +Pawel Krynicki +#testfest AmsterdamPHP 2012-06-23 +--FILE-- +rewind(); //see https://bugs.php.net/bug.php?id=62914 +while($it->valid()) { + $list[] = $it->getSubPathname(); + $it->next(); +} +asort($list); +foreach ($list as $item) { + echo $item . "\n"; +} +?> +--CLEAN-- + +--EXPECTF-- +. +.. +depth1%c. +depth1%c.. +depth1%cdepth2%c. +depth1%cdepth2%c.. +depth1%cdepth2%cgetSubPathname_test_2.tmp +depth1%cgetSubPathname_test_3.tmp +getSubPathname_test_1.tmp diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_current_basic.phpt php5-5.4.9/ext/spl/tests/SplFileObject_current_basic.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_current_basic.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_current_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,18 @@ +--TEST-- +SPL: SplFileObject::current basic +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +current(); + +?> +--EXPECT-- + +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(2); + +echo $s->current('foo'); +?> +--EXPECTF-- +Warning: SplFileObject::current() expects exactly 0 parameters, 1 given in %s on line %d diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_current_variation001.phpt php5-5.4.9/ext/spl/tests/SplFileObject_current_variation001.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_current_variation001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_current_variation001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,21 @@ +--TEST-- +SPL: SplFileObject::current variation +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(2); + +echo $s->current(); +echo $s->current(); +?> +--EXPECT-- +//line 3 +//line 3 diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_getchildren_basic.phpt php5-5.4.9/ext/spl/tests/SplFileObject_getchildren_basic.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_getchildren_basic.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_getchildren_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::getchildren basic +--CREDITS-- +Erwin Poeze +--FILE-- +getChildren()); + +?> +--EXPECT-- +NULL diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_getchildren_error001.phpt php5-5.4.9/ext/spl/tests/SplFileObject_getchildren_error001.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_getchildren_error001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_getchildren_error001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::getchildren error 001 +--CREDITS-- +Erwin Poeze +--FILE-- +getChildren('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::getChildren() expects exactly 0 parameters, 1 given in %s on line %d diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_getflags_basic.phpt php5-5.4.9/ext/spl/tests/SplFileObject_getflags_basic.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_getflags_basic.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_getflags_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::getFlags basic +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +setFlags(SplFileObject::DROP_NEW_LINE); +var_dump($fo->getFlags()); +?> +--CLEAN-- + +--EXPECT-- +int(1) diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_getflags_error001.phpt php5-5.4.9/ext/spl/tests/SplFileObject_getflags_error001.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_getflags_error001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_getflags_error001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,26 @@ +--TEST-- +SPL: SplFileObject::getFlags error 001 +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +setFlags(SplFileObject::READ_CSV); + +$fo->setFlags(SplFileObject::DROP_NEW_LINE); + +var_dump($fo->getFlags()); + +?> +--CLEAN-- + +--EXPECT-- +int(1) diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_getflags_error002.phpt php5-5.4.9/ext/spl/tests/SplFileObject_getflags_error002.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_getflags_error002.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_getflags_error002.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,21 @@ +--TEST-- +SPL: SplFileObject::getFlags error 001 +--CREDITS-- +Erwin Poeze +--FILE-- +setFlags(SplFileObject::READ_CSV); + +$fo->getFlags('fake'); + +?> +--CLEAN-- + +--EXPECTF-- +Warning: SplFileObject::getFlags() expects exactly 0 parameters, 1 given in %s on line %d diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_getflags_variation001.phpt php5-5.4.9/ext/spl/tests/SplFileObject_getflags_variation001.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_getflags_variation001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_getflags_variation001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,29 @@ +--TEST-- +SPL: SplFileObject::getFlags +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +setFlags(SplFileObject::DROP_NEW_LINE); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::READ_AHEAD); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::SKIP_EMPTY); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::READ_CSV); +var_dump($fo->getFlags()); + +?> +--EXPECT-- +int(1) +int(2) +int(4) +int(8) diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_haschildren_basic.phpt php5-5.4.9/ext/spl/tests/SplFileObject_haschildren_basic.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_haschildren_basic.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_haschildren_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::haschildren basic +--CREDITS-- +Erwin Poeze +--FILE-- +hasChildren()); + +?> +--EXPECT-- +bool(false) diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_haschildren_error001.phpt php5-5.4.9/ext/spl/tests/SplFileObject_haschildren_error001.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_haschildren_error001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_haschildren_error001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::haschildren error 001 +--CREDITS-- +Erwin Poeze +--FILE-- +hasChildren('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::hasChildren() expects exactly 0 parameters, 1 given in %s on line %d diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_key_basic.phpt php5-5.4.9/ext/spl/tests/SplFileObject_key_basic.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_key_basic.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_key_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,19 @@ +--TEST-- +SPL: SplFileObject::key basic +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(3); +echo $s->key(); +?> +--EXPECT-- +3 diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_key_error001.phpt php5-5.4.9/ext/spl/tests/SplFileObject_key_error001.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_key_error001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_key_error001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::key error +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(12); +$s->next(); +var_dump($s->key()); +var_dump($s->valid()); +?> +--EXPECT-- +int(13) +bool(false) diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_key_error002.phpt php5-5.4.9/ext/spl/tests/SplFileObject_key_error002.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_key_error002.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_key_error002.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::key error +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(120); +$s->next(); +var_dump($s->key()); +var_dump($s->valid()); +?> +--EXPECT-- +int(13) +bool(false) diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_key_error003.phpt php5-5.4.9/ext/spl/tests/SplFileObject_key_error003.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_key_error003.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_key_error003.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,15 @@ +--TEST-- +SPL: SplFileObject::key error +--CREDITS-- +Erwin Poeze +--FILE-- +key(3); +?> +--EXPECTF-- +Warning: SplFileObject::key() expects exactly 0 parameters, 1 given in %s on line %d diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_next_basic.phpt php5-5.4.9/ext/spl/tests/SplFileObject_next_basic.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_next_basic.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_next_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,22 @@ +--TEST-- +SPL: SplFileObject::next basic +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +current(); +$s->next(); + +echo $s->current(); + +?> +--EXPECT-- + +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(13); +echo $s->current(); + +$s->next(); +echo $s->current(); +var_dump($s->valid()); +?> +--EXPECT-- +?> +bool(false) diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_next_variation002.phpt php5-5.4.9/ext/spl/tests/SplFileObject_next_variation002.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_next_variation002.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_next_variation002.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +SPL: SplFileObject::next variation 002, read ahead +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(2); +echo $s->current(); +$s->next(); +echo $s->current(); + +$s->setFlags(SplFileObject::READ_AHEAD); + +$s->seek(2); +echo $s->current(); +$s->next(); +echo $s->current(); +?> +--EXPECT-- +//line 3 +//line 4 +//line 3 +//line 4 diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_rewind_basic.phpt php5-5.4.9/ext/spl/tests/SplFileObject_rewind_basic.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_rewind_basic.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_rewind_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,21 @@ +--TEST-- +SPL: SplFileObject::rewind basic +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(3); + +$s->rewind(); +echo $s->current(); +?> +--EXPECT-- + +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +rewind( "invalid" ); + +?> +--EXPECTF-- +Warning: SplFileObject::rewind() expects exactly 0 parameters, 1 given in %s on line %d diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_rewind_variation001.phpt php5-5.4.9/ext/spl/tests/SplFileObject_rewind_variation001.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_rewind_variation001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_rewind_variation001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,28 @@ +--TEST-- +SPL: SplFileObject::rewind variation 001 +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(15); +echo $s->current(); +$s->next(); +echo $s->current(); +var_dump($s->valid()); +$s->rewind(); +var_dump($s->valid()); +echo $s->current(); +?> +--EXPECT-- +?> +bool(false) +bool(true) + +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(2); +echo $s->current(); +?> +--EXPECT-- +//line 3 diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_seek_error002.phpt php5-5.4.9/ext/spl/tests/SplFileObject_seek_error002.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_seek_error002.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_seek_error002.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,18 @@ +--TEST-- +SPL: SplFileObject::seek error 001 +--CREDITS-- +Ricardo Oedietram +Erwin Poeze +#PFZ June PHP TestFest 2012 +--FILE-- +seek(20); +echo $s->current(); +?> +--EXPECT-- diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_setCsvControl_basic.phpt php5-5.4.9/ext/spl/tests/SplFileObject_setCsvControl_basic.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_setCsvControl_basic.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_setCsvControl_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +SPL: SplFileObject::setCsvControl basic +--CREDITS-- +Erwin Poeze +--FILE-- +setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('|', '\'', '/'); +foreach ($s as $row) { + list($fruit, $quantity) = $row; + echo "$fruit : $quantity\n"; +} +?> +--CLEAN-- + +--EXPECT-- +groene appelen : 10 +gele bananen : 20 +rode kersen : 30 + diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt php5-5.4.9/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,24 @@ +--TEST-- +SPL: SplFileObject::setCsvControl error 001 +--CREDITS-- +Erwin Poeze +--FILE-- +setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('||'); +?> +--CLEAN-- + +--EXPECTF-- +Warning: SplFileObject::setCsvControl(): delimiter must be a character in %s on line %d + diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt php5-5.4.9/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,24 @@ +--TEST-- +SPL: SplFileObject::setCsvControl error 002 +--CREDITS-- +Erwin Poeze +--FILE-- +setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('|', 'two'); +?> +--CLEAN-- + +--EXPECTF-- +Warning: SplFileObject::setCsvControl(): enclosure must be a character in %s on line %d + diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt php5-5.4.9/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,26 @@ +--TEST-- +SPL: SplFileObject::setCsvControl error 003 +--CREDITS-- +Erwin Poeze +--INI-- +include_path=. +--FILE-- +setFlags(SplFileObject::READ_CSV); +$s->setCsvControl('|', '\'', 'three'); +?> +--CLEAN-- + +--EXPECTF-- +Warning: SplFileObject::setCsvControl(): escape must be a character in %s on line %d + diff -Nru php5-5.4.4/ext/spl/tests/SplFileObject_setCsvControl_variation001.phpt php5-5.4.9/ext/spl/tests/SplFileObject_setCsvControl_variation001.phpt --- php5-5.4.4/ext/spl/tests/SplFileObject_setCsvControl_variation001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/SplFileObject_setCsvControl_variation001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +SPL: SplFileObject::setCsvControl variation 001 +--CREDITS-- +Erwin Poeze +--FILE-- +setFlags(SplFileObject::READ_CSV); +$s->setCsvControl(); +foreach ($s as $row) { + list($fruit, $quantity) = $row; + echo "$fruit : $quantity\n"; +} +?> +--CLEAN-- + +--EXPECT-- +groene appelen : 10 +gele bananen : 20 +rode kersen : 30 + diff -Nru php5-5.4.4/ext/spl/tests/arrayObject___construct_basic2.phpt php5-5.4.9/ext/spl/tests/arrayObject___construct_basic2.phpt --- php5-5.4.4/ext/spl/tests/arrayObject___construct_basic2.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/arrayObject___construct_basic2.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -63,7 +63,7 @@ Notice: Undefined property: ArrayObject::$prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: @@ -91,7 +91,7 @@ Notice: Undefined property: MyArrayObject::$prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: diff -Nru php5-5.4.4/ext/spl/tests/arrayObject___construct_basic3.phpt php5-5.4.9/ext/spl/tests/arrayObject___construct_basic3.phpt --- php5-5.4.4/ext/spl/tests/arrayObject___construct_basic3.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/arrayObject___construct_basic3.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -63,7 +63,7 @@ Notice: Undefined property: ArrayObject::$prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: @@ -91,7 +91,7 @@ Notice: Undefined property: MyArrayObject::$prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: diff -Nru php5-5.4.4/ext/spl/tests/arrayObject___construct_basic4.phpt php5-5.4.9/ext/spl/tests/arrayObject___construct_basic4.phpt --- php5-5.4.4/ext/spl/tests/arrayObject___construct_basic4.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/arrayObject___construct_basic4.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -61,11 +61,11 @@ bool(true) - Unset: -Notice: Undefined index: prop in %s on line 39 +Notice: Undefined index: prop in %s on line 39 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: @@ -91,9 +91,9 @@ bool(true) - Unset: -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: diff -Nru php5-5.4.4/ext/spl/tests/arrayObject___construct_basic5.phpt php5-5.4.9/ext/spl/tests/arrayObject___construct_basic5.phpt --- php5-5.4.4/ext/spl/tests/arrayObject___construct_basic5.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/arrayObject___construct_basic5.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -61,11 +61,11 @@ bool(true) - Unset: -Notice: Undefined index: prop in %s on line 39 +Notice: Undefined index: prop in %s on line 39 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: @@ -91,9 +91,9 @@ bool(true) - Unset: -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 -Notice: Undefined index: prop in %s on line 40 +Notice: Undefined index: prop in %s on line 40 NULL NULL - After: diff -Nru php5-5.4.4/ext/spl/tests/arrayObject_asort_basic1.phpt php5-5.4.9/ext/spl/tests/arrayObject_asort_basic1.phpt --- php5-5.4.4/ext/spl/tests/arrayObject_asort_basic1.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/arrayObject_asort_basic1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -17,12 +17,14 @@ var_dump($ao1); var_dump($ao2->asort('blah')); var_dump($ao2); +var_dump($ao2->asort(SORT_NUMERIC)); +var_dump($ao2); ?> ===DONE=== --EXPECTF-- *** Testing ArrayObject::asort() : basic functionality *** bool(true) -object(ArrayObject)#1 (1) { +object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(3) { [1]=> @@ -33,8 +35,22 @@ int(4) } } + +Warning: asort() expects parameter 2 to be long, string given in %sarrayObject_asort_basic1.php on line %d +bool(false) +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(3) { + ["a"]=> + int(4) + ["b"]=> + int(2) + ["c"]=> + int(3) + } +} bool(true) -object(ArrayObject)#2 (1) { +object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(3) { ["b"]=> diff -Nru php5-5.4.4/ext/spl/tests/arrayObject_ksort_basic1.phpt php5-5.4.9/ext/spl/tests/arrayObject_ksort_basic1.phpt --- php5-5.4.4/ext/spl/tests/arrayObject_ksort_basic1.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/arrayObject_ksort_basic1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -16,12 +16,14 @@ var_dump($ao1); var_dump($ao2->ksort('blah')); var_dump($ao2); +var_dump($ao2->ksort(SORT_STRING)); +var_dump($ao2); ?> ===DONE=== --EXPECTF-- *** Testing ArrayObject::ksort() : basic functionality *** bool(true) -object(ArrayObject)#1 (1) { +object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(3) { [0]=> @@ -32,18 +34,34 @@ int(3) } } -bool(true) + +Warning: ksort() expects parameter 2 to be long, string given in %sarrayObject_ksort_basic1.php on line %d +bool(false) object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> array(4) { - ["a"]=> - int(2) ["b"]=> int(4) + ["a"]=> + int(2) ["q"]=> int(3) [99]=> string(1) "x" } } +bool(true) +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(4) { + [99]=> + string(1) "x" + ["a"]=> + int(2) + ["b"]=> + int(4) + ["q"]=> + int(3) + } +} ===DONE=== diff -Nru php5-5.4.4/ext/spl/tests/arrayObject_magicMethods1.phpt php5-5.4.9/ext/spl/tests/arrayObject_magicMethods1.phpt --- php5-5.4.4/ext/spl/tests/arrayObject_magicMethods1.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/arrayObject_magicMethods1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -102,7 +102,7 @@ --> Read existent, non-existent and dynamic: string(7) "changed" -Notice: Undefined index: nonexistent in %s on line 42 +Notice: Undefined index: nonexistent in %s on line 42 NULL string(11) "new.changed" Original wrapped object: @@ -171,7 +171,7 @@ --> Unset existent, non-existent and dynamic: -Notice: Undefined index: nonexistent in %s on line 60 +Notice: Undefined index: nonexistent in %s on line 60 Original wrapped object: object(UsesMagic)#1 (3) { ["b"]=> diff -Nru php5-5.4.4/ext/spl/tests/arrayObject_magicMethods3.phpt php5-5.4.9/ext/spl/tests/arrayObject_magicMethods3.phpt --- php5-5.4.4/ext/spl/tests/arrayObject_magicMethods3.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/arrayObject_magicMethods3.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -102,7 +102,7 @@ --> Read existent, non-existent and dynamic: string(7) "changed" -Notice: Undefined index: nonexistent in %s on line 42 +Notice: Undefined index: nonexistent in %s on line 42 NULL string(11) "new.changed" Original wrapped object: @@ -171,7 +171,7 @@ --> Unset existent, non-existent and dynamic: -Notice: Undefined index: nonexistent in %s on line 60 +Notice: Undefined index: nonexistent in %s on line 60 Original wrapped object: object(UsesMagic)#1 (3) { ["b"]=> diff -Nru php5-5.4.4/ext/spl/tests/arrayObject_magicMethods4.phpt php5-5.4.9/ext/spl/tests/arrayObject_magicMethods4.phpt --- php5-5.4.4/ext/spl/tests/arrayObject_magicMethods4.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/arrayObject_magicMethods4.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -107,7 +107,7 @@ --> Read existent, non-existent and dynamic: string(7) "changed" -Notice: Undefined index: nonexistent in %s on line 45 +Notice: Undefined index: nonexistent in %s on line 45 NULL string(11) "new.changed" Original wrapped object: @@ -180,7 +180,7 @@ --> Unset existent, non-existent and dynamic: -Notice: Undefined index: nonexistent in %s on line 63 +Notice: Undefined index: nonexistent in %s on line 63 Original wrapped object: object(C)#1 (3) { ["b"]=> diff -Nru php5-5.4.4/ext/spl/tests/arrayObject_magicMethods6.phpt php5-5.4.9/ext/spl/tests/arrayObject_magicMethods6.phpt --- php5-5.4.4/ext/spl/tests/arrayObject_magicMethods6.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/arrayObject_magicMethods6.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -107,7 +107,7 @@ --> Read existent, non-existent and dynamic: string(7) "changed" -Notice: Undefined index: nonexistent in %s on line 45 +Notice: Undefined index: nonexistent in %s on line 45 NULL string(11) "new.changed" Original wrapped object: @@ -180,7 +180,7 @@ --> Unset existent, non-existent and dynamic: -Notice: Undefined index: nonexistent in %s on line 63 +Notice: Undefined index: nonexistent in %s on line 63 Original wrapped object: object(C)#1 (3) { ["b"]=> diff -Nru php5-5.4.4/ext/spl/tests/arrayObject_setFlags_basic1.phpt php5-5.4.9/ext/spl/tests/arrayObject_setFlags_basic1.phpt --- php5-5.4.4/ext/spl/tests/arrayObject_setFlags_basic1.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/arrayObject_setFlags_basic1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -44,8 +44,8 @@ --> Remove the array element and try access again: bool(false) -Notice: Undefined index: p in %s on line 10 +Notice: Undefined index: p in %s on line 10 NULL -Notice: Undefined index: p in %s on line 12 +Notice: Undefined index: p in %s on line 12 string(8) ".changed" diff -Nru php5-5.4.4/ext/spl/tests/array_001.phpt php5-5.4.9/ext/spl/tests/array_001.phpt --- php5-5.4.4/ext/spl/tests/array_001.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/array_001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -79,15 +79,15 @@ } int(0) -Notice: Undefined offset: 6 in %sarray_001.php on line %d +Notice: Undefined offset: 6 in %sarray_001.php on line %d NULL -Notice: Undefined index: b in %sarray_001.php on line %d +Notice: Undefined index: b in %sarray_001.php on line %d NULL -Notice: Undefined offset: 7 in %sarray_001.php on line %d +Notice: Undefined offset: 7 in %sarray_001.php on line %d -Notice: Undefined index: c in %sarray_001.php on line %d +Notice: Undefined index: c in %sarray_001.php on line %d object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(2) { diff -Nru php5-5.4.4/ext/spl/tests/array_010.phpt php5-5.4.9/ext/spl/tests/array_010.phpt --- php5-5.4.4/ext/spl/tests/array_010.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/array_010.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -94,10 +94,10 @@ string(3) "3rd" int(4) -Notice: Undefined index: 5th in %sarray_010.php on line %d +Notice: Undefined index: 5th in %sarray_010.php on line %d NULL -Notice: Undefined offset: 6 in %sarray_010.php on line %d +Notice: Undefined offset: 6 in %sarray_010.php on line %d NULL ===offsetSet=== WRITE 1 @@ -128,9 +128,9 @@ string(9) "changed 6" } -Notice: Undefined offset: 7 in %sarray_010.php on line %d +Notice: Undefined offset: 7 in %sarray_010.php on line %d -Notice: Undefined index: 8th in %sarray_010.php on line %d +Notice: Undefined index: 8th in %sarray_010.php on line %d array(4) { [0]=> string(3) "1st" diff -Nru php5-5.4.4/ext/spl/tests/bug45622.phpt php5-5.4.9/ext/spl/tests/bug45622.phpt --- php5-5.4.4/ext/spl/tests/bug45622.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/bug45622.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -42,7 +42,7 @@ --> Remove the array element and try access again: bool(false) -Notice: Undefined index: p in %s on line %d +Notice: Undefined index: p in %s on line %d NULL --> Re-add the real property: diff -Nru php5-5.4.4/ext/spl/tests/bug45622b.phpt php5-5.4.9/ext/spl/tests/bug45622b.phpt --- php5-5.4.4/ext/spl/tests/bug45622b.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/bug45622b.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -25,9 +25,9 @@ --EXPECTF-- Doesn't trigger __get. -Notice: Undefined index: prop1 in %s on line 11 +Notice: Undefined index: prop1 in %s on line 11 Doesn't trigger __set. Doesn't trigger __unset. -Notice: Undefined index: prop3 in %s on line 17 +Notice: Undefined index: prop3 in %s on line 17 Shouldn't trigger __isset. \ No newline at end of file diff -Nru php5-5.4.4/ext/spl/tests/bug52238.phpt php5-5.4.9/ext/spl/tests/bug52238.phpt --- php5-5.4.4/ext/spl/tests/bug52238.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/bug52238.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,5 +1,5 @@ --TEST-- -Bug #52238 - Crash when an Exception occured in iterator_to_array +Bug #52238 - Crash when an Exception occurred in iterator_to_array --FILE-- getIterator(); + +/* testing empty array, should no notice at all */ +$ai->next(); +var_dump($ai->key()); +var_dump($ai->current()); + +/* testing array changing */ +$ao2 = new ArrayObject(array(1 => 1, 2, 3, 4, 5)); +$ai2 = $ao2->getIterator(); + +$ao2->offsetUnset($ai2->key()); +$ai2->next(); + +/* now point to 2 */ +$ao2->offsetUnset($ai2->key()); +var_dump($ai2->key()); + +/* now point to 3 */ +$ao2->offsetUnset($ai2->key()); +var_dump($ai2->current()); + +$ai2->next(); +var_dump($ai2->key()); +var_dump($ai2->current()); + +/* should be at the end and no notice */ +$ai2->next(); +var_dump($ai2->key()); +var_dump($ai2->current()); + +$ai2->rewind(); +$ai2->next(); +$ai2->next(); +/* should reached the end */ +var_dump($ai2->next()); +var_dump($ai2->key()); + +/* testing RecursiveArrayIterator */ +$ao3 = new ArrayObject(array(), NULL, 'RecursiveArrayIterator'); +$ai3 = $ao3->getIterator(); + +var_dump($ai3->getChildren()); + +$ao4 = new ArrayObject(array(1, 2), NULL, 'RecursiveArrayIterator'); +$ai4 = $ao4->getIterator(); + +$ai4->next(); +$ai4->next(); +$ai4->next(); +var_dump($ai4->hasChildren()); + +$ai4->rewind(); +$ao4->offsetUnset($ai4->key()); +var_dump($ai4->hasChildren()); + +$ao4->offsetUnset($ai4->key()); +var_dump($ai4->getChildren()); +?> +==DONE== + +--EXPECTF-- +NULL +NULL + +Notice: ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sbug61527.php on line %d + +Notice: ArrayIterator::key(): Array was modified outside object and internal position is no longer valid in %sbug61527.php on line %d +NULL + +Notice: ArrayIterator::current(): Array was modified outside object and internal position is no longer valid in %sbug61527.php on line %d +NULL +int(5) +int(5) +NULL +NULL +NULL +NULL +NULL +bool(false) + +Notice: RecursiveArrayIterator::hasChildren(): Array was modified outside object and internal position is no longer valid in %sbug61527.php on line %d +bool(false) + +Notice: RecursiveArrayIterator::getChildren(): Array was modified outside object and internal position is no longer valid in %sbug61527.php on line %d +NULL +==DONE== diff -Nru php5-5.4.4/ext/spl/tests/bug62073.phpt php5-5.4.9/ext/spl/tests/bug62073.phpt --- php5-5.4.4/ext/spl/tests/bug62073.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/bug62073.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,22 @@ +--TEST-- +Bug #62073 (different ways of iterating over an SplMaxHeap result in different keys) +--FILE-- +insert(42); +foreach ($heap as $key => $value) { + var_dump($key); + var_dump($value); + break; +} + +$heap = new SplMaxHeap(); +$heap->insert(42); +var_dump($heap->key()); +var_dump($heap->current()); +?> +--EXPECT-- +int(0) +int(42) +int(0) +int(42) diff -Nru php5-5.4.4/ext/spl/tests/bug62262.phpt php5-5.4.9/ext/spl/tests/bug62262.phpt --- php5-5.4.4/ext/spl/tests/bug62262.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/bug62262.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,10 @@ +--TEST-- +Bug #62262: RecursiveArrayIterator does not implement Countable +--FILE-- + +--EXPECT-- +bool(true) diff -Nru php5-5.4.4/ext/spl/tests/bug62328.phpt php5-5.4.9/ext/spl/tests/bug62328.phpt --- php5-5.4.4/ext/spl/tests/bug62328.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/bug62328.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,24 @@ +--TEST-- +Bug #62328 (cast_object takes precedence over __toString) +--CREDITS-- +leight at gmail dot com +--FILE-- +__toString() . PHP_EOL; + +?> +--EXPECT-- +__toString +__toString diff -Nru php5-5.4.4/ext/spl/tests/bug62433.phpt php5-5.4.9/ext/spl/tests/bug62433.phpt --- php5-5.4.4/ext/spl/tests/bug62433.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/bug62433.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,18 @@ +--TEST-- +Bug #62433 Inconsistent behavior of RecursiveDirectoryIterator to dot files (. and ..) +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(false) +bool(false) diff -Nru php5-5.4.4/ext/spl/tests/bug62616.phpt php5-5.4.9/ext/spl/tests/bug62616.phpt --- php5-5.4.4/ext/spl/tests/bug62616.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/bug62616.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,15 @@ +--TEST-- +Bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault) +--FILE-- +count()); + +$ii = new IteratorIterator($ai); + +var_dump($ii->count()); +?> +--EXPECTF-- +int(2) +int(2) diff -Nru php5-5.4.4/ext/spl/tests/bug62904.phpt php5-5.4.9/ext/spl/tests/bug62904.phpt --- php5-5.4.4/ext/spl/tests/bug62904.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/bug62904.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,19 @@ +--TEST-- +Bug #62904 (Crash when cloning an object which inherits SplFixedArray) +--FILE-- +getMessage()); +} +--EXPECTF-- +string(40) "The instance wasn't initialized properly" diff -Nru php5-5.4.4/ext/spl/tests/bug62978.phpt php5-5.4.9/ext/spl/tests/bug62978.phpt --- php5-5.4.4/ext/spl/tests/bug62978.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/bug62978.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,50 @@ +--TEST-- +Bug #62987 (Assigning to ArrayObject[null][something] overrides all undefined variables) +--FILE-- + +--INI-- +include_path=. +--FILE-- +getMaxLineLen('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::getMaxLineLen() expects exactly 0 parameters, 1 given in %s on line %d diff -Nru php5-5.4.4/ext/spl/tests/fileobject_setmaxlinelen_error001.phpt php5-5.4.9/ext/spl/tests/fileobject_setmaxlinelen_error001.phpt --- php5-5.4.4/ext/spl/tests/fileobject_setmaxlinelen_error001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/fileobject_setmaxlinelen_error001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,17 @@ +--TEST-- +SPL: SplFileObject::setMaxLineLen error 001() +--CREDITS-- +Erwin Poeze +--FILE-- +setMaxLineLen(-1); +} +catch (DomainException $e) { + echo 'DomainException thrown'; +} + +?> +--EXPECT-- +DomainException thrown diff -Nru php5-5.4.4/ext/spl/tests/fileobject_setmaxlinelen_error002.phpt php5-5.4.9/ext/spl/tests/fileobject_setmaxlinelen_error002.phpt --- php5-5.4.4/ext/spl/tests/fileobject_setmaxlinelen_error002.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/fileobject_setmaxlinelen_error002.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::setMaxLineLen error 002 +--CREDITS-- +Erwin Poeze +--FILE-- +setMaxLineLen(); + +?> +--EXPECTF-- +Warning: SplFileObject::setMaxLineLen() expects exactly 1 parameter, 0 given in %s on line %d diff -Nru php5-5.4.4/ext/spl/tests/fileobject_setmaxlinelen_error003.phpt php5-5.4.9/ext/spl/tests/fileobject_setmaxlinelen_error003.phpt --- php5-5.4.4/ext/spl/tests/fileobject_setmaxlinelen_error003.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/fileobject_setmaxlinelen_error003.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,12 @@ +--TEST-- +SPL: SplFileObject::setMaxLineLen error 003 +--CREDITS-- +Erwin Poeze +--FILE-- +setMaxLineLen('string'); + +?> +--EXPECTF-- +Warning: SplFileObject::setMaxLineLen() expects parameter 1 to be long, string given in %s on line %d diff -Nru php5-5.4.4/ext/spl/tests/heap_005.phpt php5-5.4.9/ext/spl/tests/heap_005.phpt --- php5-5.4.4/ext/spl/tests/heap_005.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/heap_005.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -18,104 +18,104 @@ ===DONE=== --EXPECTF-- -100 => 1 -99 => 2 -98 => 3 -97 => 4 -96 => 5 -95 => 6 -94 => 7 -93 => 8 -92 => 9 -91 => 10 -90 => 11 -89 => 12 -88 => 13 -87 => 14 -86 => 15 -85 => 16 -84 => 17 -83 => 18 -82 => 19 -81 => 20 -80 => 21 -79 => 22 -78 => 23 -77 => 24 -76 => 25 -75 => 26 -74 => 27 -73 => 28 -72 => 29 -71 => 30 -70 => 31 -69 => 32 -68 => 33 -67 => 34 -66 => 35 -65 => 36 -64 => 37 -63 => 38 -62 => 39 -61 => 40 -60 => 41 -59 => 42 -58 => 43 -57 => 44 -56 => 45 -55 => 46 -54 => 47 -53 => 48 -52 => 49 -51 => 50 -50 => 51 -49 => 52 -48 => 53 -47 => 54 -46 => 55 -45 => 56 -44 => 57 -43 => 58 -42 => 59 -41 => 60 -40 => 61 -39 => 62 -38 => 63 -37 => 64 -36 => 65 -35 => 66 -34 => 67 -33 => 68 -32 => 69 -31 => 70 -30 => 71 -29 => 72 -28 => 73 -27 => 74 -26 => 75 -25 => 76 -24 => 77 -23 => 78 -22 => 79 -21 => 80 -20 => 81 -19 => 82 -18 => 83 -17 => 84 -16 => 85 -15 => 86 -14 => 87 -13 => 88 -12 => 89 -11 => 90 -10 => 91 -9 => 92 -8 => 93 -7 => 94 -6 => 95 -5 => 96 -4 => 97 -3 => 98 -2 => 99 -1 => 100 +99 => 1 +98 => 2 +97 => 3 +96 => 4 +95 => 5 +94 => 6 +93 => 7 +92 => 8 +91 => 9 +90 => 10 +89 => 11 +88 => 12 +87 => 13 +86 => 14 +85 => 15 +84 => 16 +83 => 17 +82 => 18 +81 => 19 +80 => 20 +79 => 21 +78 => 22 +77 => 23 +76 => 24 +75 => 25 +74 => 26 +73 => 27 +72 => 28 +71 => 29 +70 => 30 +69 => 31 +68 => 32 +67 => 33 +66 => 34 +65 => 35 +64 => 36 +63 => 37 +62 => 38 +61 => 39 +60 => 40 +59 => 41 +58 => 42 +57 => 43 +56 => 44 +55 => 45 +54 => 46 +53 => 47 +52 => 48 +51 => 49 +50 => 50 +49 => 51 +48 => 52 +47 => 53 +46 => 54 +45 => 55 +44 => 56 +43 => 57 +42 => 58 +41 => 59 +40 => 60 +39 => 61 +38 => 62 +37 => 63 +36 => 64 +35 => 65 +34 => 66 +33 => 67 +32 => 68 +31 => 69 +30 => 70 +29 => 71 +28 => 72 +27 => 73 +26 => 74 +25 => 75 +24 => 76 +23 => 77 +22 => 78 +21 => 79 +20 => 80 +19 => 81 +18 => 82 +17 => 83 +16 => 84 +15 => 85 +14 => 86 +13 => 87 +12 => 88 +11 => 89 +10 => 90 +9 => 91 +8 => 92 +7 => 93 +6 => 94 +5 => 95 +4 => 96 +3 => 97 +2 => 98 +1 => 99 +0 => 100 ===DONE=== diff -Nru php5-5.4.4/ext/spl/tests/heap_006.phpt php5-5.4.9/ext/spl/tests/heap_006.phpt --- php5-5.4.4/ext/spl/tests/heap_006.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/heap_006.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -18,104 +18,104 @@ ===DONE=== --EXPECTF-- -100 => 100 -99 => 99 -98 => 98 -97 => 97 -96 => 96 -95 => 95 -94 => 94 -93 => 93 -92 => 92 -91 => 91 -90 => 90 -89 => 89 -88 => 88 -87 => 87 -86 => 86 -85 => 85 -84 => 84 -83 => 83 -82 => 82 -81 => 81 -80 => 80 -79 => 79 -78 => 78 -77 => 77 -76 => 76 -75 => 75 -74 => 74 -73 => 73 -72 => 72 -71 => 71 -70 => 70 -69 => 69 -68 => 68 -67 => 67 -66 => 66 -65 => 65 -64 => 64 -63 => 63 -62 => 62 -61 => 61 -60 => 60 -59 => 59 -58 => 58 -57 => 57 -56 => 56 -55 => 55 -54 => 54 -53 => 53 -52 => 52 -51 => 51 -50 => 50 -49 => 49 -48 => 48 -47 => 47 -46 => 46 -45 => 45 -44 => 44 -43 => 43 -42 => 42 -41 => 41 -40 => 40 -39 => 39 -38 => 38 -37 => 37 -36 => 36 -35 => 35 -34 => 34 -33 => 33 -32 => 32 -31 => 31 -30 => 30 -29 => 29 -28 => 28 -27 => 27 -26 => 26 -25 => 25 -24 => 24 -23 => 23 -22 => 22 -21 => 21 -20 => 20 -19 => 19 -18 => 18 -17 => 17 -16 => 16 -15 => 15 -14 => 14 -13 => 13 -12 => 12 -11 => 11 -10 => 10 -9 => 9 -8 => 8 -7 => 7 -6 => 6 -5 => 5 -4 => 4 -3 => 3 -2 => 2 -1 => 1 +99 => 100 +98 => 99 +97 => 98 +96 => 97 +95 => 96 +94 => 95 +93 => 94 +92 => 93 +91 => 92 +90 => 91 +89 => 90 +88 => 89 +87 => 88 +86 => 87 +85 => 86 +84 => 85 +83 => 84 +82 => 83 +81 => 82 +80 => 81 +79 => 80 +78 => 79 +77 => 78 +76 => 77 +75 => 76 +74 => 75 +73 => 74 +72 => 73 +71 => 72 +70 => 71 +69 => 70 +68 => 69 +67 => 68 +66 => 67 +65 => 66 +64 => 65 +63 => 64 +62 => 63 +61 => 62 +60 => 61 +59 => 60 +58 => 59 +57 => 58 +56 => 57 +55 => 56 +54 => 55 +53 => 54 +52 => 53 +51 => 52 +50 => 51 +49 => 50 +48 => 49 +47 => 48 +46 => 47 +45 => 46 +44 => 45 +43 => 44 +42 => 43 +41 => 42 +40 => 41 +39 => 40 +38 => 39 +37 => 38 +36 => 37 +35 => 36 +34 => 35 +33 => 34 +32 => 33 +31 => 32 +30 => 31 +29 => 30 +28 => 29 +27 => 28 +26 => 27 +25 => 26 +24 => 25 +23 => 24 +22 => 23 +21 => 22 +20 => 21 +19 => 20 +18 => 19 +17 => 18 +16 => 17 +15 => 16 +14 => 15 +13 => 14 +12 => 13 +11 => 12 +10 => 11 +9 => 10 +8 => 9 +7 => 8 +6 => 7 +5 => 6 +4 => 5 +3 => 4 +2 => 3 +1 => 2 +0 => 1 ===DONE=== diff -Nru php5-5.4.4/ext/spl/tests/iterator_044.phpt php5-5.4.9/ext/spl/tests/iterator_044.phpt --- php5-5.4.4/ext/spl/tests/iterator_044.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/iterator_044.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -81,7 +81,7 @@ int(0) bool(false) -Notice: Undefined index: 0 in %siterator_044.php on line %d +Notice: Undefined index: 0 in %siterator_044.php on line %d NULL ===1=== object(stdClass)#%d (0) { @@ -97,31 +97,31 @@ } bool(false) -Notice: Undefined index: foo in %siterator_044.php on line %d +Notice: Undefined index: foo in %siterator_044.php on line %d NULL ===3=== NULL bool(false) -Notice: Undefined index: in %siterator_044.php on line %d +Notice: Undefined index: in %siterator_044.php on line %d NULL ===4=== int(2) bool(false) -Notice: Undefined index: 2 in %siterator_044.php on line %d +Notice: Undefined index: 2 in %siterator_044.php on line %d NULL ===5=== string(3) "foo" bool(false) -Notice: Undefined index: foo in %siterator_044.php on line %d +Notice: Undefined index: foo in %siterator_044.php on line %d NULL ===6=== int(3) bool(false) -Notice: Undefined index: 3 in %siterator_044.php on line %d +Notice: Undefined index: 3 in %siterator_044.php on line %d NULL ===FILL=== ===0=== @@ -146,7 +146,7 @@ NULL bool(false) -Notice: Undefined index: in %siterator_044.php on line %d +Notice: Undefined index: in %siterator_044.php on line %d NULL ===4=== int(2) @@ -160,6 +160,6 @@ int(3) bool(false) -Notice: Undefined index: 3 in %siterator_044.php on line %d +Notice: Undefined index: 3 in %siterator_044.php on line %d NULL ===DONE=== diff -Nru php5-5.4.4/ext/spl/tests/pqueue_001.phpt php5-5.4.9/ext/spl/tests/pqueue_001.phpt --- php5-5.4.4/ext/spl/tests/pqueue_001.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/spl/tests/pqueue_001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -63,34 +63,34 @@ --EXPECTF-- Exception: Can't extract from an empty heap -3=>b -2=>a -1=>c +2=>b +1=>a +0=>c EXTR_BOTH -3=>Array +2=>Array ( [data] => b [priority] => 2 ) -2=>Array +1=>Array ( [data] => a [priority] => 1 ) -1=>Array +0=>Array ( [data] => c [priority] => 0 ) EXTR_DATA -3=>b -2=>a -1=>c +2=>b +1=>a +0=>c EXTR_PRIORITY -3=>2 -2=>1 -1=>0 +2=>2 +1=>1 +0=>0 ===DONE=== diff -Nru php5-5.4.4/ext/sqlite3/libsqlite/sqlite3.c php5-5.4.9/ext/sqlite3/libsqlite/sqlite3.c --- php5-5.4.4/ext/sqlite3/libsqlite/sqlite3.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/sqlite3/libsqlite/sqlite3.c 2012-11-21 05:12:20.000000000 +0000 @@ -23307,7 +23307,7 @@ sqlite3_mutex_leave(pNode->mutex); } else { - /* Error occured. Free our link object. */ + /* Error occurred. Free our link object. */ sqlite3_free(pLink); } @@ -28994,7 +28994,7 @@ unixEnterMutex(); rc = findInodeInfo(pNew, &pNew->pInode); if( rc!=SQLITE_OK ){ - /* If an error occured in findInodeInfo(), close the file descriptor + /* If an error occurred in findInodeInfo(), close the file descriptor ** immediately, before releasing the mutex. findInodeInfo() may fail ** in two scenarios: ** @@ -32173,7 +32173,7 @@ ** containing the lower 32-bits of the new file-offset. Or, if it fails, ** it returns INVALID_SET_FILE_POINTER. However according to MSDN, ** INVALID_SET_FILE_POINTER may also be a valid new offset. So to determine - ** whether an error has actually occured, it is also necessary to call + ** whether an error has actually occurred, it is also necessary to call ** GetLastError(). */ dwRet = SetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN); @@ -32273,7 +32273,7 @@ int amt, /* Number of bytes to write */ sqlite3_int64 offset /* Offset into the file to begin writing at */ ){ - int rc; /* True if error has occured, else false */ + int rc; /* True if error has occurred, else false */ winFile *pFile = (winFile*)id; /* File handle */ assert( amt>0 ); @@ -37068,7 +37068,7 @@ ** * A write transaction is active. ** * An EXCLUSIVE or greater lock is held on the database file. ** * All writing and syncing of journal and database data has finished. -** If no error occured, all that remains is to finalize the journal to +** If no error occurred, all that remains is to finalize the journal to ** commit the transaction. If an error did occur, the caller will need ** to rollback the transaction. ** @@ -54279,7 +54279,7 @@ insertCell(pPage, idx, newCell, szNew, 0, 0, &rc); assert( rc!=SQLITE_OK || pPage->nCell>0 || pPage->nOverflow>0 ); - /* If no error has occured and pPage has an overflow cell, call balance() + /* If no error has occurred and pPage has an overflow cell, call balance() ** to redistribute the cells within the tree. Since balance() may move ** the cursor, zero the BtCursor.info.nSize and BtCursor.validNKey ** variables. @@ -57935,7 +57935,7 @@ } sqlite3DbFree(v->db, sIter.apSub); - /* Return true if hasAbort==mayAbort. Or if a malloc failure occured. + /* Return true if hasAbort==mayAbort. Or if a malloc failure occurred. ** If malloc failed, then the while() loop above may not have iterated ** through all opcodes and hasAbort may be set incorrectly. Return ** true for this case to prevent the assert() in the callers frame @@ -59562,7 +59562,7 @@ /* If p->iStatement is greater than zero, then this Vdbe opened a ** statement transaction that should be closed here. The only exception - ** is that an IO error may have occured, causing an emergency rollback. + ** is that an IO error may have occurred, causing an emergency rollback. ** In this case (db->nStatement==0), and there is nothing to do. */ if( db->nStatement && p->iStatement ){ @@ -59697,7 +59697,7 @@ ** ** Even if the statement is read-only, it is important to perform ** a statement or transaction rollback operation. If the error - ** occured while writing to the journal, sub-journal or database + ** occurred while writing to the journal, sub-journal or database ** file as part of an effort to free up cache space (see function ** pagerStress() in pager.c), the rollback is required to restore ** the pager to a consistent state. @@ -61245,7 +61245,7 @@ assert( p->rc!=SQLITE_ROW && p->rc!=SQLITE_DONE ); if( p->isPrepareV2 && rc!=SQLITE_ROW && rc!=SQLITE_DONE ){ /* If this statement was prepared using sqlite3_prepare_v2(), and an - ** error has occured, then return the error code in p->rc to the + ** error has occurred, then return the error code in p->rc to the ** caller. Set the error code in the database handle to the same value. */ rc = db->errCode = p->rc; @@ -113286,7 +113286,7 @@ }else{ int rc = sqlite3_reset(pCsr->pStmt); if( rc==SQLITE_OK ){ - /* If no row was found and no error has occured, then the %_content + /* If no row was found and no error has occurred, then the %_content ** table is missing a row that is present in the full-text index. ** The data structures are corrupt. */ diff -Nru php5-5.4.4/ext/sqlite3/sqlite3.c php5-5.4.9/ext/sqlite3/sqlite3.c --- php5-5.4.4/ext/sqlite3/sqlite3.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/sqlite3/sqlite3.c 2012-11-21 05:12:20.000000000 +0000 @@ -114,7 +114,10 @@ zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC); } - if (strncmp(filename, ":memory:", 8) != 0) { + if (strlen(filename) != filename_len) { + return; + } + if (memcmp(filename, ":memory:", sizeof(":memory:")) != 0) { if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unable to expand filepath", 0 TSRMLS_CC); return; @@ -1094,7 +1097,7 @@ php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract; if (sqlite3_blob_close(sqlite3_stream->blob) != SQLITE_OK) { - /* Error occured, but it still closed */ + /* Error occurred, but it still closed */ } efree(sqlite3_stream); @@ -1959,7 +1962,7 @@ switch (access_type) { case SQLITE_ATTACH: { - if (strncmp(arg3, ":memory:", sizeof(":memory:")-1) && *arg3) { + if (memcmp(arg3, ":memory:", sizeof(":memory:")) && *arg3) { TSRMLS_FETCH(); #if PHP_API_VERSION < 20100412 diff -Nru php5-5.4.4/ext/standard/assert.c php5-5.4.9/ext/standard/assert.c --- php5-5.4.4/ext/standard/assert.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/assert.c 2012-11-21 05:12:20.000000000 +0000 @@ -136,20 +136,20 @@ } /* }}} */ -/* {{{ proto int assert(string|bool assertion) +/* {{{ proto int assert(string|bool assertion[, string description]) Checks if assertion is false */ PHP_FUNCTION(assert) { zval **assertion; - int val; + int val, description_len = 0; char *myeval = NULL; - char *compiled_string_description; + char *compiled_string_description, *description = NULL; if (! ASSERTG(active)) { RETURN_TRUE; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &assertion) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|s", &assertion, &description, &description_len) == FAILURE) { return; } @@ -167,7 +167,11 @@ compiled_string_description = zend_make_compiled_string_description("assert code" TSRMLS_CC); if (zend_eval_stringl(myeval, Z_STRLEN_PP(assertion), &retval, compiled_string_description TSRMLS_CC) == FAILURE) { efree(compiled_string_description); - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval); + if (description_len == 0) { + php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval); + } else { + php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s:\"%s\"", PHP_EOL, description, myeval); + } if (ASSERTG(bail)) { zend_bailout(); } @@ -196,7 +200,7 @@ } if (ASSERTG(callback)) { - zval *args[3]; + zval **args = safe_emalloc(description_len == 0 ? 3 : 4, sizeof(zval **), 0); zval *retval; int i; uint lineno = zend_get_executed_lineno(TSRMLS_C); @@ -214,19 +218,38 @@ ZVAL_FALSE(retval); /* XXX do we want to check for error here? */ - call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 3, args TSRMLS_CC); + if (description_len == 0) { + call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 3, args TSRMLS_CC); + for (i = 0; i <= 2; i++) { + zval_ptr_dtor(&(args[i])); + } + } else { + MAKE_STD_ZVAL(args[3]); + ZVAL_STRINGL(args[3], SAFE_STRING(description), description_len, 1); - for (i = 0; i <= 2; i++) { - zval_ptr_dtor(&(args[i])); + call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 4, args TSRMLS_CC); + for (i = 0; i <= 3; i++) { + zval_ptr_dtor(&(args[i])); + } } + + efree(args); zval_ptr_dtor(&retval); } if (ASSERTG(warning)) { - if (myeval) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval); + if (description_len == 0) { + if (myeval) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval); + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed"); + } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed"); + if (myeval) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: \"%s\" failed", description, myeval); + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s failed", description); + } } } @@ -321,3 +344,4 @@ * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ + diff -Nru php5-5.4.4/ext/standard/base64.c php5-5.4.9/ext/standard/base64.c --- php5-5.4.4/ext/standard/base64.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/base64.c 2012-11-21 05:12:20.000000000 +0000 @@ -59,14 +59,14 @@ unsigned char *p; unsigned char *result; - if ((length + 2) < 0 || ((length + 2) / 3) >= (1 << (sizeof(int) * 8 - 2))) { + if (length < 0) { if (ret_length != NULL) { *ret_length = 0; } return NULL; } - result = (unsigned char *)safe_emalloc(((length + 2) / 3) * 4, sizeof(char), 1); + result = (unsigned char *) safe_emalloc((length + 2) / 3, 4 * sizeof(char), 1); p = result; while (length > 2) { /* keep going until we have less than 24 bits */ diff -Nru php5-5.4.4/ext/standard/basic_functions.c php5-5.4.9/ext/standard/basic_functions.c --- php5-5.4.4/ext/standard/basic_functions.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/basic_functions.c 2012-11-21 05:12:20.000000000 +0000 @@ -3684,6 +3684,11 @@ PHP_RINIT_FUNCTION(basic) /* {{{ */ { memset(BG(strtok_table), 0, 256); + + BG(serialize_lock) = 0; + memset(&BG(serialize), 0, sizeof(BG(serialize))); + memset(&BG(unserialize), 0, sizeof(BG(unserialize))); + BG(strtok_string) = NULL; BG(strtok_zval) = NULL; BG(strtok_last) = NULL; @@ -3719,8 +3724,6 @@ /* Default to global filters only */ FG(stream_filters) = NULL; - FG(wrapper_errors) = NULL; - return SUCCESS; } /* }}} */ @@ -3833,7 +3836,7 @@ } if (!inet_ntop(af, address, buffer, sizeof(buffer))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occured"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred"); RETURN_FALSE; } @@ -5045,8 +5048,11 @@ zend_hash_destroy(BG(user_shutdown_function_names)); FREE_HASHTABLE(BG(user_shutdown_function_names)); BG(user_shutdown_function_names) = NULL; - } - zend_end_try(); + } zend_catch { + /* maybe shutdown method call exit, we just ignore it */ + FREE_HASHTABLE(BG(user_shutdown_function_names)); + BG(user_shutdown_function_names) = NULL; + } zend_end_try(); } /* }}} */ diff -Nru php5-5.4.4/ext/standard/browscap.c php5-5.4.9/ext/standard/browscap.c --- php5-5.4.4/ext/standard/browscap.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/browscap.c 2012-11-21 05:12:20.000000000 +0000 @@ -43,7 +43,7 @@ browser_data activation_bdata; ZEND_END_MODULE_GLOBALS(browscap) -ZEND_DECLARE_MODULE_GLOBALS(browscap); +ZEND_DECLARE_MODULE_GLOBALS(browscap) #ifdef ZTS #define BROWSCAP_G(v) TSRMG(browscap_globals_id, zend_browscap_globals *, v) diff -Nru php5-5.4.4/ext/standard/crypt.c php5-5.4.9/ext/standard/crypt.c --- php5-5.4.4/ext/standard/crypt.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/crypt.c 2012-11-21 05:12:20.000000000 +0000 @@ -199,7 +199,7 @@ char *output; int needed = (sizeof(sha512_salt_prefix) - 1 + sizeof(sha512_rounds_prefix) + 9 + 1 - + strlen(salt) + 1 + 43 + 1); + + salt_in_len + 1 + 86 + 1); output = emalloc(needed); salt[salt_in_len] = '\0'; @@ -214,7 +214,7 @@ RETVAL_STRING(output, 1); } - memset(output, 0, PHP_MAX_SALT_LEN + 1); + memset(output, 0, needed); efree(output); } else if (salt[0]=='$' && salt[1]=='5' && salt[2]=='$') { const char sha256_salt_prefix[] = "$5$"; @@ -222,7 +222,7 @@ char *output; int needed = (sizeof(sha256_salt_prefix) - 1 + sizeof(sha256_rounds_prefix) + 9 + 1 - + strlen(salt) + 1 + 43 + 1); + + salt_in_len + 1 + 43 + 1); output = emalloc(needed); salt[salt_in_len] = '\0'; @@ -237,7 +237,7 @@ RETVAL_STRING(output, 1); } - memset(output, 0, PHP_MAX_SALT_LEN + 1); + memset(output, 0, needed); efree(output); } else if ( salt[0] == '$' && diff -Nru php5-5.4.4/ext/standard/file.c php5-5.4.9/ext/standard/file.c --- php5-5.4.4/ext/standard/file.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/file.c 2012-11-21 05:12:20.000000000 +0000 @@ -161,6 +161,7 @@ FG(pclose_ret) = 0; FG(user_stream_current_filename) = NULL; FG(def_chunk_size) = PHP_SOCK_CHUNK_SIZE; + FG(wrapper_errors) = NULL; } static void file_globals_dtor(php_file_globals *file_globals_p TSRMLS_DC) diff -Nru php5-5.4.4/ext/standard/incomplete_class.c php5-5.4.9/ext/standard/incomplete_class.c --- php5-5.4.4/ext/standard/incomplete_class.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/incomplete_class.c 2012-11-21 05:12:20.000000000 +0000 @@ -109,6 +109,8 @@ value = zend_objects_new(&object, class_type TSRMLS_CC); value.handlers = &php_incomplete_object_handlers; + object_properties_init(object, class_type); + return value; } diff -Nru php5-5.4.4/ext/standard/mail.c php5-5.4.9/ext/standard/mail.c --- php5-5.4.4/ext/standard/mail.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/mail.c 2012-11-21 05:12:20.000000000 +0000 @@ -39,6 +39,7 @@ #endif #endif +#include "php_syslog.h" #include "php_mail.h" #include "php_ini.h" #include "php_string.h" @@ -189,6 +190,37 @@ } /* }}} */ + +void php_mail_log_crlf_to_spaces(char *message) { + /* Find all instances of carriage returns or line feeds and + * replace them with spaces. Thus, a log line is always one line + * long + */ + char *p = message; + while ((p = strpbrk(p, "\r\n"))) { + *p = ' '; + } +} + +void php_mail_log_to_syslog(char *message) { + /* Write 'message' to syslog. */ +#ifdef HAVE_SYSLOG_H + php_syslog(LOG_NOTICE, "%s", message); +#endif +} + + +void php_mail_log_to_file(char *filename, char *message, size_t message_size TSRMLS_DC) { + /* Write 'message' to the given file. */ + uint flags = IGNORE_URL_WIN | REPORT_ERRORS | STREAM_DISABLE_OPEN_BASEDIR; + php_stream *stream = php_stream_open_wrapper(filename, "a", flags, NULL); + if (stream) { + php_stream_write(stream, message, message_size); + php_stream_close(stream); + } +} + + /* {{{ php_mail */ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC) @@ -216,19 +248,22 @@ if (mail_log && *mail_log) { char *tmp; int l = spprintf(&tmp, 0, "mail() on [%s:%d]: To: %s -- Headers: %s\n", zend_get_executed_filename(TSRMLS_C), zend_get_executed_lineno(TSRMLS_C), to, hdr ? hdr : ""); - php_stream *stream = php_stream_open_wrapper(mail_log, "a", IGNORE_URL_WIN | REPORT_ERRORS | STREAM_DISABLE_OPEN_BASEDIR, NULL); - if (hdr) { /* find all \r\n instances and replace them with spaces, so a log line is always one line long */ - char *p = tmp; - while ((p = strpbrk(p, "\r\n"))) { - *p = ' '; - } - tmp[l - 1] = '\n'; + if (hdr) { + php_mail_log_crlf_to_spaces(tmp); } - if (stream) { - php_stream_write(stream, tmp, l); - php_stream_close(stream); + + if (!strcmp(mail_log, "syslog")) { + /* Drop the final space when logging to syslog. */ + tmp[l - 1] = 0; + php_mail_log_to_syslog(tmp); + } + else { + /* Convert the final space to a newline when logging to file. */ + tmp[l - 1] = '\n'; + php_mail_log_to_file(mail_log, tmp, l TSRMLS_CC); } + efree(tmp); } if (PG(mail_x_header)) { diff -Nru php5-5.4.4/ext/standard/math.c php5-5.4.9/ext/standard/math.c --- php5-5.4.4/ext/standard/math.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/math.c 2012-11-21 05:12:20.000000000 +0000 @@ -1097,7 +1097,9 @@ return _php_math_number_format_ex(d, dec, &dec_point, 1, &thousand_sep, 1); } -PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point, size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len) +static char *_php_math_number_format_ex_len(double d, int dec, char *dec_point, + size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len, + int *result_len) { char *tmpbuf = NULL, *resbuf; char *s, *t; /* source, target */ @@ -1118,6 +1120,10 @@ tmplen = spprintf(&tmpbuf, 0, "%.*F", dec, d); if (tmpbuf == NULL || !isdigit((int)tmpbuf[0])) { + if (result_len) { + *result_len = tmplen; + } + return tmpbuf; } @@ -1205,8 +1211,19 @@ efree(tmpbuf); + if (result_len) { + *result_len = reslen; + } + return resbuf; } + +PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point, + size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len) +{ + return _php_math_number_format_ex_len(d, dec, dec_point, dec_point_len, + thousand_sep, thousand_sep_len, NULL); +} /* }}} */ /* {{{ proto string number_format(float number [, int num_decimal_places [, string dec_seperator, string thousands_seperator]]) @@ -1241,7 +1258,10 @@ thousand_sep_len = 1; } - RETURN_STRING(_php_math_number_format_ex(num, dec, dec_point, dec_point_len, thousand_sep, thousand_sep_len), 0); + Z_TYPE_P(return_value) = IS_STRING; + Z_STRVAL_P(return_value) = _php_math_number_format_ex_len(num, dec, + dec_point, dec_point_len, thousand_sep, thousand_sep_len, + &Z_STRLEN_P(return_value)); break; default: WRONG_PARAM_COUNT; diff -Nru php5-5.4.4/ext/standard/proc_open.c php5-5.4.9/ext/standard/proc_open.c --- php5-5.4.4/ext/standard/proc_open.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/proc_open.c 2012-11-21 05:12:20.000000000 +0000 @@ -56,7 +56,7 @@ /* This symbol is defined in ext/standard/config.m4. * Essentially, it is set if you HAVE_FORK || PHP_WIN32 - * Otherplatforms may modify that configure check and add suitable #ifdefs + * Other platforms may modify that configure check and add suitable #ifdefs * around the alternate code. * */ #ifdef PHP_CAN_SUPPORT_PROC_OPEN diff -Nru php5-5.4.4/ext/standard/quot_print.c php5-5.4.9/ext/standard/quot_print.c --- php5-5.4.4/ext/standard/quot_print.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/quot_print.c 2012-11-21 05:12:20.000000000 +0000 @@ -162,7 +162,10 @@ lp = 0; } else { if (iscntrl (c) || (c == 0x7f) || (c & 0x80) || (c == '=') || ((c == ' ') && (*str == '\015'))) { - if ((lp += 3) > PHP_QPRINT_MAXL) { + if ((((lp+= 3) > PHP_QPRINT_MAXL) && (c <= 0x7f)) + || ((c > 0x7f) && (c <= 0xdf) && ((lp + 3) > PHP_QPRINT_MAXL)) + || ((c > 0xdf) && (c <= 0xef) && ((lp + 6) > PHP_QPRINT_MAXL)) + || ((c > 0xef) && (c <= 0xf4) && ((lp + 9) > PHP_QPRINT_MAXL))) { *d++ = '='; *d++ = '\015'; *d++ = '\012'; @@ -283,4 +286,4 @@ * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 - */ + */ \ No newline at end of file diff -Nru php5-5.4.4/ext/standard/string.c php5-5.4.9/ext/standard/string.c --- php5-5.4.4/ext/standard/string.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/string.c 2012-11-21 05:12:20.000000000 +0000 @@ -131,8 +131,8 @@ register unsigned char *result = NULL; size_t i, j; - result = (unsigned char *) safe_emalloc(oldlen * 2, sizeof(char), 1); - + result = (unsigned char *) safe_emalloc(oldlen, 2 * sizeof(char), 1); + for (i = j = 0; i < oldlen; i++) { result[j++] = hexconvtab[old[i] >> 4]; result[j++] = hexconvtab[old[i] & 15]; @@ -3930,7 +3930,6 @@ new_char_count--; } if (new_char_count > 0) { - char_count=new_char_count; begin=new_begin; } } @@ -4029,13 +4028,12 @@ RETURN_STRINGL(str, str_len, 1); } - if (is_xhtml) { - new_length = str_len + repl_cnt * (sizeof("
") - 1); - } else { - new_length = str_len + repl_cnt * (sizeof("
") - 1); - } + { + size_t repl_len = is_xhtml ? (sizeof("
") - 1) : (sizeof("
") - 1); - tmp = target = emalloc(new_length + 1); + new_length = str_len + repl_cnt * repl_len; + tmp = target = safe_emalloc(repl_cnt, repl_len, str_len + 1); + } while (str < end) { switch (*str) { diff -Nru php5-5.4.4/ext/standard/tests/assert/assert04.phpt php5-5.4.9/ext/standard/tests/assert/assert04.phpt --- php5-5.4.4/ext/standard/tests/assert/assert04.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/assert/assert04.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -15,7 +15,7 @@ /* Wrong parameter count in assert */ assert_options(ASSERT_ACTIVE, 1); -assert(2,3); +assert(2, "failure", 3); /* Wrong parameter count in assert_options */ assert_options(ASSERT_ACTIVE, 0, 2); @@ -36,7 +36,7 @@ ?> --EXPECTF-- -Warning: assert() expects exactly 1 parameter, 2 given in %s on line %d +Warning: assert() expects at most 2 parameters, 3 given in %s on line %d Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d @@ -45,3 +45,4 @@ Warning: assert(): Assertion failed in %s on line %d Warning: assert(): Assertion failed in %s on line %d + diff -Nru php5-5.4.4/ext/standard/tests/assert/assert_basic6.phpt php5-5.4.9/ext/standard/tests/assert/assert_basic6.phpt --- php5-5.4.4/ext/standard/tests/assert/assert_basic6.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/assert/assert_basic6.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,26 @@ +--TEST-- +assert() - basic - Test that bailout works +--INI-- +assert.active = 1 +assert.warning = 1 +assert.callback = f1 +assert.quiet_eval = 1 +assert.bail = 0 +--FILE-- + - %s(%d) + %s(%f) ["is_dir"]=> bool(true) ["realpath"]=> Binary files /tmp/osuZiLfdeF/php5-5.4.4/ext/standard/tests/file/rename_variation13-win32.phpt and /tmp/lB71aGvwfy/php5-5.4.9/ext/standard/tests/file/rename_variation13-win32.phpt differ diff -Nru php5-5.4.4/ext/standard/tests/file/tempnam_variation7-win32.phpt php5-5.4.9/ext/standard/tests/file/tempnam_variation7-win32.phpt --- php5-5.4.4/ext/standard/tests/file/tempnam_variation7-win32.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/file/tempnam_variation7-win32.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -93,13 +93,13 @@ Warning: tempnam() expects parameter 1 to be a valid path, string given in %stempnam_variation7-win32.php on line %d -- File is not created -- -Warning: unlink(): Invalid argument in %s on line %d +Warning: unlink(): %r(Invalid argument|No such file or directory)%r in %s on line %d -- Iteration 7 -- Warning: tempnam() expects parameter 1 to be a valid path, array given in %s on line %d -- File is not created -- -Warning: unlink(): Invalid argument in %s on line %d +Warning: unlink(): %r(Invalid argument|No such file or directory)%r in %s on line %d -- Iteration 8 -- File name is => %s%et%s File permissions are => 100666 diff -Nru php5-5.4.4/ext/standard/tests/file/umask_basic.phpt php5-5.4.9/ext/standard/tests/file/umask_basic.phpt --- php5-5.4.4/ext/standard/tests/file/umask_basic.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/file/umask_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -20,7 +20,7 @@ var_dump( umask() ); echo "\n"; if ($mask != umask()) { - die('An error occured while changing back the umask'); + die('An error occurred while changing back the umask'); } } diff -Nru php5-5.4.4/ext/standard/tests/general_functions/bug27678.phpt php5-5.4.9/ext/standard/tests/general_functions/bug27678.phpt --- php5-5.4.4/ext/standard/tests/general_functions/bug27678.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/general_functions/bug27678.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -6,9 +6,11 @@ number_format(1e80, 0, '', ' '); number_format(1e300, 0, '', ' '); number_format(1e320, 0, '', ' '); -number_format(1e1000, 0, '', ' '); +$num = number_format(1e1000, 0, '', ' '); +var_dump(strlen($num) == 3); // $num == 'inf' echo "Done\n"; ?> --EXPECT-- +bool(true) Done diff -Nru php5-5.4.4/ext/standard/tests/general_functions/bug60723.phpt php5-5.4.9/ext/standard/tests/general_functions/bug60723.phpt --- php5-5.4.4/ext/standard/tests/general_functions/bug60723.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/general_functions/bug60723.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,19 @@ +--TEST-- +Bug #60723 (error_log error time has changed to UTC ignoring default timezo) +--INI-- +date.timezone=ASIA/Chongqing +log_errors=On +--FILE-- + +--EXPECTF-- +Notice: Undefined variable: aa in %sbug60723.php on line %d +[%s ASIA/Chongqing] PHP Notice: Undefined variable: aa in %sbug60723.php on line %d +[%s ASIA/Chongqing] dummy diff -Nru php5-5.4.4/ext/standard/tests/general_functions/debug_zval_dump_o.phpt php5-5.4.9/ext/standard/tests/general_functions/debug_zval_dump_o.phpt --- php5-5.4.4/ext/standard/tests/general_functions/debug_zval_dump_o.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/general_functions/debug_zval_dump_o.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,5 +1,7 @@ --TEST-- Test debug_zval_dump() function : working on objects +--SKIPIF-- + -===DONE=== ---EXPECTF-- -*** Testing uniqid() : basic functionality *** - -uniqid() without a prefix -string(13) "%s" -string(23) "%s.%s" -string(13) "%s" - - -uniqid() with a prefix -string(18) "99999%s" -string(28) "99999%s.%s" -string(18) "99999%s" - -string(18) "999994%s" -string(28) "999994%s.%s" -string(18) "999994%s" - -string(17) "1050%s" -string(27) "1050%s.%s" -string(17) "1050%s" - -string(13) "%s" -string(23) "%s.%s" -string(13) "%s" - -string(14) "1%s" -string(24) "1%s.%s" -string(14) "1%s" - -string(13) "%s" -string(23) "%s.%s" -string(13) "%s" - -===DONE=== - \ No newline at end of file +--TEST-- +Test uniqid() function : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing uniqid() : basic functionality *** + +uniqid() without a prefix +string(13) "%s" +string(23) "%s.%s" +string(13) "%s" + + +uniqid() with a prefix +string(18) "99999%s" +string(28) "99999%s.%s" +string(18) "99999%s" + +string(18) "99999%s" +string(28) "99999%s.%s" +string(18) "99999%s" + +string(17) "1050%s" +string(27) "1050%s.%s" +string(17) "1050%s" + +string(13) "%s" +string(23) "%s.%s" +string(13) "%s" + +string(14) "1%s" +string(24) "1%s.%s" +string(14) "1%s" + +string(13) "%s" +string(23) "%s.%s" +string(13) "%s" + +===DONE=== diff -Nru php5-5.4.4/ext/standard/tests/general_functions/var_export_error2.phpt php5-5.4.9/ext/standard/tests/general_functions/var_export_error2.phpt --- php5-5.4.4/ext/standard/tests/general_functions/var_export_error2.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/general_functions/var_export_error2.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -15,4 +15,5 @@ ===DONE=== --EXPECTF-- -Fatal error: Nesting level too deep - recursive dependency? in %s on line 9 \ No newline at end of file +Warning: var_export does not handle circular references in %s on line 9 +===DONE=== diff -Nru php5-5.4.4/ext/standard/tests/general_functions/var_export_error3.phpt php5-5.4.9/ext/standard/tests/general_functions/var_export_error3.phpt --- php5-5.4.4/ext/standard/tests/general_functions/var_export_error3.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/general_functions/var_export_error3.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -15,4 +15,5 @@ ===DONE=== --EXPECTF-- -Fatal error: Nesting level too deep - recursive dependency? in %s on line 9 \ No newline at end of file +Warning: var_export does not handle circular references in %s on line 9 +===DONE=== diff -Nru php5-5.4.4/ext/standard/tests/mail/mail_skipif.inc php5-5.4.9/ext/standard/tests/mail/mail_skipif.inc --- php5-5.4.4/ext/standard/tests/mail/mail_skipif.inc 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/mail/mail_skipif.inc 2012-11-21 05:12:20.000000000 +0000 @@ -1,5 +1,15 @@ 10, 'usec' => 10)); + // imap uses tcp port 143 + socket_connect($socket, "localhost", 143) or die ("skip can't socket to mail server"); +} // Change these to make tests run successfully $mailbox = '{localhost}'; Binary files /tmp/osuZiLfdeF/php5-5.4.4/ext/standard/tests/math/bug62112.phpt and /tmp/lB71aGvwfy/php5-5.4.9/ext/standard/tests/math/bug62112.phpt differ diff -Nru php5-5.4.4/ext/standard/tests/network/gethostbyname_basic001.phpt php5-5.4.9/ext/standard/tests/network/gethostbyname_basic001.phpt --- php5-5.4.4/ext/standard/tests/network/gethostbyname_basic001.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/network/gethostbyname_basic001.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -5,6 +5,7 @@ --SKIPIF-- --FILE-- ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) diff -Nru php5-5.4.4/ext/standard/tests/network/gethostbyname_error004.phpt php5-5.4.9/ext/standard/tests/network/gethostbyname_error004.phpt --- php5-5.4.4/ext/standard/tests/network/gethostbyname_error004.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/network/gethostbyname_error004.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -5,6 +5,7 @@ --SKIPIF-- --FILE-- +--EXPECTF-- +Notice: serialize(): "parents" returned as member variable from __sleep() but does not exist in %sbug35895.php on line %d diff -Nru php5-5.4.4/ext/standard/tests/serialize/bug62373.phpt php5-5.4.9/ext/standard/tests/serialize/bug62373.phpt --- php5-5.4.4/ext/standard/tests/serialize/bug62373.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/serialize/bug62373.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,25 @@ +--TEST-- +Bug #62373 (serialize() generates wrong reference to the object) +--FILE-- + +--EXPECT-- +OK diff -Nru php5-5.4.4/ext/standard/tests/serialize/bug62836_1.phpt php5-5.4.9/ext/standard/tests/serialize/bug62836_1.phpt --- php5-5.4.4/ext/standard/tests/serialize/bug62836_1.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/serialize/bug62836_1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,34 @@ +--TEST-- +Bug #62836 (Seg fault or broken object references on unserialize()) +--FILE-- + +--EXPECT-- +A Object +( + [b] => B Object + ( + ) + + [b1] => B Object + ( + ) + + [c] => B Object + ( + ) + + [c1] => B Object + ( + ) + +) +okey diff -Nru php5-5.4.4/ext/standard/tests/serialize/bug62836_2.phpt php5-5.4.9/ext/standard/tests/serialize/bug62836_2.phpt --- php5-5.4.4/ext/standard/tests/serialize/bug62836_2.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/serialize/bug62836_2.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,37 @@ +--TEST-- +Bug #62836 (Seg fault or broken object references on unserialize()) +--FILE-- + +--EXPECT-- +A Object +( + [b] => B Object + ( + ) + + [b1] => B Object + ( + ) + + [c] => B Object + ( + ) + + [c1] => B Object + ( + ) + +) +okey diff -Nru php5-5.4.4/ext/standard/tests/streams/bug40459.phpt php5-5.4.9/ext/standard/tests/streams/bug40459.phpt --- php5-5.4.4/ext/standard/tests/streams/bug40459.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/streams/bug40459.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,103 @@ +--TEST-- +bug 40459 - Test whether the constructor of the user-space stream wrapper is called when stream functions are called +--FILE-- +constructorCalled = true; + } + + function stream_open($path, $mode, $options, &$opened_path) + { + echo $this->constructorCalled ? 'yes' : 'no'; + return true; + } + + function url_stat($url, $flags) + { + echo $this->constructorCalled ? 'yes' : 'no'; + return array(); + } + + function unlink($url) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function rename($from, $to) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function mkdir($dir, $mode, $options) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function rmdir($dir, $options) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function dir_opendir($url, $options) + { + echo $this->constructorCalled ? 'yes' : 'no'; + return TRUE; + } + function stream_metadata() + { + echo $this->constructorCalled ? 'yes' : 'no'; + return TRUE; + } +} + +stream_wrapper_register('test', 'testwrapper', STREAM_IS_URL); + +echo 'stream_open: '; +fopen('test://test', 'r'); +echo "\n"; + +echo 'url_stat: '; +stat('test://test'); +echo "\n"; + +echo 'dir_opendir: '; +opendir('test://test'); +echo "\n"; + +echo 'rmdir: '; +rmdir('test://test'); +echo "\n"; + +echo 'mkdir: '; +mkdir('test://test'); +echo "\n"; + +echo 'rename: '; +rename('test://test', 'test://test2'); +echo "\n"; + +echo 'unlink: '; +unlink('test://test'); +echo "\n"; + +echo 'touch: '; +touch('test://test', time()); +echo "\n"; + + + +?> +==DONE== +--EXPECT-- +stream_open: yes +url_stat: yes +dir_opendir: yes +rmdir: yes +mkdir: yes +rename: yes +unlink: yes +touch: yes +==DONE== diff -Nru php5-5.4.4/ext/standard/tests/streams/bug61115-1.phpt php5-5.4.9/ext/standard/tests/streams/bug61115-1.phpt --- php5-5.4.4/ext/standard/tests/streams/bug61115-1.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/streams/bug61115-1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,5 +1,11 @@ --TEST-- Bug #61115: Stream related segfault on fatal error in php_stream_context_del_link - variation 1 +--SKIPIF-- + --FILE-- +--EXPECT-- +int(8191) +string(4) "rest" diff -Nru php5-5.4.4/ext/standard/tests/strings/bug62443.phpt php5-5.4.9/ext/standard/tests/strings/bug62443.phpt --- php5-5.4.4/ext/standard/tests/strings/bug62443.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/strings/bug62443.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,9 @@ +--TEST-- +Bug #62443 Crypt SHA256/512 Segfaults With Malformed Salt +--FILE-- + + +==DONE== +--EXPECT-- +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85= +=C4=85=C4=85=C4=85=C4=85=C4=85 +==DONE== diff -Nru php5-5.4.4/ext/standard/tests/strings/http_build_query_error.phpt php5-5.4.9/ext/standard/tests/strings/http_build_query_error.phpt --- php5-5.4.4/ext/standard/tests/strings/http_build_query_error.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/strings/http_build_query_error.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,13 @@ +--TEST-- +Testing error on null parameter 1 of http_build_query() +--CREDITS-- +Pawel Krynicki +#testfest AmsterdamPHP 2012-06-23 +--FILE-- + +--EXPECTF-- +Warning: http_build_query(): Parameter 1 expected to be Array or Object. %s value given in %s on line %d \ No newline at end of file diff -Nru php5-5.4.4/ext/standard/tests/strings/http_build_query_variation1.phpt php5-5.4.9/ext/standard/tests/strings/http_build_query_variation1.phpt --- php5-5.4.4/ext/standard/tests/strings/http_build_query_variation1.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/strings/http_build_query_variation1.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,30 @@ +--TEST-- +Test http_build_query() function: usage variations - first arguments as object +--CREDITS-- +Adam Gegotek +--FILE-- +name = 'homepage'; +$obj->page = 1; +$obj->sort = 'desc,name'; + +echo http_build_query($obj) . PHP_EOL; +echo http_build_query(new UrlBuilder()); +?> +--EXPECTF-- +name=homepage&page=1&sort=desc%2Cname +name=homepage&page=1 diff -Nru php5-5.4.4/ext/standard/tests/strings/http_build_query_variation2.phpt php5-5.4.9/ext/standard/tests/strings/http_build_query_variation2.phpt --- php5-5.4.4/ext/standard/tests/strings/http_build_query_variation2.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/strings/http_build_query_variation2.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,39 @@ +--TEST-- +Test http_build_query() function: usage variations - first arguments as multidimensional array and second argument present/not present +--CREDITS-- +Adam Gegotek +--FILE-- + 13, + "9" => array( + 1 => "val1", + 3 => "val2", + "string" => "string" + ), + "name" => "homepage", + "page" => 10, + "sort" => array( + "desc", + "admin" => array( + "admin1", + "admin2" => array( + "who" => "admin2", + 2 => "test" + ) + ) + ) +); + +echo http_build_query($mDimensional) . PHP_EOL; +echo http_build_query($mDimensional, 'prefix_'); +?> +--EXPECTF-- +0=20&5=13&9%5B1%5D=val1&9%5B3%5D=val2&9%5Bstring%5D=string&name=homepage&page=10&sort%5B0%5D=desc&sort%5Badmin%5D%5B0%5D=admin1&sort%5Badmin%5D%5Badmin2%5D%5Bwho%5D=admin2&sort%5Badmin%5D%5Badmin2%5D%5B2%5D=test +prefix_0=20&prefix_5=13&prefix_9%5B1%5D=val1&prefix_9%5B3%5D=val2&prefix_9%5Bstring%5D=string&name=homepage&page=10&sort%5B0%5D=desc&sort%5Badmin%5D%5B0%5D=admin1&sort%5Badmin%5D%5Badmin2%5D%5Bwho%5D=admin2&sort%5Badmin%5D%5Badmin2%5D%5B2%5D=test diff -Nru php5-5.4.4/ext/standard/tests/strings/http_build_query_variation3.phpt php5-5.4.9/ext/standard/tests/strings/http_build_query_variation3.phpt --- php5-5.4.4/ext/standard/tests/strings/http_build_query_variation3.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/strings/http_build_query_variation3.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,27 @@ +--TEST-- +Test http_build_query() function: usage variations - testing four parameter added in PHP 5.4.0 +--CREDITS-- +Adam Gegotek +--SKIPIF-- + +--FILE-- + "main page", + "sort" => "desc,admin", + "equation" => "10 + 10 - 5" +); + +echo http_build_query($oDimensional, '', ini_get('arg_separator.output'), PHP_QUERY_RFC1738) . PHP_EOL; +echo http_build_query($oDimensional, '', ini_get('arg_separator.output'), PHP_QUERY_RFC3986); +?> +--EXPECTF-- +name=main+page&sort=desc%2Cadmin&equation=10+%2B+10+-+5 +name=main%20page&sort=desc%2Cadmin&equation=10%20%2B%2010%20-%205 Binary files /tmp/osuZiLfdeF/php5-5.4.4/ext/standard/tests/strings/quoted_printable_encode_002.phpt and /tmp/lB71aGvwfy/php5-5.4.9/ext/standard/tests/strings/quoted_printable_encode_002.phpt differ diff -Nru php5-5.4.4/ext/standard/tests/strings/str_pad_variation5.phpt php5-5.4.9/ext/standard/tests/strings/str_pad_variation5.phpt --- php5-5.4.4/ext/standard/tests/strings/str_pad_variation5.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/strings/str_pad_variation5.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -5,6 +5,9 @@ --SKIPIF-- --FILE-- http://user:pass@host +[1]=> //user:pass@host +[2]=> //user@host +--FILE-- + +--EXPECT-- +array(4) { + ["scheme"]=> + string(4) "http" + ["host"]=> + string(4) "host" + ["user"]=> + string(4) "user" + ["pass"]=> + string(4) "pass" +} +array(3) { + ["host"]=> + string(4) "host" + ["user"]=> + string(4) "user" + ["pass"]=> + string(4) "pass" +} +array(2) { + ["host"]=> + string(4) "host" + ["user"]=> + string(4) "user" +} diff -Nru php5-5.4.4/ext/standard/tests/url/parse_url_relative_scheme.phpt php5-5.4.9/ext/standard/tests/url/parse_url_relative_scheme.phpt --- php5-5.4.4/ext/standard/tests/url/parse_url_relative_scheme.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/url/parse_url_relative_scheme.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,11 @@ +--TEST-- +Test parse_url() function: Checks relative URL schemes (e.g. "//example.com") +--FILE-- + + string(11) "example.org" +} + diff -Nru php5-5.4.4/ext/standard/tests/zend_logo_guid.phpt php5-5.4.9/ext/standard/tests/zend_logo_guid.phpt --- php5-5.4.4/ext/standard/tests/zend_logo_guid.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/tests/zend_logo_guid.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,5 +1,5 @@ --TEST-- -Checking the zend_logo_guid() functio +Checking the zend_logo_guid() function --CREDITS-- Sebastian Schürmann sschuermann@chip.de diff -Nru php5-5.4.4/ext/standard/url.c php5-5.4.9/ext/standard/url.c --- php5-5.4.4/ext/standard/url.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/url.c 2012-11-21 05:12:20.000000000 +0000 @@ -201,9 +201,13 @@ STR_FREE(ret->scheme); efree(ret); return NULL; + } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ + s += 2; } else { goto just_path; } + } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ + s += 2; } else { just_path: ue = s + length; @@ -220,14 +224,14 @@ if (query && fragment) { if (query > fragment) { - p = e = fragment; + e = fragment; } else { - p = e = query; + e = query; } } else if (query) { - p = e = query; + e = query; } else if (fragment) { - p = e = fragment; + e = fragment; } } else { e = p; diff -Nru php5-5.4.4/ext/standard/url_scanner_ex.c php5-5.4.9/ext/standard/url_scanner_ex.c --- php5-5.4.4/ext/standard/url_scanner_ex.c 2012-06-13 06:08:08.000000000 +0000 +++ php5-5.4.9/ext/standard/url_scanner_ex.c 2012-11-21 05:53:10.000000000 +0000 @@ -1,9 +1,9 @@ /* Generated by re2c 0.13.5 on Mon May 23 12:29:55 2011 */ /* +----------------------------------------------------------------------+ - | PHP Version 6 | + | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/standard/url_scanner_ex.re php5-5.4.9/ext/standard/url_scanner_ex.re --- php5-5.4.4/ext/standard/url_scanner_ex.re 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/url_scanner_ex.re 2012-11-21 05:12:20.000000000 +0000 @@ -1,8 +1,8 @@ /* +----------------------------------------------------------------------+ - | PHP Version 6 | + | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/ext/standard/var.c php5-5.4.9/ext/standard/var.c --- php5-5.4.4/ext/standard/var.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/standard/var.c 2012-11-21 05:12:20.000000000 +0000 @@ -453,6 +453,11 @@ break; case IS_ARRAY: myht = Z_ARRVAL_PP(struc); + if(myht && myht->nApplyCount > 0){ + smart_str_appendl(buf, "NULL", 4); + zend_error(E_WARNING, "var_export does not handle circular references"); + return; + } if (level > 1) { smart_str_appendc(buf, '\n'); buffer_append_spaces(buf, level - 1); @@ -469,6 +474,11 @@ case IS_OBJECT: myht = Z_OBJPROP_PP(struc); + if(myht && myht->nApplyCount > 0){ + smart_str_appendl(buf, "NULL", 4); + zend_error(E_WARNING, "var_export does not handle circular references"); + return; + } if (level > 1) { smart_str_appendc(buf, '\n'); buffer_append_spaces(buf, level - 1); @@ -541,12 +551,9 @@ /* relies on "(long)" being a perfect hash function for data pointers, * however the actual identity of an object has had to be determined - * by its object handle and the class entry since 5.0. */ + * by its object handle since 5.0. */ if ((Z_TYPE_P(var) == IS_OBJECT) && Z_OBJ_HT_P(var)->get_class_entry) { - p = smart_str_print_long(id + sizeof(id) - 1, - (((size_t)Z_OBJCE_P(var) << 5) - | ((size_t)Z_OBJCE_P(var) >> (sizeof(long) * 8 - 5))) - + (long) Z_OBJ_HANDLE_P(var)); + p = smart_str_print_long(id + sizeof(id) - 1, (long) Z_OBJ_HANDLE_P(var)); *(--p) = 'O'; len = id + sizeof(id) - 1 - p; } else { @@ -632,6 +639,7 @@ HashPosition pos; int i; zval nval, *nvalp; + HashTable *propers; ZVAL_NULL(&nval); nvalp = &nval; @@ -657,7 +665,8 @@ smart_str_appendl(buf,"N;", 2); continue; } - if (zend_hash_find(Z_OBJPROP_P(struc), Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, (void *) &d) == SUCCESS) { + propers = Z_OBJPROP_P(struc); + if (zend_hash_find(propers, Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, (void *) &d) == SUCCESS) { php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC); } else { @@ -669,7 +678,7 @@ do { zend_mangle_property_name(&priv_name, &prop_name_length, ce->name, ce->name_length, Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS); - if (zend_hash_find(Z_OBJPROP_P(struc), priv_name, prop_name_length + 1, (void *) &d) == SUCCESS) { + if (zend_hash_find(propers, priv_name, prop_name_length + 1, (void *) &d) == SUCCESS) { php_var_serialize_string(buf, priv_name, prop_name_length); pefree(priv_name, ce->type & ZEND_INTERNAL_CLASS); php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC); @@ -677,7 +686,7 @@ } pefree(priv_name, ce->type & ZEND_INTERNAL_CLASS); zend_mangle_property_name(&prot_name, &prop_name_length, "*", 1, Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS); - if (zend_hash_find(Z_OBJPROP_P(struc), prot_name, prop_name_length + 1, (void *) &d) == SUCCESS) { + if (zend_hash_find(propers, prot_name, prop_name_length + 1, (void *) &d) == SUCCESS) { php_var_serialize_string(buf, prot_name, prop_name_length); pefree(prot_name, ce->type & ZEND_INTERNAL_CLASS); php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC); diff -Nru php5-5.4.4/ext/standard/var_unserializer.c php5-5.4.9/ext/standard/var_unserializer.c --- php5-5.4.4/ext/standard/var_unserializer.c 2012-06-13 06:08:08.000000000 +0000 +++ php5-5.4.9/ext/standard/var_unserializer.c 2012-11-21 05:53:10.000000000 +0000 @@ -612,10 +612,13 @@ do { /* Try to find class directly */ + BG(serialize_lock) = 1; if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { + BG(serialize_lock) = 0; ce = *pce; break; } + BG(serialize_lock) = 0; /* Check for unserialize callback */ if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) { @@ -630,7 +633,9 @@ args[0] = &arg_func_name; MAKE_STD_ZVAL(arg_func_name); ZVAL_STRING(arg_func_name, class_name, 1); + BG(serialize_lock) = 1; if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { + BG(serialize_lock) = 0; php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val); incomplete_class = 1; ce = PHP_IC_ENTRY; @@ -638,6 +643,7 @@ zval_ptr_dtor(&arg_func_name); break; } + BG(serialize_lock) = 0; if (retval_ptr) { zval_ptr_dtor(&retval_ptr); } diff -Nru php5-5.4.4/ext/tidy/examples/cleanhtml.php php5-5.4.9/ext/tidy/examples/cleanhtml.php --- php5-5.4.4/ext/tidy/examples/cleanhtml.php 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/tidy/examples/cleanhtml.php 2012-11-21 05:12:20.000000000 +0000 @@ -26,7 +26,7 @@ if(tidy_warning_count() || tidy_error_count()) { - echo "\n\nThe following errors or warnings occured:\n"; + echo "\n\nThe following errors or warnings occurred:\n"; echo tidy_get_error_buffer(); echo "\n"; } diff -Nru php5-5.4.4/ext/tidy/examples/cleanhtml5.php php5-5.4.9/ext/tidy/examples/cleanhtml5.php --- php5-5.4.4/ext/tidy/examples/cleanhtml5.php 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/tidy/examples/cleanhtml5.php 2012-11-21 05:12:20.000000000 +0000 @@ -25,7 +25,7 @@ if(!empty($tidy->errorBuffer)) { - echo "\n\nThe following errors or warnings occured:\n"; + echo "\n\nThe following errors or warnings occurred:\n"; echo "{$tidy->errorBuffer}\n"; } diff -Nru php5-5.4.4/ext/tidy/tests/004.phpt php5-5.4.9/ext/tidy/tests/004.phpt --- php5-5.4.4/ext/tidy/tests/004.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/tidy/tests/004.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -6,7 +6,7 @@ '); var_dump(tidy_diagnose($a)); -echo tidy_get_error_buffer($a); +echo str_replace("\r", "", tidy_get_error_buffer($a)); $html = <<< HTML diff -Nru php5-5.4.4/ext/tidy/tidy.c php5-5.4.9/ext/tidy/tidy.c --- php5-5.4.4/ext/tidy/tidy.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/tidy/tidy.c 2012-11-21 05:12:20.000000000 +0000 @@ -1238,7 +1238,7 @@ /* }}} */ /* {{{ proto string tidy_get_error_buffer() - Return warnings and errors which occured parsing the specified document*/ + Return warnings and errors which occurred parsing the specified document*/ static PHP_FUNCTION(tidy_get_error_buffer) { TIDY_FETCH_OBJECT; diff -Nru php5-5.4.4/ext/wddx/tests/bug48562.phpt php5-5.4.9/ext/wddx/tests/bug48562.phpt --- php5-5.4.4/ext/wddx/tests/bug48562.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/wddx/tests/bug48562.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -16,6 +16,12 @@ var_dump(wddx_serialize_vars($a)); +// replace $a - the recursion detection seems to be causing $a to be not an array here, maybe its internally a pointer +// replacing $a with a new array() allows this test to still check for 2 things +// 1. recursion detection in &$a; +// 2. recursion detection in adding $a to itself and then serializing $a +// the one thing the test won't check is using $a as an array after doing &$a; which isn't really a wddx problem. +$a = array(); $a['x'] = 'foo'; $a['x'] = $a; diff -Nru php5-5.4.4/ext/xml/tests/bug62328.phpt php5-5.4.9/ext/xml/tests/bug62328.phpt --- php5-5.4.4/ext/xml/tests/bug62328.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/xml/tests/bug62328.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,21 @@ +--TEST-- +Bug #62328 (implementing __toString and a cast to string fails) +--SKIPIF-- + +--FILE-- +'); + +var_dump((string) $xml); +var_dump($xml->__toString()); +--EXPECT-- +string(15) "stringification" +string(15) "stringification" diff -Nru php5-5.4.4/ext/xmlrpc/tests/bug61264.phpt php5-5.4.9/ext/xmlrpc/tests/bug61264.phpt --- php5-5.4.4/ext/xmlrpc/tests/bug61264.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/xmlrpc/tests/bug61264.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,5 +1,7 @@ --TEST-- Bug #61264: xmlrpc_parse_method_descriptions leaks temporary variable +--SKIPIF-- + --FILE-- type == IS_OBJECT && instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) { diff -Nru php5-5.4.4/ext/zip/config.m4 php5-5.4.9/ext/zip/config.m4 --- php5-5.4.4/ext/zip/config.m4 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/config.m4 2012-11-21 05:12:20.000000000 +0000 @@ -89,7 +89,14 @@ lib/zip_new.c lib/zip_source_file.c lib/zip_stat_index.c \ lib/zip_set_archive_comment.c lib/zip_set_file_comment.c \ lib/zip_unchange_archive.c lib/zip_memdup.c lib/zip_stat_init.c lib/zip_add_dir.c \ - lib/zip_error_clear.c lib/zip_file_error_clear.c" + lib/zip_error_clear.c lib/zip_file_error_clear.c \ + lib/zip_fdopen.c lib/zip_fopen_encrypted.c lib/zip_fopen_index_encrypted.c \ + lib/zip_get_compression_implementation.c lib/zip_get_encryption_implementation.c \ + lib/zip_get_file_extra.c lib/zip_get_num_entries.c lib/zip_set_default_password.c \ + lib/zip_set_file_extra.c lib/zip_source_close.c lib/zip_source_crc.c \ + lib/zip_source_deflate.c lib/zip_source_error.c lib/zip_source_layered.c \ + lib/zip_source_open.c lib/zip_source_pkware.c lib/zip_source_pop.c \ + lib/zip_source_read.c lib/zip_source_stat.c" AC_DEFINE(HAVE_ZIP,1,[ ]) PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared) diff -Nru php5-5.4.4/ext/zip/config.w32 php5-5.4.9/ext/zip/config.w32 --- php5-5.4.4/ext/zip/config.w32 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/config.w32 2012-11-21 05:12:20.000000000 +0000 @@ -27,7 +27,14 @@ zip_get_archive_comment.c zip_get_file_comment.c \ zip_set_archive_comment.c zip_set_file_comment.c \ zip_unchange_archive.c zip_memdup.c zip_stat_init.c \ - zip_add_dir.c zip_file_error_clear.c zip_error_clear.c", "zip"); + zip_add_dir.c zip_file_error_clear.c zip_error_clear.c \ + zip_fdopen.c zip_fopen_encrypted.c zip_fopen_index_encrypted.c \ + zip_get_compression_implementation.c zip_get_encryption_implementation.c \ + zip_get_file_extra.c zip_get_num_entries.c zip_set_default_password.c \ + zip_set_file_extra.c zip_source_close.c zip_source_crc.c \ + zip_source_deflate.c zip_source_error.c zip_source_layered.c \ + zip_source_open.c zip_source_pkware.c zip_source_pop.c \ + zip_source_read.c zip_source_stat.c", "zip"); AC_DEFINE('HAVE_ZIP', 1); } else { diff -Nru php5-5.4.4/ext/zip/lib/zip.h php5-5.4.9/ext/zip/lib/zip.h --- php5-5.4.4/ext/zip/lib/zip.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip.h 2012-11-21 05:12:20.000000000 +0000 @@ -3,7 +3,7 @@ /* zip.h -- exported declarations. - Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -52,6 +52,8 @@ BEGIN_EXTERN_C() +#include "zipconf.h" + #include #include #include @@ -71,10 +73,19 @@ #define ZIP_FL_COMPRESSED 4 /* read compressed data */ #define ZIP_FL_UNCHANGED 8 /* use original data, ignoring changes */ #define ZIP_FL_RECOMPRESS 16 /* force recompression of data */ +#define ZIP_FL_ENCRYPTED 32 /* read encrypted data + (implies ZIP_FL_COMPRESSED) */ /* archive global flags flags */ #define ZIP_AFL_TORRENT 1 /* torrent zipped */ +#define ZIP_AFL_RDONLY 2 /* read only -- cannot be cleared */ + + +/* flags for compression and encryption sources */ + +#define ZIP_CODEC_ENCODE 1 /* compress/encrypt */ + /* libzip error codes */ @@ -102,7 +113,10 @@ #define ZIP_ER_INCONS 21 /* N Zip archive inconsistent */ #define ZIP_ER_REMOVE 22 /* S Can't remove file */ #define ZIP_ER_DELETED 23 /* N Entry has been deleted */ - +#define ZIP_ER_ENCRNOTSUPP 24 /* N Encryption method not supported */ +#define ZIP_ER_RDONLY 25 /* N Read-only archive */ +#define ZIP_ER_NOPASSWD 26 /* N No password provided */ +#define ZIP_ER_WRONGPASSWD 27 /* N Wrong password provided */ /* type of system error value */ @@ -162,69 +176,99 @@ ZIP_SOURCE_FREE /* cleanup and free resources */ }; -typedef ssize_t (*zip_source_callback)(void *state, void *data, - size_t len, enum zip_source_cmd cmd); +#define ZIP_SOURCE_ERR_LOWER -2 + +#define ZIP_STAT_NAME 0x0001 +#define ZIP_STAT_INDEX 0x0002 +#define ZIP_STAT_SIZE 0x0004 +#define ZIP_STAT_COMP_SIZE 0x0008 +#define ZIP_STAT_MTIME 0x0010 +#define ZIP_STAT_CRC 0x0020 +#define ZIP_STAT_COMP_METHOD 0x0040 +#define ZIP_STAT_ENCRYPTION_METHOD 0x0080 +#define ZIP_STAT_FLAGS 0x0100 struct zip_stat { + zip_uint64_t valid; /* which fields have valid values */ const char *name; /* name of the file */ - int index; /* index within archive */ - unsigned int crc; /* crc of file data */ + zip_uint64_t index; /* index within archive */ + zip_uint64_t size; /* size of file (uncompressed) */ + zip_uint64_t comp_size; /* size of file (compressed) */ time_t mtime; /* modification time */ - off_t size; /* size of file (uncompressed) */ - off_t comp_size; /* size of file (compressed) */ - unsigned short comp_method; /* compression method used */ - unsigned short encryption_method; /* encryption method used */ + zip_uint32_t crc; /* crc of file data */ + zip_uint16_t comp_method; /* compression method used */ + zip_uint16_t encryption_method; /* encryption method used */ + zip_uint32_t flags; /* reserved for future use */ }; struct zip; struct zip_file; struct zip_source; +typedef zip_int64_t (*zip_source_callback)(void *, void *, zip_uint64_t, + enum zip_source_cmd); + -ZIP_EXTERN(int) zip_add(struct zip *, const char *, struct zip_source *); -ZIP_EXTERN(int) zip_add_dir(struct zip *, const char *); +ZIP_EXTERN(zip_int64_t) zip_add(struct zip *, const char *, struct zip_source *); +ZIP_EXTERN(zip_int64_t) zip_add_dir(struct zip *, const char *); ZIP_EXTERN(int) zip_close(struct zip *); -ZIP_EXTERN(int) zip_delete(struct zip *, int); +ZIP_EXTERN(int) zip_delete(struct zip *, zip_uint64_t); ZIP_EXTERN(void) zip_error_clear(struct zip *); ZIP_EXTERN(void) zip_error_get(struct zip *, int *, int *); ZIP_EXTERN(int) zip_error_get_sys_type(int); -ZIP_EXTERN(int) zip_error_to_str(char *, size_t, int, int); +ZIP_EXTERN(int) zip_error_to_str(char *, zip_uint64_t, int, int); ZIP_EXTERN(int) zip_fclose(struct zip_file *); +ZIP_EXTERN(struct zip *)zip_fdopen(int, int, int *); ZIP_EXTERN(void) zip_file_error_clear(struct zip_file *); ZIP_EXTERN(void) zip_file_error_get(struct zip_file *, int *, int *); ZIP_EXTERN(const char *)zip_file_strerror(struct zip_file *); -ZIP_EXTERN(struct zip_file *)zip_fopen(struct zip *, const char *, int); -ZIP_EXTERN(struct zip_file *)zip_fopen_index(struct zip *, int, int); -ZIP_EXTERN(ssize_t) zip_fread(struct zip_file *, void *, size_t); +ZIP_EXTERN(struct) zip_file *zip_fopen(struct zip *, const char *, int); +ZIP_EXTERN(struct) zip_file *zip_fopen_encrypted(struct zip *, const char *, + int, const char *); +ZIP_EXTERN(struct zip_file *)zip_fopen_index(struct zip *, zip_uint64_t, int); +ZIP_EXTERN(struct zip_file *)zip_fopen_index_encrypted(struct zip *, + zip_uint64_t, int, + const char *); +ZIP_EXTERN(zip_int64_t) zip_fread(struct zip_file *, void *, zip_uint64_t); ZIP_EXTERN(const char *)zip_get_archive_comment(struct zip *, int *, int); ZIP_EXTERN(int) zip_get_archive_flag(struct zip *, int, int); -ZIP_EXTERN(const char *)zip_get_file_comment(struct zip *, int, int *, int); -ZIP_EXTERN(const char *)zip_get_name(struct zip *, int, int); -ZIP_EXTERN(int) zip_get_num_files(struct zip *); +ZIP_EXTERN(const char *)zip_get_file_comment(struct zip *, zip_uint64_t, + int *, int); +ZIP_EXTERN(const char *)zip_get_file_extra(struct zip *, zip_uint64_t, + int *, int); +ZIP_EXTERN(const char *)zip_get_name(struct zip *, zip_uint64_t, int); +ZIP_EXTERN(zip_uint64_t) zip_get_num_entries(struct zip *, int); +ZIP_EXTERN(int) zip_get_num_files(struct zip *); /* deprecated, use zip_get_num_entries instead */ ZIP_EXTERN(int) zip_name_locate(struct zip *, const char *, int); ZIP_EXTERN(struct zip *)zip_open(const char *, int, int *); -ZIP_EXTERN(int) zip_rename(struct zip *, int, const char *); -ZIP_EXTERN(int) zip_replace(struct zip *, int, struct zip_source *); +ZIP_EXTERN(int) zip_rename(struct zip *, zip_uint64_t, const char *); +ZIP_EXTERN(int) zip_replace(struct zip *, zip_uint64_t, struct zip_source *); ZIP_EXTERN(int) zip_set_archive_comment(struct zip *, const char *, int); ZIP_EXTERN(int) zip_set_archive_flag(struct zip *, int, int); -ZIP_EXTERN(int) zip_set_file_comment(struct zip *, int, const char *, int); -ZIP_EXTERN(struct zip_source *)zip_source_buffer(struct zip *, const void *, - off_t, int); -ZIP_EXTERN(struct zip_source *)zip_source_file(struct zip *, const char *, - off_t, off_t); -ZIP_EXTERN(struct zip_source *)zip_source_filep(struct zip *, FILE *, - off_t, off_t); +ZIP_EXTERN(int) zip_set_default_password(struct zip *, const char *); +ZIP_EXTERN(int) zip_set_file_comment(struct zip *, zip_uint64_t, + const char *, int); +ZIP_EXTERN(int) zip_set_file_extra(struct zip *, zip_uint64_t, + const char *, int); +ZIP_EXTERN(struct) zip_source *zip_source_buffer(struct zip *, const void *, + zip_uint64_t, int); +ZIP_EXTERN(struct) zip_source *zip_source_file(struct zip *, const char *, + zip_uint64_t, zip_int64_t); +ZIP_EXTERN(struct) zip_source *zip_source_filep(struct zip *, FILE *, + zip_uint64_t, zip_int64_t); ZIP_EXTERN(void) zip_source_free(struct zip_source *); ZIP_EXTERN(struct zip_source *)zip_source_function(struct zip *, zip_source_callback, void *); ZIP_EXTERN(struct zip_source *)zip_source_zip(struct zip *, struct zip *, - int, int, off_t, off_t); + zip_uint64_t, int, + zip_uint64_t, zip_int64_t); ZIP_EXTERN(int) zip_stat(struct zip *, const char *, int, struct zip_stat *); -ZIP_EXTERN(int) zip_stat_index(struct zip *, int, int, struct zip_stat *); +ZIP_EXTERN(int) zip_stat_index(struct zip *, zip_uint64_t, int, + struct zip_stat *); ZIP_EXTERN(void) zip_stat_init(struct zip_stat *); ZIP_EXTERN(const char *)zip_strerror(struct zip *); -ZIP_EXTERN(int) zip_unchange(struct zip *, int); +ZIP_EXTERN(int) zip_unchange(struct zip *, zip_uint64_t); ZIP_EXTERN(int) zip_unchange_all(struct zip *); ZIP_EXTERN(int) zip_unchange_archive(struct zip *); diff -Nru php5-5.4.4/ext/zip/lib/zip_add.c php5-5.4.9/ext/zip/lib/zip_add.c --- php5-5.4.4/ext/zip/lib/zip_add.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_add.c 2012-11-21 05:12:20.000000000 +0000 @@ -37,13 +37,20 @@ -ZIP_EXTERN(int) +/* + NOTE: Return type is signed so we can return -1 on error. + The index can not be larger than ZIP_INT64_MAX since the size + of the central directory cannot be larger than + ZIP_UINT64_MAX, and each entry is larger than 2 bytes. +*/ + +ZIP_EXTERN(zip_int64_t) zip_add(struct zip *za, const char *name, struct zip_source *source) { if (name == NULL || source == NULL) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } - - return _zip_replace(za, -1, name, source); + + return _zip_replace(za, ZIP_UINT64_MAX, name, source); } diff -Nru php5-5.4.4/ext/zip/lib/zip_add_dir.c php5-5.4.9/ext/zip/lib/zip_add_dir.c --- php5-5.4.4/ext/zip/lib/zip_add_dir.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_add_dir.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_add_dir.c -- add directory - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -40,13 +40,21 @@ -ZIP_EXTERN(int) +/* NOTE: Signed due to -1 on error. See zip_add.c for more details. */ + +ZIP_EXTERN(zip_int64_t) zip_add_dir(struct zip *za, const char *name) { - int len, ret; + int len; + zip_int64_t ret; char *s; struct zip_source *source; + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + if (name == NULL) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; diff -Nru php5-5.4.4/ext/zip/lib/zip_close.c php5-5.4.9/ext/zip/lib/zip_close.c --- php5-5.4.4/ext/zip/lib/zip_close.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_close.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_close.c -- close zip archive and update changes - Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -33,26 +33,28 @@ +#include "zipint.h" + #include #include #include #include +#ifdef HAVE_UNISTD_H +#include +#endif #include #include - -#include "zipint.h" +#ifdef PHP_WIN32 +#include +#include +#endif static int add_data(struct zip *, struct zip_source *, struct zip_dirent *, FILE *); -static int add_data_comp(zip_source_callback, void *, struct zip_stat *, - FILE *, struct zip_error *); -static int add_data_uncomp(struct zip *, zip_source_callback, void *, - struct zip_stat *, FILE *); -static void ch_set_error(struct zip_error *, zip_source_callback, void *); static int copy_data(FILE *, off_t, FILE *, struct zip_error *); +static int copy_source(struct zip *, struct zip_source *, FILE *); static int write_cdir(struct zip *, struct zip_cdir *, FILE *); static int _zip_cdir_set_comment(struct zip_cdir *, struct zip *); -static int _zip_changed(struct zip *, int *); static char *_zip_create_temp_output(struct zip *, FILE **); static int _zip_torrentzip_cmp(const void *, const void *); @@ -72,7 +74,9 @@ int i, j, error; char *temp; FILE *out; +#ifndef PHP_WIN32 mode_t mask; +#endif struct zip_cdir *cd; struct zip_dirent de; struct filelist *filelist; @@ -99,7 +103,7 @@ } _zip_free(za); return 0; - } + } if ((filelist=(struct filelist *)malloc(sizeof(filelist[0])*survivors)) == NULL) @@ -126,11 +130,11 @@ cd->comment_len = TORRENT_SIG_LEN + TORRENT_CRC_LEN; } else if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, ZIP_FL_UNCHANGED) == 0) { - if (_zip_cdir_set_comment(cd, za) == -1) { - _zip_cdir_free(cd); + if (_zip_cdir_set_comment(cd, za) == -1) { + _zip_cdir_free(cd); free(filelist); - return -1; - } + return -1; + } } if ((temp=_zip_create_temp_output(za, &out)) == NULL) { @@ -198,8 +202,7 @@ error = 1; break; } - memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j])); - + memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j])); if (de.bitflags & ZIP_GPBF_DATA_DESCRIPTOR) { de.crc = za->cdir->entry[i].crc; de.comp_size = za->cdir->entry[i].comp_size; @@ -220,6 +223,22 @@ cd->entry[j].filename_len = de.filename_len; } + if (za->entry[i].ch_extra_len != -1) { + free(de.extrafield); + if ((de.extrafield=malloc(za->entry[i].ch_extra_len)) == NULL) { + error = 1; + break; + } + memcpy(de.extrafield, za->entry[i].ch_extra, za->entry[i].ch_extra_len); + de.extrafield_len = za->entry[i].ch_extra_len; + /* as the rest of cd entries, its malloc/free is done by za */ + /* TODO unsure if this should also be set in the CD -- + * not done for now + cd->entry[j].extrafield = za->entry[i].ch_extra; + cd->entry[j].extrafield_len = za->entry[i].ch_extra_len; + */ + } + if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0) == 0 && za->entry[i].ch_comment_len != -1) { /* as the rest of cd entries, its malloc/free is done by za */ @@ -234,16 +253,22 @@ zs = NULL; if (!ZIP_ENTRY_DATA_CHANGED(za->entry+i)) { - if ((zs=zip_source_zip(za, za, i, ZIP_FL_RECOMPRESS, 0, -1)) == NULL) { - error = 1; - break; - } + if ((zs=zip_source_zip(za, za, i, ZIP_FL_RECOMPRESS, 0, -1)) + == NULL) { + error = 1; + break; + } } if (add_data(za, zs ? zs : za->entry[i].source, &de, out) < 0) { error = 1; + if (zs) + zip_source_free(zs); break; } + if (zs) + zip_source_free(zs); + cd->entry[j].last_mod = de.last_mod; cd->entry[j].comp_method = de.comp_method; cd->entry[j].comp_size = de.comp_size; @@ -291,27 +316,27 @@ free(temp); return -1; } - - if (za->zp) { - fclose(za->zp); - za->zp = NULL; - reopen_on_error = 1; + + if (za->zp) { + fclose(za->zp); + za->zp = NULL; + reopen_on_error = 1; } if (_zip_rename(temp, za->zn) != 0) { - _zip_error_set(&za->error, ZIP_ER_RENAME, errno); - remove(temp); - free(temp); - if (reopen_on_error) { - /* ignore errors, since we're already in an error case */ - za->zp = fopen(za->zn, "rb"); - } - return -1; + _zip_error_set(&za->error, ZIP_ER_RENAME, errno); + remove(temp); + free(temp); + if (reopen_on_error) { + /* ignore errors, since we're already in an error case */ + za->zp = fopen(za->zn, "rb"); } + return -1; + } +#ifndef PHP_WIN32 mask = umask(0); umask(mask); chmod(za->zn, 0666&~mask); - if (za->ch_comment) - free(za->ch_comment); +#endif _zip_free(za); free(temp); @@ -322,23 +347,17 @@ static int -add_data(struct zip *za, struct zip_source *zs, struct zip_dirent *de, FILE *ft) +add_data(struct zip *za, struct zip_source *src, struct zip_dirent *de, + FILE *ft) { - off_t offstart, offend; - zip_source_callback cb; - void *ud; + off_t offstart, offdata, offend; struct zip_stat st; - - cb = zs->f; - ud = zs->ud; - - if (cb(ud, &st, sizeof(st), ZIP_SOURCE_STAT) < (ssize_t)sizeof(st)) { - ch_set_error(&za->error, cb, ud); - return -1; - } - - if (cb(ud, NULL, 0, ZIP_SOURCE_OPEN) < 0) { - ch_set_error(&za->error, cb, ud); + struct zip_source *s2; + zip_compression_implementation comp_impl; + int ret; + + if (zip_source_stat(src, &st) < 0) { + _zip_error_set_from_source(&za->error, src); return -1; } @@ -347,20 +366,50 @@ if (_zip_dirent_write(de, ft, 1, &za->error) < 0) return -1; - if (st.comp_method != ZIP_CM_STORE) { - if (add_data_comp(cb, ud, &st, ft, &za->error) < 0) - return -1; + if ((s2=zip_source_crc(za, src, 0)) == NULL) { + zip_source_pop(s2); + return -1; } - else { - if (add_data_uncomp(za, cb, ud, &st, ft) < 0) + + /* XXX: deflate 0-byte files for torrentzip? */ + if (((st.valid & ZIP_STAT_COMP_METHOD) == 0 + || st.comp_method == ZIP_CM_STORE) + && ((st.valid & ZIP_STAT_SIZE) == 0 || st.size != 0)) { + comp_impl = NULL; + if ((comp_impl=zip_get_compression_implementation(ZIP_CM_DEFLATE)) + == NULL) { + _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); + zip_source_pop(s2); + return -1; + } + if ((s2=comp_impl(za, s2, ZIP_CM_DEFLATE, ZIP_CODEC_ENCODE)) + == NULL) { + /* XXX: set error? */ + zip_source_pop(s2); return -1; + } } + else + s2 = src; - if (cb(ud, NULL, 0, ZIP_SOURCE_CLOSE) < 0) { - ch_set_error(&za->error, cb, ud); - return -1; + offdata = ftello(ft); + + ret = copy_source(za, s2, ft); + + if (zip_source_stat(s2, &st) < 0) + ret = -1; + + while (s2 != src) { + if ((s2=zip_source_pop(s2)) == NULL) { + /* XXX: set erorr */ + ret = -1; + break; + } } + if (ret < 0) + return -1; + offend = ftello(ft); if (fseeko(ft, offstart, SEEK_SET) < 0) { @@ -368,19 +417,18 @@ return -1; } - de->last_mod = st.mtime; de->comp_method = st.comp_method; de->crc = st.crc; de->uncomp_size = st.size; - de->comp_size = st.comp_size; + de->comp_size = offend - offdata; if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) _zip_dirent_torrent_normalize(de); if (_zip_dirent_write(de, ft, 1, &za->error) < 0) return -1; - + if (fseeko(ft, offend, SEEK_SET) < 0) { _zip_error_set(&za->error, ZIP_ER_SEEK, errno); return -1; @@ -392,133 +440,6 @@ static int -add_data_comp(zip_source_callback cb, void *ud, struct zip_stat *st,FILE *ft, - struct zip_error *error) -{ - char buf[BUFSIZE]; - ssize_t n; - - st->comp_size = 0; - while ((n=cb(ud, buf, sizeof(buf), ZIP_SOURCE_READ)) > 0) { - if (fwrite(buf, 1, n, ft) != (size_t)n) { - _zip_error_set(error, ZIP_ER_WRITE, errno); - return -1; - } - - st->comp_size += n; - } - if (n < 0) { - ch_set_error(error, cb, ud); - return -1; - } - - return 0; -} - - - -static int -add_data_uncomp(struct zip *za, zip_source_callback cb, void *ud, - struct zip_stat *st, FILE *ft) -{ - char b1[BUFSIZE], b2[BUFSIZE]; - int end, flush, ret; - ssize_t n; - size_t n2; - z_stream zstr; - int mem_level; - - st->comp_method = ZIP_CM_DEFLATE; - st->comp_size = st->size = 0; - st->crc = crc32(0, NULL, 0); - - zstr.zalloc = Z_NULL; - zstr.zfree = Z_NULL; - zstr.opaque = NULL; - zstr.avail_in = 0; - zstr.avail_out = 0; - - if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) - mem_level = TORRENT_MEM_LEVEL; - else - mem_level = MAX_MEM_LEVEL; - - /* -MAX_WBITS: undocumented feature of zlib to _not_ write a zlib header */ - deflateInit2(&zstr, Z_BEST_COMPRESSION, Z_DEFLATED, -MAX_WBITS, mem_level, - Z_DEFAULT_STRATEGY); - - zstr.next_out = (Bytef *)b2; - zstr.avail_out = sizeof(b2); - zstr.next_in = NULL; - zstr.avail_in = 0; - - flush = 0; - end = 0; - while (!end) { - if (zstr.avail_in == 0 && !flush) { - if ((n=cb(ud, b1, sizeof(b1), ZIP_SOURCE_READ)) < 0) { - ch_set_error(&za->error, cb, ud); - deflateEnd(&zstr); - return -1; - } - if (n > 0) { - zstr.avail_in = n; - zstr.next_in = (Bytef *)b1; - st->size += n; - st->crc = crc32(st->crc, (Bytef *)b1, n); - } - else - flush = Z_FINISH; - } - - ret = deflate(&zstr, flush); - if (ret != Z_OK && ret != Z_STREAM_END) { - _zip_error_set(&za->error, ZIP_ER_ZLIB, ret); - return -1; - } - - if (zstr.avail_out != sizeof(b2)) { - n2 = sizeof(b2) - zstr.avail_out; - - if (fwrite(b2, 1, n2, ft) != n2) { - _zip_error_set(&za->error, ZIP_ER_WRITE, errno); - return -1; - } - - zstr.next_out = (Bytef *)b2; - zstr.avail_out = sizeof(b2); - st->comp_size += n2; - } - - if (ret == Z_STREAM_END) { - deflateEnd(&zstr); - end = 1; - } - } - - return 0; -} - - - -static void -ch_set_error(struct zip_error *error, zip_source_callback cb, void *ud) -{ - int e[2]; - - if ((cb(ud, e, sizeof(e), ZIP_SOURCE_ERROR)) < (ssize_t)sizeof(e)) { - error->zip_err = ZIP_ER_INTERNAL; - error->sys_err = 0; - } - else { - error->zip_err = e[0]; - error->sys_err = e[1]; - } -} - - - -static int copy_data(FILE *fs, off_t len, FILE *ft, struct zip_error *error) { char buf[BUFSIZE]; @@ -552,6 +473,40 @@ static int +copy_source(struct zip *za, struct zip_source *src, FILE *ft) +{ + char buf[BUFSIZE]; + zip_int64_t n; + int ret; + + if (zip_source_open(src) < 0) { + _zip_error_set_from_source(&za->error, src); + return -1; + } + + ret = 0; + while ((n=zip_source_read(src, buf, sizeof(buf))) > 0) { + if (fwrite(buf, 1, n, ft) != (size_t)n) { + _zip_error_set(&za->error, ZIP_ER_WRITE, errno); + ret = -1; + break; + } + } + + if (n < 0) { + if (ret == 0) + _zip_error_set_from_source(&za->error, src); + ret = -1; + } + + zip_source_close(src); + + return ret; +} + + + +static int write_cdir(struct zip *za, struct zip_cdir *cd, FILE *out) { off_t offset; @@ -613,7 +568,7 @@ -static int +int _zip_changed(struct zip *za, int *survivorsp) { int changed, i, survivors; @@ -626,13 +581,15 @@ for (i=0; inentry; i++) { if ((za->entry[i].state != ZIP_ST_UNCHANGED) + || (za->entry[i].ch_extra_len != -1) || (za->entry[i].ch_comment_len != -1)) changed = 1; if (za->entry[i].state != ZIP_ST_DELETED) survivors++; } - *survivorsp = survivors; + if (survivorsp) + *survivorsp = survivors; return changed; } @@ -668,6 +625,10 @@ return NULL; } #ifdef PHP_WIN32 + /* + According to Pierre Joye, Windows in some environments per + default creates text files, so force binary mode. + */ _setmode(_fileno(tfp), _O_BINARY ); #endif diff -Nru php5-5.4.4/ext/zip/lib/zip_delete.c php5-5.4.9/ext/zip/lib/zip_delete.c --- php5-5.4.4/ext/zip/lib/zip_delete.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_delete.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_delete.c -- delete file from zip archive - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -38,13 +38,18 @@ ZIP_EXTERN(int) -zip_delete(struct zip *za, int idx) +zip_delete(struct zip *za, zip_uint64_t idx) { - if (idx < 0 || idx >= za->nentry) { + if (idx >= za->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + /* allow duplicate file names, because the file will * be removed directly afterwards */ if (_zip_unchange(za, idx, 1) != 0) diff -Nru php5-5.4.4/ext/zip/lib/zip_dirent.c php5-5.4.9/ext/zip/lib/zip_dirent.c --- php5-5.4.4/ext/zip/lib/zip_dirent.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_dirent.c 2012-11-21 05:12:20.000000000 +0000 @@ -45,7 +45,6 @@ static time_t _zip_d2u_time(int, int); static char *_zip_readfpstr(FILE *, unsigned int, int, struct zip_error *); static char *_zip_readstr(unsigned char **, int, int, struct zip_error *); -static void _zip_u2d_time(time_t, unsigned short *, unsigned short *); static void _zip_write2(unsigned short, FILE *); static void _zip_write4(unsigned int, FILE *); @@ -213,13 +212,13 @@ int _zip_dirent_read(struct zip_dirent *zde, FILE *fp, - unsigned char **bufp, unsigned int *leftp, int local, + unsigned char **bufp, zip_uint32_t *leftp, int local, struct zip_error *error) { unsigned char buf[CDENTRYSIZE]; unsigned char *cur; unsigned short dostime, dosdate; - unsigned int size; + zip_uint32_t size; if (local) size = LENTRYSIZE; @@ -473,8 +472,10 @@ static time_t _zip_d2u_time(int dtime, int ddate) { - struct tm tm = {0}; + struct tm tm; + memset(&tm, 0, sizeof(tm)); + /* let mktime decide if DST is in effect */ tm.tm_isdst = -1; @@ -598,7 +599,7 @@ -static void +void _zip_u2d_time(time_t time, unsigned short *dtime, unsigned short *ddate) { struct tm *tm; diff -Nru php5-5.4.4/ext/zip/lib/zip_entry_free.c php5-5.4.9/ext/zip/lib/zip_entry_free.c --- php5-5.4.4/ext/zip/lib/zip_entry_free.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_entry_free.c 2012-11-21 05:12:20.000000000 +0000 @@ -44,6 +44,9 @@ { free(ze->ch_filename); ze->ch_filename = NULL; + free(ze->ch_extra); + ze->ch_extra = NULL; + ze->ch_extra_len = -1; free(ze->ch_comment); ze->ch_comment = NULL; ze->ch_comment_len = -1; diff -Nru php5-5.4.4/ext/zip/lib/zip_entry_new.c php5-5.4.9/ext/zip/lib/zip_entry_new.c --- php5-5.4.4/ext/zip/lib/zip_entry_new.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_entry_new.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_entry_new.c -- create and init struct zip_entry - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -46,20 +46,21 @@ if (!za) { ze = (struct zip_entry *)malloc(sizeof(struct zip_entry)); if (!ze) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); return NULL; } } else { - if (za->nentry >= za->nentry_alloc-1) { + if (za->nentry+1 >= za->nentry_alloc) { + struct zip_entry *rentries; za->nentry_alloc += 16; - za->entry = (struct zip_entry *)realloc(za->entry, - sizeof(struct zip_entry) - * za->nentry_alloc); - if (!za->entry) { + rentries = (struct zip_entry *)realloc(za->entry, + sizeof(struct zip_entry) + * za->nentry_alloc); + if (!rentries) { _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); return NULL; } + za->entry = rentries; } ze = za->entry+za->nentry; } @@ -67,6 +68,8 @@ ze->state = ZIP_ST_UNCHANGED; ze->ch_filename = NULL; + ze->ch_extra = NULL; + ze->ch_extra_len = -1; ze->ch_comment = NULL; ze->ch_comment_len = -1; ze->source = NULL; diff -Nru php5-5.4.4/ext/zip/lib/zip_err_str.c php5-5.4.9/ext/zip/lib/zip_err_str.c --- php5-5.4.4/ext/zip/lib/zip_err_str.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_err_str.c 2012-11-21 05:12:20.000000000 +0000 @@ -32,6 +32,10 @@ "Zip archive inconsistent", "Can't remove file", "Entry has been deleted", + "Encryption method not supported", + "Read-only archive", + "No password provided", + "Wrong password provided", }; const int _zip_nerr_str = sizeof(_zip_err_str)/sizeof(_zip_err_str[0]); @@ -65,4 +69,8 @@ N, S, N, + N, + N, + N, + N, }; diff -Nru php5-5.4.4/ext/zip/lib/zip_error.c php5-5.4.9/ext/zip/lib/zip_error.c --- php5-5.4.4/ext/zip/lib/zip_error.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_error.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_error.c -- struct zip_error helper functions - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -99,3 +99,14 @@ err->sys_err = se; } } + + + +void +_zip_error_set_from_source(struct zip_error *err, struct zip_source *src) +{ + int ze, se; + + zip_source_error(src, &ze, &se); + _zip_error_set(err, ze, se); +} diff -Nru php5-5.4.4/ext/zip/lib/zip_error_to_str.c php5-5.4.9/ext/zip/lib/zip_error_to_str.c --- php5-5.4.4/ext/zip/lib/zip_error_to_str.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_error_to_str.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_error_to_str.c -- get string representation of zip error code - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -43,7 +43,7 @@ ZIP_EXTERN(int) -zip_error_to_str(char *buf, size_t len, int ze, int se) +zip_error_to_str(char *buf, zip_uint64_t len, int ze, int se) { const char *zs, *ss; diff -Nru php5-5.4.4/ext/zip/lib/zip_fclose.c php5-5.4.9/ext/zip/lib/zip_fclose.c --- php5-5.4.4/ext/zip/lib/zip_fclose.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_fclose.c 2012-11-21 05:12:20.000000000 +0000 @@ -44,28 +44,20 @@ { int i, ret; - if (zf->zstr) - inflateEnd(zf->zstr); - free(zf->buffer); - free(zf->zstr); - if (zf->za) { - for (i=0; iza->nfile; i++) { - if (zf->za->file[i] == zf) { - zf->za->file[i] = zf->za->file[zf->za->nfile-1]; - zf->za->nfile--; - break; - } - } + if (zf->src) + zip_source_free(zf->src); + + for (i=0; iza->nfile; i++) { + if (zf->za->file[i] == zf) { + zf->za->file[i] = zf->za->file[zf->za->nfile-1]; + zf->za->nfile--; + break; } + } ret = 0; if (zf->error.zip_err) ret = zf->error.zip_err; - else if ((zf->flags & ZIP_ZF_CRC) && (zf->flags & ZIP_ZF_EOF)) { - /* if EOF, compare CRC */ - if (zf->crc_orig != zf->crc) - ret = ZIP_ER_CRC; - } free(zf); return ret; diff -Nru php5-5.4.4/ext/zip/lib/zip_fdopen.c php5-5.4.9/ext/zip/lib/zip_fdopen.c --- php5-5.4.4/ext/zip/lib/zip_fdopen.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_fdopen.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,62 @@ +/* + zip_fdopen.c -- open read-only archive from file descriptor + Copyright (C) 2009-2010 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(struct zip *) +zip_fdopen(int fd_orig, int flags, int *zep) +{ + int fd; + FILE *fp; + + /* We dup() here to avoid messing with the passed in fd. + We could not restore it to the original state in case of error. */ + + if ((fd=dup(fd_orig)) < 0) { + *zep = ZIP_ER_OPEN; + return NULL; + } + + if ((fp=fdopen(fd, "rb")) == NULL) { + close(fd); + *zep = ZIP_ER_OPEN; + return NULL; + } + + close(fd_orig); + return _zip_open(NULL, fp, flags, ZIP_AFL_RDONLY, zep); +} diff -Nru php5-5.4.4/ext/zip/lib/zip_filerange_crc.c php5-5.4.9/ext/zip/lib/zip_filerange_crc.c --- php5-5.4.4/ext/zip/lib/zip_filerange_crc.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_filerange_crc.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_filerange_crc.c -- compute CRC32 for a range of a file - Copyright (C) 2008-2009 Dieter Baron and Thomas Klausner + Copyright (C) 2008 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at diff -Nru php5-5.4.4/ext/zip/lib/zip_fopen.c php5-5.4.9/ext/zip/lib/zip_fopen.c --- php5-5.4.4/ext/zip/lib/zip_fopen.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_fopen.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_fopen.c -- open file in zip archive for reading - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -45,5 +45,5 @@ if ((idx=zip_name_locate(za, fname, flags)) < 0) return NULL; - return zip_fopen_index(za, idx, flags); + return zip_fopen_index_encrypted(za, idx, flags, za->default_password); } diff -Nru php5-5.4.4/ext/zip/lib/zip_fopen_encrypted.c php5-5.4.9/ext/zip/lib/zip_fopen_encrypted.c --- php5-5.4.4/ext/zip/lib/zip_fopen_encrypted.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_fopen_encrypted.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,50 @@ +/* + zip_fopen_encrypted.c -- open file for reading with password + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(struct zip_file *) +zip_fopen_encrypted(struct zip *za, const char *fname, int flags, + const char *password) +{ + int idx; + + if ((idx=zip_name_locate(za, fname, flags)) < 0) + return NULL; + + return zip_fopen_index_encrypted(za, idx, flags, password); +} diff -Nru php5-5.4.4/ext/zip/lib/zip_fopen_index.c php5-5.4.9/ext/zip/lib/zip_fopen_index.c --- php5-5.4.4/ext/zip/lib/zip_fopen_index.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_fopen_index.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_fopen_index.c -- open file in zip archive for reading by index - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -39,178 +39,10 @@ #include "zipint.h" -static struct zip_file *_zip_file_new(struct zip *za); - ZIP_EXTERN(struct zip_file *) -zip_fopen_index(struct zip *za, int fileno, int flags) -{ - int len, ret; - int zfflags; - struct zip_file *zf; - - if ((fileno < 0) || (fileno >= za->nentry)) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - if ((flags & ZIP_FL_UNCHANGED) == 0 - && ZIP_ENTRY_DATA_CHANGED(za->entry+fileno)) { - _zip_error_set(&za->error, ZIP_ER_CHANGED, 0); - return NULL; - } - - if (fileno >= za->cdir->nentry) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - zfflags = 0; - switch (za->cdir->entry[fileno].comp_method) { - case ZIP_CM_STORE: - zfflags |= ZIP_ZF_CRC; - break; - - case ZIP_CM_DEFLATE: - if ((flags & ZIP_FL_COMPRESSED) == 0) - zfflags |= ZIP_ZF_CRC | ZIP_ZF_DECOMP; - break; - default: - if ((flags & ZIP_FL_COMPRESSED) == 0) { - _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); - return NULL; - } - break; - } - - zf = _zip_file_new(za); - - zf->flags = zfflags; - /* zf->name = za->cdir->entry[fileno].filename; */ - zf->method = za->cdir->entry[fileno].comp_method; - zf->bytes_left = za->cdir->entry[fileno].uncomp_size; - zf->cbytes_left = za->cdir->entry[fileno].comp_size; - zf->crc_orig = za->cdir->entry[fileno].crc; - - if ((zf->fpos=_zip_file_get_offset(za, fileno)) == 0) { - zip_fclose(zf); - return NULL; - } - - if ((zf->flags & ZIP_ZF_DECOMP) == 0) - zf->bytes_left = zf->cbytes_left; - else { - if ((zf->buffer=(char *)malloc(BUFSIZE)) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - zip_fclose(zf); - return NULL; - } - - len = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf); - if (len <= 0) { - _zip_error_copy(&za->error, &zf->error); - zip_fclose(zf); - return NULL; - } - - if ((zf->zstr = (z_stream *)malloc(sizeof(z_stream))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - zip_fclose(zf); - return NULL; - } - zf->zstr->zalloc = Z_NULL; - zf->zstr->zfree = Z_NULL; - zf->zstr->opaque = NULL; - zf->zstr->next_in = (Bytef *)zf->buffer; - zf->zstr->avail_in = len; - - /* negative value to tell zlib that there is no header */ - if ((ret=inflateInit2(zf->zstr, -MAX_WBITS)) != Z_OK) { - _zip_error_set(&za->error, ZIP_ER_ZLIB, ret); - zip_fclose(zf); - return NULL; - } - } - - return zf; -} - - - -int -_zip_file_fillbuf(void *buf, size_t buflen, struct zip_file *zf) -{ - int i, j; - - if (zf->error.zip_err != ZIP_ER_OK) - return -1; - - if ((zf->flags & ZIP_ZF_EOF) || zf->cbytes_left <= 0 || buflen <= 0) - return 0; - - if (fseeko(zf->za->zp, zf->fpos, SEEK_SET) < 0) { - _zip_error_set(&zf->error, ZIP_ER_SEEK, errno); - return -1; - } - if (buflen < zf->cbytes_left) - i = buflen; - else - i = zf->cbytes_left; - - j = fread(buf, 1, i, zf->za->zp); - if (j == 0) { - _zip_error_set(&zf->error, ZIP_ER_EOF, 0); - j = -1; - } - else if (j < 0) - _zip_error_set(&zf->error, ZIP_ER_READ, errno); - else { - zf->fpos += j; - zf->cbytes_left -= j; - } - - return j; -} - - - -static struct zip_file * -_zip_file_new(struct zip *za) +zip_fopen_index(struct zip *za, zip_uint64_t fileno, int flags) { - struct zip_file *zf, **file; - int n; - - if ((zf=(struct zip_file *)malloc(sizeof(struct zip_file))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return NULL; - } - - if (za->nfile >= za->nfile_alloc-1) { - n = za->nfile_alloc + 10; - file = (struct zip_file **)realloc(za->file, - n*sizeof(struct zip_file *)); - if (file == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - free(zf); - return NULL; - } - za->nfile_alloc = n; - za->file = file; - } - - za->file[za->nfile++] = zf; - - zf->za = za; - _zip_error_init(&zf->error); - zf->flags = 0; - zf->crc = crc32(0L, Z_NULL, 0); - zf->crc_orig = 0; - zf->method = -1; - zf->bytes_left = zf->cbytes_left = 0; - zf->fpos = 0; - zf->buffer = NULL; - zf->zstr = NULL; - - return zf; + return zip_fopen_index_encrypted(za, fileno, flags, za->default_password); } diff -Nru php5-5.4.4/ext/zip/lib/zip_fopen_index_encrypted.c php5-5.4.9/ext/zip/lib/zip_fopen_index_encrypted.c --- php5-5.4.4/ext/zip/lib/zip_fopen_index_encrypted.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_fopen_index_encrypted.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,191 @@ +/* + zip_fopen_index_encrypted.c -- open file for reading by index w/ password + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include +#include +#include + +#include "zipint.h" + +static struct zip_file *_zip_file_new(struct zip *za); + + + +ZIP_EXTERN(struct zip_file *) +zip_fopen_index_encrypted(struct zip *za, zip_uint64_t fileno, int flags, + const char *password) +{ + struct zip_file *zf; + zip_compression_implementation comp_impl; + zip_encryption_implementation enc_impl; + struct zip_source *src, *s2; + zip_uint64_t start; + struct zip_stat st; + + if (fileno >= za->nentry) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + + if ((flags & ZIP_FL_UNCHANGED) == 0 + && ZIP_ENTRY_DATA_CHANGED(za->entry+fileno)) { + _zip_error_set(&za->error, ZIP_ER_CHANGED, 0); + return NULL; + } + + if (fileno >= za->cdir->nentry) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + + if (flags & ZIP_FL_ENCRYPTED) + flags |= ZIP_FL_COMPRESSED; + + zip_stat_index(za, fileno, flags, &st); + + enc_impl = NULL; + if ((flags & ZIP_FL_ENCRYPTED) == 0) { + if (st.encryption_method != ZIP_EM_NONE) { + if (password == NULL) { + _zip_error_set(&za->error, ZIP_ER_NOPASSWD, 0); + return NULL; + } + if ((enc_impl=zip_get_encryption_implementation( + st.encryption_method)) == NULL) { + _zip_error_set(&za->error, ZIP_ER_ENCRNOTSUPP, 0); + return NULL; + } + } + } + + comp_impl = NULL; + if ((flags & ZIP_FL_COMPRESSED) == 0) { + if (st.comp_method != ZIP_CM_STORE) { + if ((comp_impl=zip_get_compression_implementation( + st.comp_method)) == NULL) { + _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); + return NULL; + } + } + } + + if ((start=_zip_file_get_offset(za, fileno)) == 0) + return NULL; + + if (st.comp_size == 0) { + if ((src=zip_source_buffer(za, NULL, 0, 0)) == NULL) + return NULL; + } + else { + if ((src=_zip_source_file_or_p(za, NULL, za->zp, start, st.comp_size, + 0, &st)) == NULL) + return NULL; + if (enc_impl) { + if ((s2=enc_impl(za, src, ZIP_EM_TRAD_PKWARE, 0, + password)) == NULL) { + zip_source_free(src); + /* XXX: set error (how?) */ + return NULL; + } + src = s2; + } + if (comp_impl) { + if ((s2=comp_impl(za, src, za->cdir->entry[fileno].comp_method, + 0)) == NULL) { + zip_source_free(src); + /* XXX: set error (how?) */ + return NULL; + } + src = s2; + } + if ((flags & ZIP_FL_COMPRESSED) == 0 + || st.comp_method == ZIP_CM_STORE ) { + if ((s2=zip_source_crc(za, src, 1)) == NULL) { + zip_source_free(src); + /* XXX: set error (how?) */ + return NULL; + } + src = s2; + } + } + + if (zip_source_open(src) < 0) { + _zip_error_set_from_source(&za->error, src); + zip_source_free(src); + return NULL; + } + + zf = _zip_file_new(za); + + zf->src = src; + + return zf; +} + + + +static struct zip_file * +_zip_file_new(struct zip *za) +{ + struct zip_file *zf, **file; + int n; + + if ((zf=(struct zip_file *)malloc(sizeof(struct zip_file))) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } + + if (za->nfile >= za->nfile_alloc-1) { + n = za->nfile_alloc + 10; + file = (struct zip_file **)realloc(za->file, + n*sizeof(struct zip_file *)); + if (file == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + free(zf); + return NULL; + } + za->nfile_alloc = n; + za->file = file; + } + + za->file[za->nfile++] = zf; + + zf->za = za; + _zip_error_init(&zf->error); + zf->eof = 0; + zf->src = NULL; + + return zf; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_fread.c php5-5.4.9/ext/zip/lib/zip_fread.c --- php5-5.4.4/ext/zip/lib/zip_fread.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_fread.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_fread.c -- read from file - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -37,12 +37,10 @@ -ZIP_EXTERN(ssize_t) -zip_fread(struct zip_file *zf, void *outbuf, size_t toread) +ZIP_EXTERN(zip_int64_t) +zip_fread(struct zip_file *zf, void *outbuf, zip_uint64_t toread) { - int ret; - size_t out_before, len; - int i; + zip_int64_t n; if (!zf) return -1; @@ -50,81 +48,18 @@ if (zf->error.zip_err != 0) return -1; - if ((zf->flags & ZIP_ZF_EOF) || (toread == 0)) - return 0; + if (toread > ZIP_INT64_MAX) { + _zip_error_set(&zf->error, ZIP_ER_INVAL, 0); + return -1; + } - if (zf->bytes_left == 0) { - zf->flags |= ZIP_ZF_EOF; - if (zf->flags & ZIP_ZF_CRC) { - if (zf->crc != zf->crc_orig) { - _zip_error_set(&zf->error, ZIP_ER_CRC, 0); - return -1; - } - } + if ((zf->eof) || (toread == 0)) return 0; - } - if ((zf->flags & ZIP_ZF_DECOMP) == 0) { - ret = _zip_file_fillbuf(outbuf, toread, zf); - if (ret > 0) { - if (zf->flags & ZIP_ZF_CRC) - zf->crc = crc32(zf->crc, (Bytef *)outbuf, ret); - zf->bytes_left -= ret; - } - return ret; - } - - zf->zstr->next_out = (Bytef *)outbuf; - zf->zstr->avail_out = toread; - out_before = zf->zstr->total_out; - - /* endless loop until something has been accomplished */ - for (;;) { - ret = inflate(zf->zstr, Z_SYNC_FLUSH); - - switch (ret) { - case Z_STREAM_END: - if (zf->zstr->total_out == out_before) { - if (zf->crc != zf->crc_orig) { - _zip_error_set(&zf->error, ZIP_ER_CRC, 0); - return -1; - } - else - return 0; - } - - /* fallthrough */ - - case Z_OK: - len = zf->zstr->total_out - out_before; - if (len >= zf->bytes_left || len >= toread) { - if (zf->flags & ZIP_ZF_CRC) - zf->crc = crc32(zf->crc, (Bytef *)outbuf, len); - zf->bytes_left -= len; - return len; - } - break; - - case Z_BUF_ERROR: - if (zf->zstr->avail_in == 0) { - i = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf); - if (i == 0) { - _zip_error_set(&zf->error, ZIP_ER_INCONS, 0); - return -1; - } - else if (i < 0) - return -1; - zf->zstr->next_in = (Bytef *)zf->buffer; - zf->zstr->avail_in = i; - continue; - } - /* fallthrough */ - case Z_NEED_DICT: - case Z_DATA_ERROR: - case Z_STREAM_ERROR: - case Z_MEM_ERROR: - _zip_error_set(&zf->error, ZIP_ER_ZLIB, ret); - return -1; - } + if ((n=zip_source_read(zf->src, outbuf, toread)) < 0) { + _zip_error_set_from_source(&zf->error, zf->src); + return -1; } + + return n; } diff -Nru php5-5.4.4/ext/zip/lib/zip_free.c php5-5.4.9/ext/zip/lib/zip_free.c --- php5-5.4.4/ext/zip/lib/zip_free.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_free.c 2012-11-21 05:12:20.000000000 +0000 @@ -57,7 +57,9 @@ if (za->zp) fclose(za->zp); + free(za->default_password); _zip_cdir_free(za->cdir); + free(za->ch_comment); if (za->entry) { for (i=0; inentry; i++) { diff -Nru php5-5.4.4/ext/zip/lib/zip_get_archive_comment.c php5-5.4.9/ext/zip/lib/zip_get_archive_comment.c --- php5-5.4.4/ext/zip/lib/zip_get_archive_comment.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_get_archive_comment.c 2012-11-21 05:12:20.000000000 +0000 @@ -42,11 +42,11 @@ { if ((flags & ZIP_FL_UNCHANGED) || (za->ch_comment_len == -1)) { - if (za->cdir) { - if (lenp != NULL) - *lenp = za->cdir->comment_len; - return za->cdir->comment; - } + if (za->cdir) { + if (lenp != NULL) + *lenp = za->cdir->comment_len; + return za->cdir->comment; + } else { if (lenp != NULL) *lenp = -1; diff -Nru php5-5.4.4/ext/zip/lib/zip_get_archive_flag.c php5-5.4.9/ext/zip/lib/zip_get_archive_flag.c --- php5-5.4.4/ext/zip/lib/zip_get_archive_flag.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_get_archive_flag.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_get_archive_flag.c -- get archive global flag - Copyright (C) 2008-2009 Dieter Baron and Thomas Klausner + Copyright (C) 2008 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at diff -Nru php5-5.4.4/ext/zip/lib/zip_get_compression_implementation.c php5-5.4.9/ext/zip/lib/zip_get_compression_implementation.c --- php5-5.4.4/ext/zip/lib/zip_get_compression_implementation.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_get_compression_implementation.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,46 @@ +/* + zip_get_compression_implementation.c -- get compression implementation + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(zip_compression_implementation) +zip_get_compression_implementation(zip_uint16_t cm) +{ + if (cm == ZIP_CM_DEFLATE) + return zip_source_deflate; + return NULL; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_get_encryption_implementation.c php5-5.4.9/ext/zip/lib/zip_get_encryption_implementation.c --- php5-5.4.4/ext/zip/lib/zip_get_encryption_implementation.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_get_encryption_implementation.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,46 @@ +/* + zip_get_encryption_implementation.c -- get encryption implementation + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(zip_encryption_implementation) +zip_get_encryption_implementation(zip_uint16_t em) +{ + if (em == ZIP_EM_TRAD_PKWARE) + return zip_source_pkware; + return NULL; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_get_file_comment.c php5-5.4.9/ext/zip/lib/zip_get_file_comment.c --- php5-5.4.4/ext/zip/lib/zip_get_file_comment.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_get_file_comment.c 2012-11-21 05:12:20.000000000 +0000 @@ -38,9 +38,9 @@ ZIP_EXTERN(const char *) -zip_get_file_comment(struct zip *za, int idx, int *lenp, int flags) +zip_get_file_comment(struct zip *za, zip_uint64_t idx, int *lenp, int flags) { - if (idx < 0 || idx >= za->nentry) { + if (idx >= za->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return NULL; } diff -Nru php5-5.4.4/ext/zip/lib/zip_get_file_extra.c php5-5.4.9/ext/zip/lib/zip_get_file_extra.c --- php5-5.4.4/ext/zip/lib/zip_get_file_extra.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_get_file_extra.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,58 @@ +/* + zip_get_file_extra.c -- get file extra field + Copyright (C) 2006-2010 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(const char *) +zip_get_file_extra(struct zip *za, zip_uint64_t idx, int *lenp, int flags) +{ + if (idx >= za->nentry) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + + if ((flags & ZIP_FL_UNCHANGED) + || (za->entry[idx].ch_extra_len == -1)) { + if (lenp != NULL) + *lenp = za->cdir->entry[idx].extrafield_len; + return za->cdir->entry[idx].extrafield; + } + + if (lenp != NULL) + *lenp = za->entry[idx].ch_extra_len; + return za->entry[idx].ch_extra; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_get_name.c php5-5.4.9/ext/zip/lib/zip_get_name.c --- php5-5.4.4/ext/zip/lib/zip_get_name.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_get_name.c 2012-11-21 05:12:20.000000000 +0000 @@ -38,7 +38,7 @@ ZIP_EXTERN(const char *) -zip_get_name(struct zip *za, int idx, int flags) +zip_get_name(struct zip *za, zip_uint64_t idx, int flags) { return _zip_get_name(za, idx, flags, &za->error); } @@ -46,9 +46,10 @@ const char * -_zip_get_name(struct zip *za, int idx, int flags, struct zip_error *error) +_zip_get_name(struct zip *za, zip_uint64_t idx, int flags, + struct zip_error *error) { - if (idx < 0 || idx >= za->nentry) { + if (idx >= za->nentry) { _zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } diff -Nru php5-5.4.4/ext/zip/lib/zip_get_num_entries.c php5-5.4.9/ext/zip/lib/zip_get_num_entries.c --- php5-5.4.4/ext/zip/lib/zip_get_num_entries.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_get_num_entries.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,52 @@ +/* + zip_get_num_entries.c -- get number of entries in archive + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(zip_uint64_t) +zip_get_num_entries(struct zip *za, int flags) +{ + if (za == NULL) + return -1; + + if (flags & ZIP_FL_UNCHANGED) { + if (za->cdir == NULL) + return 0; + return za->cdir->nentry; + } + return za->nentry; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_name_locate.c php5-5.4.9/ext/zip/lib/zip_name_locate.c --- php5-5.4.4/ext/zip/lib/zip_name_locate.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_name_locate.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_name_locate.c -- get index by name - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -55,13 +55,17 @@ const char *fn, *p; int i, n; + if (za == NULL) + return -1; + if (fname == NULL) { _zip_error_set(error, ZIP_ER_INVAL, 0); return -1; } - if((flags & ZIP_FL_UNCHANGED) && !za->cdir) { - return -1; + if ((flags & ZIP_FL_UNCHANGED) && za->cdir == NULL) { + _zip_error_set(error, ZIP_ER_NOENT, 0); + return -1; } cmp = (flags & ZIP_FL_NOCASE) ? strcmpi : strcmp; @@ -76,7 +80,7 @@ /* newly added (partially filled) entry */ if (fn == NULL) continue; - + if (flags & ZIP_FL_NODIR) { p = strrchr(fn, '/'); if (p) diff -Nru php5-5.4.4/ext/zip/lib/zip_new.c php5-5.4.9/ext/zip/lib/zip_new.c --- php5-5.4.4/ext/zip/lib/zip_new.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_new.c 2012-11-21 05:12:20.000000000 +0000 @@ -65,6 +65,7 @@ za->nfile = za->nfile_alloc = 0; za->file = NULL; za->flags = za->ch_flags = 0; + za->default_password = NULL; return za; } diff -Nru php5-5.4.4/ext/zip/lib/zip_open.c php5-5.4.9/ext/zip/lib/zip_open.c --- php5-5.4.4/ext/zip/lib/zip_open.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_open.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* - zip_open.c -- open zip archive - Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + zip_open.c -- open zip archive by name + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -52,7 +52,7 @@ struct zip_dirent *, int); static unsigned char *_zip_memmem(const unsigned char *, int, const unsigned char *, int); -static struct zip_cdir *_zip_readcdir(FILE *, unsigned char *, unsigned char *, +static struct zip_cdir *_zip_readcdir(FILE *, off_t, unsigned char *, unsigned char *, int, int, struct zip_error *); @@ -61,10 +61,6 @@ zip_open(const char *fn, int flags, int *zep) { FILE *fp; - struct zip *za; - struct zip_cdir *cdir; - int i; - off_t len; if (flags & ZIP_OVERWRITE) { return _zip_allocate_new(fn, zep); @@ -75,10 +71,8 @@ if (!(flags & ZIP_OVERWRITE)) { return NULL; } - case 0: return _zip_allocate_new(fn, zep); - default: break; } @@ -88,7 +82,23 @@ return NULL; } - fseeko(fp, 0, SEEK_END); + return _zip_open(fn, fp, flags, 0, zep); +} + + + +struct zip * +_zip_open(const char *fn, FILE *fp, int flags, int aflags, int *zep) +{ + struct zip *za; + struct zip_cdir *cdir; + int i; + off_t len; + + if (fseeko(fp, 0, SEEK_END) < 0) { + *zep = ZIP_ER_SEEK; + return NULL; + } len = ftello(fp); /* treat empty files as empty archives */ @@ -156,13 +166,13 @@ entries, or NULL if unsuccessful. */ static struct zip_cdir * -_zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen, +_zip_readcdir(FILE *fp, off_t buf_offset, unsigned char *buf, unsigned char *eocd, int buflen, int flags, struct zip_error *error) { struct zip_cdir *cd; unsigned char *cdp, **bufp; int i, comlen, nentry; - unsigned int left; + zip_uint32_t left; comlen = buf + buflen - eocd - EOCDLEN; if (comlen < 0) { @@ -196,14 +206,24 @@ cd->comment = NULL; cd->comment_len = _zip_read2(&cdp); + if (((zip_uint64_t)cd->offset)+cd->size > buf_offset + (eocd-buf)) { + /* cdir spans past EOCD record */ + _zip_error_set(error, ZIP_ER_INCONS, 0); + cd->nentry = 0; + _zip_cdir_free(cd); + return NULL; + } + if ((comlen < cd->comment_len) || (cd->nentry != i)) { _zip_error_set(error, ZIP_ER_NOZIP, 0); - free(cd); + cd->nentry = 0; + _zip_cdir_free(cd); return NULL; } if ((flags & ZIP_CHECKCONS) && comlen != cd->comment_len) { _zip_error_set(error, ZIP_ER_INCONS, 0); - free(cd); + cd->nentry = 0; + _zip_cdir_free(cd); return NULL; } @@ -211,14 +231,15 @@ if ((cd->comment=(char *)_zip_memdup(eocd+EOCDLEN, cd->comment_len, error)) == NULL) { - free(cd); + cd->nentry = 0; + _zip_cdir_free(cd); return NULL; } } - if (cd->size < (unsigned int)(eocd-buf)) { + if (cd->offset >= buf_offset) { /* if buffer already read in, use it */ - cdp = eocd - cd->size; + cdp = buf + (cd->offset - buf_offset); bufp = &cdp; } else { @@ -234,20 +255,15 @@ _zip_error_set(error, ZIP_ER_SEEK, errno); else _zip_error_set(error, ZIP_ER_NOZIP, 0); - free(cd); + cd->nentry = 0; + _zip_cdir_free(cd); return NULL; } } left = cd->size; i=0; - do { - if (i == cd->nentry && left > 0) { - /* Infozip extension for more than 64k entries: - nentries wraps around, size indicates correct EOCD */ - _zip_cdir_grow(cd, cd->nentry+0x10000, error); - } - + while (inentry && left > 0) { if ((_zip_dirent_read(cd->entry+i, fp, bufp, &left, 0, error)) < 0) { cd->nentry = i; _zip_cdir_free(cd); @@ -255,7 +271,18 @@ } i++; - } while (inentry); + if (i == cd->nentry && left > 0) { + /* Infozip extension for more than 64k entries: + nentries wraps around, size indicates correct EOCD */ + if (_zip_cdir_grow(cd, cd->nentry+ZIP_UINT16_MAX, error) < 0) { + cd->nentry = i; + _zip_cdir_free(cd); + return NULL; + } + } + } + + cd->nentry = i; return cd; } @@ -336,17 +363,17 @@ if (za->cdir->comment_len != TORRENT_SIG_LEN+8 || strncmp(za->cdir->comment, TORRENT_SIG, TORRENT_SIG_LEN) != 0) return; - + memcpy(buf, za->cdir->comment+TORRENT_SIG_LEN, 8); buf[8] = '\0'; errno = 0; crc_should = strtoul(buf, &end, 16); if ((crc_should == UINT_MAX && errno != 0) || (end && *end)) return; - + if (_zip_filerange_crc(za->zp, za->cdir->offset, za->cdir->size, &crc_got, NULL) < 0) - return; + return; if (crc_got == crc_should) za->flags |= ZIP_AFL_TORRENT; @@ -434,12 +461,16 @@ set_error(zep, &error, 0); return NULL; } - - za->zn = strdup(fn); - if (!za->zn) { - _zip_free(za); - set_error(zep, NULL, ZIP_ER_MEMORY); - return NULL; + + if (fn == NULL) + za->zn = NULL; + else { + za->zn = strdup(fn); + if (!za->zn) { + _zip_free(za); + set_error(zep, NULL, ZIP_ER_MEMORY); + return NULL; + } } return za; } @@ -481,6 +512,7 @@ { struct zip_cdir *cdir, *cdirnew; unsigned char *buf, *match; + off_t buf_offset; int a, best, buflen, i; struct zip_error zerr; @@ -490,7 +522,8 @@ set_error(zep, NULL, ZIP_ER_SEEK); return NULL; } - + buf_offset = ftello(fp); + /* 64k is too much for stack */ if ((buf=(unsigned char *)malloc(CDBUFSIZE)) == NULL) { set_error(zep, NULL, ZIP_ER_MEMORY); @@ -516,7 +549,7 @@ /* found match -- check, if good */ /* to avoid finding the same match all over again */ match++; - if ((cdirnew=_zip_readcdir(fp, buf, match-1, buflen, flags, + if ((cdirnew=_zip_readcdir(fp, buf_offset, buf, match-1, buflen, flags, &zerr)) == NULL) continue; diff -Nru php5-5.4.4/ext/zip/lib/zip_rename.c php5-5.4.9/ext/zip/lib/zip_rename.c --- php5-5.4.4/ext/zip/lib/zip_rename.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_rename.c 2012-11-21 05:12:20.000000000 +0000 @@ -40,16 +40,21 @@ ZIP_EXTERN(int) -zip_rename(struct zip *za, int idx, const char *name) +zip_rename(struct zip *za, zip_uint64_t idx, const char *name) { const char *old_name; int old_is_dir, new_is_dir; - if (idx >= za->nentry || idx < 0 || name[0] == '\0') { + if (idx >= za->nentry || name[0] == '\0') { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + if ((old_name=zip_get_name(za, idx, 0)) == NULL) return -1; diff -Nru php5-5.4.4/ext/zip/lib/zip_replace.c php5-5.4.9/ext/zip/lib/zip_replace.c --- php5-5.4.4/ext/zip/lib/zip_replace.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_replace.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_replace.c -- replace file via callback function - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -38,9 +38,9 @@ ZIP_EXTERN(int) -zip_replace(struct zip *za, int idx, struct zip_source *source) +zip_replace(struct zip *za, zip_uint64_t idx, struct zip_source *source) { - if (idx < 0 || idx >= za->nentry || source == NULL) { + if (idx >= za->nentry || source == NULL) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } @@ -54,11 +54,18 @@ -int -_zip_replace(struct zip *za, int idx, const char *name, +/* NOTE: Signed due to -1 on error. See zip_add.c for more details. */ + +zip_int64_t +_zip_replace(struct zip *za, zip_uint64_t idx, const char *name, struct zip_source *source) { - if (idx == -1) { + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + + if (idx == ZIP_UINT64_MAX) { if (_zip_entry_new(za) == NULL) return -1; diff -Nru php5-5.4.4/ext/zip/lib/zip_set_archive_comment.c php5-5.4.9/ext/zip/lib/zip_set_archive_comment.c --- php5-5.4.4/ext/zip/lib/zip_set_archive_comment.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_set_archive_comment.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_set_archive_comment.c -- set archive comment - Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -50,6 +50,11 @@ return -1; } + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + if (len > 0) { if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL) return -1; diff -Nru php5-5.4.4/ext/zip/lib/zip_set_archive_flag.c php5-5.4.9/ext/zip/lib/zip_set_archive_flag.c --- php5-5.4.4/ext/zip/lib/zip_set_archive_flag.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_set_archive_flag.c 2012-11-21 05:12:20.000000000 +0000 @@ -40,10 +40,30 @@ ZIP_EXTERN(int) zip_set_archive_flag(struct zip *za, int flag, int value) { + unsigned int new_flags; + if (value) - za->ch_flags |= flag; + new_flags = za->ch_flags | flag; else - za->ch_flags &= ~flag; + new_flags = za->ch_flags & ~flag; + + if (new_flags == za->ch_flags) + return 0; + + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + + if ((flag & ZIP_AFL_RDONLY) && value + && (za->ch_flags & ZIP_AFL_RDONLY) == 0) { + if (_zip_changed(za, NULL)) { + _zip_error_set(&za->error, ZIP_ER_CHANGED, 0); + return -1; + } + } + + za->ch_flags = new_flags; return 0; } diff -Nru php5-5.4.4/ext/zip/lib/zip_set_default_password.c php5-5.4.9/ext/zip/lib/zip_set_default_password.c --- php5-5.4.4/ext/zip/lib/zip_set_default_password.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_set_default_password.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,62 @@ +/* + zip_set_default_password.c -- set default password for decryption + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include +#include + +#include "zipint.h" + + + +ZIP_EXTERN(int) +zip_set_default_password(struct zip *za, const char *passwd) +{ + if (za == NULL) + return -1; + + if (za->default_password) + free(za->default_password); + + if (passwd) { + if ((za->default_password=strdup(passwd)) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return -1; + } + } + else + za->default_password = NULL; + + return 0; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_set_file_comment.c php5-5.4.9/ext/zip/lib/zip_set_file_comment.c --- php5-5.4.4/ext/zip/lib/zip_set_file_comment.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_set_file_comment.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_set_file_comment.c -- set comment for file in archive - Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -40,17 +40,23 @@ ZIP_EXTERN(int) -zip_set_file_comment(struct zip *za, int idx, const char *comment, int len) +zip_set_file_comment(struct zip *za, zip_uint64_t idx, + const char *comment, int len) { char *tmpcom; - if (idx < 0 || idx >= za->nentry + if (idx >= za->nentry || len < 0 || len > MAXCOMLEN || (len > 0 && comment == NULL)) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + if (len > 0) { if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL) return -1; diff -Nru php5-5.4.4/ext/zip/lib/zip_set_file_extra.c php5-5.4.9/ext/zip/lib/zip_set_file_extra.c --- php5-5.4.4/ext/zip/lib/zip_set_file_extra.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_set_file_extra.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,72 @@ +/* + zip_set_file_extra.c -- set extra field for file in archive + Copyright (C) 2006-2010 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include + +#include "zipint.h" + + + +ZIP_EXTERN(int) +zip_set_file_extra(struct zip *za, zip_uint64_t idx, + const char *extra, int len) +{ + char *tmpext; + + if (idx >= za->nentry + || len < 0 || len > MAXEXTLEN + || (len > 0 && extra == NULL)) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return -1; + } + + if (ZIP_IS_RDONLY(za)) { + _zip_error_set(&za->error, ZIP_ER_RDONLY, 0); + return -1; + } + + if (len > 0) { + if ((tmpext=(char *)_zip_memdup(extra, len, &za->error)) == NULL) + return -1; + } + else + tmpext = NULL; + + free(za->entry[idx].ch_extra); + za->entry[idx].ch_extra = tmpext; + za->entry[idx].ch_extra_len = len; + + return 0; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_set_name.c php5-5.4.9/ext/zip/lib/zip_set_name.c --- php5-5.4.4/ext/zip/lib/zip_set_name.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_set_name.c 2012-11-21 05:12:20.000000000 +0000 @@ -41,12 +41,12 @@ int -_zip_set_name(struct zip *za, int idx, const char *name) +_zip_set_name(struct zip *za, zip_uint64_t idx, const char *name) { char *s; - int i; + zip_int64_t i; - if (idx < 0 || idx >= za->nentry || name == NULL) { + if (idx >= za->nentry || name == NULL) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } diff -Nru php5-5.4.4/ext/zip/lib/zip_source_buffer.c php5-5.4.9/ext/zip/lib/zip_source_buffer.c --- php5-5.4.4/ext/zip/lib/zip_source_buffer.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_buffer.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_source_buffer.c -- create zip data source from buffer - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -44,13 +44,12 @@ int freep; }; -static ssize_t read_data(void *state, void *data, size_t len, - enum zip_source_cmd cmd); +static zip_int64_t read_data(void *, void *, zip_uint64_t, enum zip_source_cmd); ZIP_EXTERN(struct zip_source *) -zip_source_buffer(struct zip *za, const void *data, off_t len, int freep) +zip_source_buffer(struct zip *za, const void *data, zip_uint64_t len, int freep) { struct read_data *f; struct zip_source *zs; @@ -58,7 +57,7 @@ if (za == NULL) return NULL; - if (len < 0 || (data == NULL && len > 0)) { + if (data == NULL && len > 0) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return NULL; } @@ -83,12 +82,12 @@ -static ssize_t -read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd) +static zip_int64_t +read_data(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd) { struct read_data *z; char *buf; - size_t n; + zip_uint64_t n; z = (struct read_data *)state; buf = (char *)data; @@ -99,6 +98,8 @@ return 0; case ZIP_SOURCE_READ: + /* XXX: return error if (len > ZIP_INT64_MAX) */ + n = z->end - z->buf; if (n > len) n = len; @@ -125,6 +126,11 @@ zip_stat_init(st); st->mtime = z->mtime; st->size = z->end - z->data; + st->comp_size = st->size; + st->comp_method = ZIP_CM_STORE; + st->encryption_method = ZIP_EM_NONE; + st->valid = ZIP_STAT_MTIME|ZIP_STAT_SIZE|ZIP_STAT_COMP_SIZE + |ZIP_STAT_COMP_METHOD|ZIP_STAT_ENCRYPTION_METHOD; return sizeof(*st); } diff -Nru php5-5.4.4/ext/zip/lib/zip_source_close.c php5-5.4.9/ext/zip/lib/zip_source_close.c --- php5-5.4.4/ext/zip/lib/zip_source_close.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_close.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,54 @@ +/* + zip_source_close.c -- close zip_source (stop reading) + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(void) +zip_source_close(struct zip_source *src) +{ + if (!src->is_open) + return; + + if (src->src == NULL) + (void)src->cb.f(src->ud, NULL, 0, ZIP_SOURCE_CLOSE); + else { + (void)src->cb.l(src->src, src->ud, NULL, 0, ZIP_SOURCE_CLOSE); + zip_source_close(src->src); + } + + src->is_open = 0; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_source_crc.c php5-5.4.9/ext/zip/lib/zip_source_crc.c --- php5-5.4.4/ext/zip/lib/zip_source_crc.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_crc.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,159 @@ +/* + zip_source_crc.c -- pass-through source that calculates CRC32 and size + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include +#include + +#include "zipint.h" + +struct crc { + int eof; + int validate; + int e[2]; + zip_uint64_t size; + zip_uint32_t crc; +}; + +static zip_int64_t crc_read(struct zip_source *, void *, void * + , zip_uint64_t, enum zip_source_cmd); + + + +ZIP_EXTERN(struct zip_source *) +zip_source_crc(struct zip *za, struct zip_source *src, int validate) +{ + struct crc *ctx; + + if (src == NULL) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + + if ((ctx=(struct crc *)malloc(sizeof(*ctx))) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } + + ctx->validate = validate; + + return zip_source_layered(za, src, crc_read, ctx); +} + + + +static zip_int64_t +crc_read(struct zip_source *src, void *_ctx, void *data, + zip_uint64_t len, enum zip_source_cmd cmd) +{ + struct crc *ctx; + zip_int64_t n; + + ctx = (struct crc *)_ctx; + + switch (cmd) { + case ZIP_SOURCE_OPEN: + ctx->eof = 0; + ctx->crc = crc32(0, NULL, 0); + ctx->size = 0; + + return 0; + + case ZIP_SOURCE_READ: + if (ctx->eof || len == 0) + return 0; + + if ((n=zip_source_read(src, data, len)) < 0) + return ZIP_SOURCE_ERR_LOWER; + + if (n == 0) { + ctx->eof = 1; + if (ctx->validate) { + struct zip_stat st; + + if (zip_source_stat(src, &st) < 0) + return ZIP_SOURCE_ERR_LOWER; + + if ((st.valid & ZIP_STAT_CRC) && st.crc != ctx->crc) { + ctx->e[0] = ZIP_ER_CRC; + ctx->e[1] = 0; + + return -1; + } + if ((st.valid & ZIP_STAT_SIZE) && st.size != ctx->size) { + ctx->e[0] = ZIP_ER_INCONS; + ctx->e[1] = 0; + + return -1; + } + } + } + else { + ctx->size += n; + ctx->crc = crc32(ctx->crc, data, n); + } + return n; + + case ZIP_SOURCE_CLOSE: + return 0; + + case ZIP_SOURCE_STAT: + { + struct zip_stat *st; + + st = (struct zip_stat *)data; + + if (ctx->eof) { + /* XXX: Set comp_size, comp_method, encryption_method? + After all, this only works for uncompressed data. */ + st->size = ctx->size; + st->crc = ctx->crc; + st->valid |= ZIP_STAT_SIZE|ZIP_STAT_CRC; + } + } + return 0; + + case ZIP_SOURCE_ERROR: + memcpy(data, ctx->e, sizeof(ctx->e)); + return 0; + + case ZIP_SOURCE_FREE: + free(ctx); + return 0; + + default: + return -1; + } + +} diff -Nru php5-5.4.4/ext/zip/lib/zip_source_deflate.c php5-5.4.9/ext/zip/lib/zip_source_deflate.c --- php5-5.4.4/ext/zip/lib/zip_source_deflate.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_deflate.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,394 @@ +/* + zip_source_deflate.c -- deflate (de)compressoin routines + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include +#include + +#include "zipint.h" + +struct deflate { + int e[2]; + + int eof; + int mem_level; + zip_uint64_t size; + char buffer[BUFSIZE]; + z_stream zstr; +}; + +static zip_int64_t compress_read(struct zip_source *, struct deflate *, + void *, zip_uint64_t); +static zip_int64_t decompress_read(struct zip_source *, struct deflate *, + void *, zip_uint64_t); +static zip_int64_t deflate_compress(struct zip_source *, void *, void *, + zip_uint64_t, enum zip_source_cmd); +static zip_int64_t deflate_decompress(struct zip_source *, void *, void *, + zip_uint64_t, enum zip_source_cmd); +static void deflate_free(struct deflate *); + + + +ZIP_EXTERN(struct zip_source *) +zip_source_deflate(struct zip *za, struct zip_source *src, + zip_uint16_t cm, int flags) +{ + struct deflate *ctx; + struct zip_source *s2; + + if (src == NULL || cm != ZIP_CM_DEFLATE) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + + if ((ctx=(struct deflate *)malloc(sizeof(*ctx))) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } + + ctx->e[0] = ctx->e[1] = 0; + ctx->eof = 0; + if (flags & ZIP_CODEC_ENCODE) { + if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) + ctx->mem_level = TORRENT_MEM_LEVEL; + else + ctx->mem_level = MAX_MEM_LEVEL; + } + + if ((s2=zip_source_layered(za, src, + ((flags & ZIP_CODEC_ENCODE) + ? deflate_compress : deflate_decompress), + ctx)) == NULL) { + deflate_free(ctx); + return NULL; + } + + return s2; +} + + + +static zip_int64_t +compress_read(struct zip_source *src, struct deflate *ctx, + void *data, zip_uint64_t len) +{ + int end, ret; + zip_int64_t n; + + if (ctx->e[0] != 0) + return -1; + + if (len == 0) + return 0; + + ctx->zstr.next_out = (Bytef *)data; + ctx->zstr.avail_out = len; + + end = 0; + while (!end) { + ret = deflate(&ctx->zstr, ctx->eof ? Z_FINISH : 0); + + switch (ret) { + case Z_OK: + case Z_STREAM_END: + /* all ok */ + + if (ctx->zstr.avail_out == 0 + || (ctx->eof && ctx->zstr.avail_in == 0)) + end = 1; + break; + + case Z_BUF_ERROR: + if (ctx->zstr.avail_in == 0) { + if (ctx->eof) { + end = 1; + break; + } + + if ((n=zip_source_read(src, ctx->buffer, + sizeof(ctx->buffer))) < 0) { + zip_source_error(src, ctx->e, ctx->e+1); + end = 1; + break; + } + else if (n == 0) { + ctx->eof = 1; + ctx->size = ctx->zstr.total_in; + /* XXX: check against stat of src? */ + } + else { + ctx->zstr.next_in = (Bytef *)ctx->buffer; + ctx->zstr.avail_in = n; + } + continue; + } + /* fallthrough */ + case Z_NEED_DICT: + case Z_DATA_ERROR: + case Z_STREAM_ERROR: + case Z_MEM_ERROR: + ctx->e[0] = ZIP_ER_ZLIB; + ctx->e[1] = ret; + + end = 1; + break; + } + } + + if (ctx->zstr.avail_out < len) + return len - ctx->zstr.avail_out; + + return (ctx->e[0] == 0) ? 0 : -1; +} + + + +static zip_int64_t +decompress_read(struct zip_source *src, struct deflate *ctx, + void *data, zip_uint64_t len) +{ + int end, ret; + zip_int64_t n; + + if (ctx->e[0] != 0) + return -1; + + if (len == 0) + return 0; + + ctx->zstr.next_out = (Bytef *)data; + ctx->zstr.avail_out = len; + + end = 0; + while (!end && ctx->zstr.avail_out) { + ret = inflate(&ctx->zstr, Z_SYNC_FLUSH); + + switch (ret) { + case Z_OK: + break; + + case Z_STREAM_END: + ctx->eof = 1; + end = 1; + break; + + case Z_BUF_ERROR: + if (ctx->zstr.avail_in == 0) { + if (ctx->eof) { + end = 1; + break; + } + + if ((n=zip_source_read(src, ctx->buffer, + sizeof(ctx->buffer))) < 0) { + zip_source_error(src, ctx->e, ctx->e+1); + end = 1; + break; + } + else if (n == 0) + ctx->eof = 1; + else { + ctx->zstr.next_in = (Bytef *)ctx->buffer; + ctx->zstr.avail_in = n; + } + continue; + } + /* fallthrough */ + case Z_NEED_DICT: + case Z_DATA_ERROR: + case Z_STREAM_ERROR: + case Z_MEM_ERROR: + ctx->e[0] = ZIP_ER_ZLIB; + ctx->e[1] = ret; + end = 1; + break; + } + } + + if (ctx->zstr.avail_out < len) + return len - ctx->zstr.avail_out; + + return (ctx->e[0] == 0) ? 0 : -1; +} + + + +static zip_int64_t +deflate_compress(struct zip_source *src, void *ud, void *data, + zip_uint64_t len, enum zip_source_cmd cmd) +{ + struct deflate *ctx; + int ret; + + ctx = (struct deflate *)ud; + + switch (cmd) { + case ZIP_SOURCE_OPEN: + ctx->zstr.zalloc = Z_NULL; + ctx->zstr.zfree = Z_NULL; + ctx->zstr.opaque = NULL; + ctx->zstr.avail_in = 0; + ctx->zstr.next_in = NULL; + ctx->zstr.avail_out = 0; + ctx->zstr.next_out = NULL; + + /* negative value to tell zlib not to write a header */ + if ((ret=deflateInit2(&ctx->zstr, Z_BEST_COMPRESSION, Z_DEFLATED, + -MAX_WBITS, ctx->mem_level, + Z_DEFAULT_STRATEGY)) != Z_OK) { + ctx->e[0] = ZIP_ER_ZLIB; + ctx->e[1] = ret; + return -1; + } + + return 0; + + case ZIP_SOURCE_READ: + return compress_read(src, ctx, data, len); + + case ZIP_SOURCE_CLOSE: + deflateEnd(&ctx->zstr); + return 0; + + case ZIP_SOURCE_STAT: + { + struct zip_stat *st; + + st = (struct zip_stat *)data; + + st->comp_method = ZIP_CM_DEFLATE; + st->valid |= ZIP_STAT_COMP_METHOD; + if (ctx->eof) { + st->comp_size = ctx->size; + st->valid |= ZIP_STAT_COMP_SIZE; + } + else + st->valid &= ~ZIP_STAT_COMP_SIZE; + } + return 0; + + case ZIP_SOURCE_ERROR: + memcpy(data, ctx->e, sizeof(int)*2); + return sizeof(int)*2; + + case ZIP_SOURCE_FREE: + deflate_free(ctx); + return 0; + + default: + ctx->e[0] = ZIP_ER_INVAL; + ctx->e[1] = 0; + return -1; + } +} + + + +static zip_int64_t +deflate_decompress(struct zip_source *src, void *ud, void *data, + zip_uint64_t len, enum zip_source_cmd cmd) +{ + struct deflate *ctx; + zip_int64_t n; + int ret; + + ctx = (struct deflate *)ud; + + switch (cmd) { + case ZIP_SOURCE_OPEN: + if ((n=zip_source_read(src, ctx->buffer, sizeof(ctx->buffer))) < 0) + return ZIP_SOURCE_ERR_LOWER; + + ctx->zstr.zalloc = Z_NULL; + ctx->zstr.zfree = Z_NULL; + ctx->zstr.opaque = NULL; + ctx->zstr.next_in = (Bytef *)ctx->buffer; + ctx->zstr.avail_in = n; + + /* negative value to tell zlib that there is no header */ + if ((ret=inflateInit2(&ctx->zstr, -MAX_WBITS)) != Z_OK) { + ctx->e[0] = ZIP_ER_ZLIB; + ctx->e[1] = ret; + + return -1; + } + return 0; + + case ZIP_SOURCE_READ: + return decompress_read(src, ctx, data, len); + + case ZIP_SOURCE_CLOSE: + inflateEnd(&ctx->zstr); + return 0; + + case ZIP_SOURCE_STAT: + { + struct zip_stat *st; + + st = (struct zip_stat *)data; + + st->comp_method = ZIP_CM_STORE; + if (st->comp_size > 0 && st->size > 0) + st->comp_size = st->size; + } + return 0; + + case ZIP_SOURCE_ERROR: + if (len < sizeof(int)*2) + return -1; + + memcpy(data, ctx->e, sizeof(int)*2); + return sizeof(int)*2; + + case ZIP_SOURCE_FREE: + /* XXX: inflateEnd if close was not called */ + free(ctx); + return 0; + + default: + ctx->e[0] = ZIP_ER_INVAL; + ctx->e[1] = 0; + return -1; + } + +} + + + +static void +deflate_free(struct deflate *ctx) +{ + /* XXX: deflateEnd if close was not called */ + free(ctx); +} diff -Nru php5-5.4.4/ext/zip/lib/zip_source_error.c php5-5.4.9/ext/zip/lib/zip_source_error.c --- php5-5.4.4/ext/zip/lib/zip_source_error.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_error.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,87 @@ +/* + zip_source_error.c -- get last error from zip_source + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(void) +zip_source_error(struct zip_source *src, int *ze, int *se) +{ + int e[2]; + + if (src->src == NULL) { + } + else { + switch (src->error_source) { + case ZIP_LES_NONE: + if (src->src == NULL) { + if (src->cb.f(src->ud, e, sizeof(e), ZIP_SOURCE_ERROR) < 0) { + e[0] = ZIP_ER_INTERNAL; + e[1] = 0; + } + } + else + e[0] = e[1] = 0; + break; + + case ZIP_LES_INVAL: + e[0] = ZIP_ER_INVAL; + e[1] = 0; + break; + + case ZIP_LES_LOWER: + zip_source_error(src->src, ze, se); + return; + + case ZIP_LES_UPPER: + if (src->cb.l(src->src, src->ud, e, sizeof(e), + ZIP_SOURCE_ERROR) < 0) { + e[0] = ZIP_ER_INTERNAL; + e[1] = 0; + } + break; + + default: + e[0] = ZIP_ER_INTERNAL; + e[1] = 0; + } + } + + if (ze) + *ze = e[0]; + if (se) + *se = e[1]; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_source_file.c php5-5.4.9/ext/zip/lib/zip_source_file.c --- php5-5.4.4/ext/zip/lib/zip_source_file.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_file.c 2012-11-21 05:12:20.000000000 +0000 @@ -41,15 +41,16 @@ ZIP_EXTERN(struct zip_source *) -zip_source_file(struct zip *za, const char *fname, off_t start, off_t len) +zip_source_file(struct zip *za, const char *fname, zip_uint64_t start, + zip_int64_t len) { if (za == NULL) return NULL; - if (fname == NULL || start < 0 || len < -1) { + if (fname == NULL || len < -1) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return NULL; } - return _zip_source_file_or_p(za, fname, NULL, start, len); + return _zip_source_file_or_p(za, fname, NULL, start, len, 1, NULL); } diff -Nru php5-5.4.4/ext/zip/lib/zip_source_filep.c php5-5.4.9/ext/zip/lib/zip_source_filep.c --- php5-5.4.4/ext/zip/lib/zip_source_filep.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_filep.c 2012-11-21 05:12:20.000000000 +0000 @@ -44,19 +44,23 @@ struct read_file { char *fname; /* name of file to copy from */ FILE *f; /* file to copy from */ - off_t off; /* start offset of */ - off_t len; /* lengt of data to copy */ - off_t remain; /* bytes remaining to be copied */ + int closep; /* close f */ + struct zip_stat st; /* stat information passed in */ + + zip_uint64_t off; /* start offset of */ + zip_int64_t len; /* length of data to copy */ + zip_int64_t remain; /* bytes remaining to be copied */ int e[2]; /* error codes */ }; -static ssize_t read_file(void *state, void *data, size_t len, +static zip_int64_t read_file(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd); ZIP_EXTERN(struct zip_source *) -zip_source_filep(struct zip *za, FILE *file, off_t start, off_t len) +zip_source_filep(struct zip *za, FILE *file, zip_uint64_t start, + zip_int64_t len) { if (za == NULL) return NULL; @@ -66,14 +70,15 @@ return NULL; } - return _zip_source_file_or_p(za, NULL, file, start, len); + return _zip_source_file_or_p(za, NULL, file, start, len, 1, NULL); } struct zip_source * _zip_source_file_or_p(struct zip *za, const char *fname, FILE *file, - off_t start, off_t len) + zip_uint64_t start, zip_int64_t len, int closep, + const struct zip_stat *st) { struct read_file *f; struct zip_source *zs; @@ -99,7 +104,12 @@ f->f = file; f->off = start; f->len = (len ? len : -1); - + f->closep = f->fname ? 1 : closep; + if (st) + memcpy(&f->st, st, sizeof(f->st)); + else + zip_stat_init(&f->st); + if ((zs=zip_source_function(za, read_file, f)) == NULL) { free(f); return NULL; @@ -110,8 +120,8 @@ -static ssize_t -read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd) +static zip_int64_t +read_file(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd) { struct read_file *z; char *buf; @@ -130,20 +140,33 @@ } } - if (fseeko(z->f, z->off, SEEK_SET) < 0) { - z->e[0] = ZIP_ER_SEEK; - z->e[1] = errno; - return -1; + if (z->closep) { + if (fseeko(z->f, (off_t)z->off, SEEK_SET) < 0) { + z->e[0] = ZIP_ER_SEEK; + z->e[1] = errno; + return -1; + } } z->remain = z->len; return 0; case ZIP_SOURCE_READ: + /* XXX: return INVAL if len > size_t max */ if (z->remain != -1) n = len > z->remain ? z->remain : len; else n = len; - + + if (!z->closep) { + /* we might share this file with others, so let's be safe */ + if (fseeko(z->f, (off_t)(z->off + z->len-z->remain), + SEEK_SET) < 0) { + z->e[0] = ZIP_ER_SEEK; + z->e[1] = errno; + return -1; + } + } + if ((i=fread(buf, 1, n, z->f)) < 0) { z->e[0] = ZIP_ER_READ; z->e[1] = errno; @@ -164,34 +187,42 @@ case ZIP_SOURCE_STAT: { - struct zip_stat *st; - struct stat fst; - int err; - - if (len < sizeof(*st)) + if (len < sizeof(z->st)) return -1; - if (z->f) - err = fstat(fileno(z->f), &fst); - else - err = stat(z->fname, &fst); - - if (err != 0) { - z->e[0] = ZIP_ER_READ; /* best match */ - z->e[1] = errno; - return -1; + if (z->st.valid != 0) + memcpy(data, &z->st, sizeof(z->st)); + else { + struct zip_stat *st; + struct stat fst; + int err; + + if (z->f) + err = fstat(fileno(z->f), &fst); + else + err = stat(z->fname, &fst); + + if (err != 0) { + z->e[0] = ZIP_ER_READ; /* best match */ + z->e[1] = errno; + return -1; + } + + st = (struct zip_stat *)data; + + zip_stat_init(st); + st->mtime = fst.st_mtime; + st->valid |= ZIP_STAT_MTIME; + if (z->len != -1) { + st->size = z->len; + st->valid |= ZIP_STAT_SIZE; + } + else if ((fst.st_mode&S_IFMT) == S_IFREG) { + st->size = fst.st_size; + st->valid |= ZIP_STAT_SIZE; + } } - - st = (struct zip_stat *)data; - - zip_stat_init(st); - st->mtime = fst.st_mtime; - if (z->len != -1) - st->size = z->len; - else if ((fst.st_mode&S_IFMT) == S_IFREG) - st->size = fst.st_size; - - return sizeof(*st); + return sizeof(z->st); } case ZIP_SOURCE_ERROR: @@ -203,8 +234,8 @@ case ZIP_SOURCE_FREE: free(z->fname); - if (z->f) - fclose(z->f); + if (z->closep && z->f) + fclose(z->f); free(z); return 0; diff -Nru php5-5.4.4/ext/zip/lib/zip_source_free.c php5-5.4.9/ext/zip/lib/zip_source_free.c --- php5-5.4.4/ext/zip/lib/zip_source_free.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_free.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_source_free.c -- free zip data source - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -40,12 +40,20 @@ ZIP_EXTERN(void) -zip_source_free(struct zip_source *source) +zip_source_free(struct zip_source *src) { - if (source == NULL) + if (src == NULL) return; - (void)source->f(source->ud, NULL, 0, ZIP_SOURCE_FREE); + if (src->is_open) + zip_source_close(src); - free(source); + if (src->src == NULL) + (void)src->cb.f(src->ud, NULL, 0, ZIP_SOURCE_FREE); + else { + (void)src->cb.l(src->src, src->ud, NULL, 0, ZIP_SOURCE_FREE); + zip_source_free(src->src); + } + + free(src); } diff -Nru php5-5.4.4/ext/zip/lib/zip_source_function.c php5-5.4.9/ext/zip/lib/zip_source_function.c --- php5-5.4.4/ext/zip/lib/zip_source_function.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_function.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_source_function.c -- create zip data source from callback function - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -47,13 +47,32 @@ if (za == NULL) return NULL; - if ((zs=(struct zip_source *)malloc(sizeof(*zs))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + if ((zs=_zip_source_new(za)) == NULL) return NULL; - } - zs->f = zcb; + zs->cb.f = zcb; zs->ud = ud; return zs; } + + + +struct zip_source * +_zip_source_new(struct zip *za) +{ + struct zip_source *src; + + if ((src=(struct zip_source *)malloc(sizeof(*src))) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } + + src->src = NULL; + src->cb.f = NULL; + src->ud = NULL; + src->error_source = ZIP_LES_NONE; + src->is_open = 0; + + return src; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_source_layered.c php5-5.4.9/ext/zip/lib/zip_source_layered.c --- php5-5.4.4/ext/zip/lib/zip_source_layered.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_layered.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,59 @@ +/* + zip_source_layered.c -- create layered source + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include + +#include "zipint.h" + + + +ZIP_EXTERN(struct zip_source *) +zip_source_layered(struct zip *za, struct zip_source *src, + zip_source_layered_callback cb, void *ud) +{ + struct zip_source *zs; + + if (za == NULL) + return NULL; + + if ((zs=_zip_source_new(za)) == NULL) + return NULL; + + zs->src = src; + zs->cb.l = cb; + zs->ud = ud; + + return zs; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_source_open.c php5-5.4.9/ext/zip/lib/zip_source_open.c --- php5-5.4.4/ext/zip/lib/zip_source_open.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_open.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,76 @@ +/* + zip_source_open.c -- open zip_source (prepare for reading) + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(int) +zip_source_open(struct zip_source *src) +{ + zip_int64_t ret; + + if (src->is_open) { + src->error_source = ZIP_LES_INVAL; + return -1; + } + + if (src->src == NULL) { + if (src->cb.f(src->ud, NULL, 0, ZIP_SOURCE_OPEN) < 0) + return -1; + } + else { + if (zip_source_open(src->src) < 0) { + src->error_source = ZIP_LES_LOWER; + return -1; + } + + ret = src->cb.l(src->src, src->ud, NULL, 0, ZIP_SOURCE_OPEN); + + if (ret < 0) { + (void)zip_source_close(src->src); + + if (ret == ZIP_SOURCE_ERR_LOWER) + src->error_source = ZIP_LES_LOWER; + else + src->error_source = ZIP_LES_UPPER; + return -1; + } + } + + src->is_open = 1; + + return 0; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_source_pkware.c php5-5.4.9/ext/zip/lib/zip_source_pkware.c --- php5-5.4.4/ext/zip/lib/zip_source_pkware.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_pkware.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,241 @@ +/* + zip_source_pkware.c -- Traditional PKWARE de/encryption routines + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include +#include + +#include "zipint.h" + +struct trad_pkware { + int e[2]; + + zip_uint32_t key[3]; +}; + +#define HEADERLEN 12 +#define KEY0 305419896 +#define KEY1 591751049 +#define KEY2 878082192 + +static const uLongf *crc = NULL; + +#define CRC32(c, b) (crc[((c) ^ (b)) & 0xff] ^ ((c) >> 8)) + + + +static void decrypt(struct trad_pkware *, zip_uint8_t *, + const zip_uint8_t *, zip_uint64_t, int); +static int decrypt_header(struct zip_source *, struct trad_pkware *); +static zip_int64_t pkware_decrypt(struct zip_source *, void *, void *, + zip_uint64_t, enum zip_source_cmd); +static void pkware_free(struct trad_pkware *); + + + +ZIP_EXTERN(struct zip_source *) +zip_source_pkware(struct zip *za, struct zip_source *src, + zip_uint16_t em, int flags, const char *password) +{ + struct trad_pkware *ctx; + struct zip_source *s2; + + if (password == NULL || src == NULL || em != ZIP_EM_TRAD_PKWARE) { + _zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return NULL; + } + if (flags & ZIP_CODEC_ENCODE) { + _zip_error_set(&za->error, ZIP_ER_ENCRNOTSUPP, 0); + return NULL; + } + + if (crc == NULL) + crc = get_crc_table(); + + if ((ctx=(struct trad_pkware *)malloc(sizeof(*ctx))) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } + + ctx->e[0] = ctx->e[1] = 0; + + ctx->key[0] = KEY0; + ctx->key[1] = KEY1; + ctx->key[2] = KEY2; + decrypt(ctx, NULL, (const zip_uint8_t *)password, strlen(password), 1); + + if ((s2=zip_source_layered(za, src, pkware_decrypt, ctx)) == NULL) { + pkware_free(ctx); + return NULL; + } + + return s2; +} + + + +static void +decrypt(struct trad_pkware *ctx, zip_uint8_t *out, const zip_uint8_t *in, + zip_uint64_t len, int update_only) +{ + zip_uint16_t tmp; + zip_uint64_t i; + Bytef b; + + for (i=0; ikey[2] | 2; + tmp = (tmp * (tmp ^ 1)) >> 8; + b ^= tmp; + } + + /* store cleartext */ + if (out) + out[i] = b; + + /* update keys */ + ctx->key[0] = CRC32(ctx->key[0], b); + ctx->key[1] = (ctx->key[1] + (ctx->key[0] & 0xff)) * 134775813 + 1; + b = ctx->key[1] >> 24; + ctx->key[2] = CRC32(ctx->key[2], b); + } +} + + + +static int +decrypt_header(struct zip_source *src, struct trad_pkware *ctx) +{ + zip_uint8_t header[HEADERLEN]; + struct zip_stat st; + zip_int64_t n; + unsigned short dostime, dosdate; + + if ((n=zip_source_read(src, header, HEADERLEN)) < 0) { + zip_source_error(src, ctx->e, ctx->e+1); + return -1; + } + + if (n != HEADERLEN) { + ctx->e[0] = ZIP_ER_EOF; + ctx->e[1] = 0; + return -1; + } + + decrypt(ctx, header, header, HEADERLEN, 0); + + if (zip_source_stat(src, &st) < 0) { + /* stat failed, skip password validation */ + return 0; + } + + _zip_u2d_time(st.mtime, &dostime, &dosdate); + + if (header[HEADERLEN-1] != st.crc>>24 + && header[HEADERLEN-1] != dostime>>8) { + ctx->e[0] = ZIP_ER_WRONGPASSWD; + ctx->e[1] = 0; + return -1; + } + + return 0; +} + + + +static zip_int64_t +pkware_decrypt(struct zip_source *src, void *ud, void *data, + zip_uint64_t len, enum zip_source_cmd cmd) +{ + struct trad_pkware *ctx; + zip_int64_t n; + + ctx = (struct trad_pkware *)ud; + + switch (cmd) { + case ZIP_SOURCE_OPEN: + if (decrypt_header(src, ctx) < 0) + return -1; + return 0; + + case ZIP_SOURCE_READ: + if ((n=zip_source_read(src, data, len)) < 0) + return ZIP_SOURCE_ERR_LOWER; + + decrypt(ud, (zip_uint8_t *)data, (zip_uint8_t *)data, (zip_uint64_t)n, + 0); + return n; + + case ZIP_SOURCE_CLOSE: + return 0; + + case ZIP_SOURCE_STAT: + { + struct zip_stat *st; + + st = (struct zip_stat *)data; + + st->encryption_method = ZIP_EM_NONE; + st->valid |= ZIP_STAT_ENCRYPTION_METHOD; + /* XXX: deduce HEADERLEN from size for uncompressed */ + if (st->valid & ZIP_STAT_COMP_SIZE) + st->comp_size -= HEADERLEN; + } + return 0; + + case ZIP_SOURCE_ERROR: + memcpy(data, ctx->e, sizeof(int)*2); + return sizeof(int)*2; + + case ZIP_SOURCE_FREE: + pkware_free(ctx); + return 0; + + default: + ctx->e[0] = ZIP_ER_INVAL; + ctx->e[1] = 0; + return -1; + } +} + + + +static void +pkware_free(struct trad_pkware *ctx) +{ + free(ctx); +} diff -Nru php5-5.4.4/ext/zip/lib/zip_source_pop.c php5-5.4.9/ext/zip/lib/zip_source_pop.c --- php5-5.4.4/ext/zip/lib/zip_source_pop.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_pop.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,63 @@ +/* + zip_source_pop.c -- pop top layer from zip data source + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include + +#include "zipint.h" + + + +ZIP_EXTERN(struct zip_source *) +zip_source_pop(struct zip_source *src) +{ + struct zip_source *lower; + + if (src == NULL) + return NULL; + + lower = src->src; + + if (lower == NULL) + zip_source_free(src); + else { + if (src->is_open) + (void)src->cb.l(src, src->ud, NULL, 0, ZIP_SOURCE_CLOSE); + (void)src->cb.l(src, src->ud, NULL, 0, ZIP_SOURCE_FREE); + + free(src); + } + + return lower; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_source_read.c php5-5.4.9/ext/zip/lib/zip_source_read.c --- php5-5.4.4/ext/zip/lib/zip_source_read.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_read.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,64 @@ +/* + zip_source_read.c -- read data from zip_source + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(zip_int64_t) +zip_source_read(struct zip_source *src, void *data, zip_uint64_t len) +{ + zip_int64_t ret; + + if (!src->is_open || len > ZIP_INT64_MAX || (len > 0 && data == NULL)) { + src->error_source = ZIP_LES_INVAL; + return -1; + } + + if (src->src == NULL) + return src->cb.f(src->ud, data, len, ZIP_SOURCE_READ); + + ret = src->cb.l(src->src, src->ud, data, len, ZIP_SOURCE_READ); + + if (ret < 0) { + if (ret == ZIP_SOURCE_ERR_LOWER) + src->error_source = ZIP_LES_LOWER; + else + src->error_source = ZIP_LES_UPPER; + return -1; + } + + return ret; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_source_stat.c php5-5.4.9/ext/zip/lib/zip_source_stat.c --- php5-5.4.4/ext/zip/lib/zip_source_stat.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_stat.c 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,72 @@ +/* + zip_source_stat.c -- get meta information from zip_source + Copyright (C) 2009 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + + +#include "zipint.h" + + + +ZIP_EXTERN(int) +zip_source_stat(struct zip_source *src, struct zip_stat *st) +{ + zip_int64_t ret; + + if (st == NULL) { + src->error_source = ZIP_LES_INVAL; + return -1; + } + + if (src->src == NULL) { + if (src->cb.f(src->ud, st, sizeof(*st), ZIP_SOURCE_STAT) < 0) + return -1; + return 0; + } + + if (zip_source_stat(src->src, st) < 0) { + src->error_source = ZIP_LES_LOWER; + return -1; + } + + ret = src->cb.l(src->src, src->ud, st, sizeof(*st), ZIP_SOURCE_STAT); + + if (ret < 0) { + if (ret == ZIP_SOURCE_ERR_LOWER) + src->error_source = ZIP_LES_LOWER; + else + src->error_source = ZIP_LES_UPPER; + return -1; + } + + return 0; +} diff -Nru php5-5.4.4/ext/zip/lib/zip_source_zip.c php5-5.4.9/ext/zip/lib/zip_source_zip.c --- php5-5.4.4/ext/zip/lib/zip_source_zip.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_source_zip.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_source_zip.c -- create data source from zip file - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -41,17 +41,18 @@ struct read_zip { struct zip_file *zf; struct zip_stat st; - off_t off, len; + zip_uint64_t off; + zip_int64_t len; }; -static ssize_t read_zip(void *st, void *data, size_t len, +static zip_int64_t read_zip(void *st, void *data, zip_uint64_t len, enum zip_source_cmd cmd); ZIP_EXTERN(struct zip_source *) -zip_source_zip(struct zip *za, struct zip *srcza, int srcidx, int flags, - off_t start, off_t len) +zip_source_zip(struct zip *za, struct zip *srcza, zip_uint64_t srcidx, + int flags, zip_uint64_t start, zip_int64_t len) { struct zip_error error; struct zip_source *zs; @@ -62,7 +63,7 @@ if (za == NULL) return NULL; - if (srcza == NULL || start < 0 || len < -1 || srcidx < 0 || srcidx >= srcza->nentry) { + if (srcza == NULL || len < -1 || srcidx < 0 || srcidx >= srcza->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return NULL; } @@ -115,12 +116,13 @@ -static ssize_t -read_zip(void *state, void *data, size_t len, enum zip_source_cmd cmd) +static zip_int64_t +read_zip(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd) { struct read_zip *z; char b[8192], *buf; - int i, n; + int i; + zip_uint64_t n; z = (struct read_zip *)state; buf = (char *)data; diff -Nru php5-5.4.4/ext/zip/lib/zip_stat_index.c php5-5.4.9/ext/zip/lib/zip_stat_index.c --- php5-5.4.4/ext/zip/lib/zip_stat_index.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_stat_index.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_stat_index.c -- get information about file by index - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -38,11 +38,12 @@ ZIP_EXTERN(int) -zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st) +zip_stat_index(struct zip *za, zip_uint64_t index, int flags, + struct zip_stat *st) { const char *name; - if (index < 0 || index >= za->nentry) { + if (index >= za->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } @@ -53,8 +54,7 @@ if ((flags & ZIP_FL_UNCHANGED) == 0 && ZIP_ENTRY_DATA_CHANGED(za->entry+index)) { - if (za->entry[index].source->f(za->entry[index].source->ud, - st, sizeof(*st), ZIP_SOURCE_STAT) < 0) { + if (zip_source_stat(za->entry[index].source, st) < 0) { _zip_error_set(&za->error, ZIP_ER_CHANGED, 0); return -1; } @@ -64,7 +64,9 @@ _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } - + + zip_stat_init(st); + st->crc = za->cdir->entry[index].crc; st->size = za->cdir->entry[index].uncomp_size; st->mtime = za->cdir->entry[index].last_mod; @@ -80,11 +82,13 @@ } else st->encryption_method = ZIP_EM_NONE; - /* st->bitflags = za->cdir->entry[index].bitflags; */ + st->valid = ZIP_STAT_CRC|ZIP_STAT_SIZE|ZIP_STAT_MTIME + |ZIP_STAT_COMP_SIZE|ZIP_STAT_COMP_METHOD|ZIP_STAT_ENCRYPTION_METHOD; } st->index = index; st->name = name; + st->valid |= ZIP_STAT_INDEX|ZIP_STAT_NAME; return 0; } diff -Nru php5-5.4.4/ext/zip/lib/zip_stat_init.c php5-5.4.9/ext/zip/lib/zip_stat_init.c --- php5-5.4.4/ext/zip/lib/zip_stat_init.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_stat_init.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_stat_init.c -- initialize struct zip_stat. - Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -40,12 +40,13 @@ ZIP_EXTERN(void) zip_stat_init(struct zip_stat *st) { + st->valid = 0; st->name = NULL; - st->index = -1; + st->index = ZIP_UINT64_MAX; st->crc = 0; st->mtime = (time_t)-1; - st->size = -1; - st->comp_size = -1; + st->size = 0; + st->comp_size = 0; st->comp_method = ZIP_CM_STORE; st->encryption_method = ZIP_EM_NONE; } diff -Nru php5-5.4.4/ext/zip/lib/zip_unchange.c php5-5.4.9/ext/zip/lib/zip_unchange.c --- php5-5.4.4/ext/zip/lib/zip_unchange.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_unchange.c 2012-11-21 05:12:20.000000000 +0000 @@ -40,7 +40,7 @@ ZIP_EXTERN(int) -zip_unchange(struct zip *za, int idx) +zip_unchange(struct zip *za, zip_uint64_t idx) { return _zip_unchange(za, idx, 0); } @@ -48,11 +48,11 @@ int -_zip_unchange(struct zip *za, int idx, int allow_duplicates) +_zip_unchange(struct zip *za, zip_uint64_t idx, int allow_duplicates) { int i; - if (idx < 0 || idx >= za->nentry) { + if (idx >= za->nentry) { _zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } @@ -72,6 +72,9 @@ za->entry[idx].ch_filename = NULL; } + free(za->entry[idx].ch_extra); + za->entry[idx].ch_extra = NULL; + za->entry[idx].ch_extra_len = -1; free(za->entry[idx].ch_comment); za->entry[idx].ch_comment = NULL; za->entry[idx].ch_comment_len = -1; diff -Nru php5-5.4.4/ext/zip/lib/zip_unchange_archive.c php5-5.4.9/ext/zip/lib/zip_unchange_archive.c --- php5-5.4.4/ext/zip/lib/zip_unchange_archive.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_unchange_archive.c 2012-11-21 05:12:20.000000000 +0000 @@ -1,6 +1,6 @@ /* zip_unchange_archive.c -- undo global changes to ZIP archive - Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2008 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at diff -Nru php5-5.4.4/ext/zip/lib/zip_unchange_data.c php5-5.4.9/ext/zip/lib/zip_unchange_data.c --- php5-5.4.4/ext/zip/lib/zip_unchange_data.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zip_unchange_data.c 2012-11-21 05:12:20.000000000 +0000 @@ -43,8 +43,7 @@ _zip_unchange_data(struct zip_entry *ze) { if (ze->source) { - (void)ze->source->f(ze->source->ud, NULL, 0, ZIP_SOURCE_FREE); - free(ze->source); + zip_source_free(ze->source); ze->source = NULL; } diff -Nru php5-5.4.4/ext/zip/lib/zipconf.h php5-5.4.9/ext/zip/lib/zipconf.h --- php5-5.4.4/ext/zip/lib/zipconf.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zipconf.h 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,51 @@ +#ifndef _HAD_ZIPCONF_H +#define _HAD_ZIPCONF_H + +/* + zipconf.h -- platform specific include file + + This file was generated automatically by ./make_zipconf.sh + based on ../config.h. + */ + +#define LIBZIP_VERSION "0.10.1" +#define LIBZIP_VERSION_MAJOR 0 +#define LIBZIP_VERSION_MINOR 10 +#define LIBZIP_VERSION_MICRO 0 + +#ifdef PHP_WIN32 +#include +#else +#include +#endif + +typedef int8_t zip_int8_t; +#define ZIP_INT8_MIN INT8_MIN +#define ZIP_INT8_MAX INT8_MAX + +typedef uint8_t zip_uint8_t; +#define ZIP_UINT8_MAX UINT8_MAX + +typedef int16_t zip_int16_t; +#define ZIP_INT16_MIN INT16_MIN +#define ZIP_INT16_MAX INT16_MAX + +typedef uint16_t zip_uint16_t; +#define ZIP_UINT16_MAX UINT16_MAX + +typedef int32_t zip_int32_t; +#define ZIP_INT32_MIN INT32_MIN +#define ZIP_INT32_MAX INT32_MAX + +typedef uint32_t zip_uint32_t; +#define ZIP_UINT32_MAX UINT32_MAX + +typedef int64_t zip_int64_t; +#define ZIP_INT64_MIN INT64_MIN +#define ZIP_INT64_MAX INT64_MAX + +typedef uint64_t zip_uint64_t; +#define ZIP_UINT64_MAX UINT64_MAX + + +#endif /* zipconf.h */ diff -Nru php5-5.4.4/ext/zip/lib/zipint.h php5-5.4.9/ext/zip/lib/zipint.h --- php5-5.4.4/ext/zip/lib/zipint.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/lib/zipint.h 2012-11-21 05:12:20.000000000 +0000 @@ -3,7 +3,7 @@ /* zipint.h -- internal declarations. - Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -38,12 +38,37 @@ #include "zip.h" +#ifndef HAVE_FSEEKO +#define fseeko(s, o, w) (fseek((s), (long int)(o), (w))) +#endif + +#ifndef HAVE_FTELLO +#define ftello(s) ((long)ftell((s))) +#endif + +#ifndef PHP_WIN32 +#ifndef HAVE_MKSTEMP +int _zip_mkstemp(char *); +#define mkstemp _zip_mkstemp +#endif +#endif + #ifdef PHP_WIN32 #include #include #define _zip_rename(s, t) \ (!MoveFileExA((s), (t), \ MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING)) + +/* for dup(), close(), etc. */ +#include + +#if !defined(HAVE_OPEN) +#if defined(HAVE__OPEN) +#define open(a, b, c) _open((a), (b)) +#endif +#endif + #else #define _zip_rename rename #endif @@ -52,12 +77,6 @@ # define strcmpi strcasecmp #endif -#ifndef HAVE_FSEEKO -#define fseeko(s, o, w) (fseek((s), (long int)(o), (w))) -#endif -#ifndef HAVE_FTELLO -#define ftello(s) ((long)ftell((s))) -#endif @@ -73,22 +92,77 @@ #define LENTRYSIZE 30 #undef MAXCOMLEN /* defined as 19 on BSD for max command name */ #define MAXCOMLEN 65536 +#define MAXEXTLEN 65536 #define EOCDLEN 22 #define CDBUFSIZE (MAXCOMLEN+EOCDLEN) #define BUFSIZE 8192 +/* This section contains API that won't materialize like this. It's + placed in the internal section, pending cleanup. */ + +typedef struct zip_source *(*zip_compression_implementation)(struct zip *, + struct zip_source *, + zip_uint16_t, int); +typedef struct zip_source *(*zip_encryption_implementation)(struct zip *, + struct zip_source *, + zip_uint16_t, int, + const char *); + +ZIP_EXTERN(zip_compression_implementation) zip_get_compression_implementation( + zip_uint16_t); +ZIP_EXTERN(zip_encryption_implementation) zip_get_encryption_implementation( + zip_uint16_t); + + + + +/* This section contains API that is of limited use until support for + user-supplied compression/encryption implementation is finished. + Thus we will keep it private for now. */ + +typedef zip_int64_t (*zip_source_layered_callback)(struct zip_source *, void *, + void *, zip_uint64_t, + enum zip_source_cmd); + +ZIP_EXTERN(void) zip_source_close(struct zip_source *); +ZIP_EXTERN(struct zip_source *)zip_source_crc(struct zip *, struct zip_source *, + int); +ZIP_EXTERN(struct zip_source *)zip_source_deflate(struct zip *, + struct zip_source *, + zip_uint16_t, int); +ZIP_EXTERN(void) zip_source_error(struct zip_source *, int *, int *); +ZIP_EXTERN(struct zip_source *)zip_source_layered(struct zip *, + struct zip_source *, + zip_source_layered_callback, + void *); +ZIP_EXTERN(int) zip_source_open(struct zip_source *); +ZIP_EXTERN(struct zip_source *)zip_source_pkware(struct zip *, + struct zip_source *, + zip_uint16_t, int, + const char *); +ZIP_EXTERN(zip_int64_t) zip_source_read(struct zip_source *, void *, + zip_uint64_t); +ZIP_EXTERN(int) zip_source_stat(struct zip_source *, struct zip_stat *); + + +/* This function will probably remain private. It is not needed to + implement compression/encryption routines. (We should probably + rename it to _zip_source_pop.) */ + +ZIP_EXTERN(struct zip_source *)zip_source_pop(struct zip_source *); + + + /* state of change of a file in zip archive */ enum zip_state { ZIP_ST_UNCHANGED, ZIP_ST_DELETED, ZIP_ST_REPLACED, ZIP_ST_ADDED, ZIP_ST_RENAMED }; -/* constants for struct zip_file's member flags */ +/* error source for layered sources */ -#define ZIP_ZF_EOF 1 /* EOF reached */ -#define ZIP_ZF_DECOMP 2 /* decompress data */ -#define ZIP_ZF_CRC 4 /* compute and compare CRC */ +enum zip_les { ZIP_LES_NONE, ZIP_LES_UPPER, ZIP_LES_LOWER, ZIP_LES_INVAL }; /* directory entry: general purpose bit flags */ @@ -114,12 +188,14 @@ unsigned int flags; /* archive global flags */ unsigned int ch_flags; /* changed archive global flags */ + char *default_password; /* password used when no other supplied */ + struct zip_cdir *cdir; /* central directory */ char *ch_comment; /* changed archive comment */ int ch_comment_len; /* length of changed zip archive * comment, -1 if unchanged */ - int nentry; /* number of entries */ - int nentry_alloc; /* number of entries allocated */ + zip_uint64_t nentry; /* number of entries */ + zip_uint64_t nentry_alloc; /* number of entries allocated */ struct zip_entry *entry; /* entries */ int nfile; /* number of opened files within archive */ int nfile_alloc; /* number of files allocated */ @@ -131,18 +207,8 @@ struct zip_file { struct zip *za; /* zip archive containing this file */ struct zip_error error; /* error information */ - int flags; /* -1: eof, >0: error */ - - int method; /* compression method */ - off_t fpos; /* position within zip file (fread/fwrite) */ - unsigned long bytes_left; /* number of bytes left to read */ - unsigned long cbytes_left; /* number of bytes of compressed data left */ - - unsigned long crc; /* CRC so far */ - unsigned long crc_orig; /* CRC recorded in archive */ - - char *buffer; - z_stream *zstr; + int eof; + struct zip_source *src; /* data source */ }; /* zip archive directory entry (central or local) */ @@ -183,8 +249,14 @@ struct zip_source { - zip_source_callback f; + struct zip_source *src; + union { + zip_source_callback f; + zip_source_layered_callback l; + } cb; void *ud; + enum zip_les error_source; + int is_open; }; /* entry in zip archive directory */ @@ -193,6 +265,8 @@ enum zip_state state; struct zip_source *source; char *ch_filename; + char *ch_extra; + int ch_extra_len; char *ch_comment; int ch_comment_len; }; @@ -209,6 +283,8 @@ ((x)->state == ZIP_ST_REPLACED \ || (x)->state == ZIP_ST_ADDED) +#define ZIP_IS_RDONLY(za) ((za)->ch_flags & ZIP_AFL_RDONLY) + int _zip_cdir_compute_crc(struct zip *, uLong *); @@ -220,7 +296,7 @@ void _zip_dirent_finalize(struct zip_dirent *); void _zip_dirent_init(struct zip_dirent *); int _zip_dirent_read(struct zip_dirent *, FILE *, unsigned char **, - unsigned int *, int, struct zip_error *); + zip_uint32_t *, int, struct zip_error *); void _zip_dirent_torrent_normalize(struct zip_dirent *); int _zip_dirent_write(struct zip_dirent *, FILE *, int, struct zip_error *); @@ -234,6 +310,7 @@ void _zip_error_get(struct zip_error *, int *, int *); void _zip_error_init(struct zip_error *); void _zip_error_set(struct zip_error *, int, int); +void _zip_error_set_from_source(struct zip_error *, struct zip_source *); const char *_zip_error_strerror(struct zip_error *); int _zip_file_fillbuf(void *, size_t, struct zip_file *); @@ -241,20 +318,27 @@ int _zip_filerange_crc(FILE *, off_t, off_t, uLong *, struct zip_error *); +struct zip *_zip_open(const char *, FILE *, int, int, int *); + struct zip_source *_zip_source_file_or_p(struct zip *, const char *, FILE *, - off_t, off_t); + zip_uint64_t, zip_int64_t, int, + const struct zip_stat *); +struct zip_source *_zip_source_new(struct zip *); +int _zip_changed(struct zip *, int *); void _zip_free(struct zip *); -const char *_zip_get_name(struct zip *, int, int, struct zip_error *); +const char *_zip_get_name(struct zip *, zip_uint64_t, int, struct zip_error *); int _zip_local_header_read(struct zip *, int); void *_zip_memdup(const void *, size_t, struct zip_error *); int _zip_name_locate(struct zip *, const char *, int, struct zip_error *); struct zip *_zip_new(struct zip_error *); unsigned short _zip_read2(unsigned char **); unsigned int _zip_read4(unsigned char **); -int _zip_replace(struct zip *, int, const char *, struct zip_source *); -int _zip_set_name(struct zip *, int, const char *); -int _zip_unchange(struct zip *, int, int); +zip_int64_t _zip_replace(struct zip *, zip_uint64_t, const char *, + struct zip_source *); +int _zip_set_name(struct zip *, zip_uint64_t, const char *); +void _zip_u2d_time(time_t, unsigned short *, unsigned short *); +int _zip_unchange(struct zip *, zip_uint64_t, int); void _zip_unchange_data(struct zip_entry *); #endif /* zipint.h */ diff -Nru php5-5.4.4/ext/zip/php_zip.c php5-5.4.9/ext/zip/php_zip.c --- php5-5.4.4/ext/zip/php_zip.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/php_zip.c 2012-11-21 05:12:20.000000000 +0000 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id$ */ +/* $Id: 74f868b5c3320a31af332207df35d4ff525cba1e $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1152,7 +1152,13 @@ if (zr_rsrc) { if (zr_rsrc->zf) { - zip_fclose(zr_rsrc->zf); + if (zr_rsrc->zf->za) { + zip_fclose(zr_rsrc->zf); + } else { + if (zr_rsrc->zf->src) + zip_source_free(zr_rsrc->zf->src); + free(zr_rsrc->zf); + } zr_rsrc->zf = NULL; } efree(zr_rsrc); @@ -1321,9 +1327,8 @@ } /* }}} */ -/* {{{ proto void zip_entry_close(resource zip_ent) +/* {{{ proto bool zip_entry_close(resource zip_ent) Close a zip entry */ -/* another dummy function to fit in the old api*/ static PHP_NAMED_FUNCTION(zif_zip_entry_close) { zval * zip_entry; @@ -1334,8 +1339,8 @@ } ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry); - /* we got a zip_entry resource, be happy */ - RETURN_TRUE; + + RETURN_BOOL(SUCCESS == zend_list_delete(Z_LVAL_P(zip_entry))); } /* }}} */ @@ -2861,9 +2866,9 @@ php_info_print_table_start(); php_info_print_table_row(2, "Zip", "enabled"); - php_info_print_table_row(2, "Extension Version","$Id$"); + php_info_print_table_row(2, "Extension Version","$Id: 74f868b5c3320a31af332207df35d4ff525cba1e $"); php_info_print_table_row(2, "Zip version", PHP_ZIP_VERSION_STRING); - php_info_print_table_row(2, "Libzip version", "0.9.0"); + php_info_print_table_row(2, "Libzip version", LIBZIP_VERSION); php_info_print_table_end(); } diff -Nru php5-5.4.4/ext/zip/php_zip.h php5-5.4.9/ext/zip/php_zip.h --- php5-5.4.4/ext/zip/php_zip.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zip/php_zip.h 2012-11-21 05:12:20.000000000 +0000 @@ -30,7 +30,7 @@ #include "lib/zip.h" -#define PHP_ZIP_VERSION_STRING "1.9.1" +#define PHP_ZIP_VERSION_STRING "1.11.0" #if ((PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION >= 6) # define PHP_ZIP_USE_OO 1 diff -Nru php5-5.4.4/ext/zip/tests/bug51353.phpt php5-5.4.9/ext/zip/tests/bug51353.phpt --- php5-5.4.4/ext/zip/tests/bug51353.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zip/tests/bug51353.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,54 @@ +--TEST-- +Bug #51353 ZIP64 problem, archive with 100000 items +--SKIPIF-- +12M big, + or create it dynamically. */ +$zip = new ZipArchive; +$r = $zip->open("$base_path/51353.zip", ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE); +if ($r) { + for ($i = 0; $i < 100000; $i++) { + $zip->addFromString("$i.txt", '1'); + } + $zip->close(); +} else { + die("failed"); +} + +$zip = new ZipArchive; +$r = $zip->open("$base_path/51353.zip"); +if ($r) { + $zip->extractTo("$base_path/51353_unpack"); + $zip->close(); + + $a = glob("$base_path/51353_unpack/*.txt"); + echo count($a) . "\n"; +} else { + die("failed"); +} + +echo "OK"; +--CLEAN-- + --DONE-- --EXPECTF-- -ZIP contents size: %d -zip_readfile recorded data does not match unpacked size: %specl12414.zip : MYLOGOV2.GFX +zip_readfile could not read from %specl12414.zip : MYLOGOV2.GFX diff -Nru php5-5.4.4/ext/zlib/php_zlib.h php5-5.4.9/ext/zlib/php_zlib.h --- php5-5.4.4/ext/zlib/php_zlib.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zlib/php_zlib.h 2012-11-21 05:12:20.000000000 +0000 @@ -54,6 +54,8 @@ long output_compression_level; char *output_handler; php_zlib_context *ob_gzhandler; + long output_compression_default; + zend_bool handler_registered; ZEND_END_MODULE_GLOBALS(zlib); php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); Binary files /tmp/osuZiLfdeF/php5-5.4.4/ext/zlib/tests/bug55544-win.phpt and /tmp/lB71aGvwfy/php5-5.4.9/ext/zlib/tests/bug55544-win.phpt differ Binary files /tmp/osuZiLfdeF/php5-5.4.4/ext/zlib/tests/bug55544.phpt and /tmp/lB71aGvwfy/php5-5.4.9/ext/zlib/tests/bug55544.phpt differ diff -Nru php5-5.4.4/ext/zlib/tests/bug_52944-darwin.phpt php5-5.4.9/ext/zlib/tests/bug_52944-darwin.phpt --- php5-5.4.4/ext/zlib/tests/bug_52944-darwin.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/ext/zlib/tests/bug_52944-darwin.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,24 @@ +--TEST-- +Bug #52944 (segfault with zlib filter and corrupted data) +--SKIPIF-- + + + ---INI-- -allow_url_fopen=1 ---FILE-- - + (\d+\.\d+\.\d+),s', $info, $match)) { + $version = $match[1]; + } + + return $version; +} + diff -Nru php5-5.4.4/ext/zlib/tests/gzgetc_basic.phpt php5-5.4.9/ext/zlib/tests/gzgetc_basic.phpt --- php5-5.4.4/ext/zlib/tests/gzgetc_basic.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zlib/tests/gzgetc_basic.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,10 +1,14 @@ --TEST-- -Test function gzgetc() by calling it with its expected arguments +Test function gzgetc() by calling it with its expected arguments zlib 1.2.5 --SKIPIF-- 0) { + die('skip - only for zlib <= 1.2.5'); +} ?> --FILE-- = 1.2.7'); +} +?> +--FILE-- + +===DONE=== +--EXPECT-- +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me + +characters counted=176 +===DONE=== diff -Nru php5-5.4.4/ext/zlib/zlib.c php5-5.4.9/ext/zlib/zlib.c --- php5-5.4.4/ext/zlib/zlib.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/ext/zlib/zlib.c 2012-11-21 05:12:20.000000000 +0000 @@ -263,6 +263,8 @@ ZLIBG(output_compression) = chunk_size ? chunk_size : PHP_OUTPUT_HANDLER_DEFAULT_SIZE; } + ZLIBG(handler_registered) = 1; + if ((h = php_output_handler_create_internal(handler_name, handler_name_len, php_zlib_output_handler, chunk_size, flags TSRMLS_CC))) { php_output_handler_set_context(h, php_zlib_output_handler_context_init(TSRMLS_C), php_zlib_output_handler_context_dtor TSRMLS_CC); } @@ -690,6 +692,7 @@ /* {{{ proto binary zlib_decode(binary data[, int max_decoded_len]) Uncompress any raw/gzip/zlib encoded data */ PHP_ZLIB_DECODE_FUNC(zlib_decode, PHP_ZLIB_ENCODING_ANY); +/* }}} */ /* NOTE: The naming of these userland functions was quite unlucky */ /* {{{ proto binary gzdeflate(binary data[, int level = -1[, int encoding = ZLIB_ENCODING_RAW]) @@ -701,18 +704,22 @@ Encode data with the gzip encoding */ PHP_ZLIB_ENCODE_FUNC(gzencode, PHP_ZLIB_ENCODING_GZIP); /* }}} */ + /* {{{ proto binary gzcompress(binary data[, int level = -1[, int encoding = ZLIB_ENCODING_DEFLATE]) Encode data with the zlib encoding */ PHP_ZLIB_ENCODE_FUNC(gzcompress, PHP_ZLIB_ENCODING_DEFLATE); /* }}} */ + /* {{{ proto binary gzinflate(binary data[, int max_decoded_len]) Decode raw deflate encoded data */ PHP_ZLIB_DECODE_FUNC(gzinflate, PHP_ZLIB_ENCODING_RAW); /* }}} */ + /* {{{ proto binary gzdecode(binary data[, int max_decoded_len]) Decode gzip encoded data */ PHP_ZLIB_DECODE_FUNC(gzdecode, PHP_ZLIB_ENCODING_GZIP); /* }}} */ + /* {{{ proto binary gzuncompress(binary data[, int max_decoded_len]) Decode zlib encoded data */ PHP_ZLIB_DECODE_FUNC(gzuncompress, PHP_ZLIB_ENCODING_DEFLATE); @@ -890,6 +897,7 @@ status = OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + ZLIBG(output_compression) = ZLIBG(output_compression_default); if (stage == PHP_INI_STAGE_RUNTIME && int_value) { if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)) { php_zlib_output_compression_start(TSRMLS_C); @@ -914,7 +922,7 @@ /* {{{ INI */ PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression, zend_zlib_globals, zlib_globals) + STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression_default, zend_zlib_globals, zlib_globals) STD_PHP_INI_ENTRY("zlib.output_compression_level", "-1", PHP_INI_ALL, OnUpdateLong, output_compression_level, zend_zlib_globals, zlib_globals) STD_PHP_INI_ENTRY("zlib.output_handler", "", PHP_INI_ALL, OnUpdate_zlib_output_handler, output_handler, zend_zlib_globals, zlib_globals) PHP_INI_END() @@ -958,19 +966,24 @@ static PHP_RINIT_FUNCTION(zlib) { ZLIBG(compression_coding) = 0; - - php_zlib_output_compression_start(TSRMLS_C); + if (!ZLIBG(handler_registered)) { + ZLIBG(output_compression) = ZLIBG(output_compression_default); + php_zlib_output_compression_start(TSRMLS_C); + } return SUCCESS; } /* }}} */ +/* {{{ PHP_RSHUTDOWN_FUNCTION */ static PHP_RSHUTDOWN_FUNCTION(zlib) { php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C); + ZLIBG(handler_registered) = 0; return SUCCESS; } +/* }}} */ /* {{{ PHP_MINFO_FUNCTION */ static PHP_MINFO_FUNCTION(zlib) @@ -991,6 +1004,7 @@ static ZEND_MODULE_GLOBALS_CTOR_D(zlib) { zlib_globals->ob_gzhandler = NULL; + zlib_globals->handler_registered = 0; } /* }}} */ diff -Nru php5-5.4.4/install-sh php5-5.4.9/install-sh --- php5-5.4.4/install-sh 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/install-sh 2012-11-21 05:53:01.000000000 +0000 @@ -1,520 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2009-04-28.21; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff -Nru php5-5.4.4/ltmain.sh php5-5.4.9/ltmain.sh --- php5-5.4.4/ltmain.sh 2012-12-13 17:00:19.000000000 +0000 +++ php5-5.4.9/ltmain.sh 2012-11-21 05:12:20.000000000 +0000 @@ -1,89 +1,52 @@ - -# libtool (GNU libtool) 2.4 -# Written by Gordon Matzigkeit , 1996 - +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify +# 2007, 2008 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but +# This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4 Debian-2.4-2ubuntu1 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" -PROGRAM=libtool +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh PACKAGE=libtool -VERSION="2.4 Debian-2.4-2ubuntu1" -TIMESTAMP="" -package_revision=1.3293 +VERSION=1.5.26 +TIMESTAMP=" (1.1220.2.492 2008/01/30 06:40:56)" -# Be Bourne compatible +# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -97,462 +60,104 @@ BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` - done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" +if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + $echo "$modename: not configured to build any kind of library" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 +##################################### +# Shell function definitions: +# This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running @@ -562,7 +167,7 @@ { my_template="${TMPDIR-/tmp}/${1-$progname}" - if test "$opt_dry_run" = ":"; then + if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else @@ -571,8865 +176,6359 @@ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } fi - $ECHO "$my_tmpdir" -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi + $echo "X$my_tmpdir" | $Xsed } -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () { - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac fi -} - -# func_tr_sh -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; - * ) - func_tr_sh_result=$1 + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac ;; esac + $echo $win32_libid_type } -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $opt_debug - - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () { - $opt_debug - - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. -func_help () -{ - $opt_debug - - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ - p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac fi } -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - $opt_debug - - func_error "missing argument for $1." - exit_cmd=exit -} - - -# func_split_short_opt shortopt -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () -{ - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' - - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` -} # func_split_short_opt may be replaced by extended shell implementation - -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () +# func_extract_an_archive dir oldlib +func_extract_an_archive () { - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' - - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` -} # func_split_long_opt may be replaced by extended shell implementation - -exit_cmd=: - - - - - -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" - -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "${1}=\$${1}\${2}" -} # func_append may be replaced by extended shell implementation + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} -# func_append_quoted var value -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -func_append_quoted () +# func_extract_archives gentop oldlib ... +func_extract_archives () { - func_quote_for_eval "${2}" - eval "${1}=\$${1}\\ \$func_quote_for_eval_result" -} # func_append_quoted may be replaced by extended shell implementation - + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "${@}"` -} # func_arith may be replaced by extended shell implementation + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + extracted_serial=`expr $extracted_serial + 1` + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation +disable_libs=no +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + esac -# func_fatal_configuration arg... -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." -} + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + prev= + prevopt= + continue + fi -# func_config -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + --version) + echo "\ +$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP + +Copyright (C) 2008 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit $? + ;; + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done - exit $? -} + ;; -# func_features -# Display the features supported by this script. -func_features () -{ - echo "host: $host" + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" + $echo "enable shared libraries" else - echo "disable shared libraries" + $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then - echo "enable static libraries" + $echo "enable static libraries" else - echo "disable static libraries" + $echo "disable static libraries" fi - exit $? -} + ;; -# func_enable_tag tagname -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname="$1" + --finish) mode="finish" ;; - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" + --preserve-dup-deps) duplicate_deps="yes" ;; - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; - exit $EXIT_MISMATCH - fi -} + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift +shared) + build_libtool_libs=no + build_old_libs=yes ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= +if test -z "$show_help"; then -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_verbose=: -opt_silent=false -opt_verbose=false - + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. -{ - # this just eases exit handling - while test $# -gt 0; do - opt="$1" - shift - case $opt in - --debug|-x) opt_debug='set -x' - func_echo "enabling shell trace mode" - $opt_debug - ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" - shift - ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac - shift - ;; - --no-silent|--no-quiet) - opt_silent=false -func_append preserve_args " $opt" - ;; - --no-verbose) - opt_verbose=false -func_append preserve_args " $opt" - ;; - --silent|--quiet) - opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false - ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false - ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -func_append preserve_args " $opt $optarg" -func_enable_tag "$optarg" - shift - ;; + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; - - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} - shift - ;; + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; - esac - done - - # Validate options: + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" + target ) + libobj="$arg" + arg_mode=normal + continue + ;; - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; - $opt_help || { - # Sanity checks first: - func_check_version_match + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi + -no-suppress) + suppress_opt=no + continue + ;; - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE -} + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + base_compile="$base_compile $lastarg" + done # for arg -## ----------- ## -## Main. ## -## ----------- ## - -# func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac -# func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case "$lalib_p_line" in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test "$lalib_p" = yes -} + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.[fF][09]?) xform=[fF][09]. ;; + *.for) xform=for ;; + *.java) xform=java ;; + *.obj) xform=obj ;; + *.sx) xform=sx ;; + esac -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - func_lalib_p "$1" -} + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit $EXIT_FAILURE + ;; esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" -} + func_infer_tag $base_compile -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + -prefer-pic) + pic_mode=yes + continue + ;; -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $opt_debug - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$save_ifs - eval cmd=\"$cmd\" - func_show_eval "$cmd" "${2-:}" + -prefer-non-pic) + pic_mode=no + continue + ;; + esac done - IFS=$save_ifs -} - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. -func_source () -{ - $opt_debug - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; esac -} + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case "$lt_sysroot:$1" in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} + $run $rm $removelist + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $opt_debug - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + else + output_obj= + need_locks=no + lockfile= fi -} + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$progpath" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none + $run $rm $removelist + exit $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" fi - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac - $opt_dry_run || { - cat >${write_libobj}T < ${libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $opt_debug - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi + if test ! -d "${xdir}$objdir"; then + $show "$mkdir ${xdir}$objdir" + $run $mkdir ${xdir}$objdir + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then + exit $exit_status + fi fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 + if test -z "$output_obj"; then + $run $rm "$lobj" + # Place PIC objects in $objdir + command="$command -o $lobj" + else + $run $rm "$lobj" "$output_obj" + fi -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $opt_debug - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" - fi -} -#end: func_cygpath + $show "$command" + if $run eval $lt_env "$command"; then : + else + test -n "$output_obj" && $run $rm $removelist + exit $EXIT_FAILURE + fi + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $opt_debug - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 +but it should contain: +$srcfile +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $opt_debug - if test -z "$2" && test -n "$1" ; then - func_error "Could not determine host file name corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result="$1" - fi -} -# end func_convert_file_check + $run $rm $removelist + exit $EXIT_FAILURE + fi + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $opt_debug - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " \`$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result="$3" - fi - fi -} -# end func_convert_path_check + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` +but it should contain: +$srcfile -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $opt_debug - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + $run $rm $removelist + exit $EXIT_FAILURE + fi -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result="$1" -} -# end func_convert_file_noop + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $opt_debug - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" - fi -} + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $opt_debug - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result="$1" -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi -# func_mode_compile arg... -func_mode_compile () -{ - $opt_debug - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - pie_flag= + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. - target ) - libobj="$arg" - arg_mode=normal - continue - ;; + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi - normal ) - # Accept any command-line options. - case $arg in - -o) - test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" - arg_mode=target + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit $EXIT_FAILURE + fi + arg=$save_arg + prev= continue ;; - - -pie | -fpie | -fPIE) - func_append pie_flag " $arg" + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= continue ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" continue ;; - - -no-suppress) - suppress_opt=no + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" continue ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - func_append_quoted lastarg "$arg" - done - IFS="$save_ifs" - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - func_append base_compile " $lastarg" + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= continue ;; - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" + eval "$prev=\"\$arg\"" + prev= + continue ;; - esac # case $arg + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue ;; - esac # case $arg_mode - # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" - done # for arg + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; - case $arg_mode in - arg) - func_fatal_error "you must specify an argument for -Xcompile" - ;; - target) - func_fatal_error "you must specify a target with \`-o'" - ;; - *) - # Get the name of the library object. - test -z "$libobj" && { - func_basename "$srcfile" - libobj="$func_basename_result" - } - ;; - esac + -avoid-version) + avoid_version=yes + continue + ;; - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - case $libobj in - *.[cCFSifmso] | \ - *.ada | *.adb | *.ads | *.asm | \ - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) - func_xform "$libobj" - libobj=$func_xform_result - ;; - esac + -dlopen) + prev=dlfiles + continue + ;; - case $libobj in - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; - *) - func_fatal_error "cannot determine name of library object from \`$libobj'" - ;; - esac + -dlpreopen) + prev=dlprefiles + continue + ;; - func_infer_tag $base_compile + -export-dynamic) + export_dynamic=yes + continue + ;; - for arg in $later; do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi continue ;; - -static) - build_libtool_libs=no - build_old_libs=yes + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" continue ;; - -prefer-pic) - pic_mode=yes + -inst-prefix-dir) + prev=inst_prefix continue ;; - -prefer-non-pic) - pic_mode=no + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac continue ;; - esac - done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + notinst_path="$notinst_path $dir" + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi + -multi_module) + single_module="${wl}-multi_module" + continue + ;; - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` + -module) + module=yes + continue + ;; -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - func_append removelist " $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; - $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + -shrext) + prev=shrext + continue + ;; - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile + -no-fast-install) + fast_install=no + continue + ;; - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; - func_mkdir_p "$xdir$objdir" + -no-undefined) + allow_undefined=no + continue + ;; - if test -z "$output_obj"; then - # Place PIC objects in $objdir - func_append command " -o $lobj" - fi + -objectlist) + prev=objectlist + continue + ;; - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + -o) prev=output ;; - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` + -precious-files-regex) + prev=precious_regex + continue + ;; -but it should contain: -$srcfile + -release) + prev=release + continue + ;; -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." + -rpath) + prev=rpath + continue + ;; - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi + -R) + prev=xrpath + continue + ;; - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - fi + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - func_append command " -o $obj" - fi + -thread-safe) + thread_safe=yes + continue + ;; - # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + -version-info) + prev=vinfo + continue + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; -but it should contain: -$srcfile + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." + -Xcompiler) + prev=xcompiler + continue + ;; - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi + -Xlinker) + prev=xlinker + continue + ;; - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi + -XCClinker) + prev=xcclinker + continue + ;; - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - removelist=$lockfile - $RM "$lockfile" - fi - } + *.$objext) + # A standard object. + objs="$objs $arg" + ;; - exit $EXIT_SUCCESS -} + *.lo) + # A libtool-controlled object. -$opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} -} + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= -func_mode_help () -{ - # We need to display help for each of the modes. - case $opt_mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi -Remove files from the build directory. + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi -Compile a source file into a libtool library object. + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi -This mode accepts the following additional options: + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; -Automatically set library path, then run a program. + *.la) + # A libtool-controlled library. -This mode accepts the following additional options: + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; - -dlopen FILE add the directory containing FILE to the library path + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg -This mode sets the library path environment variable according to \`-dlopen' -flags. + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi -Then, COMMAND is executed, with ARGS as arguments." - ;; + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" -Complete the installation of libtool libraries. + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" -Each LIBDIR is a directory that contains libtool libraries. + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $exit_status + fi + fi -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode \`$opt_mode'" - ;; + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. esac - echo - $ECHO "Try \`$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $opt_dlopen; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir="$func_dirname_result" - - if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir="$func_dirname_result" - ;; - - *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file="$progdir/$program" - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" - done - - if test "X$opt_dry_run" = Xfalse; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} - + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "\`$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument \`$opt'" + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac fi + libs="$libs $deplib" done - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" done - ${RM}r "$tmpdir" fi + pre_post_deps= fi - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the \`$flag' linker flag" + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue ;; - esac - echo "----------------------------------------------------------------------" - fi - exit $EXIT_SUCCESS -} + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + fi -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." -# func_mode_install arg... -func_mode_install () -{ - $opt_debug - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - func_append files " $dest" - dest=$arg - continue - fi + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac - case $arg in - -d) isdir=yes ;; - -f) - if $install_cp; then :; else - prev=$arg + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE fi - prev= - else - dest=$arg continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - func_append install_shared_prog " $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" - - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" - fi - fi + fi # $pass = conv - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) - func_fatal_help "\`$destdir' must be an absolute directory name" + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi ;; esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - func_append staticlibs " $file" - ;; - - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - library_names= - old_library= - relink_command= - func_source "$file" + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; - esac + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue fi - func_dirname "$file" "/" "" - dir="$func_dirname_result" - func_append dir "$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes fi - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname="$1" - shift + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + esac + fi - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme="" + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac ;; esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue fi + fi - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=".exe" + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" fi - ;; - esac - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" - func_source "$wrapper" + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + fi - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi fi - done - - relink_command= - func_source "$wrapper" + fi - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" else - func_warning "cannot relink \`$file'" + add="$libdir/$linklib" fi - } + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? - # Set up the ranlib parameters. - oldlib="$destdir/$name" + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$deplibdir/$depdepl" ; then + depdepl="$deplibdir/$depdepl" + elif test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + else + # Can't find it, oh well... + depdepl= + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" fi -} - -test "$opt_mode" = install && func_mode_install ${1+"$@"} + case $linkmode in + oldlib) + case " $deplibs" in + *\ -l* | *\ -L*) + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;; + esac -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" - else - func_error "not configured to extract global symbols from dlpreopened files" + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi - fi - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi -#ifdef __cplusplus -extern \"C\" { -#endif + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" - done + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit $EXIT_FAILURE + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $opt_dry_run || { - $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes fi - for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" - func_basename "$dlprefile" - name="$func_basename_result" - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" - echo >> "$output_objdir/$my_dlsyms" "\ + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; -LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows|none) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no ;; esac - echo >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi - ;; - esac + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE ;; esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; - esac - done - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + fi - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; - # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" - case $host in - *cygwin* | *mingw* | *cegcc* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; - esac - ;; - *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' - 1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $opt_debug - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $opt_debug - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + major=`expr $current - $age` + else + major=`expr $current - $age + 1` + fi + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result="" - fi -} + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; - func_mkdir_p "$my_xdir" + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} + versuffix=".0.0" + fi + fi -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done - func_exec_program_core \${1+\"\$@\"} -} - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` + # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` + # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` + #done - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi - file=\"\$\$-\$program\" + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name=`expr $a_deplib : '-l\(.*\)'` + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac - $ECHO "\ + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs fi - fi - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - $ECHO "\ + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" - if test -f \"\$progdir/\$program\"; then" - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + case $archive_cmds in + *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; + *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; + esac + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift - export $shlibpath_var -" + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname fi - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` -# func_emit_cwrapperexe_src -# emit the source code for a wrapper executable on stdout -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat < \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi -/* $cwrappersource - temporary wrapper executable for $objdir/$outputname - Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi - The $output program cannot be directly executed until all the libtool - libraries that it depends on are installed. + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" - This wrapper executable should never be moved out of the build directory. - If it is, it will not operate correctly. -*/ -EOF - cat <<"EOF" -#ifdef _MSC_VER -# define _CRT_SECURE_NO_DEPRECATE 1 -#endif -#include -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined(__CYGWIN__) -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined (other platforms) ... */ -#endif + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi -/* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ -#endif + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$echo "X$output" | $Xsed -e "$basename"` -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$output_la-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif + $echo "creating a temporary reloadable object file: $output" -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF + libobjs=$output + # Restore the value of output. + output=$save_output - cat <&2 ;; + esac - /* very simple arg parsing; don't want to rely on getopt - * also, copy all non cwrapper options to newargz, except - * argz[0], which is handled differently - */ - newargc=0; - for (i = 1; i < argc; i++) - { - if (strcmp (argv[i], dumpscript_opt) == 0) - { -EOF - case "$host" in - *mingw* | *cygwin* ) - # make stdout use "unix" line endings - echo " setmode(1,_O_BINARY);" - ;; - esac + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi - cat <<"EOF" - lt_dump_script (stdout); - return 0; - } - if (strcmp (argv[i], debug_opt) == 0) - { - lt_debug = 1; - continue; - } - if (strcmp (argv[i], ltwrapper_option_prefix) == 0) - { - /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX - namespace, but it is not one of the ones we know about and - have already dealt with, above (inluding dump-script), then - report an error. Otherwise, targets might begin to believe - they are allowed to use options in the LTWRAPPER_OPTION_PREFIX - namespace. The first time any user complains about this, we'll - need to make LTWRAPPER_OPTION_PREFIX a configure-time option - or a configure.ac-settable value. - */ - lt_fatal (__FILE__, __LINE__, - "unrecognized %s option: '%s'", - ltwrapper_option_prefix, argv[i]); - } - /* otherwise ... */ - newargz[++newargc] = xstrdup (argv[i]); - } - newargz[++newargc] = NULL; + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi -EOF - cat <&2 + fi - cat <&2 + fi - cat <<"EOF" - /* stop here, and copy so we don't have to do this twice */ - tmp_pathspec = xstrdup (newargz[0]); - - /* do NOT want the lt- prefix here, so use actual_cwrapper_name */ - strcat (newargz[0], actual_cwrapper_name); - - /* DO want the lt- prefix here if it exists, so use target_name */ - lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1); - XFREE (tmp_pathspec); - tmp_pathspec = NULL; -EOF + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi - case $host_os in - mingw*) - cat <<"EOF" - { - char* p; - while ((p = strchr (newargz[0], '\\')) != NULL) - { - *p = '/'; - } - while ((p = strchr (lt_argv_zero, '\\')) != NULL) - { - *p = '/'; - } - } -EOF - ;; - esac + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit $EXIT_FAILURE + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac - cat <<"EOF" - XFREE (target_name); - XFREE (actual_cwrapper_path); - XFREE (actual_cwrapper_name); - - lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */ - lt_setenv ("DUALCASE", "1"); /* for MSK sh */ - /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must - be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath) - because on Windows, both *_VARNAMEs are PATH but uninstalled - libraries must come first. */ - lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE); - lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE); - - lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", - nonnull (lt_argv_zero)); - for (i = 0; i < newargc; i++) - { - lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", - i, nonnull (newargz[i])); - } + # Delete the old objects. + $run $rm $obj $libobj -EOF + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= - case $host_os in - mingw*) - cat <<"EOF" - /* execv doesn't actually work on mingw as expected on unix */ - newargz = prepare_spawn (newargz); - rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); - if (rval == -1) - { - /* failed to start process */ - lt_debugprintf (__FILE__, __LINE__, - "(main) failed to launch target \"%s\": %s\n", - lt_argv_zero, nonnull (strerror (errno))); - return 127; - } - return rval; -EOF - ;; - *) - cat <<"EOF" - execv (lt_argv_zero, newargz); - return rval; /* =127, but avoids unused variable warning */ -EOF - ;; - esac + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" - cat <<"EOF" -} + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi -void * -xmalloc (size_t num) -{ - void *p = (void *) malloc (num); - if (!p) - lt_fatal (__FILE__, __LINE__, "memory exhausted"); + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - return p; -} + output="$obj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), - string) : NULL; -} + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi -const char * -base_name (const char *name) -{ - const char *base; + exit $EXIT_SUCCESS + fi -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char) name[0]) && name[1] == ':') - name += 2; -#endif + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi -int -check_executable (const char *path) -{ - struct stat st; + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi - lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi - if ((stat (path, &st) >= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} + exit $EXIT_SUCCESS + ;; -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" - if (!has_symlinks) - { - return xstrdup (pathspec); - } + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi - assert (str != NULL); - assert (pat != NULL); + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" - len = strlen (str); - patlen = strlen (pat); + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); +#ifdef __cplusplus +extern \"C\" { +#endif - if (exit_status >= 0) - exit (exit_status); -} +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} +/* External symbol declarations for the compiler. */\ +" -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + fi + fi -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; + $echo >> "$output_objdir/$dlsyms" "\ - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; +#undef lt_preloaded_symbols - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; +/* The mapping between symbol names and symbols. */ +" - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - return new_argv; + $echo >> "$output_objdir/$dlsyms" "\ + const char *name; + lt_ptr address; } -EOF - ;; - esac +lt_preloaded_symbols[] = +{\ +" - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; } +#endif -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt +#ifdef __cplusplus +} +#endif\ +" + fi - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built + # Transform the symbol file into the correct name. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + else + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + fi + ;; + * ) + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + ;; + esac ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE ;; esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + fi - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` + link_command="$compile_command$compile_rpath" - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + exit_status=$? - case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $exit_status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" ;; *) - if test "$prev" = dlfiles; then - func_append dlfiles " $arg" - else - func_append dlprefiles " $arg" - fi - prev= - continue + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" ;; esac - ;; - expsyms) - export_symbols="$arg" - test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# func_append moreargs " $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + done + temp_rpath="$rpath" + fi - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit $EXIT_SUCCESS + fi - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - done + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` else - func_fatal_error "link input file \`$arg' does not exist" + # fast_install is set to needless + relink_command= fi - arg=$save_arg - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) func_append rpath " $arg" ;; - esac + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" else - case "$xrpath " in - *" $arg "*) ;; - *) func_append xrpath " $arg" ;; - esac + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - func_append weak_libs " $arg" - prev= - continue - ;; - xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" - prev= - func_append compile_command " $wl$qarg" - func_append finalize_command " $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + fi - prevarg="$arg" + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" - fi - continue - ;; + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" - ;; + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include - -export-dynamic) - export_dynamic=yes - continue - ;; +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif - -framework) - prev=framework - continue - ;; +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif - -inst-prefix-dir) - prev=inst_prefix - continue - ;; +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ - -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" - else - func_fatal_error "need path for \`-L' option" - fi - fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; - *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - continue - ;; +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - func_append deplibs " $arg" - continue - ;; +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif - -module) - module=yes - continue - ;; +const char *program_name = NULL; - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - prev=xcompiler - continue - ;; +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; - esac - continue - ;; +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; - -multi_module) - single_module="${wl}-multi_module" - continue - ;; + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF - -no-fast-install) - fast_install=no - continue - ;; + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; - -no-undefined) - allow_undefined=no - continue - ;; + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} - -release) - prev=release - continue - ;; +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); - -rpath) - prev=rpath - continue - ;; + return p; +} - -R) - prev=xrpath - continue - ;; +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - continue - ;; +const char * +base_name (const char *name) +{ + const char *base; - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif - -shrext) - prev=shrext - continue - ;; + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; +int +check_executable(const char * path) +{ + struct stat st; - -thread-safe) - thread_safe=yes - continue - ;; + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; - -version-info) - prev=vinfo - continue - ;; + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; - -weak) - prev=weak - continue - ;; + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" - func_append finalize_command " $arg" - func_append compiler_flags " $arg" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - func_append objs " $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - ;; + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif - *.$libext) - # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" - continue - ;; + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); - *.la) - # A libtool-controlled library. + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + return NULL; +} - func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" - prev= - else - func_append deplibs " $func_resolve_sysroot_result" - fi - continue - ;; +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - esac # arg + assert(str != NULL); + assert(pat != NULL); - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop + len = strlen(str); + patlen = strlen(pat); - test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" + if (exit_status >= 0) + exit (exit_status); +} - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result - # Create the object directory. - func_mkdir_p "$output_objdir" + $echo > $output "\ +#! $SHELL - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. - specialdeplibs= +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then - case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append libs " $deplib" - done +# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; - esac - func_append pre_post_deps " $pre_post_dep" - done - fi - pre_post_deps= - fi +relink_command=\"$relink_command\" - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs="$tmp_deplibs" - fi - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; - esac - fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - func_resolve_sysroot "$lib" - case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result - case " $weak_libs " in - *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; - esac - done - done - libs="$dlprefiles" - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append compiler_flags " $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - func_append newdlprefiles " $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append newdlfiles " $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib="$l" - done - fi - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" - else - func_append newdlfiles " $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" - fi - ;; - esac - func_basename "$lib" - laname="$func_basename_result" - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" - fi - case "$host" in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - func_append newlib_search_path " $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in - *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc*) - # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - func_append notinst_deplibs " $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" - break - fi - done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - echo - if test "$linkmode" = prog; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname="$1" - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc*) - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - func_basename "$soroot" - soname="$func_basename_result" - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from \`$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$opt_mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - elif test -n "$old_library"; then - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$opt_mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system can not link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; - esac;; - *) func_append temp_deplibs " $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - func_append newlib_search_path " $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; - esac - fi - func_append tmp_libs " $func_resolve_sysroot_result" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - path= - case $deplib in - -L*) path="$deplib" ;; - *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result - func_dirname "$deplib" "" "." - dir=$func_dirname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" - path= - fi - fi - ;; - *) - path="-L$absdir/$objdir" - ;; - esac - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" - - path="-L$absdir" - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; - esac - ;; - *) func_append tmp_libs " $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - func_append tmp_libs " $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "\`-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - func_append objs "$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" - - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" - else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" - fi - fi - - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" - - install_libdir="$1" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - shift - IFS="$save_ifs" - - test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$1" - number_minor="$2" - number_revision="$3" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - func_append verstring ":${current}.0" - ;; - - qnx) - major=".$current" - versuffix=".$current" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - - *) - func_fatal_configuration "unknown library version type \`$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - fi - - func_generate_dlsyms "$libname" "$libname" "yes" - func_append libobjs " $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$opt_mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - func_append removelist " $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - func_append oldlibs " $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - func_append deplibs " -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c </dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - deplibs="$new_libs" + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_apped perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname="$1" - shift + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi + if test "$fast_install" = yes; then + $echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" - lib="$output_objdir/$realname" - linknames= - for link - do - func_append linknames " $link" - done + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= + file=\"\$\$-\$program\" - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" - func_append delfiles " $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols="$export_symbols" - export_symbols= - always_export_symbols=yes - fi - fi - ;; - esac + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd1 in $cmds; do - IFS="$save_ifs" - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test "$try_normal_branch" = yes \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=${output_objdir}/${output_la}.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" - func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi + $echo >> $output "\ - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit $EXIT_FAILURE + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" fi - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - func_append tmp_deplibs " $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" + $echo >> $output "\ - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + if test -f \"\$progdir/\$program\"; then" - func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" - fi + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + export $shlibpath_var +" fi - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" fi - if test "X$skipped_export" != "X:" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - func_basename "$output" - output_la=$func_basename_result + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \$*\" + exit $EXIT_FAILURE + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test "$compiler_needs_object" = yes; then - firstobj="$1 " - shift - fi - for obj - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test "X$objlist" = X || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - func_append delfiles " $output" + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do - else - output= - fi + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - fi + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." - exit $lt_exit - } - done - IFS="$save_ifs" + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status fi fi - if ${skipped_export-false}; then - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - fi + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi - libobjs=$output - # Restore the value of output. - output=$save_output + eval cmds=\"$old_archive_cmds\" - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; then + : else - cmds=$module_cmds + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" - func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. - exit $EXIT_SUCCESS - fi +# The name that we can dlopen(3). +dlname='$tdlname' - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done +# Names of this library. +library_names='$library_names' - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; +# The name of the static archive. +old_library='$old_library' - obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" - fi +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; - esac +# Is this an already installed library? +installed=$installed - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" +# Should we warn about portability when linking against -modules? +shouldnotlink=$module - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi - test -n "$release" && \ - func_warning "\`-release' is ignored for objects" + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit $EXIT_SUCCESS + ;; - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" + # libtool install mode + install) + modename="$modename: install" - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj="$output" + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" ;; esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg=$nonopt + fi - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= else - gentop="$output_objdir/${obj}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" + dest=$arg + continue fi - fi - - # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + ;; + esac - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi - exit $EXIT_SUCCESS + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 fi + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE fi - - exit $EXIT_SUCCESS + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done ;; + esac - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" ;; - esac - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - func_append compile_command " ${wl}-bind_at_load" - func_append finalize_command " ${wl}-bind_at_load" - ;; - esac + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - compile_deplibs="$new_libs" + fi + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - fi + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit $EXIT_FAILURE fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; - esac fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi - wrappers_required=yes - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' + exit $lt_exit + } + done + IFS="$save_ifs" fi - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' - fi + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? - exit $exit_status - fi + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi + *.lo) + # Install (i.e. copy) a libtool object. - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" fi - fi - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? fi - exit $EXIT_SUCCESS - fi + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit $EXIT_SUCCESS + ;; - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" fi - fi - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= - func_show_eval "$link_command" 'exit $?' + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + fi - # Now create the wrapper script. - func_verbose "creating $output" + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi + relink_command= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + $show "$relink_command" + if $run eval "$relink_command"; then : else - func_emit_wrapper no > $func_ltwrapper_scriptname_result + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi - func_emit_wrapper no > $output - chmod +x $output + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac ;; esac - } - exit $EXIT_SUCCESS - ;; - esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" - fi - fi - addlibs="$old_convenience" - fi + # Set up the ranlib parameters. + oldlib="$destdir/$name" - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? - func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" + if test -n "$stripme" && test -n "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? fi - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi - func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" - fi + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + ;; - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase="$func_basename_result" - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" - ;; - *) func_append oldobjs " $obj" ;; - esac - done - fi - eval cmds=\"$old_archive_cmds\" + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - len=$len0 - fi + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi + IFS="$save_ifs" fi - fi - func_execute_cmds "$cmds" 'exit $?' + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $echo "Libraries have been installed in:" + for libdir in $libdirs; do + $echo " $libdir" done + $echo + $echo "If you ever happen to want to link against installed libraries" + $echo "in a given directory, LIBDIR, you must either use libtool, and" + $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + $echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + $echo " during execution" + fi + if test -n "$runpath_var"; then + $echo " - add LIBDIR to the \`$runpath_var' environment variable" + $echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" - test -n "$generated" && \ - func_show_eval "${RM}r$generated" + $echo " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $echo " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $echo + $echo "See any operating system documentation about shared libraries for" + $echo "more information, such as the ld(1) and ld.so(8) manual pages." + $echo "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - func_verbose "creating $output" + # libtool execute mode + execute) + modename="$modename: execute" - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit $EXIT_FAILURE + fi - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" - ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" - ;; - *) func_append newdlfiles " $lib" ;; - esac - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" - ;; - esac - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlfiles " $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlprefiles " $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi -# The name that we can dlopen(3). -dlname='$tdlname' + # Read the libtool library. + dlname= + library_names= -# Names of this library. -library_names='$library_names' + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac -# The name of the static archive. -old_library='$old_library' + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + if test ! -f "$dir/$dlname"; then + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi + fi + ;; -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; -# Version information for $libname. -current=$current -age=$age -revision=$revision + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac -# Is this an already installed library? -installed=$installed + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" -# Should we warn about portability when linking against -modules? -shouldnotlink=$module + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + fi" + done -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $opt_debug - RM="$nonopt" + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit $EXIT_SUCCESS + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" files= rmforce= exit_status=0 @@ -9441,41 +6540,44 @@ for arg do case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; esac done - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi rmdirs= + origobjdir="$objdir" for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" else - odir="$dir/$objdir" + objdir="$dir/$origobjdir" fi - func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" - # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then : elif test -d "$file"; then exit_status=1 @@ -9489,32 +6591,55 @@ case $name in *.la) # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do - func_append rmfiles " $odir/$n" + rmfiles="$rmfiles $objdir/$n" done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - case "$opt_mode" in + case "$mode" in clean) - case " $library_names " in + case " $library_names " in + # " " in the beginning catches empty $dlname *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; @@ -9524,95 +6649,288 @@ *.lo) # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file - func_source $dir/$name + . $dir/$name # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then - func_append rmfiles " $dir/$pic_object" + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then - func_append rmfiles " $dir/$non_pic_object" + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) - if test "$opt_mode" = clean ; then + if test "$mode" = clean ; then noexename=$name case $file in *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe - func_append rmfiles " $file" + rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" + rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" + rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac - func_show_eval "$RM $rmfiles" 'exit_status=1' + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 done + objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status -} - -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} + ;; -test -z "$opt_mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + ;; + esac -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" if test -n "$exec_cmd"; then - eval exec "$exec_cmd" + eval exec $exec_cmd exit $EXIT_FAILURE fi -exit $exit_status +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting @@ -9626,17 +6944,14 @@ # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes +disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: -# vi:sw=2 - diff -Nru php5-5.4.4/main/main.c php5-5.4.9/main/main.c --- php5-5.4.4/main/main.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/main/main.c 2012-11-21 05:12:20.000000000 +0000 @@ -597,6 +597,7 @@ { return module_initialized; } +/* }}} */ /* {{{ php_log_err */ @@ -627,7 +628,15 @@ char *error_time_str; time(&error_time); - error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC); +#ifdef ZTS + if (!php_during_module_startup()) { + error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC); + } else { + error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC); + } +#else + error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC); +#endif len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL); #ifdef PHP_WIN32 php_flock(fd, 2); @@ -1080,7 +1089,7 @@ PG(display_errors) == PHP_DISPLAY_ERRORS_STDERR ) { #ifdef PHP_WIN32 - fprintf(stderr, "%s: %s in %s on line%d\n", error_type_str, buffer, error_filename, error_lineno); + fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno); fflush(stderr); #else fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno); diff -Nru php5-5.4.4/main/output.c php5-5.4.9/main/output.c --- php5-5.4.4/main/output.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/main/output.c 2012-11-21 05:12:20.000000000 +0000 @@ -214,7 +214,7 @@ * Used by SAPIs to disable output */ PHPAPI void php_output_set_status(int status TSRMLS_DC) { - OG(flags) = status & 0xf; + OG(flags) = (OG(flags) & ~0xf) | (status & 0xf); } /* }}} */ diff -Nru php5-5.4.4/main/php_config.h.in php5-5.4.9/main/php_config.h.in --- php5-5.4.4/main/php_config.h.in 2012-06-13 06:08:08.000000000 +0000 +++ php5-5.4.9/main/php_config.h.in 2012-11-21 05:53:10.000000000 +0000 @@ -1498,6 +1498,9 @@ /* */ #undef HAVE_SAPDB +/* Whether you have sockaddr_storage.ss_family */ +#undef HAVE_SA_SS_FAMILY + /* Define to 1 if you have the `scandir' function. */ #undef HAVE_SCANDIR diff -Nru php5-5.4.4/main/php_version.h php5-5.4.9/main/php_version.h --- php5-5.4.4/main/php_version.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/main/php_version.h 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ /* edit configure.in to change version number */ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 4 -#define PHP_RELEASE_VERSION 4 +#define PHP_RELEASE_VERSION 9 #define PHP_EXTRA_VERSION "" -#define PHP_VERSION "5.4.4" -#define PHP_VERSION_ID 50404 +#define PHP_VERSION "5.4.9" +#define PHP_VERSION_ID 50409 diff -Nru php5-5.4.4/main/snprintf.c php5-5.4.9/main/snprintf.c --- php5-5.4.4/main/snprintf.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/main/snprintf.c 2012-11-21 05:12:20.000000000 +0000 @@ -94,7 +94,7 @@ *decpt = 0; c = *p; zend_freedtoa(p); - return(c == 'I' ? "INF" : "NAN"); + return strdup((c == 'I' ? "INF" : "NAN")); } /* Make a local copy and adjust rve to be in terms of s */ if (pad && fmode) { diff -Nru php5-5.4.4/main/streams/streams.c php5-5.4.9/main/streams/streams.c --- php5-5.4.4/main/streams/streams.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/main/streams/streams.c 2012-11-21 05:12:20.000000000 +0000 @@ -1060,9 +1060,17 @@ if (has_delim) { /* search for delimiter, but skip buffered_len (the number of bytes * buffered before this loop iteration), as they have already been - * searched for the delimiter */ + * searched for the delimiter. + * The left part of the delimiter may still remain in the buffer, + * so subtract up to from buffered_len, which is + * the ammount of data we skip on this search as an optimization + */ found_delim = _php_stream_search_delim( - stream, maxlen, buffered_len, delim, delim_len TSRMLS_CC); + stream, maxlen, + buffered_len >= (delim_len - 1) + ? buffered_len - (delim_len - 1) + : 0, + delim, delim_len TSRMLS_CC); if (found_delim) { break; } @@ -2332,8 +2340,8 @@ php_stream *stream; php_stream_dirent sdp; char **vector = NULL; - int vector_size = 0; - int nfiles = 0; + unsigned int vector_size = 0; + unsigned int nfiles = 0; if (!namelist) { return FAILURE; @@ -2349,14 +2357,24 @@ if (vector_size == 0) { vector_size = 10; } else { + if(vector_size*2 < vector_size) { + /* overflow */ + efree(vector); + return FAILURE; + } vector_size *= 2; } - vector = (char **) erealloc(vector, vector_size * sizeof(char *)); + vector = (char **) safe_erealloc(vector, vector_size, sizeof(char *), 0); } vector[nfiles] = estrdup(sdp.d_name); nfiles++; + if(vector_size < 10 || nfiles == 0) { + /* overflow */ + efree(vector); + return FAILURE; + } } php_stream_closedir(stream); diff -Nru php5-5.4.4/main/streams/userspace.c php5-5.4.9/main/streams/userspace.c --- php5-5.4.4/main/streams/userspace.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/main/streams/userspace.c 2012-11-21 05:12:20.000000000 +0000 @@ -281,43 +281,22 @@ }}} **/ -static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) +static zval *user_stream_create_object(struct php_user_stream_wrapper *uwrap, php_stream_context *context TSRMLS_DC) { - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - php_userstream_data_t *us; - zval *zfilename, *zmode, *zopened, *zoptions, *zretval = NULL, *zfuncname; - zval **args[4]; - int call_result; - php_stream *stream = NULL; - zend_bool old_in_user_include; - - /* Try to catch bad usage without preventing flexibility */ - if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented"); - return NULL; - } - FG(user_stream_current_filename) = filename; + zval *object; + /* create an instance of our class */ + ALLOC_ZVAL(object); + object_init_ex(object, uwrap->ce); + Z_SET_REFCOUNT_P(object, 1); + Z_SET_ISREF_P(object); - /* if the user stream was registered as local and we are in include context, - we add allow_url_include restrictions to allow_url_fopen ones */ - /* we need only is_url == 0 here since if is_url == 1 and remote wrappers - were restricted we wouldn't get here */ - old_in_user_include = PG(in_user_include); - if(uwrap->wrapper.is_url == 0 && - (options & STREAM_OPEN_FOR_INCLUDE) && - !PG(allow_url_include)) { - PG(in_user_include) = 1; + if (context) { + add_property_resource(object, "context", context->rsrc_id); + zend_list_addref(context->rsrc_id); + } else { + add_property_null(object, "context"); } - us = emalloc(sizeof(*us)); - us->wrapper = uwrap; - - /* create an instance of our class */ - ALLOC_ZVAL(us->object); - object_init_ex(us->object, uwrap->ce); - Z_SET_REFCOUNT_P(us->object, 1); - Z_SET_ISREF_P(us->object); - if (uwrap->ce->constructor) { zend_fcall_info fci; zend_fcall_info_cache fcc; @@ -327,7 +306,7 @@ fci.function_table = &uwrap->ce->function_table; fci.function_name = NULL; fci.symbol_table = NULL; - fci.object_ptr = us->object; + fci.object_ptr = object; fci.retval_ptr_ptr = &retval_ptr; fci.param_count = 0; fci.params = NULL; @@ -336,16 +315,13 @@ fcc.initialized = 1; fcc.function_handler = uwrap->ce->constructor; fcc.calling_scope = EG(scope); - fcc.called_scope = Z_OBJCE_P(us->object); - fcc.object_ptr = us->object; + fcc.called_scope = Z_OBJCE_P(object); + fcc.object_ptr = object; if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute %s::%s()", uwrap->ce->name, uwrap->ce->constructor->common.function_name); - zval_dtor(us->object); - FREE_ZVAL(us->object); - efree(us); - FG(user_stream_current_filename) = NULL; - PG(in_user_include) = old_in_user_include; + zval_dtor(object); + FREE_ZVAL(object); return NULL; } else { if (retval_ptr) { @@ -353,12 +329,46 @@ } } } + return object; +} - if (context) { - add_property_resource(us->object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(us->object, "context"); +static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) +{ + struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; + php_userstream_data_t *us; + zval *zfilename, *zmode, *zopened, *zoptions, *zretval = NULL, *zfuncname; + zval **args[4]; + int call_result; + php_stream *stream = NULL; + zend_bool old_in_user_include; + + /* Try to catch bad usage without preventing flexibility */ + if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) { + php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented"); + return NULL; + } + FG(user_stream_current_filename) = filename; + + /* if the user stream was registered as local and we are in include context, + we add allow_url_include restrictions to allow_url_fopen ones */ + /* we need only is_url == 0 here since if is_url == 1 and remote wrappers + were restricted we wouldn't get here */ + old_in_user_include = PG(in_user_include); + if(uwrap->wrapper.is_url == 0 && + (options & STREAM_OPEN_FOR_INCLUDE) && + !PG(allow_url_include)) { + PG(in_user_include) = 1; + } + + us = emalloc(sizeof(*us)); + us->wrapper = uwrap; + + us->object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(us->object == NULL) { + FG(user_stream_current_filename) = NULL; + PG(in_user_include) = old_in_user_include; + efree(us); + return NULL; } /* call it's stream_open method - set up params first */ @@ -447,17 +457,11 @@ us = emalloc(sizeof(*us)); us->wrapper = uwrap; - /* create an instance of our class */ - ALLOC_ZVAL(us->object); - object_init_ex(us->object, uwrap->ce); - Z_SET_REFCOUNT_P(us->object, 1); - Z_SET_ISREF_P(us->object); - - if (context) { - add_property_resource(us->object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(us->object, "context"); + us->object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(us == NULL) { + FG(user_stream_current_filename) = NULL; + efree(us); + return NULL; } /* call it's dir_open method - set up params first */ @@ -1157,16 +1161,9 @@ int ret = 0; /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + return ret; } /* call the unlink method */ @@ -1211,16 +1208,9 @@ int ret = 0; /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + return ret; } /* call the rename method */ @@ -1270,16 +1260,9 @@ int ret = 0; /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + return ret; } /* call the mkdir method */ @@ -1335,16 +1318,9 @@ int ret = 0; /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + return ret; } /* call the rmdir method */ @@ -1420,16 +1396,10 @@ } /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + zval_ptr_dtor(&zvalue); + return ret; } /* call the mkdir method */ @@ -1484,16 +1454,9 @@ int ret = -1; /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - Z_SET_REFCOUNT_P(object, 1); - Z_SET_ISREF_P(object); - - if (context) { - add_property_resource(object, "context", context->rsrc_id); - zend_list_addref(context->rsrc_id); - } else { - add_property_null(object, "context"); + object = user_stream_create_object(uwrap, context TSRMLS_CC); + if(object == NULL) { + return ret; } /* call it's stat_url method - set up params first */ diff -Nru php5-5.4.4/makedist php5-5.4.9/makedist --- php5-5.4.4/makedist 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/makedist 2012-11-21 05:12:20.000000000 +0000 @@ -69,9 +69,6 @@ cd $DIR || exit 5 -# The full ChangeLog is available separately from lxr.php.net -rm -f ChangeLog* - # hide away our own versions of libtool-generated files for i in $LT_TARGETS; do if test -f "$i"; then diff -Nru php5-5.4.4/netware/start.c php5-5.4.9/netware/start.c --- php5-5.4.4/netware/start.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/netware/start.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/php.ini-development php5-5.4.9/php.ini-development --- php5-5.4.4/php.ini-development 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/php.ini-development 2012-11-21 05:12:20.000000000 +0000 @@ -751,7 +751,7 @@ ; will look for to know it is OK to continue execution. Setting this variable MAY ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. ; http://php.net/cgi.redirect-status-env -;cgi.redirect_status_env = ; +;cgi.redirect_status_env = ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok @@ -768,7 +768,7 @@ ; does not currently support this feature (03/17/2002) ; Set to 1 if running under IIS. Default is zero. ; http://php.net/fastcgi.impersonate -;fastcgi.impersonate = 1; +;fastcgi.impersonate = 1 ; Disable logging through FastCGI connection. PHP's default behavior is to enable ; this feature. @@ -1020,6 +1020,8 @@ ; The path to a log file that will log all mail() calls. Log entries include ; the full path of the script, line number, To address and headers. ;mail.log = +; Log mail to syslog (Event Log on NT, not valid in Windows 95). +;mail.log = syslog [SQL] ; http://php.net/sql.safe-mode diff -Nru php5-5.4.4/php.ini-production php5-5.4.9/php.ini-production --- php5-5.4.4/php.ini-production 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/php.ini-production 2012-11-21 05:12:20.000000000 +0000 @@ -751,7 +751,7 @@ ; will look for to know it is OK to continue execution. Setting this variable MAY ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. ; http://php.net/cgi.redirect-status-env -;cgi.redirect_status_env = ; +;cgi.redirect_status_env = ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok @@ -768,7 +768,7 @@ ; does not currently support this feature (03/17/2002) ; Set to 1 if running under IIS. Default is zero. ; http://php.net/fastcgi.impersonate -;fastcgi.impersonate = 1; +;fastcgi.impersonate = 1 ; Disable logging through FastCGI connection. PHP's default behavior is to enable ; this feature. @@ -1020,6 +1020,8 @@ ; The path to a log file that will log all mail() calls. Log entries include ; the full path of the script, line number, To address and headers. ;mail.log = +; Log mail to syslog (Event Log on NT, not valid in Windows 95). +;mail.log = syslog [SQL] ; http://php.net/sql.safe-mode diff -Nru php5-5.4.4/run-tests.php php5-5.4.9/run-tests.php --- php5-5.4.4/run-tests.php 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/run-tests.php 2012-11-21 05:12:20.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/php +#!/usr/bin/env php = 330) { /* valgrind 3.3.0+ doesn't have --log-file-exactly option */ @@ -1759,6 +1764,7 @@ } else { $env['USE_ZEND_ALLOC'] = '1'; + $env['ZEND_DONT_UNLOAD_MODULES'] = 0; } if ($DETAILED) echo " @@ -2092,8 +2098,10 @@ if (isset($old_php)) { $php = $old_php; } + + $diff = empty($diff) ? '' : "', $diff) . "\n]]>"; - junit_mark_test_as($restype, str_replace($cwd . '/', '', $tested_file), $tested, null, $info, "', $diff) . "\n]]>"); + junit_mark_test_as($restype, str_replace($cwd . '/', '', $tested_file), $tested, null, $info, $diff); return $restype[0] . 'ED'; } @@ -2669,12 +2677,15 @@ $time = null !== $time ? $time : junit_get_timer($file_name); junit_suite_record($suite, 'execution_time', $time); + $escaped_details = htmlspecialchars($details, ENT_QUOTES, 'UTF-8'); + $escaped_test_name = basename($file_name) . ' - ' . htmlspecialchars($test_name, ENT_QUOTES); $JUNIT['files'][$file_name]['xml'] = "\n"; if (is_array($type)) { $output_type = $type[0] . 'ED'; - $type = reset(array_intersect(array('XFAIL', 'FAIL'), $type)); + $temp = array_intersect(array('XFAIL', 'FAIL'), $type); + $type = reset($temp); } else { $output_type = $type . 'ED'; } @@ -2689,10 +2700,10 @@ $JUNIT['files'][$file_name]['xml'] .= "$message\n"; } elseif('FAIL' == $type) { junit_suite_record($suite, 'test_fail'); - $JUNIT['files'][$file_name]['xml'] .= "$details\n"; + $JUNIT['files'][$file_name]['xml'] .= "$escaped_details\n"; } else { junit_suite_record($suite, 'test_error'); - $JUNIT['files'][$file_name]['xml'] .= "$details\n"; + $JUNIT['files'][$file_name]['xml'] .= "$escaped_details\n"; } $JUNIT['files'][$file_name]['xml'] .= "\n"; diff -Nru php5-5.4.4/sapi/apache2filter/sapi_apache2.c php5-5.4.9/sapi/apache2filter/sapi_apache2.c --- php5-5.4.4/sapi/apache2filter/sapi_apache2.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/apache2filter/sapi_apache2.c 2012-11-21 05:12:20.000000000 +0000 @@ -311,7 +311,7 @@ static double php_apache_sapi_get_request_time(TSRMLS_D) { php_struct *ctx = SG(server_context); - return apr_time_as_msec(ctx->r->request_time); + return ((double) apr_time_as_msec(ctx->r->request_time)) / 1000.0; } extern zend_module_entry php_apache_module; diff -Nru php5-5.4.4/sapi/cgi/tests/apache_request_headers.phpt php5-5.4.9/sapi/cgi/tests/apache_request_headers.phpt --- php5-5.4.4/sapi/cgi/tests/apache_request_headers.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/cgi/tests/apache_request_headers.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -1,5 +1,7 @@ --TEST-- apache_request_headers() stack overflow. +--INI-- +default_charset="UTF-8" --SKIPIF-- '); -passthru("$php $file"); +passthru("$php -n $file"); $names = array('HTTP_X_TEST', 'HTTP_X__TEST', 'HTTP_X_'); foreach ($names as $name) { putenv($name."=".str_repeat("A", 256)); - passthru("$php -q $file"); + passthru("$php -n -q $file"); putenv($name); } unlink($file); @@ -29,7 +31,7 @@ ?> --EXPECTF-- X-Powered-By: PHP/%s -Content-type: text/html +Content-type: text/%s Array ( diff -Nru php5-5.4.4/sapi/cli/cli.h php5-5.4.9/sapi/cli/cli.h --- php5-5.4.4/sapi/cli/cli.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/cli/cli.h 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/sapi/cli/config.m4 php5-5.4.9/sapi/cli/config.m4 --- php5-5.4.4/sapi/cli/config.m4 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/cli/config.m4 2012-11-21 05:12:20.000000000 +0000 @@ -44,5 +44,7 @@ PHP_SUBST(BUILD_CLI) PHP_OUTPUT(sapi/cli/php.1) + + PHP_INSTALL_HEADERS([sapi/cli/cli.h]) fi AC_MSG_RESULT($PHP_CLI) diff -Nru php5-5.4.4/sapi/cli/php_cli.c php5-5.4.9/sapi/cli/php_cli.c --- php5-5.4.4/sapi/cli/php_cli.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/cli/php_cli.c 2012-11-21 05:12:20.000000000 +0000 @@ -1167,12 +1167,15 @@ } zend_end_try(); out: - if (exit_status == 0) { - exit_status = EG(exit_status); - } if (request_started) { php_request_shutdown((void *) 0); } + if (translated_path) { + free(translated_path); + } + if (exit_status == 0) { + exit_status = EG(exit_status); + } return exit_status; err: sapi_deactivate(TSRMLS_C); diff -Nru php5-5.4.4/sapi/cli/php_cli_server.c php5-5.4.9/sapi/cli/php_cli_server.c --- php5-5.4.4/sapi/cli/php_cli_server.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/cli/php_cli_server.c 2012-11-21 05:12:20.000000000 +0000 @@ -116,7 +116,7 @@ } php_cli_server_poller; typedef struct php_cli_server_request { - enum php_http_method request_method; + enum php_http_method request_method; int protocol_version; char *request_uri; size_t request_uri_len; @@ -245,9 +245,10 @@ }; static php_cli_server_http_reponse_status_code_pair template_map[] = { - { 400, "

%s

Your browser sent a request that this server could not understand.

" }, - { 404, "

%s

The requested resource %s was not found on this server.

" }, - { 500, "

%s

The server is temporality unavaiable.

" } + { 400, "

%s

Your browser sent a request that this server could not understand.

" }, + { 404, "

%s

The requested resource %s was not found on this server.

" }, + { 500, "

%s

The server is temporarily unavailable.

" }, + { 501, "

%s

Request method not supported.

" } }; static php_cli_server_ext_mime_type_pair mime_type_map[] = { @@ -275,25 +276,13 @@ ZEND_DECLARE_MODULE_GLOBALS(cli_server); -/* {{{ static char php_cli_server_css[] +/* {{{ static char php_cli_server_css[] * copied from ext/standard/info.c */ -static const char php_cli_server_css[] = "\n"; +static const char php_cli_server_css[] = "\n"; /* }}} */ static void char_ptr_dtor_p(char **p) /* {{{ */ @@ -543,7 +532,7 @@ } } /* }}} */ -static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { +static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { zval *track_vars_array = va_arg(args, zval *); if (hash_key->nKeyLength) { char *real_key, *key; @@ -583,7 +572,7 @@ } else { sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", client->addr_str TSRMLS_CC); } - } + } { char *tmp; spprintf(&tmp, 0, "PHP %s Development Server", PHP_VERSION); @@ -681,7 +670,7 @@ sapi_cli_server_log_message, /* Log message */ NULL, /* Get request time */ NULL, /* Child terminate */ - + STANDARD_SAPI_MODULE_PROPERTIES }; /* }}} */ @@ -778,7 +767,7 @@ } } } - + #else php_socket_t fd = 0; const php_socket_t max_fd = poller->max_fd; @@ -966,7 +955,7 @@ } else if (nbytes_sent == chunk->data.immortal.len) { php_cli_server_chunk_dtor(chunk); pefree(chunk, 1); - sender->buffer.first = next; + sender->buffer.first = next; if (!next) { sender->buffer.last = NULL; } @@ -1345,7 +1334,7 @@ } } break; /* regular file */ - } + } if (prev_path) { pefree(prev_path, 1); *q = DEFAULT_SLASH; @@ -1384,7 +1373,7 @@ if (request->vpath[i] == '\\') { request->vpath[i] = '/'; } - } + } } #endif request->sb = sb; @@ -1452,7 +1441,7 @@ } } } - + *decoded_vpath_end = '\0'; *retval = decoded_vpath; *retval_len = decoded_vpath_end - decoded_vpath; @@ -1618,7 +1607,11 @@ client->parser.data = client; nbytes_consumed = php_http_parser_execute(&client->parser, &settings, buf, nbytes_read); if (nbytes_consumed != nbytes_read) { - *errstr = estrdup("Malformed HTTP request"); + if (buf[0] & 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) { + *errstr = estrdup("Unsupported SSL request"); + } else { + *errstr = estrdup("Malformed HTTP request"); + } return -1; } if (client->current_header_name) { @@ -1752,7 +1745,7 @@ escaped_request_uri = php_escape_html_entities_ex((unsigned char *)client->request.request_uri, client->request.request_uri_len, &escaped_request_uri_len, 0, ENT_QUOTES, NULL, 0 TSRMLS_CC); { - static const char prologue_template[] = "%d %s"; + static const char prologue_template[] = "%d %s"; php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new_self_contained(strlen(prologue_template) + 3 + strlen(status_string) + 1); if (!chunk) { goto fail; @@ -1808,7 +1801,7 @@ smart_str_append_generic_ex(&buffer, php_cli_server_buffer_size(&client->content_sender.buffer), 1, size_t, _unsigned); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); - + chunk = php_cli_server_chunk_heap_new(buffer.c, buffer.c, buffer.len); if (!chunk) { smart_str_free_ex(&buffer, 1); @@ -1826,6 +1819,9 @@ return SUCCESS; fail: + if (errstr) { + pefree(errstr, 1); + } efree(escaped_request_uri); return FAILURE; } /* }}} */ @@ -1910,7 +1906,7 @@ } /* }}} */ -static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */ +static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */ char **auth; php_cli_server_client_populate_request_info(client, &SG(request_info)); if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) { @@ -1935,8 +1931,8 @@ SG(server_context) = NULL; SG(rfc1867_uploaded_files) = NULL; return SUCCESS; -} -/* }}} */ +} +/* }}} */ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ { @@ -1995,7 +1991,7 @@ destroy_request_info(&SG(request_info)); return SUCCESS; } - } + } if (server->router) { if (!php_cli_server_dispatch_router(server, client TSRMLS_CC)) { @@ -2009,7 +2005,7 @@ || SUCCESS != php_cli_server_send_error_page(server, client, 500 TSRMLS_CC)) { php_cli_server_request_shutdown(server, client TSRMLS_CC); return SUCCESS; - } + } } else { if (server->router) { static int (*send_header_func)(sapi_headers_struct * TSRMLS_DC); @@ -2022,7 +2018,7 @@ sapi_module.send_headers = send_header_func; SG(sapi_headers).send_default_content_type = 1; SG(rfc1867_uploaded_files) = NULL; - } + } if (SUCCESS != php_cli_server_begin_send_static(server, client TSRMLS_CC)) { php_cli_server_close_connection(server, client TSRMLS_CC); } @@ -2184,6 +2180,8 @@ efree(errstr); php_cli_server_close_connection(server, client TSRMLS_CC); return FAILURE; + } else if (status == 1 && client->request.request_method == PHP_HTTP_NOT_IMPLEMENTED) { + return php_cli_server_send_error_page(server, client, 501 TSRMLS_CC); } else if (status == 1) { php_cli_server_poller_remove(&server->poller, POLLIN, client->sock); php_cli_server_dispatch(server, client TSRMLS_CC); @@ -2304,7 +2302,7 @@ static int php_cli_server_do_event_loop(php_cli_server *server TSRMLS_DC) /* {{{ */ { int retval = SUCCESS; - while (server->is_running) { + while (server->is_running) { static const struct timeval tv = { 1, 0 }; int n = php_cli_server_poller_poll(&server->poller, &tv); if (n > 0) { @@ -2400,7 +2398,7 @@ php_localtime_r(&tv.tv_sec, &tm); php_asctime_r(&tm, buf); printf("PHP %s Development Server started at %s" - "Listening on %s\n" + "Listening on http://%s\n" "Document root is %s\n" "Press Ctrl-C to quit.\n", PHP_VERSION, buf, server_bind_address, document_root); diff -Nru php5-5.4.4/sapi/cli/php_http_parser.c php5-5.4.9/sapi/cli/php_http_parser.c --- php5-5.4.4/sapi/cli/php_http_parser.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/cli/php_http_parser.c 2012-11-21 05:12:20.000000000 +0000 @@ -81,6 +81,7 @@ , "HEAD" , "POST" , "PUT" + , "PATCH" , "CONNECT" , "OPTIONS" , "TRACE" @@ -99,6 +100,7 @@ , "NOTIFY" , "SUBSCRIBE" , "UNSUBSCRIBE" + , "NOTIMPLEMENTED" }; @@ -589,7 +591,7 @@ case 'S': parser->method = PHP_HTTP_SUBSCRIBE; break; case 'T': parser->method = PHP_HTTP_TRACE; break; case 'U': parser->method = PHP_HTTP_UNLOCK; /* or UNSUBSCRIBE */ break; - default: goto error; + default: parser->method = PHP_HTTP_NOT_IMPLEMENTED; break; } state = s_req_method; break; @@ -602,7 +604,7 @@ goto error; matcher = method_strings[parser->method]; - if (ch == ' ' && matcher[index] == '\0') { + if (ch == ' ' && (matcher[index] == '\0' || parser->method == PHP_HTTP_NOT_IMPLEMENTED)) { state = s_req_spaces_before_url; } else if (ch == matcher[index]) { ; /* nada */ @@ -626,12 +628,14 @@ parser->method = PHP_HTTP_PROPFIND; /* or HTTP_PROPPATCH */ } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'U') { parser->method = PHP_HTTP_PUT; + } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'A') { + parser->method = PHP_HTTP_PATCH; } else if (index == 2 && parser->method == PHP_HTTP_UNLOCK && ch == 'S') { parser->method = PHP_HTTP_UNSUBSCRIBE; } else if (index == 4 && parser->method == PHP_HTTP_PROPFIND && ch == 'P') { parser->method = PHP_HTTP_PROPPATCH; } else { - goto error; + parser->method = PHP_HTTP_NOT_IMPLEMENTED; } ++index; diff -Nru php5-5.4.4/sapi/cli/php_http_parser.h php5-5.4.9/sapi/cli/php_http_parser.h --- php5-5.4.4/sapi/cli/php_http_parser.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/cli/php_http_parser.h 2012-11-21 05:12:20.000000000 +0000 @@ -32,7 +32,10 @@ # include "win32/php_stdint.h" # include "config.w32.h" #else -# include +# include "php_config.h" +# ifdef HAVE_STDINT_H +# include +# endif #endif /* Compile with -DPHP_HTTP_PARSER_STRICT=0 to make less checks, but run @@ -77,6 +80,7 @@ , PHP_HTTP_HEAD , PHP_HTTP_POST , PHP_HTTP_PUT + , PHP_HTTP_PATCH /* pathological */ , PHP_HTTP_CONNECT , PHP_HTTP_OPTIONS @@ -99,6 +103,8 @@ , PHP_HTTP_NOTIFY , PHP_HTTP_SUBSCRIBE , PHP_HTTP_UNSUBSCRIBE + /* unknown, not implemented */ + , PHP_HTTP_NOT_IMPLEMENTED }; diff -Nru php5-5.4.4/sapi/cli/tests/bug61546.phpt php5-5.4.9/sapi/cli/tests/bug61546.phpt --- php5-5.4.4/sapi/cli/tests/bug61546.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/cli/tests/bug61546.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -2,13 +2,22 @@ Bug #61546 (functions related to current script failed when chdir() in cli sapi) --FILE-- +--FILE-- + +--EXPECTF-- +HTTP/1.1 501 Not Implemented diff -Nru php5-5.4.4/sapi/cli/tests/php_cli_server.inc php5-5.4.9/sapi/cli/tests/php_cli_server.inc --- php5-5.4.4/sapi/cli/tests/php_cli_server.inc 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/cli/tests/php_cli_server.inc 2012-11-21 05:12:20.000000000 +0000 @@ -38,7 +38,7 @@ // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' // it might not be listening yet...need to wait until fsockopen() call returns $i = 0; - while (($i++ < 5) && !($fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT))) { + while (($i++ < 30) && !($fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT))) { usleep(10000); } diff -Nru php5-5.4.4/sapi/cli/tests/php_cli_server_013.phpt php5-5.4.9/sapi/cli/tests/php_cli_server_013.phpt --- php5-5.4.4/sapi/cli/tests/php_cli_server_013.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/cli/tests/php_cli_server_013.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -33,7 +33,7 @@ } } -echo preg_replace("/", $output), "\n"; +echo preg_replace("/", $output), "\n"; fclose($fp); @@ -55,7 +55,7 @@ } } -echo preg_replace("/", $output), "\n"; +echo preg_replace("/", $output), "\n"; fclose($fp); $output = ''; @@ -76,7 +76,7 @@ } } -echo preg_replace("/", $output), "\n"; +echo preg_replace("/", $output), "\n"; fclose($fp); ?> --EXPECTF-- @@ -87,22 +87,22 @@ Content-Type: text/html; charset=UTF-8 Content-Length: %d -404 Not Found -

Not Found

The requested resource / was not found on this server.

+404 Not Found +

Not Found

The requested resource / was not found on this server.

HTTP/1.1 404 Not Found Host: %s Connection: close Content-Type: text/html; charset=UTF-8 Content-Length: %d -404 Not Found -

Not Found

The requested resource /main/style.css was not found on this server.

+404 Not Found +

Not Found

The requested resource /main/style.css was not found on this server.

HTTP/1.1 404 Not Found Host: %s Connection: close Content-Type: text/html; charset=UTF-8 Content-Length: %d -404 Not Found -

Not Found

The requested resource /main/foo/bar was not found on this server.

+404 Not Found +

Not Found

The requested resource /main/foo/bar was not found on this server.

diff -Nru php5-5.4.4/sapi/cli/tests/php_cli_server_014.phpt php5-5.4.9/sapi/cli/tests/php_cli_server_014.phpt --- php5-5.4.4/sapi/cli/tests/php_cli_server_014.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/cli/tests/php_cli_server_014.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -57,7 +57,7 @@ } } -echo preg_replace("/", $output), "\n"; +echo preg_replace("/", $output), "\n"; fclose($fp); ?> @@ -76,5 +76,5 @@ Content-Type: %s Content-Length: %d -404 Not Found -

Not Found

The requested resource /main/no-exists.php was not found on this server.

+404 Not Found +

Not Found

The requested resource /main/no-exists.php was not found on this server.

diff -Nru php5-5.4.4/sapi/cli/tests/php_cli_server_018.phpt php5-5.4.9/sapi/cli/tests/php_cli_server_018.phpt --- php5-5.4.4/sapi/cli/tests/php_cli_server_018.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/sapi/cli/tests/php_cli_server_018.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,44 @@ +--TEST-- +Implement Req #61679 (Support HTTP PATCH method) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +HTTP/1.1 200 OK +Host: %s +Connection: close +X-Powered-By: %s +Content-type: text/html + +string(5) "PATCH" diff -Nru php5-5.4.4/sapi/fpm/config.m4 php5-5.4.9/sapi/fpm/config.m4 --- php5-5.4.4/sapi/fpm/config.m4 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/config.m4 2012-11-21 05:12:20.000000000 +0000 @@ -16,6 +16,7 @@ AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h]) AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/time.h]) AC_CHECK_HEADERS([arpa/inet.h netinet/in.h]) + AC_CHECK_HEADERS([sysexits.h]) ]) AC_DEFUN([AC_FPM_PRCTL], @@ -192,6 +193,8 @@ have_ptrace=no have_broken_ptrace=yes AC_MSG_RESULT([no]) + ], [ + AC_MSG_RESULT([skipped (cross compiling)]) ]) fi @@ -264,6 +267,8 @@ ], [ proc_mem_file="" AC_MSG_RESULT([no]) + ], [ + AC_MSG_RESULT([skipped (cross compiling)]) ]) fi @@ -582,12 +587,16 @@ AC_DEFINE_UNQUOTED(PHP_FPM_USER, "$php_fpm_user", [fpm user name]) AC_DEFINE_UNQUOTED(PHP_FPM_GROUP, "$php_fpm_group", [fpm group name]) + AC_DEFINE_UNQUOTED(PHP_FPM_USER, "$php_fpm_user", [fpm user name]) + AC_DEFINE_UNQUOTED(PHP_FPM_GROUP, "$php_fpm_group", [fpm group name]) + PHP_ADD_BUILD_DIR(sapi/fpm/fpm) PHP_ADD_BUILD_DIR(sapi/fpm/fpm/events) - PHP_OUTPUT(sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.8 sapi/fpm/status.html) + PHP_OUTPUT(sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html) PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/fpm/Makefile.frag]) SAPI_FPM_PATH=sapi/fpm/php-fpm + if test "$fpm_trace_type" && test -f "$abs_srcdir/sapi/fpm/fpm/fpm_trace_$fpm_trace_type.c"; then PHP_FPM_TRACE_FILES="fpm/fpm_trace.c fpm/fpm_trace_$fpm_trace_type.c" diff -Nru php5-5.4.4/sapi/fpm/fpm/fastcgi.c php5-5.4.9/sapi/fpm/fpm/fastcgi.c --- php5-5.4.4/sapi/fpm/fpm/fastcgi.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fastcgi.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -399,7 +399,7 @@ { int ret = 1; int zero_found = 0; - *eff_len = 0; + *eff_len = 0; for (; p != end; ++p) { if (*p == '\0') { zero_found = 1; @@ -427,7 +427,7 @@ char *tmp = buf; size_t buf_size = sizeof(buf); int name_len, val_len; - uint eff_name_len, eff_val_len; + uint eff_name_len; char *s; int ret = 1; size_t bytes_consumed; @@ -453,8 +453,12 @@ ret = 0; break; } - if (!fcgi_param_get_eff_len(p, p+name_len, &eff_name_len) || - !fcgi_param_get_eff_len(p+name_len, p+name_len+val_len, &eff_val_len)) { + + /* + * get the effective length of the name in case it's not a valid string + * don't do this on the value because it can be binary data + */ + if (!fcgi_param_get_eff_len(p, p+name_len, &eff_name_len)){ /* Malicious request */ ret = 0; break; @@ -473,7 +477,7 @@ } memcpy(tmp, p, eff_name_len); tmp[eff_name_len] = 0; - s = estrndup((char*)p + name_len, eff_val_len); + s = estrndup((char*)p + name_len, val_len); if (s == NULL) { ret = 0; break; diff -Nru php5-5.4.4/sapi/fpm/fpm/fastcgi.h php5-5.4.9/sapi/fpm/fpm/fastcgi.h --- php5-5.4.4/sapi/fpm/fpm/fastcgi.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fastcgi.h 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm.c php5-5.4.9/sapi/fpm/fpm/fpm.c --- php5-5.4.4/sapi/fpm/fpm/fpm.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm.c 2012-11-21 05:12:20.000000000 +0000 @@ -37,10 +37,12 @@ .max_requests = 0, .is_child = 0, .test_successful = 0, - .heartbeat = 0 + .heartbeat = 0, + .run_as_root = 0, + .send_config_pipe = {0, 0}, }; -int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf) /* {{{ */ +int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root, int force_daemon) /* {{{ */ { fpm_globals.argc = argc; fpm_globals.argv = argv; @@ -49,10 +51,11 @@ } fpm_globals.prefix = prefix; fpm_globals.pid = pid; + fpm_globals.run_as_root = run_as_root; if (0 > fpm_php_init_main() || 0 > fpm_stdio_init_main() || - 0 > fpm_conf_init_main(test_conf) || + 0 > fpm_conf_init_main(test_conf, force_daemon) || 0 > fpm_unix_init_main() || 0 > fpm_scoreboard_init_main() || 0 > fpm_pctl_init_main() || @@ -64,7 +67,7 @@ 0 > fpm_event_init_main()) { if (fpm_globals.test_successful) { - exit(0); + exit(FPM_EXIT_OK); } else { zlog(ZLOG_ERROR, "FPM initialization failed"); return -1; diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm.h php5-5.4.9/sapi/fpm/fpm/fpm.h --- php5-5.4.4/sapi/fpm/fpm/fpm.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm.h 2012-11-21 05:12:20.000000000 +0000 @@ -7,8 +7,37 @@ #include +#ifdef HAVE_SYSEXITS_H +#include +#endif + +#ifdef EX_OK +#define FPM_EXIT_OK EX_OK +#else +#define FPM_EXIT_OK 0 +#endif + +#ifdef EX_USAGE +#define FPM_EXIT_USAGE EX_USAGE +#else +#define FPM_EXIT_USAGE 64 +#endif + +#ifdef EX_SOFTWARE +#define FPM_EXIT_SOFTWARE EX_SOFTWARE +#else +#define FPM_EXIT_SOFTWARE 70 +#endif + +#ifdef EX_CONFIG +#define FPM_EXIT_CONFIG EX_CONFIG +#else +#define FPM_EXIT_CONFIG 78 +#endif + + int fpm_run(int *max_requests); -int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf); +int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root, int force_daemon); struct fpm_globals_s { pid_t parent_pid; @@ -25,6 +54,8 @@ int is_child; int test_successful; int heartbeat; + int run_as_root; + int send_config_pipe[2]; }; extern struct fpm_globals_s fpm_globals; diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_children.c php5-5.4.9/sapi/fpm/fpm/fpm_children.c --- php5-5.4.4/sapi/fpm/fpm/fpm_children.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_children.c 2012-11-21 05:12:20.000000000 +0000 @@ -156,7 +156,7 @@ 0 > fpm_php_init_child(wp)) { zlog(ZLOG_ERROR, "[pool %s] child failed to initialize", wp->config->name); - exit(255); + exit(FPM_EXIT_SOFTWARE); } } /* }}} */ @@ -198,7 +198,7 @@ restart_child = 0; } - if (WEXITSTATUS(status) != 0) { + if (WEXITSTATUS(status) != FPM_EXIT_OK) { severity = ZLOG_WARNING; } diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_conf.c php5-5.4.9/sapi/fpm/fpm/fpm_conf.c --- php5-5.4.4/sapi/fpm/fpm/fpm_conf.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_conf.c 2012-11-21 05:12:20.000000000 +0000 @@ -53,7 +53,9 @@ static int fpm_conf_load_ini_file(char *filename TSRMLS_DC); static char *fpm_conf_set_integer(zval *value, void **config, intptr_t offset); +#if 0 /* not used for now */ static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset); +#endif static char *fpm_conf_set_time(zval *value, void **config, intptr_t offset); static char *fpm_conf_set_boolean(zval *value, void **config, intptr_t offset); static char *fpm_conf_set_string(zval *value, void **config, intptr_t offset); @@ -70,6 +72,7 @@ .syslog_facility = -1, #endif .process_max = 0, + .process_priority = 64, /* 64 means unset */ }; static struct fpm_worker_pool_s *current_wp = NULL; static int ini_recursion = 0; @@ -92,6 +95,7 @@ { "emergency_restart_interval", &fpm_conf_set_time, GO(emergency_restart_interval) }, { "process_control_timeout", &fpm_conf_set_time, GO(process_control_timeout) }, { "process.max", &fpm_conf_set_integer, GO(process_max) }, + { "process.priority", &fpm_conf_set_integer, GO(process_priority) }, { "daemonize", &fpm_conf_set_boolean, GO(daemonize) }, { "rlimit_files", &fpm_conf_set_integer, GO(rlimit_files) }, { "rlimit_core", &fpm_conf_set_rlimit_core, GO(rlimit_core) }, @@ -112,6 +116,7 @@ { "listen.group", &fpm_conf_set_string, WPO(listen_group) }, { "listen.mode", &fpm_conf_set_string, WPO(listen_mode) }, { "listen.allowed_clients", &fpm_conf_set_string, WPO(listen_allowed_clients) }, + { "process.priority", &fpm_conf_set_integer, WPO(process_priority) }, { "pm", &fpm_conf_set_pm, WPO(pm) }, { "pm.max_children", &fpm_conf_set_integer, WPO(pm_max_children) }, { "pm.start_servers", &fpm_conf_set_integer, WPO(pm_start_servers) }, @@ -239,6 +244,7 @@ } /* }}} */ +#if 0 /* not used for now */ static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset) /* {{{ */ { char *val = Z_STRVAL_P(value); @@ -254,6 +260,7 @@ return NULL; } /* }}} */ +#endif static char *fpm_conf_set_time(zval *value, void **config, intptr_t offset) /* {{{ */ { @@ -577,6 +584,7 @@ memset(wp->config, 0, sizeof(struct fpm_worker_pool_config_s)); wp->config->listen_backlog = FPM_BACKLOG_DEFAULT; wp->config->pm_process_idle_timeout = 10; /* 10s by default */ + wp->config->process_priority = 64; /* 64 means unset */ if (!fpm_worker_all_pools) { fpm_worker_all_pools = wp; @@ -704,7 +712,7 @@ static int fpm_conf_process_all_pools() /* {{{ */ { - struct fpm_worker_pool_s *wp; + struct fpm_worker_pool_s *wp, *wp2; if (!fpm_worker_all_pools) { zlog(ZLOG_ERROR, "No pool defined. at least one pool section must be specified in config file"); @@ -723,8 +731,8 @@ } } - /* user */ - if (!wp->config->user) { + /* alert if user is not set only if we are not root*/ + if (!wp->config->user && !geteuid()) { zlog(ZLOG_ALERT, "[pool %s] user has not been defined", wp->config->name); return -1; } @@ -741,6 +749,11 @@ return -1; } + if (wp->config->process_priority != 64 && (wp->config->process_priority < -19 || wp->config->process_priority > 20)) { + zlog(ZLOG_ERROR, "[pool %s] process.priority must be included into [-19,20]", wp->config->name); + return -1; + } + /* pm */ if (wp->config->pm != PM_STYLE_STATIC && wp->config->pm != PM_STYLE_DYNAMIC && wp->config->pm != PM_STYLE_ONDEMAND) { zlog(ZLOG_ALERT, "[pool %s] the process manager is missing (static, dynamic or ondemand)", wp->config->name); @@ -1044,6 +1057,20 @@ } } } + + /* ensure 2 pools do not use the same listening address */ + for (wp = fpm_worker_all_pools; wp; wp = wp->next) { + for (wp2 = fpm_worker_all_pools; wp2; wp2 = wp2->next) { + if (wp == wp2) { + continue; + } + + if (wp->config->listen_address && *wp->config->listen_address && wp2->config->listen_address && *wp2->config->listen_address && !strcmp(wp->config->listen_address, wp2->config->listen_address)) { + zlog(ZLOG_ERROR, "[pool %s] unable to set listen address as it's already used in another pool '%s'", wp2->config->name, wp->config->name); + return -1; + } + } + } return 0; } /* }}} */ @@ -1088,7 +1115,7 @@ } /* }}} */ -static int fpm_conf_post_process(TSRMLS_D) /* {{{ */ +static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */ { struct fpm_worker_pool_s *wp; @@ -1096,6 +1123,11 @@ fpm_evaluate_full_path(&fpm_global_config.pid_file, NULL, PHP_LOCALSTATEDIR, 0); } + if (force_daemon >= 0) { + /* forced from command line options */ + fpm_global_config.daemonize = force_daemon; + } + fpm_globals.log_level = fpm_global_config.log_level; if (fpm_global_config.process_max < 0) { @@ -1103,6 +1135,11 @@ return -1; } + if (fpm_global_config.process_priority != 64 && (fpm_global_config.process_priority < -19 || fpm_global_config.process_priority > 20)) { + zlog(ZLOG_ERROR, "process.priority must be included into [-19,20]"); + return -1; + } + if (!fpm_global_config.error_log) { fpm_global_config.error_log = strdup("log/php-fpm.log"); } @@ -1485,6 +1522,11 @@ zlog(ZLOG_NOTICE, "\temergency_restart_threshold = %d", fpm_global_config.emergency_restart_threshold); zlog(ZLOG_NOTICE, "\tprocess_control_timeout = %ds", fpm_global_config.process_control_timeout); zlog(ZLOG_NOTICE, "\tprocess.max = %d", fpm_global_config.process_max); + if (fpm_global_config.process_priority == 64) { + zlog(ZLOG_NOTICE, "\tprocess.priority = undefined"); + } else { + zlog(ZLOG_NOTICE, "\tprocess.priority = %d", fpm_global_config.process_priority); + } zlog(ZLOG_NOTICE, "\tdaemonize = %s", BOOL2STR(fpm_global_config.daemonize)); zlog(ZLOG_NOTICE, "\trlimit_files = %d", fpm_global_config.rlimit_files); zlog(ZLOG_NOTICE, "\trlimit_core = %d", fpm_global_config.rlimit_core); @@ -1504,6 +1546,11 @@ zlog(ZLOG_NOTICE, "\tlisten.group = %s", STR2STR(wp->config->listen_group)); zlog(ZLOG_NOTICE, "\tlisten.mode = %s", STR2STR(wp->config->listen_mode)); zlog(ZLOG_NOTICE, "\tlisten.allowed_clients = %s", STR2STR(wp->config->listen_allowed_clients)); + if (wp->config->process_priority == 64) { + zlog(ZLOG_NOTICE, "\tprocess.priority = undefined"); + } else { + zlog(ZLOG_NOTICE, "\tprocess.priority = %d", wp->config->process_priority); + } zlog(ZLOG_NOTICE, "\tpm = %s", PM2STR(wp->config->pm)); zlog(ZLOG_NOTICE, "\tpm.max_children = %d", wp->config->pm_max_children); zlog(ZLOG_NOTICE, "\tpm.start_servers = %d", wp->config->pm_start_servers); @@ -1542,7 +1589,7 @@ } /* }}} */ -int fpm_conf_init_main(int test_conf) /* {{{ */ +int fpm_conf_init_main(int test_conf, int force_daemon) /* {{{ */ { int ret; TSRMLS_FETCH(); @@ -1588,7 +1635,7 @@ return -1; } - if (0 > fpm_conf_post_process(TSRMLS_C)) { + if (0 > fpm_conf_post_process(force_daemon TSRMLS_CC)) { zlog(ZLOG_ERROR, "failed to post process the configuration"); return -1; } diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_conf.h php5-5.4.9/sapi/fpm/fpm/fpm_conf.h --- php5-5.4.4/sapi/fpm/fpm/fpm_conf.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_conf.h 2012-11-21 05:12:20.000000000 +0000 @@ -35,6 +35,7 @@ int emergency_restart_interval; int process_control_timeout; int process_max; + int process_priority; int daemonize; int rlimit_files; int rlimit_core; @@ -57,6 +58,7 @@ char *listen_group; char *listen_mode; char *listen_allowed_clients; + int process_priority; int pm; int pm_max_children; int pm_start_servers; @@ -95,7 +97,7 @@ PM_STYLE_ONDEMAND = 3 }; -int fpm_conf_init_main(int test_conf); +int fpm_conf_init_main(int test_conf, int force_daemon); int fpm_worker_pool_config_free(struct fpm_worker_pool_config_s *wpc); int fpm_conf_write_pid(); int fpm_conf_unlink_pid(); diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_main.c php5-5.4.9/sapi/fpm/fpm/fpm_main.c --- php5-5.4.4/sapi/fpm/fpm/fpm_main.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_main.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -154,6 +154,9 @@ {'t', 0, "test"}, {'p', 1, "prefix"}, {'g', 1, "pid"}, + {'R', 0, "allow-to-run-as-root"}, + {'D', 0, "daemonize"}, + {'F', 0, "nodaemonize"}, {'-', 0, NULL} /* end of args */ }; @@ -646,12 +649,38 @@ } } -static void sapi_cgi_log_message(char *message TSRMLS_DC) +/* {{{ sapi_cgi_log_fastcgi + * + * Ignore level, we want to send all messages through fastcgi + */ +void sapi_cgi_log_fastcgi(int level, char *message, size_t len) { - if (CGIG(fcgi_logging)) { - zlog(ZLOG_NOTICE, "PHP message: %s", message); + TSRMLS_FETCH(); + + fcgi_request *request = (fcgi_request*) SG(server_context); + + /* ensure we want: + * - to log (fastcgi.logging in php.ini) + * - we are currently dealing with a request + * - the message is not empty + */ + if (CGIG(fcgi_logging) && request && message && len > 0) { + char *buf = malloc(len + 2); + memcpy(buf, message, len); + memcpy(buf + len, "\n", sizeof("\n")); + fcgi_write(request, FCGI_STDERR, buf, len+1); + free(buf); } } +/* }}} */ + +/* {{{ sapi_cgi_log_message + */ +static void sapi_cgi_log_message(char *message) +{ + zlog(ZLOG_NOTICE, "PHP message: %s", message); +} +/* }}} */ /* {{{ php_cgi_ini_activate_user_config */ @@ -885,7 +914,7 @@ prog = "php"; } - php_printf( "Usage: %s [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p ] [-g ] [-c ] [-d foo[=bar]] [-y ]\n" + php_printf( "Usage: %s [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p ] [-g ] [-c ] [-d foo[=bar]] [-y ] [-D] [-F]\n" " -c | Look for php.ini file in this directory\n" " -n No php.ini file will be used\n" " -d foo[=bar] Define INI entry foo with value 'bar'\n" @@ -900,7 +929,12 @@ " Specify the PID file location.\n" " -y, --fpm-config \n" " Specify alternative path to FastCGI process manager config file.\n" - " -t, --test Test FPM configuration and exit\n", + " -t, --test Test FPM configuration and exit\n" + " -D, --daemonize force to run in background, and ignore daemonize option from config file\n" + " -F, --nodaemonize\n" + " force to stay in foreground, and ignore daemonize option from config file\n" + " -R, --allow-to-run-as-root\n" + " Allow pool to run as root (disabled by default)\n", prog, PHP_PREFIX); } /* }}} */ @@ -1499,7 +1533,7 @@ */ int main(int argc, char *argv[]) { - int exit_status = SUCCESS; + int exit_status = FPM_EXIT_OK; int cgi = 0, c, use_extended_info = 0; zend_file_handle file_handle; @@ -1521,7 +1555,9 @@ char *fpm_prefix = NULL; char *fpm_pid = NULL; int test_conf = 0; + int force_daemon = -1; int php_information = 0; + int php_allow_to_run_as_root = 0; #ifdef HAVE_SIGNAL_H #if defined(SIGPIPE) && defined(SIG_IGN) @@ -1629,13 +1665,25 @@ php_output_end_all(TSRMLS_C); php_output_deactivate(TSRMLS_C); fcgi_shutdown(); - exit_status = 0; + exit_status = FPM_EXIT_OK; goto out; case 'i': /* php info & quit */ php_information = 1; break; + case 'R': /* allow to run as root */ + php_allow_to_run_as_root = 1; + break; + + case 'D': /* daemonize */ + force_daemon = 1; + break; + + case 'F': /* nodaemonize */ + force_daemon = 0; + break; + default: case 'h': case '?': @@ -1646,7 +1694,7 @@ php_output_end_all(TSRMLS_C); php_output_deactivate(TSRMLS_C); fcgi_shutdown(); - exit_status = 0; + exit_status = (c == 'h') ? FPM_EXIT_OK : FPM_EXIT_USAGE; goto out; case 'v': /* show php version & quit */ @@ -1654,19 +1702,19 @@ if (php_request_startup(TSRMLS_C) == FAILURE) { SG(server_context) = NULL; php_module_shutdown(TSRMLS_C); - return FAILURE; + return FPM_EXIT_SOFTWARE; } SG(headers_sent) = 1; SG(request_info).no_headers = 1; #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2009 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2009 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif php_request_shutdown((void *) 0); fcgi_shutdown(); - exit_status = 0; + exit_status = FPM_EXIT_OK; goto out; } } @@ -1677,14 +1725,14 @@ if (php_request_startup(TSRMLS_C) == FAILURE) { SG(server_context) = NULL; php_module_shutdown(TSRMLS_C); - return FAILURE; + return FPM_EXIT_SOFTWARE; } SG(headers_sent) = 1; SG(request_info).no_headers = 1; php_print_info(0xFFFFFFFF TSRMLS_CC); php_request_shutdown((void *) 0); fcgi_shutdown(); - exit_status = 0; + exit_status = FPM_EXIT_OK; goto out; } @@ -1697,7 +1745,7 @@ php_output_end_all(TSRMLS_C); php_output_deactivate(TSRMLS_C); fcgi_shutdown(); - exit_status = 0; + exit_status = FPM_EXIT_USAGE; goto out; } @@ -1716,7 +1764,7 @@ #ifdef ZTS tsrm_shutdown(); #endif - return FAILURE; + return FPM_EXIT_SOFTWARE; } if (use_extended_info) { @@ -1759,19 +1807,35 @@ */ tsrm_shutdown(); #endif - return FAILURE; + return FPM_EXIT_SOFTWARE; } } - if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf)) { - return FAILURE; + if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root, force_daemon)) { + + if (fpm_globals.send_config_pipe[1]) { + int writeval = 0; + zlog(ZLOG_DEBUG, "Sending \"0\" (error) to parent via fd=%d", fpm_globals.send_config_pipe[1]); + write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval)); + close(fpm_globals.send_config_pipe[1]); + } + return FPM_EXIT_CONFIG; } + if (fpm_globals.send_config_pipe[1]) { + int writeval = 1; + zlog(ZLOG_DEBUG, "Sending \"1\" (OK) to parent via fd=%d", fpm_globals.send_config_pipe[1]); + write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval)); + close(fpm_globals.send_config_pipe[1]); + } fpm_is_running = 1; fcgi_fd = fpm_run(&max_requests); parent = 0; + /* onced forked tell zlog to also send messages through sapi_cgi_log_fastcgi() */ + zlog_set_external_logger(sapi_cgi_log_fastcgi); + /* make php call us to get _ENV vars */ php_php_import_environment_variables = php_import_environment_variables; php_import_environment_variables = cgi_php_import_environment_variables; @@ -1795,7 +1859,7 @@ fcgi_finish_request(&request, 1); SG(server_context) = NULL; php_module_shutdown(TSRMLS_C); - return FAILURE; + return FPM_EXIT_SOFTWARE; } /* check if request_method has been sent. @@ -1883,17 +1947,9 @@ php_request_shutdown((void *) 0); - if (exit_status == 0) { - exit_status = EG(exit_status); - } - requests++; if (max_requests && (requests == max_requests)) { fcgi_finish_request(&request, 1); - if (max_requests != 1) { - /* no need to return exit_status of the last request */ - exit_status = 0; - } break; } /* end of fastcgi loop */ @@ -1907,7 +1963,7 @@ free(cgi_sapi_module.ini_entries); } } zend_catch { - exit_status = 255; + exit_status = FPM_EXIT_SOFTWARE; } zend_end_try(); out: diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_php.c php5-5.4.9/sapi/fpm/fpm/fpm_php.c --- php5-5.4.4/sapi/fpm/fpm/fpm_php.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_php.c 2012-11-21 05:12:20.000000000 +0000 @@ -257,3 +257,41 @@ return 1; /* extension not found: not allowed */ } /* }}} */ + +char* fpm_php_get_string_from_table(char *table, char *key TSRMLS_DC) /* {{{ */ +{ + zval **data, **tmp; + char *string_key; + uint string_len; + ulong num_key; + if (!table || !key) { + return NULL; + } + + /* inspired from ext/standard/info.c */ + + zend_is_auto_global(table, strlen(table) TSRMLS_CC); + + /* find the table and ensure it's an array */ + if (zend_hash_find(&EG(symbol_table), table, strlen(table) + 1, (void **) &data) == SUCCESS && Z_TYPE_PP(data) == IS_ARRAY) { + + /* reset the internal pointer */ + zend_hash_internal_pointer_reset(Z_ARRVAL_PP(data)); + + /* parse the array to look for our key */ + while (zend_hash_get_current_data(Z_ARRVAL_PP(data), (void **) &tmp) == SUCCESS) { + /* ensure the key is a string */ + if (zend_hash_get_current_key_ex(Z_ARRVAL_PP(data), &string_key, &string_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING) { + /* compare to our key */ + if (!strncmp(string_key, key, string_len)) { + return Z_STRVAL_PP(tmp); + } + } + zend_hash_move_forward(Z_ARRVAL_PP(data)); + } + } + + return NULL; +} +/* }}} */ + diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_php.h php5-5.4.9/sapi/fpm/fpm/fpm_php.h --- php5-5.4.4/sapi/fpm/fpm/fpm_php.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_php.h 2012-11-21 05:12:20.000000000 +0000 @@ -44,6 +44,7 @@ int fpm_php_init_main(); int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode); int fpm_php_limit_extensions(char *path); +char* fpm_php_get_string_from_table(char *table, char *key TSRMLS_DC); #endif diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_php_trace.c php5-5.4.9/sapi/fpm/fpm/fpm_php_trace.c --- php5-5.4.4/sapi/fpm/fpm/fpm_php_trace.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_php_trace.c 2012-11-21 05:12:20.000000000 +0000 @@ -26,6 +26,7 @@ #include "fpm_children.h" #include "fpm_worker_pool.h" #include "fpm_process_ctl.h" +#include "fpm_scoreboard.h" #include "zlog.h" @@ -137,6 +138,7 @@ void fpm_php_trace(struct fpm_child_s *child) /* {{{ */ { TSRMLS_FETCH(); + fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_SET, child->wp->scoreboard); FILE *slowlog; zlog(ZLOG_NOTICE, "about to trace %d", (int) child->pid); diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_process_ctl.c php5-5.4.9/sapi/fpm/fpm/fpm_process_ctl.c --- php5-5.4.4/sapi/fpm/fpm/fpm_process_ctl.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_process_ctl.c 2012-11-21 05:12:20.000000000 +0000 @@ -71,7 +71,7 @@ fpm_conf_unlink_pid(); fpm_cleanups_run(FPM_CLEANUP_PARENT_EXIT_MAIN); - exit(0); + exit(FPM_EXIT_OK); } /* }}} */ @@ -100,7 +100,7 @@ fpm_cleanups_run(FPM_CLEANUP_PARENT_EXEC); execvp(saved_argv[0], saved_argv); zlog(ZLOG_SYSERROR, "failed to reload: execvp() failed"); - exit(1); + exit(FPM_EXIT_SOFTWARE); } /* }}} */ @@ -353,7 +353,7 @@ #endif } } - fpm_scoreboard_update(idle, active, cur_lq, -1, -1, -1, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard); + fpm_scoreboard_update(idle, active, cur_lq, -1, -1, -1, 0, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard); /* this is specific to PM_STYLE_ONDEMAND */ if (wp->config->pm == PM_STYLE_ONDEMAND) { @@ -388,7 +388,7 @@ if (idle < wp->config->pm_min_spare_servers) { if (wp->running_children >= wp->config->pm_max_children) { if (!wp->warn_max_children) { - fpm_scoreboard_update(0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); + fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); zlog(ZLOG_WARNING, "[pool %s] server reached pm.max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children); wp->warn_max_children = 1; } @@ -407,7 +407,7 @@ children_to_fork = MIN(children_to_fork, wp->config->pm_max_children - wp->running_children); if (children_to_fork <= 0) { if (!wp->warn_max_children) { - fpm_scoreboard_update(0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); + fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); zlog(ZLOG_WARNING, "[pool %s] server reached pm.max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children); wp->warn_max_children = 1; } @@ -511,7 +511,7 @@ if (wp->running_children >= wp->config->pm_max_children) { if (!wp->warn_max_children) { - fpm_scoreboard_update(0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); + fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard); zlog(ZLOG_WARNING, "[pool %s] server reached max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children); wp->warn_max_children = 1; } diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_request.c php5-5.4.9/sapi/fpm/fpm/fpm_request.c --- php5-5.4.4/sapi/fpm/fpm/fpm_request.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_request.c 2012-11-21 05:12:20.000000000 +0000 @@ -54,7 +54,7 @@ fpm_scoreboard_proc_release(proc); /* idle++, active-- */ - fpm_scoreboard_update(1, -1, 0, 0, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL); + fpm_scoreboard_update(1, -1, 0, 0, 0, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL); } /* }}} */ @@ -98,7 +98,7 @@ fpm_scoreboard_proc_release(proc); /* idle--, active++, request++ */ - fpm_scoreboard_update(-1, 1, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, NULL); + fpm_scoreboard_update(-1, 1, 0, 0, 1, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL); } /* }}} */ diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_scoreboard.c php5-5.4.9/sapi/fpm/fpm/fpm_scoreboard.c --- php5-5.4.4/sapi/fpm/fpm/fpm_scoreboard.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_scoreboard.c 2012-11-21 05:12:20.000000000 +0000 @@ -73,7 +73,7 @@ } /* }}} */ -void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int action, struct fpm_scoreboard_s *scoreboard) /* {{{ */ +void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int slow_rq, int action, struct fpm_scoreboard_s *scoreboard) /* {{{ */ { if (!scoreboard) { scoreboard = fpm_scoreboard; @@ -110,6 +110,9 @@ if (max_children_reached >= 0) { scoreboard->max_children_reached = max_children_reached; } + if (slow_rq > 0) { + scoreboard->slow_rq += slow_rq; + } } else { if (scoreboard->idle + idle > 0) { scoreboard->idle += idle; diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_scoreboard.h php5-5.4.9/sapi/fpm/fpm/fpm_scoreboard.h --- php5-5.4.4/sapi/fpm/fpm/fpm_scoreboard.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_scoreboard.h 2012-11-21 05:12:20.000000000 +0000 @@ -64,13 +64,14 @@ unsigned int lq_len; unsigned int nprocs; int free_proc; + unsigned long int slow_rq; struct fpm_scoreboard_proc_s *procs[]; }; int fpm_scoreboard_init_main(); int fpm_scoreboard_init_child(struct fpm_worker_pool_s *wp); -void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int action, struct fpm_scoreboard_s *scoreboard); +void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int slow_rq, int action, struct fpm_scoreboard_s *scoreboard); struct fpm_scoreboard_s *fpm_scoreboard_get(); struct fpm_scoreboard_proc_s *fpm_scoreboard_proc_get(struct fpm_scoreboard_s *scoreboard, int child_index); diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_sockets.c php5-5.4.9/sapi/fpm/fpm/fpm_sockets.c --- php5-5.4.4/sapi/fpm/fpm/fpm_sockets.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_sockets.c 2012-11-21 05:12:20.000000000 +0000 @@ -179,6 +179,10 @@ setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags)); if (wp->listen_address_domain == FPM_AF_UNIX) { + if (fpm_socket_unix_test_connect((struct sockaddr_un *)sa, socklen) == 0) { + zlog(ZLOG_ERROR, "An another FPM instance seems to already listen on %s", ((struct sockaddr_un *) sa)->sun_path); + return -1; + } unlink( ((struct sockaddr_un *) sa)->sun_path); saved_umask = umask(0777 ^ wp->socket_mode); } @@ -352,7 +356,7 @@ } if (wp->listen_address_domain == FPM_AF_INET && fpm_socket_get_listening_queue(wp->listening_socket, NULL, &lq_len) >= 0) { - fpm_scoreboard_update(-1, -1, -1, (int)lq_len, -1, -1, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard); + fpm_scoreboard_update(-1, -1, -1, (int)lq_len, -1, -1, 0, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard); } } @@ -450,3 +454,24 @@ } #endif + +int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen) /* {{{ */ +{ + int fd; + + if (!sock || sock->sun_family != AF_UNIX) { + return -1; + } + + if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { + return -1; + } + + if (connect(fd, (struct sockaddr *)sock, socklen) == -1) { + return -1; + } + + close(fd); + return 0; +} +/* }}} */ diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_sockets.h php5-5.4.9/sapi/fpm/fpm/fpm_sockets.h --- php5-5.4.4/sapi/fpm/fpm/fpm_sockets.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_sockets.h 2012-11-21 05:12:20.000000000 +0000 @@ -5,6 +5,9 @@ #ifndef FPM_MISC_H #define FPM_MISC_H 1 +#include +#include +#include #include #include @@ -22,6 +25,7 @@ enum fpm_address_domain fpm_sockets_domain_from_address(char *addr); int fpm_sockets_init_main(); int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq); +int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen); static inline int fd_set_blocked(int fd, int blocked) /* {{{ */ diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_status.c php5-5.4.9/sapi/fpm/fpm/fpm_status.c --- php5-5.4.4/sapi/fpm/fpm/fpm_status.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_status.c 2012-11-21 05:12:20.000000000 +0000 @@ -14,6 +14,7 @@ #include "zlog.h" #include "fpm_atomic.h" #include "fpm_conf.h" +#include "fpm_php.h" #include static char *fpm_status_uri = NULL; @@ -125,13 +126,13 @@ } /* full status ? */ - full = SG(request_info).request_uri && strstr(SG(request_info).query_string, "full"); + full = (fpm_php_get_string_from_table("_GET", "full" TSRMLS_CC) != NULL); short_syntax = short_post = NULL; full_separator = full_pre = full_syntax = full_post = NULL; encode = 0; /* HTML */ - if (SG(request_info).query_string && strstr(SG(request_info).query_string, "html")) { + if (fpm_php_get_string_from_table("_GET", "html" TSRMLS_CC)) { sapi_add_header_ex(ZEND_STRL("Content-Type: text/html"), 1, 1 TSRMLS_CC); time_format = "%d/%b/%Y:%H:%M:%S %z"; encode = 1; @@ -147,7 +148,7 @@ "start time%s\n" "start since%lu\n" "accepted conn%lu\n" -#if HAVE_FPM_LQ +#ifdef HAVE_FPM_LQ "listen queue%u\n" "max listen queue%u\n" "listen queue len%d\n" @@ -157,6 +158,7 @@ "total processes%d\n" "max active processes%d\n" "max children reached%u\n" + "slow requests%lu\n" "\n"; if (!full) { @@ -176,7 +178,7 @@ "content length" "user" "script" -#if HAVE_FPM_LQ +#ifdef HAVE_FPM_LQ "last request cpu" #endif "last request memory" @@ -195,7 +197,7 @@ "%zu" "%s" "%s" -#if HAVE_FPM_LQ +#ifdef HAVE_FPM_LQ "%.2f" #endif "%zu" @@ -205,7 +207,7 @@ } /* XML */ - } else if (SG(request_info).request_uri && strstr(SG(request_info).query_string, "xml")) { + } else if (fpm_php_get_string_from_table("_GET", "xml" TSRMLS_CC)) { sapi_add_header_ex(ZEND_STRL("Content-Type: text/xml"), 1, 1 TSRMLS_CC); time_format = "%s"; encode = 1; @@ -218,7 +220,7 @@ "%s\n" "%lu\n" "%lu\n" -#if HAVE_FPM_LQ +#ifdef HAVE_FPM_LQ "%u\n" "%u\n" "%d\n" @@ -227,7 +229,8 @@ "%d\n" "%d\n" "%d\n" - "%u\n"; + "%u\n" + "%lu\n"; if (!full) { short_post = ""; @@ -246,7 +249,7 @@ "%zu" "%s" "" -#if HAVE_FPM_LQ +#ifdef HAVE_FPM_LQ "%.2f" #endif "%zu" @@ -256,7 +259,7 @@ } /* JSON */ - } else if (SG(request_info).request_uri && strstr(SG(request_info).query_string, "json")) { + } else if (fpm_php_get_string_from_table("_GET", "json" TSRMLS_CC)) { sapi_add_header_ex(ZEND_STRL("Content-Type: application/json"), 1, 1 TSRMLS_CC); time_format = "%s"; @@ -267,7 +270,7 @@ "\"start time\":%s," "\"start since\":%lu," "\"accepted conn\":%lu," -#if HAVE_FPM_LQ +#ifdef HAVE_FPM_LQ "\"listen queue\":%u," "\"max listen queue\":%u," "\"listen queue len\":%d," @@ -276,7 +279,8 @@ "\"active processes\":%d," "\"total processes\":%d," "\"max active processes\":%d," - "\"max children reached\":%u"; + "\"max children reached\":%u," + "\"slow requests\":%lu"; if (!full) { short_post = "}"; @@ -296,7 +300,7 @@ "\"content length\":%zu," "\"user\":\"%s\"," "\"script\":\"%s\"," -#if HAVE_FPM_LQ +#ifdef HAVE_FPM_LQ "\"last request cpu\":%.2f," #endif "\"last request memory\":%zu" @@ -316,7 +320,7 @@ "start time: %s\n" "start since: %lu\n" "accepted conn: %lu\n" -#if HAVE_FPM_LQ +#ifdef HAVE_FPM_LQ "listen queue: %u\n" "max listen queue: %u\n" "listen queue len: %d\n" @@ -325,7 +329,8 @@ "active processes: %d\n" "total processes: %d\n" "max active processes: %d\n" - "max children reached: %u\n"; + "max children reached: %u\n" + "slow requests: %lu\n"; if (full) { full_syntax = @@ -357,7 +362,7 @@ time_buffer, now_epoch - scoreboard.start_epoch, scoreboard.requests, -#if HAVE_FPM_LQ +#ifdef HAVE_FPM_LQ scoreboard.lq, scoreboard.lq_max, scoreboard.lq_len, @@ -366,7 +371,8 @@ scoreboard.active, scoreboard.idle + scoreboard.active, scoreboard.active_max, - scoreboard.max_children_reached); + scoreboard.max_children_reached, + scoreboard.slow_rq); PUTS(buffer); efree(buffer); diff -Nru php5-5.4.4/sapi/fpm/fpm/fpm_unix.c php5-5.4.9/sapi/fpm/fpm/fpm_unix.c --- php5-5.4.4/sapi/fpm/fpm/fpm_unix.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/fpm_unix.c 2012-11-21 05:12:20.000000000 +0000 @@ -23,6 +23,7 @@ #include "fpm_clock.h" #include "fpm_stdio.h" #include "fpm_unix.h" +#include "fpm_signals.h" #include "zlog.h" size_t fpm_pagesize; @@ -112,21 +113,24 @@ } } -#ifndef I_REALLY_WANT_ROOT_PHP - if (wp->set_uid == 0 || wp->set_gid == 0) { - zlog(ZLOG_ERROR, "[pool %s] please specify user and group other than root", wp->config->name); - return -1; + if (!fpm_globals.run_as_root) { + if (wp->set_uid == 0 || wp->set_gid == 0) { + zlog(ZLOG_ERROR, "[pool %s] please specify user and group other than root", wp->config->name); + return -1; + } } -#endif } else { /* not root */ if (wp->config->user && *wp->config->user) { - zlog(ZLOG_WARNING, "[pool %s] 'user' directive is ignored when FPM is not running as root", wp->config->name); + zlog(ZLOG_NOTICE, "[pool %s] 'user' directive is ignored when FPM is not running as root", wp->config->name); } if (wp->config->group && *wp->config->group) { - zlog(ZLOG_WARNING, "[pool %s] 'group' directive is ignored when FPM is not running as root", wp->config->name); + zlog(ZLOG_NOTICE, "[pool %s] 'group' directive is ignored when FPM is not running as root", wp->config->name); } if (wp->config->chroot && *wp->config->chroot) { - zlog(ZLOG_WARNING, "[pool %s] 'chroot' directive is ignored when FPM is not running as root", wp->config->name); + zlog(ZLOG_NOTICE, "[pool %s] 'chroot' directive is ignored when FPM is not running as root", wp->config->name); + } + if (wp->config->process_priority != 64) { + zlog(ZLOG_NOTICE, "[pool %s] 'process.priority' directive is ignored when FPM is not running as root", wp->config->name); } /* set up HOME and USER anyway */ @@ -183,6 +187,14 @@ } if (is_root) { + + if (wp->config->process_priority != 64) { + if (setpriority(PRIO_PROCESS, 0, wp->config->process_priority) < 0) { + zlog(ZLOG_SYSERROR, "[pool %s] Unable to set priority for this new process", wp->config->name); + return -1; + } + } + if (wp->set_gid) { if (0 > setgid(wp->set_gid)) { zlog(ZLOG_SYSERROR, "[pool %s] failed to setgid(%d)", wp->config->name, wp->set_gid); @@ -217,6 +229,7 @@ int fpm_unix_init_main() /* {{{ */ { struct fpm_worker_pool_s *wp; + int is_root = !geteuid(); if (fpm_global_config.rlimit_files) { struct rlimit r; @@ -242,23 +255,105 @@ fpm_pagesize = getpagesize(); if (fpm_global_config.daemonize) { - switch (fork()) { - case -1 : + /* + * If daemonize, the calling process will die soon + * and the master process continues to initialize itself. + * + * The parent process has then to wait for the master + * process to initialize to return a consistent exit + * value. For this pupose, the master process will + * send \"1\" into the pipe if everything went well + * and \"0\" otherwise. + */ + + + struct timeval tv; + fd_set rfds; + int ret; + + if (pipe(fpm_globals.send_config_pipe) == -1) { + zlog(ZLOG_SYSERROR, "failed to create pipe"); + return -1; + } + + /* then fork */ + pid_t pid = fork(); + switch (pid) { + + case -1 : /* error */ zlog(ZLOG_SYSERROR, "failed to daemonize"); return -1; - case 0 : + + case 0 : /* children */ + close(fpm_globals.send_config_pipe[0]); /* close the read side of the pipe */ break; - default : - fpm_cleanups_run(FPM_CLEANUP_PARENT_EXIT); - exit(0); + + default : /* parent */ + close(fpm_globals.send_config_pipe[1]); /* close the write side of the pipe */ + + /* + * wait for 10s before exiting with error + * the child is supposed to send 1 or 0 into the pipe to tell the parent + * how it goes for it + */ + FD_ZERO(&rfds); + FD_SET(fpm_globals.send_config_pipe[0], &rfds); + + tv.tv_sec = 10; + tv.tv_usec = 0; + + zlog(ZLOG_DEBUG, "The calling process is waiting for the master process to ping via fd=%d", fpm_globals.send_config_pipe[0]); + ret = select(fpm_globals.send_config_pipe[0] + 1, &rfds, NULL, NULL, &tv); + if (ret == -1) { + zlog(ZLOG_SYSERROR, "failed to select"); + exit(FPM_EXIT_SOFTWARE); + } + if (ret) { /* data available */ + int readval; + ret = read(fpm_globals.send_config_pipe[0], &readval, sizeof(readval)); + if (ret == -1) { + zlog(ZLOG_SYSERROR, "failed to read from pipe"); + exit(FPM_EXIT_SOFTWARE); + } + + if (ret == 0) { + zlog(ZLOG_ERROR, "no data have been read from pipe"); + exit(FPM_EXIT_SOFTWARE); + } else { + if (readval == 1) { + zlog(ZLOG_DEBUG, "I received a valid acknoledge from the master process, I can exit without error"); + fpm_cleanups_run(FPM_CLEANUP_PARENT_EXIT); + exit(FPM_EXIT_OK); + } else { + zlog(ZLOG_DEBUG, "The master process returned an error !"); + exit(FPM_EXIT_SOFTWARE); + } + } + } else { /* no date sent ! */ + zlog(ZLOG_ERROR, "the master process didn't send back its status (via the pipe to the calling process)"); + exit(FPM_EXIT_SOFTWARE); + } + exit(FPM_EXIT_SOFTWARE); } } + /* continue as a child */ setsid(); if (0 > fpm_clock_init()) { return -1; } + if (fpm_global_config.process_priority != 64) { + if (is_root) { + if (setpriority(PRIO_PROCESS, 0, fpm_global_config.process_priority) < 0) { + zlog(ZLOG_SYSERROR, "Unable to set priority for the master process"); + return -1; + } + } else { + zlog(ZLOG_NOTICE, "'process.priority' directive is ignored when FPM is not running as root"); + } + } + fpm_globals.parent_pid = getpid(); for (wp = fpm_worker_all_pools; wp; wp = wp->next) { if (0 > fpm_unix_conf_wp(wp)) { diff -Nru php5-5.4.4/sapi/fpm/fpm/zlog.c php5-5.4.9/sapi/fpm/fpm/zlog.c --- php5-5.4.4/sapi/fpm/fpm/zlog.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/zlog.c 2012-11-21 05:12:20.000000000 +0000 @@ -22,6 +22,7 @@ static int zlog_fd = -1; static int zlog_level = ZLOG_NOTICE; static int launched = 0; +static void (*external_logger)(int, char *, size_t) = NULL; static const char *level_names[] = { [ZLOG_DEBUG] = "DEBUG", @@ -41,6 +42,12 @@ }; #endif +void zlog_set_external_logger(void (*logger)(int, char *, size_t)) /* {{{ */ +{ + external_logger = logger; +} +/* }}} */ + const char *zlog_get_level_name(int log_level) /* {{{ */ { if (log_level < 0) { @@ -101,6 +108,19 @@ int truncated = 0; int saved_errno; + if (external_logger) { + va_start(args, fmt); + len = vsnprintf(buf, buf_size, fmt, args); + va_end(args); + if (len >= buf_size) { + memcpy(buf + buf_size - sizeof("..."), "...", sizeof("...") - 1); + len = buf_size - 1; + } + external_logger(flags & ZLOG_LEVEL_MASK, buf, len); + len = 0; + memset(buf, '\0', buf_size); + } + if ((flags & ZLOG_LEVEL_MASK) < zlog_level) { return; } diff -Nru php5-5.4.4/sapi/fpm/fpm/zlog.h php5-5.4.9/sapi/fpm/fpm/zlog.h --- php5-5.4.4/sapi/fpm/fpm/zlog.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/fpm/zlog.h 2012-11-21 05:12:20.000000000 +0000 @@ -9,6 +9,7 @@ struct timeval; +void zlog_set_external_logger(void (*logger)(int, char *, size_t)); int zlog_set_fd(int new_fd); int zlog_set_level(int new_value); const char *zlog_get_level_name(int log_level); diff -Nru php5-5.4.4/sapi/fpm/init.d.php-fpm.in php5-5.4.9/sapi/fpm/init.d.php-fpm.in --- php5-5.4.4/sapi/fpm/init.d.php-fpm.in 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/init.d.php-fpm.in 2012-11-21 05:12:20.000000000 +0000 @@ -18,7 +18,7 @@ php_fpm_PID=@localstatedir@/run/php-fpm.pid -php_opts="--fpm-config $php_fpm_CONF" +php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID" wait_for_pid () { @@ -54,7 +54,7 @@ start) echo -n "Starting php-fpm " - $php_fpm_BIN $php_opts + $php_fpm_BIN --daemonize $php_opts if [ "$?" != 0 ] ; then echo " failed" diff -Nru php5-5.4.4/sapi/fpm/php-fpm.8.in php5-5.4.9/sapi/fpm/php-fpm.8.in --- php5-5.4.4/sapi/fpm/php-fpm.8.in 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/php-fpm.8.in 2012-11-21 05:12:20.000000000 +0000 @@ -99,6 +99,20 @@ If called twice (-tt), the configuration is dumped before exiting. .TP .PD 0 +.B \-\-daemonize +.TP +.PD 1 +.B \-D +Force to run in background and ignore daemonize option from configuration file. +.TP +.PD 0 +.B \-\-nodaemonize +.TP +.PD 1 +.B \-F +Force to stay in foreground and ignore daemonize option from configuration file. +.TP +.PD 0 .B \-\-zend\-extension \fIfile\fP .TP .PD 1 @@ -113,13 +127,20 @@ .B php.ini The standard php configuration file. .SH EXAMPLES -You should use the init script provided to start and stop the php-fpm daemon. This situation applies for any unix systems which use init.d for their main process manager. +For any unix systems which use init.d for their main process manager, you should use the init script provided to start and stop the php-fpm daemon. .P .PD 1 .RS sudo /etc/init.d/php-fpm start .RE .TP +For any unix systems which use systemd for their main process manager, you should use the unit file provided to start and stop the php-fpm daemon. +.P +.PD 1 +.RS +sudo systemctl start php-fpm.service +.RE +.TP If your installation has no appropriate init script, launch php-fpm with no arguments. It will launch as a daemon (background process) by default. The file @php_fpm_localstatedir@/run/php-fpm.pid determines whether php-fpm is already up and running. Once started, php-fpm then responds to several POSIX signals: .P .PD 0 diff -Nru php5-5.4.4/sapi/fpm/php-fpm.conf.in php5-5.4.9/sapi/fpm/php-fpm.conf.in --- php5-5.4.4/sapi/fpm/php-fpm.conf.in 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/fpm/php-fpm.conf.in 2012-11-21 05:12:20.000000000 +0000 @@ -76,6 +76,14 @@ ; Default Value: 0 ; process.max = 128 +; Specify the nice(2) priority to apply to the master process (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool process will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. ; Default Value: yes ;daemonize = yes @@ -163,6 +171,14 @@ ; Default Value: any ;listen.allowed_clients = 127.0.0.1 +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; priority = -19 + ; Choose how the process manager will control the number of child processes. ; Possible Values: ; static - a fixed number (pm.max_children) of child processes; diff -Nru php5-5.4.4/sapi/fpm/php-fpm.service.in php5-5.4.9/sapi/fpm/php-fpm.service.in --- php5-5.4.4/sapi/fpm/php-fpm.service.in 1970-01-01 00:00:00.000000000 +0000 +++ php5-5.4.9/sapi/fpm/php-fpm.service.in 2012-11-21 05:12:20.000000000 +0000 @@ -0,0 +1,12 @@ +[Unit] +Description=The PHP FastCGI Process Manager +After=syslog.target network.target + +[Service] +PIDFile=@localstatedir@/run/php-fpm.pid +ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf +ExecReload=/bin/kill -USR2 $MAINPID + +[Install] +WantedBy=multi-user.target + diff -Nru php5-5.4.4/sapi/litespeed/lsapi_main.c php5-5.4.9/sapi/litespeed/lsapi_main.c --- php5-5.4.4/sapi/litespeed/lsapi_main.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/litespeed/lsapi_main.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -719,9 +719,9 @@ case 'v': if (php_request_startup(TSRMLS_C) != FAILURE) { #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); diff -Nru php5-5.4.4/sapi/litespeed/lsapidef.h php5-5.4.9/sapi/litespeed/lsapidef.h --- php5-5.4.4/sapi/litespeed/lsapidef.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/litespeed/lsapidef.h 2012-11-21 05:12:20.000000000 +0000 @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/sapi/litespeed/lsapilib.c php5-5.4.9/sapi/litespeed/lsapilib.c --- php5-5.4.4/sapi/litespeed/lsapilib.c 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/litespeed/lsapilib.c 2012-11-21 05:12:20.000000000 +0000 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/sapi/litespeed/lsapilib.h php5-5.4.9/sapi/litespeed/lsapilib.h --- php5-5.4.4/sapi/litespeed/lsapilib.h 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/sapi/litespeed/lsapilib.h 2012-11-21 05:12:20.000000000 +0000 @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | + | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff -Nru php5-5.4.4/tests/lang/bug45392.phpt php5-5.4.9/tests/lang/bug45392.phpt --- php5-5.4.4/tests/lang/bug45392.phpt 2012-06-13 04:54:23.000000000 +0000 +++ php5-5.4.9/tests/lang/bug45392.phpt 2012-11-21 05:12:20.000000000 +0000 @@ -2,6 +2,11 @@ Bug #45392 (ob_start()/ob_end_clean() and memory_limit) --INI-- display_errors=stderr +--SKIPIF-- +tv_sec = (int)(ff/(__int64)10000000-(__int64)11644473600); time_Info->tv_usec = (int)(ff % 10000000)/10; return 0;