Skip to content

Commit 90a2d19

Browse files
committed
upgrade PCRE to version 7.9
1 parent ff62b87 commit 90a2d19

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3205
-1508
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ PHP NEWS
33
?? ??? 200?, PHP 5.3.0 RC 2
44
- Undeprecated ticks. (Arnaud)
55
- Upgraded bundled sqlite to version 3.6.12. (Scott)
6+
- Upgraded bundled PCRE to version 7.9. (Nuno)
67
- Added 'n' flag to fopen to allow passing O_NONBLOCK to the underlying
78
open(2) system call. (Mikko)
89

ext/pcre/pcrelib/AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Email domain: cam.ac.uk
88
University of Cambridge Computing Service,
99
Cambridge, England.
1010

11-
Copyright (c) 1997-2008 University of Cambridge
11+
Copyright (c) 1997-2009 University of Cambridge
1212
All rights reserved
1313

1414

ext/pcre/pcrelib/ChangeLog

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,128 @@
11
ChangeLog for PCRE
22
------------------
33

4+
Version 7.9 11-Apr-09
5+
---------------------
6+
7+
1. When building with support for bzlib/zlib (pcregrep) and/or readline
8+
(pcretest), all targets were linked against these libraries. This included
9+
libpcre, libpcreposix, and libpcrecpp, even though they do not use these
10+
libraries. This caused unwanted dependencies to be created. This problem
11+
has been fixed, and now only pcregrep is linked with bzlib/zlib and only
12+
pcretest is linked with readline.
13+
14+
2. The "typedef int BOOL" in pcre_internal.h that was included inside the
15+
"#ifndef FALSE" condition by an earlier change (probably 7.8/18) has been
16+
moved outside it again, because FALSE and TRUE are already defined in AIX,
17+
but BOOL is not.
18+
19+
3. The pcre_config() function was treating the PCRE_MATCH_LIMIT and
20+
PCRE_MATCH_LIMIT_RECURSION values as ints, when they should be long ints.
21+
22+
4. The pcregrep documentation said spaces were inserted as well as colons (or
23+
hyphens) following file names and line numbers when outputting matching
24+
lines. This is not true; no spaces are inserted. I have also clarified the
25+
wording for the --colour (or --color) option.
26+
27+
5. In pcregrep, when --colour was used with -o, the list of matching strings
28+
was not coloured; this is different to GNU grep, so I have changed it to be
29+
the same.
30+
31+
6. When --colo(u)r was used in pcregrep, only the first matching substring in
32+
each matching line was coloured. Now it goes on to look for further matches
33+
of any of the test patterns, which is the same behaviour as GNU grep.
34+
35+
7. A pattern that could match an empty string could cause pcregrep to loop; it
36+
doesn't make sense to accept an empty string match in pcregrep, so I have
37+
locked it out (using PCRE's PCRE_NOTEMPTY option). By experiment, this
38+
seems to be how GNU grep behaves.
39+
40+
8. The pattern (?(?=.*b)b|^) was incorrectly compiled as "match must be at
41+
start or after a newline", because the conditional assertion was not being
42+
correctly handled. The rule now is that both the assertion and what follows
43+
in the first alternative must satisfy the test.
44+
45+
9. If auto-callout was enabled in a pattern with a conditional group whose
46+
condition was an assertion, PCRE could crash during matching, both with
47+
pcre_exec() and pcre_dfa_exec().
48+
49+
10. The PCRE_DOLLAR_ENDONLY option was not working when pcre_dfa_exec() was
50+
used for matching.
51+
52+
11. Unicode property support in character classes was not working for
53+
characters (bytes) greater than 127 when not in UTF-8 mode.
54+
55+
12. Added the -M command line option to pcretest.
56+
57+
14. Added the non-standard REG_NOTEMPTY option to the POSIX interface.
58+
59+
15. Added the PCRE_NO_START_OPTIMIZE match-time option.
60+
61+
16. Added comments and documentation about mis-use of no_arg in the C++
62+
wrapper.
63+
64+
17. Implemented support for UTF-8 encoding in EBCDIC environments, a patch
65+
from Martin Jerabek that uses macro names for all relevant character and
66+
string constants.
67+
68+
18. Added to pcre_internal.h two configuration checks: (a) If both EBCDIC and
69+
SUPPORT_UTF8 are set, give an error; (b) If SUPPORT_UCP is set without
70+
SUPPORT_UTF8, define SUPPORT_UTF8. The "configure" script handles both of
71+
these, but not everybody uses configure.
72+
73+
19. A conditional group that had only one branch was not being correctly
74+
recognized as an item that could match an empty string. This meant that an
75+
enclosing group might also not be so recognized, causing infinite looping
76+
(and probably a segfault) for patterns such as ^"((?(?=[a])[^"])|b)*"$
77+
with the subject "ab", where knowledge that the repeated group can match
78+
nothing is needed in order to break the loop.
79+
80+
20. If a pattern that was compiled with callouts was matched using pcre_dfa_
81+
exec(), but without supplying a callout function, matching went wrong.
82+
83+
21. If PCRE_ERROR_MATCHLIMIT occurred during a recursion, there was a memory
84+
leak if the size of the offset vector was greater than 30. When the vector
85+
is smaller, the saved offsets during recursion go onto a local stack
86+
vector, but for larger vectors malloc() is used. It was failing to free
87+
when the recursion yielded PCRE_ERROR_MATCH_LIMIT (or any other "abnormal"
88+
error, in fact).
89+
90+
22. There was a missing #ifdef SUPPORT_UTF8 round one of the variables in the
91+
heapframe that is used only when UTF-8 support is enabled. This caused no
92+
problem, but was untidy.
93+
94+
23. Steven Van Ingelgem's patch to CMakeLists.txt to change the name
95+
CMAKE_BINARY_DIR to PROJECT_BINARY_DIR so that it works when PCRE is
96+
included within another project.
97+
98+
24. Steven Van Ingelgem's patches to add more options to the CMake support,
99+
slightly modified by me:
100+
101+
(a) PCRE_BUILD_TESTS can be set OFF not to build the tests, including
102+
not building pcregrep.
103+
104+
(b) PCRE_BUILD_PCREGREP can be see OFF not to build pcregrep, but only
105+
if PCRE_BUILD_TESTS is also set OFF, because the tests use pcregrep.
106+
107+
25. Forward references, both numeric and by name, in patterns that made use of
108+
duplicate group numbers, could behave incorrectly or give incorrect errors,
109+
because when scanning forward to find the reference group, PCRE was not
110+
taking into account the duplicate group numbers. A pattern such as
111+
^X(?3)(a)(?|(b)|(q))(Y) is an example.
112+
113+
26. Changed a few more instances of "const unsigned char *" to USPTR, making
114+
the feature of a custom pointer more persuasive (as requested by a user).
115+
116+
27. Wrapped the definitions of fileno and isatty for Windows, which appear in
117+
pcretest.c, inside #ifndefs, because it seems they are sometimes already
118+
pre-defined.
119+
120+
28. Added support for (*UTF8) at the start of a pattern.
121+
122+
29. Arrange for flags added by the "release type" setting in CMake to be shown
123+
in the configuration summary.
124+
125+
4126
Version 7.8 05-Sep-08
5127
---------------------
6128

