1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Upgrading libpcre from 7.4 to 7.6. Tested on Linux and Windows XP.

This commit is contained in:
kris
2008-02-16 20:55:50 +00:00
parent a02bf67a70
commit a3a78c535b
39 changed files with 1567 additions and 609 deletions

View File

@@ -77,6 +77,8 @@ o Fixed a man page bug related to our DocBook to Nroff translation
uses the ".nse" string which was being confused with the Nroff uses the ".nse" string which was being confused with the Nroff
no-space mode command. [Fyodor] no-space mode command. [Fyodor]
o Upgraded the shipped LibPCRE from version 7.4 to 7.6. [Kris]
o The Zenmap man page is now installed on Unix when "make install" is o The Zenmap man page is now installed on Unix when "make install" is
run. This was supposed to work before, but didn't. [Kris] run. This was supposed to work before, but didn't. [Kris]

View File

@@ -8,7 +8,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service, University of Cambridge Computing Service,
Cambridge, England. Cambridge, England.
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
All rights reserved All rights reserved
@@ -17,7 +17,7 @@ THE C++ WRAPPER LIBRARY
Written by: Google Inc. Written by: Google Inc.
Copyright (c) 2007 Google Inc Copyright (c) 2007-2008 Google Inc
All rights reserved All rights reserved
#### ####

View File

@@ -22,7 +22,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service, University of Cambridge Computing Service,
Cambridge, England. Cambridge, England.
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
All rights reserved. All rights reserved.
@@ -31,7 +31,7 @@ THE C++ WRAPPER FUNCTIONS
Contributed by: Google Inc. Contributed by: Google Inc.
Copyright (c) 2007, Google Inc. Copyright (c) 2007-2008, Google Inc.
All rights reserved. All rights reserved.

View File

