Merged update from upstream sources
This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/mingw-pcre.git#fa4f2f0ef17623370217832a2f449960d3d3c3a0
This commit is contained in:
parent
eb74dbe2c0
commit
617607bc20
9
.gitignore
vendored
9
.gitignore
vendored
@ -0,0 +1,9 @@
|
||||
/pcre-8.10.tar.gz
|
||||
/pcre-8.30.tar.gz
|
||||
/pcre-8.31.tar.gz
|
||||
/pcre-8.32.tar.gz
|
||||
/pcre-8.33.tar.gz
|
||||
/pcre-8.34.tar.gz
|
||||
/pcre-8.36.tar.bz2
|
||||
/pcre-8.38.tar.bz2
|
||||
/pcre-8.43.tar.bz2
|
301
mingw-pcre.spec
Normal file
301
mingw-pcre.spec
Normal file
@ -0,0 +1,301 @@
|
||||
%?mingw_package_header
|
||||
|
||||
Name: mingw-pcre
|
||||
Version: 8.43
|
||||
Release: 4%{?dist}
|
||||
Summary: MinGW Windows pcre library
|
||||
|
||||
License: BSD
|
||||
URL: http://www.pcre.org/
|
||||
Source0: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-%{version}.tar.bz2
|
||||
|
||||
# Refused by upstream, bug #675477
|
||||
Patch1: pcre-8.32-refused_spelling_terminated.patch
|
||||
# Fix recursion stack estimator, upstream bug #2173, refused by upstream
|
||||
Patch2: pcre-8.41-fix_stack_estimator.patch
|
||||
# Link applications to PCRE-specific symbols when using POSIX API, bug #1667614,
|
||||
# upstream bug 1830, partially borrowed from PCRE2, proposed to upstream,
|
||||
# This amends ABI, application built with this patch cannot run with
|
||||
# previous libpcreposix builds.
|
||||
Patch3: pcre-8.42-Declare-POSIX-regex-function-names-as-macros-to-PCRE.patch
|
||||
# Add (*LF) to a list of start-of-pattern options in the C++ wrapper,
|
||||
# upstream bug #2400, in upstream after 8.43
|
||||
Patch4: pcre-8.43-Fix-omission-of-LF-from-list-in-the-C-wrapper.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: git
|
||||
BuildRequires: redhat-rpm-config
|
||||
|
||||
BuildRequires: mingw32-filesystem >= 95
|
||||
BuildRequires: mingw32-gcc
|
||||
BuildRequires: mingw32-gcc-c++
|
||||
BuildRequires: mingw32-binutils
|
||||
|
||||
BuildRequires: mingw64-filesystem >= 95
|
||||
BuildRequires: mingw64-gcc
|
||||
BuildRequires: mingw64-gcc-c++
|
||||
BuildRequires: mingw64-binutils
|
||||
|
||||
|
||||
%description
|
||||
Cross compiled Perl-compatible regular expression library for use with mingw32.
|
||||
|
||||
PCRE has its own native API, but a set of "wrapper" functions that are based on
|
||||
the POSIX API are also supplied in the library libpcreposix. Note that this
|
||||
just provides a POSIX calling interface to PCRE: the regular expressions
|
||||
themselves still follow Perl syntax and semantics. The header file
|
||||
for the POSIX-style functions is called pcreposix.h.
|
||||
|
||||
|
||||
# Win32
|
||||
%package -n mingw32-pcre
|
||||
Summary: MinGW Windows pcre library
|
||||
Requires: pkgconfig
|
||||
|
||||
%description -n mingw32-pcre
|
||||
Cross compiled Perl-compatible regular expression library for use with mingw32.
|
||||
|
||||
PCRE has its own native API, but a set of "wrapper" functions that are based on
|
||||
the POSIX API are also supplied in the library libpcreposix. Note that this
|
||||
just provides a POSIX calling interface to PCRE: the regular expressions
|
||||
themselves still follow Perl syntax and semantics. The header file
|
||||
for the POSIX-style functions is called pcreposix.h.
|
||||
|
||||
%package -n mingw32-pcre-static
|
||||
Summary: Static version of the mingw32-pcre library
|
||||
Requires: mingw32-pcre = %{version}-%{release}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n mingw32-pcre-static
|
||||
Static version of the mingw32-pcre library.
|
||||
|
||||
# Win64
|
||||
%package -n mingw64-pcre
|
||||
Summary: MinGW Windows pcre library
|
||||
Requires: pkgconfig
|
||||
|
||||
%description -n mingw64-pcre
|
||||
Cross compiled Perl-compatible regular expression library for use with mingw64.
|
||||
|
||||
PCRE has its own native API, but a set of "wrapper" functions that are based on
|
||||
the POSIX API are also supplied in the library libpcreposix. Note that this
|
||||
just provides a POSIX calling interface to PCRE: the regular expressions
|
||||
themselves still follow Perl syntax and semantics. The header file
|
||||
for the POSIX-style functions is called pcreposix.h.
|
||||
|
||||
%package -n mingw64-pcre-static
|
||||
Summary: Static version of the mingw64-pcre library
|
||||
Requires: mingw64-pcre = %{version}-%{release}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n mingw64-pcre-static
|
||||
Static version of the mingw64-pcre library.
|
||||
|
||||
|
||||
%?mingw_debug_package
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -S git_am -n pcre-%{version}
|
||||
|
||||
|
||||
%build
|
||||
%mingw_configure --enable-utf8 --enable-unicode-properties --enable-static --enable-pcre8 --enable-pcre16 --enable-pcre32
|
||||
%mingw_make %{?_smp_mflags}
|
||||
|
||||
|
||||
%install
|
||||
%mingw_make DESTDIR=$RPM_BUILD_ROOT install
|
||||
|
||||
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/doc/*
|
||||
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/doc/*
|
||||
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/man/*
|
||||
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/man/*
|
||||
|
||||
# Drop all .la files
|
||||
find $RPM_BUILD_ROOT -name "*.la" -delete
|
||||
|
||||
|
||||
# Win32
|
||||
%files -n mingw32-pcre
|
||||
%doc AUTHORS COPYING LICENCE NEWS README ChangeLog
|
||||
%{mingw32_bindir}/pcre-config
|
||||
%{mingw32_bindir}/pcregrep.exe
|
||||
%{mingw32_bindir}/pcretest.exe
|
||||
%{mingw32_bindir}/libpcre-1.dll
|
||||
%{mingw32_bindir}/libpcre16-0.dll
|
||||
%{mingw32_bindir}/libpcre32-0.dll
|
||||
%{mingw32_bindir}/libpcrecpp-0.dll
|
||||
%{mingw32_bindir}/libpcreposix-0.dll
|
||||
%{mingw32_libdir}/libpcre.dll.a
|
||||
%{mingw32_libdir}/libpcre16.dll.a
|
||||
%{mingw32_libdir}/libpcre32.dll.a
|
||||
%{mingw32_libdir}/libpcrecpp.dll.a
|
||||
%{mingw32_libdir}/libpcreposix.dll.a
|
||||
%{mingw32_libdir}/pkgconfig/libpcre.pc
|
||||
%{mingw32_libdir}/pkgconfig/libpcre16.pc
|
||||
%{mingw32_libdir}/pkgconfig/libpcre32.pc
|
||||
%{mingw32_libdir}/pkgconfig/libpcrecpp.pc
|
||||
%{mingw32_libdir}/pkgconfig/libpcreposix.pc
|
||||
%{mingw32_includedir}/pcre.h
|
||||
%{mingw32_includedir}/pcre_scanner.h
|
||||
%{mingw32_includedir}/pcre_stringpiece.h
|
||||
%{mingw32_includedir}/pcrecpp.h
|
||||
%{mingw32_includedir}/pcrecpparg.h
|
||||
%{mingw32_includedir}/pcreposix.h
|
||||
|
||||
%files -n mingw32-pcre-static
|
||||
%{mingw32_libdir}/libpcre.a
|
||||
%{mingw32_libdir}/libpcre16.a
|
||||
%{mingw32_libdir}/libpcre32.a
|
||||
%{mingw32_libdir}/libpcrecpp.a
|
||||
%{mingw32_libdir}/libpcreposix.a
|
||||
|
||||
# Win64
|
||||
%files -n mingw64-pcre
|
||||
%doc AUTHORS COPYING LICENCE NEWS README ChangeLog
|
||||
%{mingw64_bindir}/pcre-config
|
||||
%{mingw64_bindir}/pcregrep.exe
|
||||
%{mingw64_bindir}/pcretest.exe
|
||||
%{mingw64_bindir}/libpcre-1.dll
|
||||
%{mingw64_bindir}/libpcre16-0.dll
|
||||
%{mingw64_bindir}/libpcre32-0.dll
|
||||
%{mingw64_bindir}/libpcrecpp-0.dll
|
||||
%{mingw64_bindir}/libpcreposix-0.dll
|
||||
%{mingw64_libdir}/libpcre.dll.a
|
||||
%{mingw64_libdir}/libpcre16.dll.a
|
||||
%{mingw64_libdir}/libpcre32.dll.a
|
||||
%{mingw64_libdir}/libpcrecpp.dll.a
|
||||
%{mingw64_libdir}/libpcreposix.dll.a
|
||||
%{mingw64_libdir}/pkgconfig/libpcre.pc
|
||||
%{mingw64_libdir}/pkgconfig/libpcre16.pc
|
||||
%{mingw64_libdir}/pkgconfig/libpcre32.pc
|
||||
%{mingw64_libdir}/pkgconfig/libpcrecpp.pc
|
||||
%{mingw64_libdir}/pkgconfig/libpcreposix.pc
|
||||
%{mingw64_includedir}/pcre.h
|
||||
%{mingw64_includedir}/pcre_scanner.h
|
||||
%{mingw64_includedir}/pcre_stringpiece.h
|
||||
%{mingw64_includedir}/pcrecpp.h
|
||||
%{mingw64_includedir}/pcrecpparg.h
|
||||
%{mingw64_includedir}/pcreposix.h
|
||||
|
||||
%files -n mingw64-pcre-static
|
||||
%{mingw64_libdir}/libpcre.a
|
||||
%{mingw64_libdir}/libpcre16.a
|
||||
%{mingw64_libdir}/libpcre32.a
|
||||
%{mingw64_libdir}/libpcrecpp.a
|
||||
%{mingw64_libdir}/libpcreposix.a
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 8.43-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 8.43-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Tue Oct 08 2019 Sandro Mani <manisandro@gmail.com> - 8.43-2
|
||||
- Rebuild (Changes/Mingw32GccDwarf2)
|
||||
|
||||
* Wed Aug 14 2019 Marc-André Lureau <marcandre.lureau@redhat.com> - 8.43-1
|
||||
- New upstream release 8.43
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 8.38-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 8.38-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 8.38-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 8.38-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8.38-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8.38-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Sat Feb 6 2016 Erik van Pienbroek <epienbro@fedoraproject.org> - 8.38-1
|
||||
- Update to 8.38
|
||||
- Fixes various CVE's:
|
||||
RHBZ #1236660, #1249905, #1250947, #1256453, #1256454, #1287616,
|
||||
RHBZ #1287619, #1287626, #1287628, #1287631, #1287634, #1287640,
|
||||
RHBZ #1287642, #1287648, #1287650, #1287656, #1287658, #1287661,
|
||||
RHBZ #1287663, #1287668, #1287670, #1287673, #1287675, #1287692,
|
||||
RHBZ #1287694, #1287698, #1287700, #1287704, #1287706, #1287720,
|
||||
RHBZ #1287722
|
||||
|
||||
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 8.36-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.36-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Thu Dec 25 2014 Yaakov Selkowitz <yselkowi@redhat.com> - 8.36-1
|
||||
- Update to 8.36
|
||||
- Add upstream patches from main pcre package
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.34-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Sat Jan 25 2014 Erik van Pienbroek <epienbro@fedoraproject.org> - 8.34-1
|
||||
- Update to 8.34
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.33-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Thu Jul 11 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 8.33-2
|
||||
- Added -static subpackages
|
||||
|
||||
* Wed Jul 3 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 8.33-1
|
||||
- Update to 8.33
|
||||
- Added the configure arguments --enable-pcre8 --enable-pcre16 --enable-pcre32
|
||||
(the pcre16 one is needed by mingw-qt5-qtbase)
|
||||
- Use a more verbose filelist
|
||||
|
||||
* Sun Mar 24 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 8.32-1
|
||||
- Update to 8.32
|
||||
|
||||
* Sun Jan 27 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 8.31-2
|
||||
- Rebuild against mingw-gcc 4.8 (win64 uses SEH exceptions now)
|
||||
|
||||
* Wed Nov 21 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 8.31-1
|
||||
- Update to 8.31
|
||||
- Dropped patch as it doesn't have any effect on the mingw target
|
||||
|
||||
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.30-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Sat Apr 14 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 8.30-9
|
||||
- Update to 8.30
|
||||
- Added win64 support
|
||||
|
||||
* Fri Mar 09 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 8.10-8
|
||||
- Dropped .la files
|
||||
|
||||
* Wed Mar 07 2012 Kalev Lember <kalevlember@gmail.com> - 8.10-7
|
||||
- Renamed the source package to mingw-pcre (#801011)
|
||||
- Modernize the spec file
|
||||
- Use mingw macros without leading underscore
|
||||
|
||||
* Mon Feb 27 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 8.10-6
|
||||
- Rebuild against the mingw-w64 toolchain
|
||||
|
||||
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.10-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Fri Apr 22 2011 Kalev Lember <kalev@smartlink.ee> - 8.10-4
|
||||
- Rebuilt for pseudo-reloc version mismatch (#698827)
|
||||
|
||||
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.10-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Mon Sep 20 2010 Adam Stokes <astokes@redhat.com> - 8.10-2
|
||||
- Restore changes from the native package to pass package review process
|
||||
|
||||
* Wed Jul 21 2010 Ryan O'Hara <rohara@redhat.com> - 8.10-1
|
||||
- Initial spec file.
|
48
pcre-8.32-refused_spelling_terminated.patch
Normal file
48
pcre-8.32-refused_spelling_terminated.patch
Normal file
@ -0,0 +1,48 @@
|
||||
From 6f8b68f2740f3100154342338ed3d26e676dae69 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Mon, 7 Feb 2011 11:37:09 +0100
|
||||
Subject: [PATCH] Fix spelling in pcretest(1) manual
|
||||
|
||||
I kept some non-dictionary words to be consistent.
|
||||
Credits to John Bradshaw.
|
||||
|
||||
Spelling refused by upstream <http://bugs.exim.org/show_bug.cgi?id=1081#c3>:
|
||||
|
||||
I have applied these patches, except for "termi-nated", because my
|
||||
Collins dictionary of spelling and word division shows "termin-ate" and
|
||||
"termin-ating". I do know that there is a cultural difference between
|
||||
British and American hyphenation conventions; I try to follow the
|
||||
British ones, as exemplified in the Collins.
|
||||
---
|
||||
doc/pcretest.1 | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/doc/pcretest.1 b/doc/pcretest.1
|
||||
index 41ef6ac..258a62f 100644
|
||||
--- a/doc/pcretest.1
|
||||
+++ b/doc/pcretest.1
|
||||
@@ -601,8 +601,8 @@ recognized:
|
||||
after a successful match (number less than 32)
|
||||
.\" JOIN
|
||||
\eCname call pcre[16|32]_copy_named_substring() for substring
|
||||
- "name" after a successful match (name termin-
|
||||
- ated by next non alphanumeric character)
|
||||
+ "name" after a successful match (name terminated
|
||||
+ by next non alphanumeric character)
|
||||
.\" JOIN
|
||||
\eC+ show the current captured substrings at callout
|
||||
time
|
||||
@@ -623,8 +623,8 @@ recognized:
|
||||
after a successful match (number less than 32)
|
||||
.\" JOIN
|
||||
\eGname call pcre[16|32]_get_named_substring() for substring
|
||||
- "name" after a successful match (name termin-
|
||||
- ated by next non-alphanumeric character)
|
||||
+ "name" after a successful match (name terminated
|
||||
+ by next non-alphanumeric character)
|
||||
.\" JOIN
|
||||
\eJdd set up a JIT stack of dd kilobytes maximum (any
|
||||
number of digits)
|
||||
--
|
||||
1.7.11.7
|
||||
|
34
pcre-8.41-fix_stack_estimator.patch
Normal file
34
pcre-8.41-fix_stack_estimator.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From 0ad3618f226deee531bcced057afa1b52d5b41f5 Mon Sep 17 00:00:00 2001
|
||||
From: Sergei Golubchik <vuvova@gmail.com>
|
||||
Date: Wed, 14 Aug 2019 12:09:30 +0400
|
||||
Subject: [PATCH] Fix recursion stack estimator
|
||||
|
||||
Due to inlining match() by recent GCC, the stack estimator reported 4-bytes
|
||||
stack consumption.
|
||||
|
||||
Author: Sergei Golubchik <vuvova@gmail.com>
|
||||
<https://bugs.exim.org/show_bug.cgi?id=2173>
|
||||
---
|
||||
pcre_exec.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/pcre_exec.c b/pcre_exec.c
|
||||
index 3fd58cb..2b4d704 100644
|
||||
--- a/pcre_exec.c
|
||||
+++ b/pcre_exec.c
|
||||
@@ -509,6 +509,12 @@ Returns: MATCH_MATCH if matched ) these values are >= 0
|
||||
(e.g. stopped by repeated call or recursion limit)
|
||||
*/
|
||||
|
||||
+#ifdef __GNUC__
|
||||
+static int
|
||||
+match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,
|
||||
+ PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,
|
||||
+ unsigned int rdepth) __attribute__((noinline,noclone));
|
||||
+#endif
|
||||
static int
|
||||
match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,
|
||||
PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,
|
||||
--
|
||||
2.23.0.rc1
|
||||
|
@ -0,0 +1,161 @@
|
||||
From f1e9a32ee7fad2263636a51536ce0f9f13f09949 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Wed, 23 Jan 2019 10:16:20 +0100
|
||||
Subject: [PATCH] Declare POSIX regex function names as macros to PCRE
|
||||
functions
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
POSIX regex libraries differ in regex_t size. If a program includes
|
||||
<pcreposix.h>, but is not linked to pcreposix library at run-time
|
||||
(either in effect of --as-needed or a lazy binding in dlopen)
|
||||
other implementation touches memory out of the structure and the
|
||||
program can crash.
|
||||
|
||||
That means once a program includes <pcreposix.h>, it must link to the
|
||||
pcreposix library.
|
||||
|
||||
This patch replaces the POSIX regex declaration with macros to the
|
||||
PCRE uniqely-named function. This ensures that the PCRE's regex_t
|
||||
structure is always handled by the PCRE functions.
|
||||
|
||||
This patch still preserves the POSIX regex definitions in order to
|
||||
preseve ABI with application compiled before this change. The
|
||||
definition can be removed in the future.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
pcreposix.c | 50 +++++++++++++++++++++++++++++++++++++++++++++-----
|
||||
pcreposix.h | 20 ++++++++++++++------
|
||||
2 files changed, 59 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/pcreposix.c b/pcreposix.c
|
||||
index a76d6bf..3f2f3ef 100644
|
||||
--- a/pcreposix.c
|
||||
+++ b/pcreposix.c
|
||||
@@ -39,7 +39,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
/* This module is a wrapper that provides a POSIX API to the underlying PCRE
|
||||
-functions. */
|
||||
+functions. The operative functions are called pcre_regcomp(), etc., with
|
||||
+wrappers that use the plain POSIX names. This makes it easier for an
|
||||
+application to be sure it gets the PCRE versions in the presence of other
|
||||
+POSIX regex libraries. */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -204,12 +207,49 @@ static const char *const pstring[] = {
|
||||
|
||||
|
||||
/*************************************************
|
||||
-* Translate error code to string *
|
||||
+* Wrappers with traditional POSIX names *
|
||||
*************************************************/
|
||||
|
||||
+/* Keep defining them to preseve ABI with application linked to pcreposix
|
||||
+ * library before they were changed into macros. */
|
||||
+
|
||||
+#undef regerror
|
||||
PCREPOSIX_EXP_DEFN size_t PCRE_CALL_CONVENTION
|
||||
regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
|
||||
{
|
||||
+return pcre_regerror(errcode, preg, errbuf, errbuf_size);
|
||||
+}
|
||||
+
|
||||
+#undef regfree
|
||||
+PCREPOSIX_EXP_DEFN void PCRE_CALL_CONVENTION
|
||||
+regfree(regex_t *preg)
|
||||
+{
|
||||
+pcre_regfree(preg);
|
||||
+}
|
||||
+
|
||||
+#undef regcomp
|
||||
+PCREPOSIX_EXP_DEFN int PCRE_CALL_CONVENTION
|
||||
+regcomp(regex_t *preg, const char *pattern, int cflags)
|
||||
+{
|
||||
+return pcre_regcomp(preg, pattern, cflags);
|
||||
+}
|
||||
+
|
||||
+#undef regexec
|
||||
+PCREPOSIX_EXP_DEFN int PCRE_CALL_CONVENTION
|
||||
+regexec(const regex_t *preg, const char *string, size_t nmatch,
|
||||
+ regmatch_t pmatch[], int eflags)
|
||||
+{
|
||||
+return pcre_regexec(preg, string, nmatch, pmatch, eflags);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*************************************************
|
||||
+* Translate error code to string *
|
||||
+*************************************************/
|
||||
+
|
||||
+PCREPOSIX_EXP_DEFN size_t PCRE_CALL_CONVENTION
|
||||
+pcre_regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
|
||||
+{
|
||||
const char *message, *addmessage;
|
||||
size_t length, addlength;
|
||||
|
||||
@@ -243,7 +283,7 @@ return length + addlength;
|
||||
*************************************************/
|
||||
|
||||
PCREPOSIX_EXP_DEFN void PCRE_CALL_CONVENTION
|
||||
-regfree(regex_t *preg)
|
||||
+pcre_regfree(regex_t *preg)
|
||||
{
|
||||
(PUBL(free))(preg->re_pcre);
|
||||
}
|
||||
@@ -266,7 +306,7 @@ Returns: 0 on success
|
||||
*/
|
||||
|
||||
PCREPOSIX_EXP_DEFN int PCRE_CALL_CONVENTION
|
||||
-regcomp(regex_t *preg, const char *pattern, int cflags)
|
||||
+pcre_regcomp(regex_t *preg, const char *pattern, int cflags)
|
||||
{
|
||||
const char *errorptr;
|
||||
int erroffset;
|
||||
@@ -320,7 +360,7 @@ be set. When this is the case, the nmatch and pmatch arguments are ignored, and
|
||||
the only result is yes/no/error. */
|
||||
|
||||
PCREPOSIX_EXP_DEFN int PCRE_CALL_CONVENTION
|
||||
-regexec(const regex_t *preg, const char *string, size_t nmatch,
|
||||
+pcre_regexec(const regex_t *preg, const char *string, size_t nmatch,
|
||||
regmatch_t pmatch[], int eflags)
|
||||
{
|
||||
int rc, so, eo;
|
||||
diff --git a/pcreposix.h b/pcreposix.h
|
||||
index c77c0b0..6f108b8 100644
|
||||
--- a/pcreposix.h
|
||||
+++ b/pcreposix.h
|
||||
@@ -131,13 +131,21 @@ file. */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
-/* The functions */
|
||||
-
|
||||
-PCREPOSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
|
||||
-PCREPOSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
|
||||
+/* The functions. The actual code is in functions with pcre_xxx names for
|
||||
+uniqueness. POSIX names are provided for API compatibility with POSIX regex
|
||||
+functions. It's done this way to ensure to they are always get from the
|
||||
+PCRE library and not by accident from elsewhere. (regex_t differs in size
|
||||
+elsewhere.) */
|
||||
+
|
||||
+PCREPOSIX_EXP_DECL int pcre_regcomp(regex_t *, const char *, int);
|
||||
+#define regcomp pcre_regcomp
|
||||
+PCREPOSIX_EXP_DECL int pcre_regexec(const regex_t *, const char *, size_t,
|
||||
regmatch_t *, int);
|
||||
-PCREPOSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
|
||||
-PCREPOSIX_EXP_DECL void regfree(regex_t *);
|
||||
+#define regexec pcre_regexec
|
||||
+PCREPOSIX_EXP_DECL size_t pcre_regerror(int, const regex_t *, char *, size_t);
|
||||
+#define regerror pcre_regerror
|
||||
+PCREPOSIX_EXP_DECL void pcre_regfree(regex_t *);
|
||||
+#define regfree pcre_regfree
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
--
|
||||
2.17.2
|
||||
|
@ -0,0 +1,28 @@
|
||||
From f74e04f2d8755fdd5cf5e387735593354972ad23 Mon Sep 17 00:00:00 2001
|
||||
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
||||
Date: Thu, 23 May 2019 16:27:33 +0000
|
||||
Subject: [PATCH] Fix omission of (*LF) from list in the C++ wrapper.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1753 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
||||
Petr Písař: Ported to 8.43.
|
||||
---
|
||||
pcrecpp.cc | 1 +
|
||||
|
||||
diff --git a/pcrecpp.cc b/pcrecpp.cc
|
||||
index 6a3eff8..0d6b140 100644
|
||||
--- a/pcrecpp.cc
|
||||
+++ b/pcrecpp.cc
|
||||
@@ -92,6 +92,7 @@ static const char *start_options[] = {
|
||||
"(*LIMIT_RECURSION=",
|
||||
"(*LIMIT_MATCH=",
|
||||
"(*CRLF)",
|
||||
+ "(*LF)",
|
||||
"(*CR)",
|
||||
"(*BSR_UNICODE)",
|
||||
"(*BSR_ANYCRLF)",
|
||||
--
|
||||
2.20.1
|
||||
|
Loading…
Reference in New Issue
Block a user