ext/pcre/pcrelib/LICENCE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Email domain: cam.ac.uk
2222
University of Cambridge Computing Service,
2323
Cambridge, England.
2424

25-
Copyright (c) 1997-2008 University of Cambridge
25+
Copyright (c) 1997-2009 University of Cambridge
2626
All rights reserved.
2727

2828

ext/pcre/pcrelib/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
News about PCRE releases
22
------------------------
33

4+
Release 7.9 11-Apr-09
5+
---------------------
6+
7+
Mostly bugfixes and tidies with just a couple of minor functional additions.
8+
49

510
Release 7.8 05-Sep-08
611
---------------------

ext/pcre/pcrelib/NON-UNIX-USE

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ I (Philip Hazel) have no experience of Windows or VMS sytems and how their
2323
libraries work. The items in the PCRE distribution and Makefile that relate to
2424
anything other than Unix-like systems are untested by me.
2525

26-
There are some other comments and files in the Contrib directory on the ftp
27-
site that you may find useful. See
26+
There are some other comments and files (including some documentation in CHM
27+
format) in the Contrib directory on the FTP site:
2828

2929
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Contrib
3030

@@ -373,6 +373,13 @@ Michael Roy sent these comments about building PCRE under Windows with BCC5.5:
373373
line.
374374

375375

376+
BUILDING UNDER WINDOWS CE WITH VISUAL STUDIO 200x
377+
378+
Vincent Richomme sent a zip archive of files to help with this process. They
379+
can be found in the file "pcre-vsbuild.zip" in the Contrib directory of the FTP
380+
site.
381+
382+
376383
BUILDING PCRE ON OPENVMS
377384

378385
Dan Mooney sent the following comments about building PCRE on OpenVMS. They
@@ -437,5 +444,5 @@ $! Locale could not be set to fr
437444
$!
438445
=========================
439446

440-
Last Updated: 05 September 2008
447+
Last Updated: 17 March 2009
441448
****

ext/pcre/pcrelib/README

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ documentation is supplied in two other forms:
8585
in various ways, and rooted in a file called index.html, is distributed in
8686
doc/html and installed in <prefix>/share/doc/pcre/html.
8787

88+
Users of PCRE have contributed files containing the documentation for various
89+
releases in CHM format. These can be found in the Contrib directory of the FTP
90+
site (see next section).
91+
8892

8993
Contributions by users of PCRE
9094
------------------------------
@@ -161,10 +165,13 @@ library. You can read more about them in the pcrebuild man page.
161165
it will try to find a C++ compiler and C++ header files, and if it succeeds,
162166
it will try to build the C++ wrapper.
163167

