Skip to content

Commit

Permalink
Upgraded bundled PCRE to version 8.01
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Alshanetsky committed Jan 21, 2010
1 parent 6dda7ad commit 50016d9
Show file tree
Hide file tree
Showing 24 changed files with 957 additions and 455 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 20??, PHP 5.3.3
- Upgraded bundled PCRE to version 8.01. (Ilia)
- Upgraded bundled sqlite to version 3.6.22. (Ilia)
- Upgraded bundled libmagic to version 5.03. (Mikko)

Expand Down
4 changes: 2 additions & 2 deletions ext/pcre/pcrelib/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.

Copyright (c) 1997-2009 University of Cambridge
Copyright (c) 1997-2010 University of Cambridge
All rights reserved


Expand All @@ -17,7 +17,7 @@ THE C++ WRAPPER LIBRARY

Written by: Google Inc.

Copyright (c) 2007-2008 Google Inc
Copyright (c) 2007-2010 Google Inc
All rights reserved

####
128 changes: 128 additions & 0 deletions ext/pcre/pcrelib/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,134 @@
ChangeLog for PCRE
------------------

Version 8.01 19-Jan-2010
------------------------

1. If a pattern contained a conditional subpattern with only one branch (in
particular, this includes all (*DEFINE) patterns), a call to pcre_study()
computed the wrong minimum data length (which is of course zero for such
subpatterns). This could cause incorrect "no match" results.

2. For patterns such as (?i)a(?-i)b|c where an option setting at the start of
the pattern is reset in the first branch, pcre_compile() failed with
"internal error: code overflow at offset...". This happened only when
the reset was to the original external option setting. (An optimization
abstracts leading options settings into an external setting, which was the
cause of this.)

3. A pattern such as ^(?!a(*SKIP)b) where a negative assertion contained one
of the verbs SKIP, PRUNE, or COMMIT, did not work correctly. When the
assertion pattern did not match (meaning that the assertion was true), it
was incorrectly treated as false if the SKIP had been reached during the
matching. This also applied to assertions used as conditions.

4. If an item that is not supported by pcre_dfa_exec() was encountered in an
assertion subpattern, including such a pattern used as a condition,
unpredictable results occurred, instead of the error return
PCRE_ERROR_DFA_UITEM.

5. The C++ GlobalReplace function was not working like Perl for the special
situation when an empty string is matched. It now does the fancy magic
stuff that is necessary.

6. In pcre_internal.h, obsolete includes to setjmp.h and stdarg.h have been
removed. (These were left over from very, very early versions of PCRE.)

7. Some cosmetic changes to the code to make life easier when compiling it
as part of something else:

(a) Change DEBUG to PCRE_DEBUG.

(b) In pcre_compile(), rename the member of the "branch_chain" structure
called "current" as "current_branch", to prevent a collision with the
Linux macro when compiled as a kernel module.

(c) In pcre_study(), rename the function set_bit() as set_table_bit(), to
prevent a collision with the Linux macro when compiled as a kernel
module.

8. In pcre_compile() there are some checks for integer overflows that used to
cast potentially large values to (double). This has been changed to that
when building, a check for int64_t is made, and if it is found, it is used
instead, thus avoiding the use of floating point arithmetic. (There is no
other use of FP in PCRE.) If int64_t is not found, the fallback is to
double.

9. Added two casts to avoid signed/unsigned warnings from VS Studio Express
2005 (difference between two addresses compared to an unsigned value).

10. Change the standard AC_CHECK_LIB test for libbz2 in configure.ac to a
custom one, because of the following reported problem in Windows:

- libbz2 uses the Pascal calling convention (WINAPI) for the functions
under Win32.
- The standard autoconf AC_CHECK_LIB fails to include "bzlib.h",
therefore missing the function definition.
- The compiler thus generates a "C" signature for the test function.
- The linker fails to find the "C" function.
- PCRE fails to configure if asked to do so against libbz2.

11. When running libtoolize from libtool-2.2.6b as part of autogen.sh, these
messages were output:

Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
rerunning libtoolize, to keep the correct libtool macros in-tree.
Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

I have done both of these things.

12. Although pcre_dfa_exec() does not use nearly as much stack as pcre_exec()
most of the time, it *can* run out if it is given a pattern that contains a
runaway infinite recursion. I updated the discussion in the pcrestack man
page.

13. Now that we have gone to the x.xx style of version numbers, the minor
version may start with zero. Using 08 or 09 is a bad idea because users
might check the value of PCRE_MINOR in their code, and 08 or 09 may be
interpreted as invalid octal numbers. I've updated the previous comment in
configure.ac, and also added a check that gives an error if 08 or 09 are
used.

14. Change 8.00/11 was not quite complete: code had been accidentally omitted,
causing partial matching to fail when the end of the subject matched \W
in a UTF-8 pattern where \W was quantified with a minimum of 3.

15. There were some discrepancies between the declarations in pcre_internal.h
of _pcre_is_newline(), _pcre_was_newline(), and _pcre_valid_utf8() and
their definitions. The declarations used "const uschar *" and the
definitions used USPTR. Even though USPTR is normally defined as "const
unsigned char *" (and uschar is typedeffed as "unsigned char"), it was
reported that: "This difference in casting confuses some C++ compilers, for
example, SunCC recognizes above declarations as different functions and
generates broken code for hbpcre." I have changed the declarations to use
USPTR.

16. GNU libtool is named differently on some systems. The autogen.sh script now
tries several variants such as glibtoolize (MacOSX) and libtoolize1x
(FreeBSD).