@@ -45,7 +45,7 @@ DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
$(srcdir)/../missing $(srcdir)/Makefile.am \ $(srcdir)/../missing $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/pcre-config.in $(srcdir)/pcre.h.in \ $(srcdir)/pcre-config.in $(srcdir)/pcre.h.in \
$(top_srcdir)/configure AUTHORS INSTALL $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -271,15 +271,15 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --foreign \ cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \ && exit 0; \
exit 1;; \ exit 1;; \
esac; \ esac; \
done; \ done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \ cd $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile $(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile .PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \ @case '$?' in \

View File

@@ -1,4 +1,4 @@
This directory contains a version of LibPCRE 7.4 that has been stripped This directory contains a version of LibPCRE 7.6 that has been stripped
down to less than a third of its original uncompressed size. So if you down to less than a third of its original uncompressed size. So if you
want docs, tests and such, you should go to the PCRE website at want docs, tests and such, you should go to the PCRE website at
http://www.pcre.org . Here are the changes for the Nmap version: http://www.pcre.org . Here are the changes for the Nmap version:
@@ -6,6 +6,7 @@ http://www.pcre.org . Here are the changes for the Nmap version:
o Started this NMAP_MODIFICATIONS file o Started this NMAP_MODIFICATIONS file
o Removed these directories: o Removed these directories:
cmake
doc doc
testdata testdata
@@ -60,8 +61,8 @@ o Removed config.sub, config.guess, depcomp, install-sh, and missing.
o Comment out some build configuration lines from pcre_internal.h because Nmap o Comment out some build configuration lines from pcre_internal.h because Nmap
builds a static library: builds a static library:
--- pcre-7.4/pcre_internal.h 2007-09-13 04:22:27.000000000 -0500 --- pcre-7.6/pcre_internal.h 2008-01-20 13:59:21.000000000 -0600
+++ libpcre/pcre_internal.h 2007-12-19 22:28:33.000000000 -0600 +++ libpcre/pcre_internal.h 2008-02-15 18:12:28.000000000 -0600
@@ -108,15 +108,19 @@ PCRE_EXP_DATA_DEFN only if they are not @@ -108,15 +108,19 @@ PCRE_EXP_DATA_DEFN only if they are not
#ifndef PCRE_EXP_DECL #ifndef PCRE_EXP_DECL
@@ -87,8 +88,8 @@ o Comment out some build configuration lines from pcre_internal.h because Nmap
...and pcre.h.in/pcre.h.generic/pcre.h: ...and pcre.h.in/pcre.h.generic/pcre.h:
--- pcre-7.4/pcre.h.in 2007-09-11 06:24:35.000000000 -0500 --- pcre-7.6/pcre.h.in 2008-01-20 14:01:08.000000000 -0600
+++ libpcre/pcre.h.in 2007-12-19 22:30:32.000000000 -0600 +++ libpcre/pcre.h.in 2008-02-15 18:12:54.000000000 -0600
@@ -51,6 +51,7 @@ imported have to be identified as such. @@ -51,6 +51,7 @@ imported have to be identified as such.
export setting is defined in pcre_internal.h, which includes this file. So we export setting is defined in pcre_internal.h, which includes this file. So we
don't change existing definitions of PCRE_EXP_DECL and PCRECPP_EXP_DECL. */ don't change existing definitions of PCRE_EXP_DECL and PCRECPP_EXP_DECL. */
@@ -109,8 +110,8 @@ o Comment out some build configuration lines from pcre_internal.h because Nmap
..and pcreposix.h: ..and pcreposix.h:
--- pcre-7.4/pcreposix.h 2007-08-01 04:06:39.000000000 -0500 --- pcre-7.6/pcreposix.h 2008-01-20 13:56:29.000000000 -0600
+++ libpcre/pcreposix.h 2007-12-19 22:31:14.000000000 -0600 +++ libpcre/pcreposix.h 2008-02-15 18:13:29.000000000 -0600
@@ -110,10 +110,12 @@ imported have to be identified as such. @@ -110,10 +110,12 @@ imported have to be identified as such.
export settings are needed, and are set in pcreposix.c before including this export settings are needed, and are set in pcreposix.c before including this
file. */ file. */

View File

@@ -8,8 +8,11 @@ This document contains the following sections:
The C++ wrapper functions The C++ wrapper functions
Building for virtual Pascal Building for virtual Pascal
Stack size in Windows environments Stack size in Windows environments
Linking programs in Windows environments
Comments about Win32 builds Comments about Win32 builds
Building PCRE with CMake 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 under Windows with BCC5.5
Building PCRE on OpenVMS Building PCRE on OpenVMS
@@ -31,10 +34,12 @@ 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++ successfully on any system that has a Standard C compiler and library. The C++
wrapper functions are a separate issue (see below). wrapper functions are a separate issue (see below).
The PCRE distribution includes support for CMake. This support is relatively The PCRE distribution includes a "configure" file for use by the Configure/Make
new, but has already been used successfully to build PCRE in multiple build build system, as found in many Unix-like environments. There is also support
environments on Windows. There are some instructions in the section entitled support for CMake, which some users prefer, in particular in Windows
"Building PCRE with CMake" below. 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 GENERIC INSTRUCTIONS FOR THE PCRE C LIBRARY
@@ -84,7 +89,7 @@ The following are generic comments about building the PCRE C library "by hand".
ucptable.h ucptable.h
(5) Also ensure that you have the following file, which is #included as source (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. when building a debugging version of PCRE, and is also used by pcretest.
pcre_printint.src pcre_printint.src
@@ -177,15 +182,22 @@ significantly slower when this is done. There is more about stack usage in the
"pcrestack" documentation. "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,
otherwise the pcre_malloc() and pcre_free() exported functions will be declared
__declspec(dllimport), with unwanted results.
COMMENTS ABOUT WIN32 BUILDS (see also "BUILDING PCRE WITH CMAKE" below) COMMENTS ABOUT WIN32 BUILDS (see also "BUILDING PCRE WITH CMAKE" below)
There are two ways of building PCRE using the "configure, make, make install" 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 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 the same thing; they are completely different from each other. There is also
some experimental, undocumented support for building using "cmake", which you support for building using CMake, which some users find a more straightforward
might like to try if you are familiar with "cmake". However, at the present way of building PCRE under Windows. However, the tests are not run
time, the "cmake" process builds only a static library (not a dll), and the automatically when CMake is used.
tests are not automatically run.
The MinGW home page (http://www.mingw.org/) says this: The MinGW home page (http://www.mingw.org/) says this:
@@ -217,10 +229,13 @@ also link with libpcre, which contains the basic functions. (Some earlier
releases of PCRE included the basic libpcre functions in libpcreposix. This no releases of PCRE included the basic libpcre functions in libpcreposix. This no
longer happens.) longer happens.)
If you want to statically link your program against a non-dll .a file, you must A user submitted a special-purpose patch that makes it easy to create
define PCRE_STATIC before including pcre.h, otherwise the pcre_malloc() and "pcre.dll" under mingw32 using the "msys" environment. It provides "pcre.dll"
pcre_free() exported functions will be declared __declspec(dllimport), with as a special target. If you use this target, no other files are built, and in
unwanted results. 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 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. If a library that is generated this way is distributed,
@@ -252,7 +267,7 @@ terminators in order to get some of the tests to work. We hope to improve
things in this area in future. things in this area in future.
BUILDING PCRE WITH CMAKE BUILDING PCRE ON WINDOWS WITH CMAKE
CMake is an alternative build facility that can be used instead of the CMake is an alternative build facility that can be used instead of the
traditional Unix "configure". CMake version 2.4.7 supports Borland makefiles, traditional Unix "configure". CMake version 2.4.7 supports Borland makefiles,
@@ -260,36 +275,65 @@ MinGW makefiles, MSYS makefiles, NMake makefiles, UNIX makefiles, Visual Studio
6, Visual Studio 7, Visual Studio 8, and Watcom W8. The following instructions 6, Visual Studio 7, Visual Studio 8, and Watcom W8. The following instructions
were contributed by a PCRE user. were contributed by a PCRE user.
1. Download CMake 2.4.7 or above from http://www.cmake.org/, install and ensure 1. Download CMake 2.4.7 or above from http://www.cmake.org/, install and ensure
that cmake\bin is on your path. that cmake\bin is on your path.
2. Unzip (retaining folder structure) the PCRE source tree into a source 2. Unzip (retaining folder structure) the PCRE source tree into a source
directory such as C:\pcre. directory such as C:\pcre.
3. Create a new, empty build directory: C:\pcre\build\ 3. Create a new, empty build directory: C:\pcre\build\
4. Run CMakeSetup from the Shell envirornment of your build tool, e.g., Msys 4. Run CMakeSetup from the Shell envirornment of your build tool, e.g., Msys
for Msys/MinGW or Visual Studio Command Prompt for VC/VC++ 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 5. Enter C:\pcre\pcre-xx and C:\pcre\build for the source and build
directories, respectively directories, respectively
6. Hit the "Configure" button. 6. Hit the "Configure" button.
7. Select the particular IDE / build tool that you are using (Visual Studio, 7. Select the particular IDE / build tool that you are using (Visual Studio,
MSYS makefiles, MinGW makefiles, etc.) MSYS makefiles, MinGW makefiles, etc.)
8. The GUI will then list several configuration options. This is where you can 8. The GUI will then list several configuration options. This is where you can
enable UTF-8 support, etc. enable UTF-8 support, etc.
9. Hit "Configure" again. The adjacent "OK" button should now be active. 9. Hit "Configure" again. The adjacent "OK" button should now be active.
10. Hit "OK". 10. Hit "OK".
11. The build directory should now contain a usable build system, be it a 11. The build directory should now contain a usable build system, be it a
solution file for Visual Studio, makefiles for MinGW, etc. solution file for Visual Studio, makefiles for MinGW, etc.
Testing with RunTest.bat
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. 1. Copy RunTest.bat into the directory where pcretest.exe has been created.
@@ -384,5 +428,5 @@ $! Locale could not be set to fr
$! $!
========================= =========================
Last Updated: 21 September 2007 Last Updated: 25 January 2008
**** ****

View File

@@ -119,9 +119,9 @@ 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. in the section entitled "Using HP's ANSI C++ compiler (aCC)" below.
The following instructions assume the use of the widely used "configure, make, The following instructions assume the use of the widely used "configure, make,
make install" process. There is also some experimental support for "cmake" in make install" process. There is also support for CMake in the PCRE
the PCRE distribution, but it is incomplete and not documented. However, if you distribution; there are some comments about using CMake in the NON-UNIX-USE
are a "cmake" user, you might want to try it. 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 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 PCRE distribution directory, with your current directory set to the directory
@@ -258,6 +258,24 @@ library. You can read more about them in the pcrebuild man page.
This automatically implies --enable-rebuild-chartables (see above). This automatically implies --enable-rebuild-chartables (see above).
. 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.
. It is possible to compile pcretest so that it links with the libreadline
library, by specifying
--enable-pcretest-libreadline
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.
The "configure" script builds the following files for the basic C library: The "configure" script builds the following files for the basic C library:
. Makefile is the makefile that builds the library . Makefile is the makefile that builds the library
@@ -285,12 +303,12 @@ script that can be run to recreate the configuration, and config.log, which
contains compiler output from tests that "configure" runs. contains compiler output from tests that "configure" runs.
Once "configure" has run, you can run "make". It builds two libraries, called Once "configure" has run, you can run "make". It builds two libraries, called
libpcre and libpcreposix, a test program called pcretest, a demonstration libpcre and libpcreposix, a test program called pcretest, and the pcregrep
program called pcredemo, and the pcregrep command. If a C++ compiler was found command. If a C++ compiler was found on your system, "make" also builds the C++
on your system, "make" also builds the C++ wrapper library, which is called wrapper library, which is called libpcrecpp, and some test programs called
libpcrecpp, and some test programs called pcrecpp_unittest, pcrecpp_unittest, pcre_scanner_unittest, and pcre_stringpiece_unittest.
pcre_scanner_unittest, and pcre_stringpiece_unittest. Building the C++ wrapper Building the C++ wrapper can be disabled by adding --disable-cpp to the
can be disabled by adding --disable-cpp to the "configure" command. "configure" command.
The command "make check" runs all the appropriate tests. Details of the PCRE The command "make check" runs all the appropriate tests. Details of the PCRE
tests are given below in a separate section of this document. tests are given below in a separate section of this document.
@@ -342,9 +360,6 @@ system. The following are installed (file names are all relative to the
pcretest.txt the pcretest man page pcretest.txt the pcretest man page
pcregrep.txt the pcregrep man page pcregrep.txt the pcregrep man page
Note that the pcredemo program that is built by "configure" is *not* installed
anywhere. It is a demonstration for programmers wanting to use PCRE.
If you want to remove PCRE from your system, you can run "make uninstall". 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 This removes all the files that "make install" installed. However, it does not
remove any directories, because these are often shared with other programs. remove any directories, because these are often shared with other programs.
@@ -725,4 +740,4 @@ The distribution should contain the following files:
Philip Hazel Philip Hazel
Email local part: ph10 Email local part: ph10
Email domain: cam.ac.uk Email domain: cam.ac.uk
Last updated: 21 September 2007 Last updated: 25 January 2008

4
libpcre/aclocal.m4 vendored
View File

@@ -11,8 +11,8 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
m4_if(m4_PACKAGE_VERSION, [2.60],, m4_if(m4_PACKAGE_VERSION, [2.61],,
[m4_fatal([this file was generated for autoconf 2.60. [m4_fatal([this file was generated for autoconf 2.61.
You have another version of autoconf. If you want to use that, You have another version of autoconf. If you want to use that,
you should regenerate the build system entirely.], [63])]) you should regenerate the build system entirely.], [63])])

View File

@@ -40,6 +40,11 @@ them both to 0; an emulation function will be used. */
/* Define to 1 if you have the <bits/type_traits.h> header file. */ /* Define to 1 if you have the <bits/type_traits.h> header file. */
/* #undef HAVE_BITS_TYPE_TRAITS_H */ /* #undef HAVE_BITS_TYPE_TRAITS_H */
/* Define to 1 if you have the <bzlib.h> header file. */
#ifndef HAVE_BZLIB_H
#define HAVE_BZLIB_H 1
#endif
/* Define to 1 if you have the <dirent.h> header file. */ /* Define to 1 if you have the <dirent.h> header file. */
#ifndef HAVE_DIRENT_H #ifndef HAVE_DIRENT_H
#define HAVE_DIRENT_H 1 #define HAVE_DIRENT_H 1
@@ -75,6 +80,16 @@ them both to 0; an emulation function will be used. */
#define HAVE_MEMORY_H 1 #define HAVE_MEMORY_H 1
#endif #endif
/* Define to 1 if you have the <readline/history.h> header file. */
#ifndef HAVE_READLINE_HISTORY_H
#define HAVE_READLINE_HISTORY_H 1
#endif
/* Define to 1 if you have the <readline/readline.h> header file. */
#ifndef HAVE_READLINE_READLINE_H
#define HAVE_READLINE_READLINE_H 1
#endif
/* Define to 1 if you have the <stdint.h> header file. */ /* Define to 1 if you have the <stdint.h> header file. */
#ifndef HAVE_STDINT_H #ifndef HAVE_STDINT_H
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
@@ -141,6 +156,11 @@ them both to 0; an emulation function will be used. */
/* Define to 1 if you have the <windows.h> header file. */ /* Define to 1 if you have the <windows.h> header file. */
/* #undef HAVE_WINDOWS_H */ /* #undef HAVE_WINDOWS_H */
/* Define to 1 if you have the <zlib.h> header file. */
#ifndef HAVE_ZLIB_H
#define HAVE_ZLIB_H 1
#endif
/* Define to 1 if you have the `_strtoi64' function. */ /* Define to 1 if you have the `_strtoi64' function. */
/* #undef HAVE__STRTOI64 */ /* #undef HAVE__STRTOI64 */
@@ -220,13 +240,13 @@ them both to 0; an emulation function will be used. */
#define PACKAGE_NAME "PCRE" #define PACKAGE_NAME "PCRE"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "PCRE 7.4" #define PACKAGE_STRING "PCRE 7.6"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "pcre" #define PACKAGE_TARNAME "pcre"
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "7.4" #define PACKAGE_VERSION "7.6"
/* If you are compiling for a system other than a Unix-like system or /* If you are compiling for a system other than a Unix-like system or
@@ -260,6 +280,17 @@ them both to 0; an emulation function will be used. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
#endif #endif
/* Define to allow pcregrep to be linked with libbz2, so that it is able to
handle .bz2 files. */
/* #undef SUPPORT_LIBBZ2 */
/* Define to allow pcretest to be linked with libreadline. */
/* #undef SUPPORT_LIBREADLINE */
/* Define to allow pcregrep to be linked with libz, so that it is able to
handle .gz files. */
/* #undef SUPPORT_LIBZ */
/* Define to enable support for Unicode properties */ /* Define to enable support for Unicode properties */
/* #undef SUPPORT_UCP */ /* #undef SUPPORT_UCP */
@@ -268,7 +299,7 @@ them both to 0; an emulation function will be used. */
/* Version number of package */ /* Version number of package */
#ifndef VERSION #ifndef VERSION
#define VERSION "7.4" #define VERSION "7.6"
#endif #endif
/* Define to empty if `const' does not conform to ANSI C. */ /* Define to empty if `const' does not conform to ANSI C. */

View File

@@ -34,6 +34,9 @@ them both to 0; an emulation function will be used. */
/* Define to 1 if you have the `bcopy' function. */ /* Define to 1 if you have the `bcopy' function. */
#undef HAVE_BCOPY #undef HAVE_BCOPY
/* Define to 1 if you have the <bzlib.h> header file. */
#undef HAVE_BZLIB_H
/* Define to 1 if you have the <dirent.h> header file. */ /* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H #undef HAVE_DIRENT_H
@@ -52,6 +55,12 @@ them both to 0; an emulation function will be used. */
/* Define to 1 if you have the <memory.h> header file. */ /* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H #undef HAVE_MEMORY_H
/* Define to 1 if you have the <readline/history.h> header file. */
#undef HAVE_READLINE_HISTORY_H
/* Define to 1 if you have the <readline/readline.h> header file. */
#undef HAVE_READLINE_READLINE_H
/* Define to 1 if you have the <stdint.h> header file. */ /* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H #undef HAVE_STDINT_H
@@ -88,6 +97,9 @@ them both to 0; an emulation function will be used. */
/* Define to 1 if you have the <windows.h> header file. */ /* Define to 1 if you have the <windows.h> header file. */
#undef HAVE_WINDOWS_H #undef HAVE_WINDOWS_H
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define to 1 if you have the `_strtoi64' function. */ /* Define to 1 if you have the `_strtoi64' function. */
#undef HAVE__STRTOI64 #undef HAVE__STRTOI64
@@ -194,6 +206,17 @@ them both to 0; an emulation function will be used. */
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS
/* Define to allow pcregrep to be linked with libbz2, so that it is able to
handle .bz2 files. */
#undef SUPPORT_LIBBZ2
/* Define to allow pcretest to be linked with libreadline. */
#undef SUPPORT_LIBREADLINE
/* Define to allow pcregrep to be linked with libz, so that it is able to
handle .gz files. */
#undef SUPPORT_LIBZ
/* Define to enable support for Unicode properties */ /* Define to enable support for Unicode properties */
#undef SUPPORT_UCP #undef SUPPORT_UCP

1500
libpcre/configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -7,9 +7,9 @@ dnl be defined as -RC2, for example. For real releases, it should be defined
dnl empty. dnl empty.
m4_define(pcre_major, [7]) m4_define(pcre_major, [7])
m4_define(pcre_minor, [4]) m4_define(pcre_minor, [6])
m4_define(pcre_prerelease, []) m4_define(pcre_prerelease, [])
m4_define(pcre_date, [2007-09-21]) m4_define(pcre_date, [2008-01-28])
AC_PREREQ(2.57) AC_PREREQ(2.57)
AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre) AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)
@@ -128,6 +128,24 @@ AC_ARG_ENABLE(stack-for-recursion,
[don't use stack recursion when matching]), [don't use stack recursion when matching]),
, enable_stack_for_recursion=yes) , enable_stack_for_recursion=yes)
# Handle --enable-pcregrep-libz
AC_ARG_ENABLE(pcregrep-libz,
AS_HELP_STRING([--enable-pcregrep-libz],
[link pcregrep with libz to handle .gz files]),
, enable_pcregrep_libz=no)
# Handle --enable-pcregrep-libbz2
AC_ARG_ENABLE(pcregrep-libbz2,
AS_HELP_STRING([--enable-pcregrep-libbz2],
[link pcregrep with libbz2 to handle .bz2 files]),
, enable_pcregrep_libbz2=no)
# Handle --enable-pcretest-libreadline
AC_ARG_ENABLE(pcretest-libreadline,
AS_HELP_STRING([--enable-pcretest-libreadline],
[link pcretest with libreadline]),
, enable_pcretest_libreadline=no)
# Handle --with-posix-malloc-threshold=NBYTES # Handle --with-posix-malloc-threshold=NBYTES
AC_ARG_WITH(posix-malloc-threshold, AC_ARG_WITH(posix-malloc-threshold,
AS_HELP_STRING([--with-posix-malloc-threshold=NBYTES], AS_HELP_STRING([--with-posix-malloc-threshold=NBYTES],
@@ -251,6 +269,22 @@ AC_SUBST(pcre_have_ulong_long)
AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll _strtoi64) AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll _strtoi64)
# Check for the availability of libz (aka zlib)
AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1])
AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1])
# Check for the availability of libbz2
AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1])
AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1])
# Check for the availabiity of libreadline
AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])
AC_CHECK_LIB([readline], [readline], [HAVE_LIB_READLINE=1])
# This facilitates -ansi builds under Linux # This facilitates -ansi builds under Linux
dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc]) dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])
@@ -283,6 +317,23 @@ if test "$enable_stack_for_recursion" = "no"; then
(use --disable-stack-for-recursion).]) (use --disable-stack-for-recursion).])
fi fi
if test "$enable_pcregrep_libz" = "yes"; then
AC_DEFINE([SUPPORT_LIBZ], [], [
Define to allow pcregrep to be linked with libz, so that it is
able to handle .gz files.])
fi
if test "$enable_pcregrep_libbz2" = "yes"; then
AC_DEFINE([SUPPORT_LIBBZ2], [], [
Define to allow pcregrep to be linked with libbz2, so that it is
able to handle .bz2 files.])
fi
if test "$enable_pcretest_libreadline" = "yes"; then
AC_DEFINE([SUPPORT_LIBREADLINE], [], [
Define to allow pcretest to be linked with libreadline.])
fi
AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [ AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [
The value of NEWLINE determines the newline character sequence. On The value of NEWLINE determines the newline character sequence. On
systems that support it, "configure" can be used to override the systems that support it, "configure" can be used to override the
@@ -389,6 +440,47 @@ EXTRA_LIBPCRE_LDFLAGS="$NO_UNDEFINED -version-info libpcre_version"
AC_SUBST(EXTRA_LIBPCRE_LDFLAGS) AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)
# Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is
# specified, the relevant library is available. If so, add it to LIBS.
if test "$enable_pcregrep_libz" = "yes"; then
if test "$HAVE_ZLIB_H" != "1"; then
echo "** Cannot --enable-pcregrep-libz because zlib.h was not found"
exit 1
fi
if test "$HAVE_LIBZ" != "1"; then
echo "** Cannot --enable-pcregrep-libz because libz was not found"
exit 1
fi
if test "$LIBS" = ""; then LIBS=-lz; else LIBS="$LIBS -lz"; fi
fi
if test "$enable_pcregrep_libbz2" = "yes"; then
if test "$HAVE_BZLIB_H" != "1"; then
echo "** Cannot --enable-pcregrep-libbz2 because bzlib.h was not found"
exit 1
fi
if test "$HAVE_LIBBZ2" != "1"; then
echo "** Cannot --enable-pcregrep-libbz2 because libbz2 was not found"
exit 1
fi
if test "$LIBS" = ""; then LIBS=-lbz2; else LIBS="$LIBS -lbz2"; fi
fi
# Similarly for --enable-pcretest-readline
if test "$enable_pcretest_libreadline" = "yes"; then
if test "$HAVE_READLINE_H" != "1"; then
echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found."
exit 1
fi
if test "$HAVE_HISTORY_H" != "1"; then
echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."
exit 1
fi
if test "$LIBS" = ""; then LIBS=-lreadline; else LIBS="$LIBS -lreadline"; fi
fi
# Produce these files, in addition to config.h. # Produce these files, in addition to config.h.
AC_CONFIG_FILES( AC_CONFIG_FILES(
Makefile Makefile

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -5,7 +5,7 @@
/* This is the public header file for the PCRE library, to be #included by /* This is the public header file for the PCRE library, to be #included by
applications that call the PCRE functions. applications that call the PCRE functions.
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* The current PCRE version information. */ /* The current PCRE version information. */
#define PCRE_MAJOR 7 #define PCRE_MAJOR 7
#define PCRE_MINOR 4 #define PCRE_MINOR 6
#define PCRE_PRERELEASE #define PCRE_PRERELEASE
#define PCRE_DATE 2007-09-21 #define PCRE_DATE 2008-01-28
/* When an application links to a PCRE DLL in Windows, the symbols that are /* 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 imported have to be identified as such. When building PCRE, the appropriate

View File

@@ -5,7 +5,7 @@
/* This is the public header file for the PCRE library, to be #included by /* This is the public header file for the PCRE library, to be #included by
applications that call the PCRE functions. applications that call the PCRE functions.
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* The current PCRE version information. */ /* The current PCRE version information. */
#define PCRE_MAJOR 7 #define PCRE_MAJOR 7
#define PCRE_MINOR 4 #define PCRE_MINOR 6
#define PCRE_PRERELEASE #define PCRE_PRERELEASE
#define PCRE_DATE 2007-09-21 #define PCRE_DATE 2008-01-28
/* When an application links to a PCRE DLL in Windows, the symbols that are /* 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 imported have to be identified as such. When building PCRE, the appropriate

View File

@@ -5,7 +5,7 @@
/* This is the public header file for the PCRE library, to be #included by /* This is the public header file for the PCRE library, to be #included by
applications that call the PCRE functions. applications that call the PCRE functions.
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -48,6 +48,7 @@ supporting internal functions that are not used by other modules. */
#include "config.h" #include "config.h"
#endif #endif
#define NLBLOCK cd /* Block containing newline information */ #define NLBLOCK cd /* Block containing newline information */
#define PSSTART start_pattern /* Field containing processed string start */ #define PSSTART start_pattern /* Field containing processed string start */
#define PSEND end_pattern /* Field containing processed string end */ #define PSEND end_pattern /* Field containing processed string end */
@@ -243,7 +244,7 @@ static const char error_texts[] =
/* 10 */ /* 10 */
"operand of unlimited repeat could match the empty string\0" /** DEAD **/ "operand of unlimited repeat could match the empty string\0" /** DEAD **/
"internal error: unexpected repeat\0" "internal error: unexpected repeat\0"
"unrecognized character after (?\0" "unrecognized character after (? or (?-\0"
"POSIX named classes are supported only within a class\0" "POSIX named classes are supported only within a class\0"
"missing )\0" "missing )\0"
/* 15 */ /* 15 */
@@ -302,7 +303,9 @@ static const char error_texts[] =
"(*VERB) with an argument is not supported\0" "(*VERB) with an argument is not supported\0"
/* 60 */ /* 60 */
"(*VERB) not recognized\0" "(*VERB) not recognized\0"
"number is too big"; "number is too big\0"
"subpattern name expected\0"
"digit expected after (?+";
/* Table to identify digits and hex digits. This is used when compiling /* Table to identify digits and hex digits. This is used when compiling
@@ -498,16 +501,16 @@ ptr--; /* Set pointer back to the last byte */
if (c == 0) *errorcodeptr = ERR1; if (c == 0) *errorcodeptr = ERR1;
/* Non-alphamerics are literals. For digits or letters, do an initial lookup in /* Non-alphanumerics are literals. For digits or letters, do an initial lookup
a table. A non-zero result is something that can be returned immediately. in a table. A non-zero result is something that can be returned immediately.
Otherwise further processing may be required. */ Otherwise further processing may be required. */
#ifndef EBCDIC /* ASCII coding */ #ifndef EBCDIC /* ASCII coding */
else if (c < '0' || c > 'z') {} /* Not alphameric */ else if (c < '0' || c > 'z') {} /* Not alphanumeric */
else if ((i = escapes[c - '0']) != 0) c = i; else if ((i = escapes[c - '0']) != 0) c = i;
#else /* EBCDIC coding */ #else /* EBCDIC coding */
else if (c < 'a' || (ebcdic_chartab[c] & 0x0E) == 0) {} /* Not alphameric */ else if (c < 'a' || (ebcdic_chartab[c] & 0x0E) == 0) {} /* Not alphanumeric */
else if ((i = escapes[c - 0x48]) != 0) c = i; else if ((i = escapes[c - 0x48]) != 0) c = i;
#endif #endif
@@ -724,10 +727,10 @@ else
break; break;
/* PCRE_EXTRA enables extensions to Perl in the matter of escapes. Any /* PCRE_EXTRA enables extensions to Perl in the matter of escapes. Any
other alphameric following \ is an error if PCRE_EXTRA was set; otherwise, other alphanumeric following \ is an error if PCRE_EXTRA was set;
for Perl compatibility, it is a literal. This code looks a bit odd, but otherwise, for Perl compatibility, it is a literal. This code looks a bit
there used to be some cases other than the default, and there may be again odd, but there used to be some cases other than the default, and there may
in future, so I haven't "optimized" it. */ be again in future, so I haven't "optimized" it. */
default: default:
if ((options & PCRE_EXTRA) != 0) switch(c) if ((options & PCRE_EXTRA) != 0) switch(c)
@@ -1508,8 +1511,9 @@ for (;;)
can match the empty string or not. It is called from could_be_empty() can match the empty string or not. It is called from could_be_empty()
below and from compile_branch() when checking for an unlimited repeat of a below and from compile_branch() when checking for an unlimited repeat of a
group that can match nothing. Note that first_significant_code() skips over group that can match nothing. Note that first_significant_code() skips over
assertions. If we hit an unclosed bracket, we return "empty" - this means we've backward and negative forward assertions when its final argument is TRUE. If we
struck an inner bracket whose current branch will already have been scanned. hit an unclosed bracket, we return "empty" - this means we've struck an inner
bracket whose current branch will already have been scanned.
Arguments: Arguments:
code points to start of search code points to start of search
@@ -1531,6 +1535,16 @@ for (code = first_significant_code(code + _pcre_OP_lengths[*code], NULL, 0, TRUE
c = *code; c = *code;
/* Skip over forward assertions; the other assertions are skipped by
first_significant_code() with a TRUE final argument. */
if (c == OP_ASSERT)
{
do code += GET(code, 1); while (*code == OP_ALT);
c = *code;
continue;
}
/* Groups with zero repeats can of course be empty; skip them. */ /* Groups with zero repeats can of course be empty; skip them. */
if (c == OP_BRAZERO || c == OP_BRAMINZERO) if (c == OP_BRAZERO || c == OP_BRAMINZERO)
@@ -1726,29 +1740,48 @@ return TRUE;
*************************************************/ *************************************************/
/* This function is called when the sequence "[:" or "[." or "[=" is /* This function is called when the sequence "[:" or "[." or "[=" is
encountered in a character class. It checks whether this is followed by an encountered in a character class. It checks whether this is followed by a
optional ^ and then a sequence of letters, terminated by a matching ":]" or sequence of characters terminated by a matching ":]" or ".]" or "=]". If we
".]" or "=]". reach an unescaped ']' without the special preceding character, return FALSE.
Argument: Originally, this function only recognized a sequence of letters between the
terminators, but it seems that Perl recognizes any sequence of characters,
though of course unknown POSIX names are subsequently rejected. Perl gives an
"Unknown POSIX class" error for [:f\oo:] for example, where previously PCRE
didn't consider this to be a POSIX class. Likewise for [:1234:].
The problem in trying to be exactly like Perl is in the handling of escapes. We
have to be sure that [abc[:x\]pqr] is *not* treated as containing a POSIX
class, but [abc[:x\]pqr:]] is (so that an error can be generated). The code
below handles the special case of \], but does not try to do any other escape
processing. This makes it different from Perl for cases such as [:l\ower:]
where Perl recognizes it as the POSIX class "lower" but PCRE does not recognize
"l\ower". This is a lesser evil that not diagnosing bad classes when Perl does,
I think.
Arguments:
ptr pointer to the initial [ ptr pointer to the initial [
endptr where to return the end pointer endptr where to return the end pointer
cd pointer to compile data
Returns: TRUE or FALSE Returns: TRUE or FALSE
*/ */
static BOOL static BOOL
check_posix_syntax(const uschar *ptr, const uschar **endptr, compile_data *cd) check_posix_syntax(const uschar *ptr, const uschar **endptr)
{ {
int terminator; /* Don't combine these lines; the Solaris cc */ int terminator; /* Don't combine these lines; the Solaris cc */
terminator = *(++ptr); /* compiler warns about "non-constant" initializer. */ terminator = *(++ptr); /* compiler warns about "non-constant" initializer. */
if (*(++ptr) == '^') ptr++; for (++ptr; *ptr != 0; ptr++)
while ((cd->ctypes[*ptr] & ctype_letter) != 0) ptr++;
if (*ptr == terminator && ptr[1] == ']')
{ {
*endptr = ptr; if (*ptr == '\\' && ptr[1] == ']') ptr++; else
return TRUE; {
if (*ptr == ']') return FALSE;
if (*ptr == terminator && ptr[1] == ']')
{
*endptr = ptr;
return TRUE;
}
}
} }
return FALSE; return FALSE;
} }
@@ -2346,6 +2379,7 @@ uschar classbits[32];
BOOL class_utf8; BOOL class_utf8;
BOOL utf8 = (options & PCRE_UTF8) != 0; BOOL utf8 = (options & PCRE_UTF8) != 0;
uschar *class_utf8data; uschar *class_utf8data;
uschar *class_utf8data_base;
uschar utf8_char[6]; uschar utf8_char[6];
#else #else
BOOL utf8 = FALSE; BOOL utf8 = FALSE;
@@ -2385,6 +2419,7 @@ req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0;
for (;; ptr++) for (;; ptr++)
{ {
BOOL negate_class; BOOL negate_class;
BOOL should_flip_negation;
BOOL possessive_quantifier; BOOL possessive_quantifier;
BOOL is_quantifier; BOOL is_quantifier;
BOOL is_recurse; BOOL is_recurse;
@@ -2608,7 +2643,7 @@ for (;; ptr++)
they are encountered at the top level, so we'll do that too. */ they are encountered at the top level, so we'll do that too. */
if ((ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') && if ((ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') &&
check_posix_syntax(ptr, &tempptr, cd)) check_posix_syntax(ptr, &tempptr))
{ {
*errorcodeptr = (ptr[1] == ':')? ERR13 : ERR31; *errorcodeptr = (ptr[1] == ':')? ERR13 : ERR31;
goto FAILED; goto FAILED;
@@ -2633,6 +2668,12 @@ for (;; ptr++)
else break; else break;
} }
/* If a class contains a negative special such as \S, we need to flip the
negation flag at the end, so that support for characters > 255 works
correctly (they are all included in the class). */
should_flip_negation = FALSE;
/* Keep a count of chars with values < 256 so that we can optimize the case /* 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 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. */ valued UTF-8 characters, we don't yet do any optimization. */
@@ -2650,6 +2691,7 @@ for (;; ptr++)
#ifdef SUPPORT_UTF8 #ifdef SUPPORT_UTF8
class_utf8 = FALSE; /* No chars >= 256 */ class_utf8 = FALSE; /* No chars >= 256 */
class_utf8data = code + LINK_SIZE + 2; /* For UTF-8 items */ class_utf8data = code + LINK_SIZE + 2; /* For UTF-8 items */
class_utf8data_base = class_utf8data; /* For resetting in pass 1 */
#endif #endif
/* Process characters until ] is reached. By writing this as a "do" it /* Process characters until ] is reached. By writing this as a "do" it
@@ -2665,6 +2707,18 @@ for (;; ptr++)
{ /* Braces are required because the */ { /* Braces are required because the */
GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */ GETCHARLEN(c, ptr, ptr); /* macro generates multiple statements */
} }
/* In the pre-compile phase, accumulate the length of any UTF-8 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
(which is on the stack). */
if (lengthptr != NULL)
{
*lengthptr += class_utf8data - class_utf8data_base;
class_utf8data = class_utf8data_base;
}
#endif #endif
/* Inside \Q...\E everything is literal except \E */ /* Inside \Q...\E everything is literal except \E */
@@ -2688,7 +2742,7 @@ for (;; ptr++)
if (c == '[' && if (c == '[' &&
(ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') && (ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') &&
check_posix_syntax(ptr, &tempptr, cd)) check_posix_syntax(ptr, &tempptr))
{ {
BOOL local_negate = FALSE; BOOL local_negate = FALSE;
int posix_class, taboffset, tabopt; int posix_class, taboffset, tabopt;
@@ -2705,6 +2759,7 @@ for (;; ptr++)
if (*ptr == '^') if (*ptr == '^')
{ {
local_negate = TRUE; local_negate = TRUE;
should_flip_negation = TRUE; /* Note negative special */
ptr++; ptr++;
} }
@@ -2779,7 +2834,7 @@ for (;; ptr++)
c = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE); c = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE);
if (*errorcodeptr != 0) goto FAILED; if (*errorcodeptr != 0) goto FAILED;
if (-c == ESC_b) c = '\b'; /* \b is backslash in a class */ if (-c == ESC_b) c = '\b'; /* \b is backspace in a class */
else if (-c == ESC_X) c = 'X'; /* \X is literal X in a class */ else if (-c == ESC_X) c = 'X'; /* \X is literal X in a class */
else if (-c == ESC_R) c = 'R'; /* \R is literal R in a class */ else if (-c == ESC_R) c = 'R'; /* \R is literal R in a class */
else if (-c == ESC_Q) /* Handle start of quoted string */ else if (-c == ESC_Q) /* Handle start of quoted string */
@@ -2807,6 +2862,7 @@ for (;; ptr++)
continue; continue;
case ESC_D: case ESC_D:
should_flip_negation = TRUE;
for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_digit]; for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_digit];
continue; continue;
@@ -2815,6 +2871,7 @@ for (;; ptr++)
continue; continue;
case ESC_W: case ESC_W:
should_flip_negation = TRUE;
for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_word]; for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_word];
continue; continue;
@@ -2824,13 +2881,11 @@ for (;; ptr++)
continue; continue;
case ESC_S: case ESC_S:
should_flip_negation = TRUE;
for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_space]; for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_space];
classbits[1] |= 0x08; /* Perl 5.004 onwards omits VT from \s */ classbits[1] |= 0x08; /* Perl 5.004 onwards omits VT from \s */
continue; continue;
case ESC_E: /* Perl ignores an orphan \E */
continue;
default: /* Not recognized; fall through */ default: /* Not recognized; fall through */
break; /* Need "default" setting to stop compiler warning. */ break; /* Need "default" setting to stop compiler warning. */
} }
@@ -3065,7 +3120,7 @@ for (;; ptr++)
d = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE); d = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE);
if (*errorcodeptr != 0) goto FAILED; if (*errorcodeptr != 0) goto FAILED;
/* \b is backslash; \X is literal X; \R is literal R; any other /* \b is backspace; \X is literal X; \R is literal R; any other
special means the '-' was literal */ special means the '-' was literal */
if (d < 0) if (d < 0)
@@ -3329,11 +3384,14 @@ we set the flag only if there is a literal "\r" or "\n" in the class. */
zeroreqbyte = reqbyte; zeroreqbyte = reqbyte;
/* If there are characters with values > 255, we have to compile an /* If there are characters with values > 255, we have to compile an
extended class, with its own opcode. If there are no characters < 256, extended class, with its own opcode, unless there was a negated special
we can omit the bitmap in the actual compiled code. */ such as \S in the class, because in that case all characters > 255 are in
the class, so any that were explicitly given as well can be ignored. If
(when there are explicit characters > 255 that must be listed) there are no
characters < 256, we can omit the bitmap in the actual compiled code. */
#ifdef SUPPORT_UTF8 #ifdef SUPPORT_UTF8
if (class_utf8) if (class_utf8 && !should_flip_negation)
{ {
*class_utf8data++ = XCL_END; /* Marks the end of extra data */ *class_utf8data++ = XCL_END; /* Marks the end of extra data */
*code++ = OP_XCLASS; *code++ = OP_XCLASS;
@@ -3359,20 +3417,19 @@ we set the flag only if there is a literal "\r" or "\n" in the class. */
} }
#endif #endif
/* If there are no characters > 255, negate the 32-byte map if necessary, /* If there are no characters > 255, set the opcode to OP_CLASS or
and copy it into the code vector. If this is the first thing in the branch, OP_NCLASS, depending on whether the whole class was negated and whether
there can be no first char setting, whatever the repeat count. Any reqbyte there were negative specials such as \S in the class. Then copy the 32-byte
setting must remain unchanged after any kind of repeat. */ map into the code vector, negating it if necessary. */
*code++ = (negate_class == should_flip_negation) ? OP_CLASS : OP_NCLASS;
if (negate_class) if (negate_class)
{ {
*code++ = OP_NCLASS;
if (lengthptr == NULL) /* Save time in the pre-compile phase */ if (lengthptr == NULL) /* Save time in the pre-compile phase */
for (c = 0; c < 32; c++) code[c] = ~classbits[c]; for (c = 0; c < 32; c++) code[c] = ~classbits[c];
} }
else else
{ {
*code++ = OP_CLASS;
memcpy(code, classbits, 32); memcpy(code, classbits, 32);
} }
code += 32; code += 32;
@@ -4008,7 +4065,9 @@ we set the flag only if there is a literal "\r" or "\n" in the class. */
int len; int len;
if (*tempcode == OP_EXACT || *tempcode == OP_TYPEEXACT || if (*tempcode == OP_EXACT || *tempcode == OP_TYPEEXACT ||
*tempcode == OP_NOTEXACT) *tempcode == OP_NOTEXACT)
tempcode += _pcre_OP_lengths[*tempcode]; tempcode += _pcre_OP_lengths[*tempcode] +
((*tempcode == OP_TYPEEXACT &&
(tempcode[3] == OP_PROP || tempcode[3] == OP_NOTPROP))? 2:0);
len = code - tempcode; len = code - tempcode;
if (len > 0) switch (*tempcode) if (len > 0) switch (*tempcode)
{ {
@@ -4235,16 +4294,13 @@ we set the flag only if there is a literal "\r" or "\n" in the class. */
*errorcodeptr = ERR58; *errorcodeptr = ERR58;
goto FAILED; goto FAILED;
} }
if (refsign == '-') recno = (refsign == '-')?
cd->bracount - recno + 1 : recno +cd->bracount;
if (recno <= 0 || recno > cd->final_bracount)
{ {
recno = cd->bracount - recno + 1; *errorcodeptr = ERR15;
if (recno <= 0) goto FAILED;
{
*errorcodeptr = ERR15;
goto FAILED;
}
} }
else recno += cd->bracount;
PUT2(code, 2+LINK_SIZE, recno); PUT2(code, 2+LINK_SIZE, recno);
break; break;
} }
@@ -4316,9 +4372,10 @@ we set the flag only if there is a literal "\r" or "\n" in the class. */
skipbytes = 1; skipbytes = 1;
} }
/* Check for the "name" actually being a subpattern number. */ /* Check for the "name" actually being a subpattern number. We are
in the second pass here, so final_bracount is set. */
else if (recno > 0) else if (recno > 0 && recno <= cd->final_bracount)
{ {
PUT2(code, 2+LINK_SIZE, recno); PUT2(code, 2+LINK_SIZE, recno);
} }
@@ -4512,7 +4569,9 @@ we set the flag only if there is a literal "\r" or "\n" in the class. */
/* We come here from the Python syntax above that handles both /* We come here from the Python syntax above that handles both
references (?P=name) and recursion (?P>name), as well as falling references (?P=name) and recursion (?P>name), as well as falling
through from the Perl recursion syntax (?&name). */ through from the Perl recursion syntax (?&name). We also come here from
the Perl \k<name> or \k'name' back reference syntax and the \k{name}
.NET syntax. */
NAMED_REF_OR_RECURSE: NAMED_REF_OR_RECURSE:
name = ++ptr; name = ++ptr;
@@ -4524,6 +4583,11 @@ we set the flag only if there is a literal "\r" or "\n" in the class. */
if (lengthptr != NULL) if (lengthptr != NULL)
{ {
if (namelen == 0)
{
*errorcodeptr = ERR62;
goto FAILED;
}
if (*ptr != terminator) if (*ptr != terminator)
{ {
*errorcodeptr = ERR42; *errorcodeptr = ERR42;
@@ -4537,14 +4601,19 @@ we set the flag only if there is a literal "\r" or "\n" in the class. */
recno = 0; recno = 0;
} }
/* In the real compile, seek the name in the table */ /* In the real compile, seek the name in the table. We check the name
first, and then check that we have reached the end of the name in the
table. That way, if the name that is longer than any in the table,
the comparison will fail without reading beyond the table entry. */
else else
{ {
slot = cd->name_table; slot = cd->name_table;
for (i = 0; i < cd->names_found; i++) for (i = 0; i < cd->names_found; i++)
{ {
if (strncmp((char *)name, (char *)slot+2, namelen) == 0) break; if (strncmp((char *)name, (char *)slot+2, namelen) == 0 &&
slot[2+namelen] == 0)
break;
slot += cd->name_entry_size; slot += cd->name_entry_size;
} }
@@ -4581,7 +4650,15 @@ we set the flag only if there is a literal "\r" or "\n" in the class. */
{ {
const uschar *called; const uschar *called;
if ((refsign = *ptr) == '+') ptr++; if ((refsign = *ptr) == '+')
{
ptr++;
if ((digitab[*ptr] & ctype_digit) == 0)
{
*errorcodeptr = ERR63;
goto FAILED;
}
}
else if (refsign == '-') else if (refsign == '-')
{ {
if ((digitab[ptr[1]] & ctype_digit) == 0) if ((digitab[ptr[1]] & ctype_digit) == 0)
@@ -5747,7 +5824,6 @@ to fill in forward references to subpatterns. */
uschar cworkspace[COMPILE_WORK_SIZE]; uschar cworkspace[COMPILE_WORK_SIZE];
/* Set this early so that early errors get offset 0. */ /* Set this early so that early errors get offset 0. */
ptr = (const uschar *)pattern; ptr = (const uschar *)pattern;
@@ -5908,7 +5984,7 @@ to compile parts of the pattern into; the compiled code is discarded when it is
no longer needed, so hopefully this workspace will never overflow, though there no longer needed, so hopefully this workspace will never overflow, though there
is a test for its doing so. */ is a test for its doing so. */
cd->bracount = 0; cd->bracount = cd->final_bracount = 0;
cd->names_found = 0; cd->names_found = 0;
cd->name_entry_size = 0; cd->name_entry_size = 0;
cd->name_table = NULL; cd->name_table = NULL;
@@ -5985,6 +6061,7 @@ field. Reset the bracket count and the names_found field. Also reset the hwm
field; this time it's used for remembering forward references to subpatterns. field; this time it's used for remembering forward references to subpatterns.
*/ */
cd->final_bracount = cd->bracount; /* Save for checking forward references */
cd->bracount = 0; cd->bracount = 0;
cd->names_found = 0; cd->names_found = 0;
cd->name_table = (uschar *)re + re->name_table_offset; cd->name_table = (uschar *)re + re->name_table_offset;

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -4672,10 +4672,10 @@ for(;;)
if (first_byte_caseless) if (first_byte_caseless)
while (start_match < end_subject && while (start_match < end_subject &&
md->lcc[*start_match] != first_byte) md->lcc[*start_match] != first_byte)
start_match++; { NEXTCHAR(start_match); }
else else
while (start_match < end_subject && *start_match != first_byte) while (start_match < end_subject && *start_match != first_byte)
start_match++; { NEXTCHAR(start_match); }
} }
/* Or to just after a linebreak for a multiline match if possible */ /* Or to just after a linebreak for a multiline match if possible */
@@ -4685,7 +4685,7 @@ for(;;)
if (start_match > md->start_subject + start_offset) if (start_match > md->start_subject + start_offset)
{ {
while (start_match <= end_subject && !WAS_NEWLINE(start_match)) while (start_match <= end_subject && !WAS_NEWLINE(start_match))
start_match++; { NEXTCHAR(start_match); }
/* If we have just passed a CR and the newline option is ANY or ANYCRLF, /* If we have just passed a CR and the newline option is ANY or ANYCRLF,
and we are now at a LF, advance the match position by one more character. and we are now at a LF, advance the match position by one more character.
@@ -4706,7 +4706,9 @@ for(;;)
while (start_match < end_subject) while (start_match < end_subject)
{ {
register unsigned int c = *start_match; register unsigned int c = *start_match;
if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++; else break; if ((start_bits[c/8] & (1 << (c&7))) == 0)
{ NEXTCHAR(start_match); }
else break;
} }
} }

View File

@@ -2,11 +2,11 @@
* Perl-Compatible Regular Expressions * * Perl-Compatible Regular Expressions *
*************************************************/ *************************************************/
/*PCRE is a library of functions to support regular expressions whose syntax /* 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. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -7,7 +7,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -367,6 +367,7 @@ never be called in byte mode. To make sure it can never even appear when UTF-8
support is omitted, we don't even define it. */ support is omitted, we don't even define it. */
#ifndef SUPPORT_UTF8 #ifndef SUPPORT_UTF8
#define NEXTCHAR(p) p++;
#define GETCHAR(c, eptr) c = *eptr; #define GETCHAR(c, eptr) c = *eptr;
#define GETCHARTEST(c, eptr) c = *eptr; #define GETCHARTEST(c, eptr) c = *eptr;
#define GETCHARINC(c, eptr) c = *eptr++; #define GETCHARINC(c, eptr) c = *eptr++;
@@ -376,6 +377,13 @@ support is omitted, we don't even define it. */
#else /* SUPPORT_UTF8 */ #else /* SUPPORT_UTF8 */
/* Advance a character pointer one byte in non-UTF-8 mode and by one character
in UTF-8 mode. */
#define NEXTCHAR(p) \
p++; \
if (utf8) { while((*p & 0xc0) == 0x80) p++; }
/* Get the next UTF-8 character, not advancing the pointer. This is called when /* Get the next UTF-8 character, not advancing the pointer. This is called when
we know we are in UTF-8 mode. */ we know we are in UTF-8 mode. */
@@ -875,7 +883,7 @@ enum { ERR0, ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9,
ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39, ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39,
ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49, ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,
ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59, ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
ERR60, ERR61 }; ERR60, ERR61, ERR62, ERR63 };
/* The real format of the start of the pcre block; the index of names and the /* 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 code vector run on as long as necessary after the end. We store an explicit
@@ -938,7 +946,8 @@ typedef struct compile_data {
uschar *name_table; /* The name/number table */ uschar *name_table; /* The name/number table */
int names_found; /* Number of entries so far */ int names_found; /* Number of entries so far */
int name_entry_size; /* Size of each entry */ int name_entry_size; /* Size of each entry */
int bracount; /* Count of capturing parens */ int bracount; /* Count of capturing parens as we compile */
int final_bracount; /* Saved value after first pass */
int top_backref; /* Maximum back reference */ int top_backref; /* Maximum back reference */
unsigned int backref_map; /* Bitmap of low back refs */ unsigned int backref_map; /* Bitmap of low back refs */
int external_options; /* External (initial) options */ int external_options; /* External (initial) options */
@@ -1040,7 +1049,7 @@ typedef struct dfa_match_data {
#define ctype_letter 0x02 #define ctype_letter 0x02
#define ctype_digit 0x04 #define ctype_digit 0x04
#define ctype_xdigit 0x08 #define ctype_xdigit 0x08
#define ctype_word 0x10 /* alphameric or '_' */ #define ctype_word 0x10 /* alphanumeric or '_' */
#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */ #define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */
/* Offsets for the bitmap tables in pcre_cbits. Each table contains a set /* Offsets for the bitmap tables in pcre_cbits. Each table contains a set

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -64,7 +64,7 @@ an invalid string are then undefined.
Originally, this function checked according to RFC 2279, allowing for values in 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 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 the canonical format. Once somebody had pointed out RFC 3629 to me (it
obsoletes 2279), additional restrictions were applies. The values are now 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 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.

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -126,7 +126,9 @@ static const int eint[] = {
REG_INVARG, /* inconsistent NEWLINE options */ REG_INVARG, /* inconsistent NEWLINE options */
REG_BADPAT, /* \g is not followed followed by an (optionally braced) non-zero number */ REG_BADPAT, /* \g is not followed followed by an (optionally braced) non-zero number */
REG_BADPAT, /* (?+ or (?- must be followed by a non-zero number */ REG_BADPAT, /* (?+ or (?- must be followed by a non-zero number */
REG_BADPAT /* number is too big */ REG_BADPAT, /* number is too big */
REG_BADPAT, /* subpattern name expected */
REG_BADPAT /* digit expected after (?+ */
}; };
/* Table of texts corresponding to POSIX error codes */ /* Table of texts corresponding to POSIX error codes */

View File

@@ -9,7 +9,7 @@
Compatible Regular Expression library. It defines the things POSIX says should Compatible Regular Expression library. It defines the things POSIX says should
be there. I hope. be there. I hope.
Copyright (c) 1997-2007 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@@ -539,7 +539,8 @@ static const cnode ucp_table[] = {
{ 0x21000293, 0x14000000 }, { 0x21000293, 0x14000000 },
{ 0x21000294, 0x1c000000 }, { 0x21000294, 0x1c000000 },
{ 0x21800295, 0x1400001a }, { 0x21800295, 0x1400001a },
{ 0x218002b0, 0x18000011 }, { 0x218002b0, 0x18000008 },
{ 0x098002b9, 0x18000008 },
{ 0x098002c2, 0x60000003 }, { 0x098002c2, 0x60000003 },
{ 0x098002c6, 0x1800000b }, { 0x098002c6, 0x1800000b },
{ 0x098002d2, 0x6000000d }, { 0x098002d2, 0x6000000d },
@@ -1039,15 +1040,18 @@ static const cnode ucp_table[] = {
{ 0x198005f3, 0x54000001 }, { 0x198005f3, 0x54000001 },
{ 0x09800600, 0x04000003 }, { 0x09800600, 0x04000003 },
{ 0x0000060b, 0x5c000000 }, { 0x0000060b, 0x5c000000 },
{ 0x0980060c, 0x54000001 }, { 0x0900060c, 0x54000000 },
{ 0x0000060d, 0x54000000 },
{ 0x0080060e, 0x68000001 }, { 0x0080060e, 0x68000001 },
{ 0x00800610, 0x30000005 }, { 0x00800610, 0x30000005 },
{ 0x0900061b, 0x54000000 }, { 0x0900061b, 0x54000000 },
{ 0x0080061e, 0x54000001 }, { 0x0000061e, 0x54000000 },
{ 0x0900061f, 0x54000000 },
{ 0x00800621, 0x1c000019 }, { 0x00800621, 0x1c000019 },
{ 0x09000640, 0x18000000 }, { 0x09000640, 0x18000000 },
{ 0x00800641, 0x1c000009 }, { 0x00800641, 0x1c000009 },
{ 0x1b80064b, 0x30000013 }, { 0x1b80064b, 0x3000000a },
{ 0x00800656, 0x30000008 },
{ 0x09800660, 0x34000009 }, { 0x09800660, 0x34000009 },
{ 0x0080066a, 0x54000003 }, { 0x0080066a, 0x54000003 },
{ 0x0080066e, 0x1c000001 }, { 0x0080066e, 0x1c000001 },
@@ -1074,7 +1078,8 @@ static const cnode ucp_table[] = {
{ 0x31000711, 0x30000000 }, { 0x31000711, 0x30000000 },
{ 0x31800712, 0x1c00001d }, { 0x31800712, 0x1c00001d },
{ 0x31800730, 0x3000001a }, { 0x31800730, 0x3000001a },
{ 0x3180074d, 0x1c000020 }, { 0x3180074d, 0x1c000002 },
{ 0x00800750, 0x1c00001d },
{ 0x37800780, 0x1c000025 }, { 0x37800780, 0x1c000025 },
{ 0x378007a6, 0x3000000a }, { 0x378007a6, 0x3000000a },
{ 0x370007b1, 0x1c000000 }, { 0x370007b1, 0x1c000000 },
@@ -1460,7 +1465,10 @@ static const cnode ucp_table[] = {
{ 0x1f0017dd, 0x30000000 }, { 0x1f0017dd, 0x30000000 },
{ 0x1f8017e0, 0x34000009 }, { 0x1f8017e0, 0x34000009 },
{ 0x1f8017f0, 0x3c000009 }, { 0x1f8017f0, 0x3c000009 },
{ 0x25801800, 0x54000005 }, { 0x25801800, 0x54000001 },
{ 0x09801802, 0x54000001 },
{ 0x25001804, 0x54000000 },
{ 0x09001805, 0x54000000 },
{ 0x25001806, 0x44000000 }, { 0x25001806, 0x44000000 },
{ 0x25801807, 0x54000003 }, { 0x25801807, 0x54000003 },
{ 0x2580180b, 0x30000002 }, { 0x2580180b, 0x30000002 },
@@ -1513,14 +1521,20 @@ static const cnode ucp_table[] = {
{ 0x3d801b61, 0x68000009 }, { 0x3d801b61, 0x68000009 },
{ 0x3d801b6b, 0x30000008 }, { 0x3d801b6b, 0x30000008 },
{ 0x3d801b74, 0x68000008 }, { 0x3d801b74, 0x68000008 },
{ 0x21801d00, 0x1400002b }, { 0x21801d00, 0x14000025 },
{ 0x21801d2c, 0x18000035 }, { 0x13801d26, 0x14000004 },
{ 0x21801d62, 0x14000015 }, { 0x0c001d2b, 0x14000000 },
{ 0x21801d2c, 0x18000030 },
{ 0x13801d5d, 0x18000004 },
{ 0x21801d62, 0x14000003 },
{ 0x13801d66, 0x14000004 },
{ 0x21801d6b, 0x1400000c },
{ 0x0c001d78, 0x18000000 }, { 0x0c001d78, 0x18000000 },
{ 0x21801d79, 0x14000003 }, { 0x21801d79, 0x14000003 },
{ 0x21001d7d, 0x14000ee6 }, { 0x21001d7d, 0x14000ee6 },
{ 0x21801d7e, 0x1400001c }, { 0x21801d7e, 0x1400001c },
{ 0x21801d9b, 0x18000024 }, { 0x21801d9b, 0x18000023 },
{ 0x13001dbf, 0x18000000 },
{ 0x1b801dc0, 0x3000000a }, { 0x1b801dc0, 0x3000000a },
{ 0x1b801dfe, 0x30000001 }, { 0x1b801dfe, 0x30000001 },
{ 0x21001e00, 0x24000001 }, { 0x21001e00, 0x24000001 },
@@ -1982,7 +1996,9 @@ static const cnode ucp_table[] = {
{ 0x13001ffc, 0x2000fff7 }, { 0x13001ffc, 0x2000fff7 },
{ 0x13801ffd, 0x60000001 }, { 0x13801ffd, 0x60000001 },
{ 0x09802000, 0x7400000a }, { 0x09802000, 0x7400000a },
{ 0x0980200b, 0x04000004 }, { 0x0900200b, 0x04000000 },
{ 0x1b80200c, 0x04000001 },
{ 0x0980200e, 0x04000001 },
{ 0x09802010, 0x44000005 }, { 0x09802010, 0x44000005 },
{ 0x09802016, 0x54000001 }, { 0x09802016, 0x54000001 },
{ 0x09002018, 0x50000000 }, { 0x09002018, 0x50000000 },
@@ -2615,7 +2631,8 @@ static const cnode ucp_table[] = {
{ 0x090030a0, 0x44000000 }, { 0x090030a0, 0x44000000 },
{ 0x1d8030a1, 0x1c000059 }, { 0x1d8030a1, 0x1c000059 },
{ 0x090030fb, 0x54000000 }, { 0x090030fb, 0x54000000 },
{ 0x098030fc, 0x18000002 }, { 0x090030fc, 0x18000000 },
{ 0x1d8030fd, 0x18000001 },
{ 0x1d0030ff, 0x1c000000 }, { 0x1d0030ff, 0x1c000000 },
{ 0x03803105, 0x1c000027 }, { 0x03803105, 0x1c000027 },
{ 0x17803131, 0x1c00005d }, { 0x17803131, 0x1c00005d },
@@ -2630,7 +2647,8 @@ static const cnode ucp_table[] = {
{ 0x0980322a, 0x68000019 }, { 0x0980322a, 0x68000019 },
{ 0x09003250, 0x68000000 }, { 0x09003250, 0x68000000 },
{ 0x09803251, 0x3c00000e }, { 0x09803251, 0x3c00000e },
{ 0x17803260, 0x6800001f }, { 0x17803260, 0x6800001d },
{ 0x0980327e, 0x68000001 },
{ 0x09803280, 0x3c000009 }, { 0x09803280, 0x3c000009 },
{ 0x0980328a, 0x68000026 }, { 0x0980328a, 0x68000026 },
{ 0x098032b1, 0x3c00000e }, { 0x098032b1, 0x3c00000e },
@@ -2678,7 +2696,8 @@ static const cnode ucp_table[] = {
{ 0x1900fb3e, 0x1c000000 }, { 0x1900fb3e, 0x1c000000 },
{ 0x1980fb40, 0x1c000001 }, { 0x1980fb40, 0x1c000001 },
{ 0x1980fb43, 0x1c000001 }, { 0x1980fb43, 0x1c000001 },
{ 0x1980fb46, 0x1c00006b }, { 0x1980fb46, 0x1c000009 },
{ 0x0080fb50, 0x1c000061 },
{ 0x0080fbd3, 0x1c00016a }, { 0x0080fbd3, 0x1c00016a },
{ 0x0900fd3e, 0x58000000 }, { 0x0900fd3e, 0x58000000 },
{ 0x0900fd3f, 0x48000000 }, { 0x0900fd3f, 0x48000000 },
@@ -2944,7 +2963,8 @@ static const cnode ucp_table[] = {
{ 0x0d01044d, 0x1400ffd8 }, { 0x0d01044d, 0x1400ffd8 },
{ 0x0d01044e, 0x1400ffd8 }, { 0x0d01044e, 0x1400ffd8 },
{ 0x0d01044f, 0x1400ffd8 }, { 0x0d01044f, 0x1400ffd8 },
{ 0x2e810450, 0x1c00004d }, { 0x2e810450, 0x1c00002f },
{ 0x2c810480, 0x1c00001d },
{ 0x2c8104a0, 0x34000009 }, { 0x2c8104a0, 0x34000009 },
{ 0x0b810800, 0x1c000005 }, { 0x0b810800, 0x1c000005 },
{ 0x0b010808, 0x1c000000 }, { 0x0b010808, 0x1c000000 },