164-
. If you want to make use of the support for UTF-8 character strings in PCRE,
165-
you must add --enable-utf8 to the "configure" command. Without it, the code
166-
for handling UTF-8 is not included in the library. (Even when included, it
167-
still has to be enabled by an option at run time.)
168+
. If you want to make use of the support for UTF-8 Unicode character strings in
169+
PCRE, you must add --enable-utf8 to the "configure" command. Without it, the
170+
code for handling UTF-8 is not included in the library. Even when included,
171+
it still has to be enabled by an option at run time. When PCRE is compiled
172+
with this option, its input can only either be ASCII or UTF-8, even when
173+
running on EBCDIC platforms. It is not possible to use both --enable-utf8 and
174+
--enable-ebcdic at the same time.
168175

169176
. If, in addition to support for UTF-8 character strings, you want to include
170177
support for the \P, \p, and \X sequences that recognize Unicode character
@@ -255,11 +262,13 @@ library. You can read more about them in the pcrebuild man page.
255262
pcre_chartables.c.dist. See "Character tables" below for further information.
256263

257264
. It is possible to compile PCRE for use on systems that use EBCDIC as their
258-
default character code (as opposed to ASCII) by specifying
265+
character code (as opposed to ASCII) by specifying
259266

260267
--enable-ebcdic
261268

262-
This automatically implies --enable-rebuild-chartables (see above).
269+
This automatically implies --enable-rebuild-chartables (see above). However,
270+
when PCRE is built this way, it always operates in EBCDIC. It cannot support
271+
both EBCDIC and UTF-8.
263272

264273
. It is possible to compile pcregrep to use libz and/or libbz2, in order to
265274
read .gz and .bz2 files (respectively), by specifying one or both of
@@ -286,7 +295,9 @@ library. You can read more about them in the pcrebuild man page.
286295
to specify something like LIBS="-lncurses" as well. This is because, to quote
287296
the readline INSTALL, "Readline uses the termcap functions, but does not link
288297
with the termcap or curses library itself, allowing applications which link
289-
with readline the to choose an appropriate library."
298+
with readline the to choose an appropriate library." If you get error
299+
messages about missing functions tgetstr, tgetent, tputs, tgetflag, or tgoto,
300+
this is the problem, and linking with the ncurses library should fix it.
290301

291302
The "configure" script builds the following files for the basic C library:
292303

@@ -753,4 +764,4 @@ The distribution should contain the following files:
753764
Philip Hazel
754765
Email local part: ph10
755766
Email domain: cam.ac.uk
756-
Last updated: 05 September 2008
767+
Last updated: 21 March 2009

ext/pcre/pcrelib/config.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ them both to 0; an emulation function will be used. */
5050

5151
/* If you are compiling for a system that uses EBCDIC instead of ASCII
5252
character codes, define this macro as 1. On systems that can use
53-
"configure", this can be done via --enable-ebcdic. */
53+
"configure", this can be done via --enable-ebcdic. PCRE will then assume
54+
that all input strings are in EBCDIC. If you do not define this macro, PCRE
55+
will assume input strings are ASCII or UTF-8 Unicode. It is not possible to
56+
build a version of PCRE that supports both EBCDIC and UTF-8. */
5457
/* #undef EBCDIC */
5558

5659
/* Define to 1 if you have the `bcopy' function. */
@@ -259,13 +262,13 @@ them both to 0; an emulation function will be used. */
259262
#define PACKAGE_NAME "PCRE"
260263

261264
/* Define to the full name and version of this package. */
262-
#define PACKAGE_STRING "PCRE 7.8"
265+
#define PACKAGE_STRING "PCRE 7.9"
263266

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

267270
/* Define to the version of this package. */
268-
#define PACKAGE_VERSION "7.8"
271+
#define PACKAGE_VERSION "7.9"
269272

270273

271274
/* If you are compiling for a system other than a Unix-like system or
@@ -313,12 +316,15 @@ them both to 0; an emulation function will be used. */
313316
/* Define to enable support for Unicode properties */
314317
/* #undef SUPPORT_UCP */
315318

316-
/* Define to enable support for the UTF-8 Unicode encoding. */
319+
/* Define to enable support for the UTF-8 Unicode encoding. This will work
320+
even in an EBCDIC environment, but it is incompatible with the EBCDIC
321+
macro. That is, PCRE can support *either* EBCDIC code *or* ASCII/UTF-8, but
322+
not both at once. */
317323
/* #undef SUPPORT_UTF8 */
318324

319325
/* Version number of package */
320326
#ifndef VERSION
321-
#define VERSION "7.8"
327+
#define VERSION "7.9"
322328
#endif
323329

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

ext/pcre/pcrelib/dftables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
and semantics are as close as possible to those of the Perl 5 language.
77
88
Written by Philip Hazel
9-
Copyright (c) 1997-2009 University of Cambridge
9+
Copyright (c) 1997-2008 University of Cambridge
1010
1111
-----------------------------------------------------------------------------
1212
Redistribution and use in source and binary forms, with or without

0 commit comments

Comments
 (0)