17. Applied Craig's patch that fixes an HP aCC compile error in pcre 8.00
(strtoXX undefined when compiling pcrecpp.cc). The patch contains this
comment: "Figure out how to create a longlong from a string: strtoll and
equivalent. It's not enough to call AC_CHECK_FUNCS: hpux has a strtoll, for
instance, but it only takes 2 args instead of 3!"

18. A subtle bug concerned with back references has been fixed by a change of
specification, with a corresponding code fix. A pattern such as
^(xa|=?\1a)+$ which contains a back reference inside the group to which it
refers, was giving matches when it shouldn't. For example, xa=xaaa would
match that pattern. Interestingly, Perl (at least up to 5.11.3) has the
same bug. Such groups have to be quantified to be useful, or contained
inside another quantified group. (If there's no repetition, the reference
can never match.) The problem arises because, having left the group and
moved on to the rest of the pattern, a later failure that backtracks into
the group uses the captured value from the final iteration of the group
rather than the correct earlier one. I have fixed this in PCRE by forcing
any group that contains a reference to itself to be an atomic group; that
is, there cannot be any backtracking into it once it has completed. This is
similar to recursive and subroutine calls.


Version 8.00 19-Oct-09
----------------------

Expand Down
4 changes: 2 additions & 2 deletions ext/pcre/pcrelib/LICENCE
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.

Copyright (c) 1997-2009 University of Cambridge
Copyright (c) 1997-2010 University of Cambridge
All rights reserved.


Expand All @@ -31,7 +31,7 @@ THE C++ WRAPPER FUNCTIONS

Contributed by: Google Inc.

Copyright (c) 2007-2008, Google Inc.
Copyright (c) 2007-2010, Google Inc.
All rights reserved.


Expand Down
7 changes: 7 additions & 0 deletions ext/pcre/pcrelib/NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
News about PCRE releases
------------------------

Release 8.01 19-Jan-2010
------------------------

This is a bug-fix release. Several bugs in the code itself and some bugs and
infelicities in the build system have been fixed.


Release 8.00 19-Oct-09
----------------------

Expand Down
17 changes: 10 additions & 7 deletions ext/pcre/pcrelib/NON-UNIX-USE
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,16 @@ The following are generic comments about building the PCRE C library "by hand".
your system has static and shared libraries, you may have to do this once
for each type.

(8) Similarly, compile pcreposix.c (remembering -DHAVE_CONFIG_H if necessary)
and link the result (on its own) as the pcreposix library.
(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 and pcreposix libraries when linking.
It also needs the pcre_printint.src source file, which it #includes.
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
Expand Down Expand Up @@ -273,8 +277,7 @@ gcc and MinGW's gcc). So, a user can:

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. We hope to improve
things in this area in future.
terminators in order to get some of the tests to work.


BUILDING PCRE ON WINDOWS WITH CMAKE
Expand Down Expand Up @@ -494,5 +497,5 @@ build.log file in the root of the package also.


=========================
Last Updated: 05 October 2009
Last Updated: 19 January 2010
****
10 changes: 5 additions & 5 deletions ext/pcre/pcrelib/README
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ The "configure" script builds the following files for the basic C library:
. RunTest is a script for running tests on the basic C library
. RunGrepTest is a script for running tests on the pcregrep command

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 the
benefit of those who have to built PCRE without the benefit of "configure". If
you use "configure", the .generic versions are not used.
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:

Expand Down Expand Up @@ -796,4 +796,4 @@ The distribution should contain the following files:
Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk
Last updated: 19 October 2009
Last updated: 19 January 2010
25 changes: 16 additions & 9 deletions ext/pcre/pcrelib/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,17 @@ them both to 0; an emulation function will be used. */
#define HAVE_STRING_H 1
#endif

/* Define to 1 if you have the `strtoll' function. */
/* #undef HAVE_STRTOLL */
/* Define to 1 if you have `strtoimax'. */
/* #undef HAVE_STRTOIMAX */

/* Define to 1 if you have the `strtoq' function. */
#ifndef HAVE_STRTOQ
#define HAVE_STRTOQ 1
/* Define to 1 if you have `strtoll'. */
#ifndef HAVE_STRTOLL
#define HAVE_STRTOLL 1
#endif

/* Define to 1 if you have `strtoq'. */
/* #undef HAVE_STRTOQ */

/* Define to 1 if you have the <sys/stat.h> header file. */
#ifndef HAVE_SYS_STAT_H
#define HAVE_SYS_STAT_H 1
Expand Down Expand Up @@ -183,7 +186,7 @@ them both to 0; an emulation function will be used. */
#define HAVE_ZLIB_H 1
#endif

/* Define to 1 if you have the `_strtoi64' function. */
/* Define to 1 if you have `_strtoi64'. */
/* #undef HAVE__STRTOI64 */

/* The value of LINK_SIZE determines the number of bytes used to store links
Expand Down Expand Up @@ -268,13 +271,13 @@ them both to 0; an emulation function will be used. */
#define PACKAGE_NAME "PCRE"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "PCRE 8.00"
#define PACKAGE_STRING "PCRE 8.01"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "pcre"

/* Define to the version of this package. */
#define PACKAGE_VERSION "8.00"
#define PACKAGE_VERSION "8.01"


/* If you are compiling for a system other than a Unix-like system or
Expand Down Expand Up @@ -330,11 +333,15 @@ them both to 0; an emulation function will be used. */

/* Version number of package */
#ifndef VERSION
#define VERSION "8.00"
#define VERSION "8.01"
#endif

/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */

/* Define to the type of a signed integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
/* #undef int64_t */

/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
Loading

0 comments on commit 50016d9

Please sign in to comment.