Unbundle pcre-2.08 (duh) and patch for 8.30

This commit is contained in:
Petr Šabata 2012-02-10 13:40:43 +01:00
parent 5eadff83c7
commit b34ee3f4aa
2 changed files with 46 additions and 2 deletions

40
tf-50b8.pcre.patch Normal file
View File

@ -0,0 +1,40 @@
diff --git a/src/macro.c b/src/macro.c
index ac28fc9..b847d09 100644
--- a/src/macro.c
+++ b/src/macro.c
@@ -893,7 +893,8 @@ static int complete_macro(Macro *spec, unsigned int hash, int num,
}
spec->attr &= ~F_NONE;
if (spec->nsubattr) {
- int n = pcre_info(spec->trig.ri->re, NULL, NULL);
+ int n;
+ pcre_fullinfo(spec->trig.ri->re, NULL, PCRE_INFO_CAPTURECOUNT, &n);
for (i = 0; i < spec->nsubattr; i++) {
spec->subattr[i].attr &= ~F_NONE;
if (spec->subattr[i].subexp > n) {
diff --git a/src/pattern.c b/src/pattern.c
index 047a44a..f1b22ed 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -151,7 +151,7 @@ static RegInfo *tf_reg_compile_fl(const char *pattern, int optimize,
emsg ? emsg : "unknown error");
goto tf_reg_compile_error;
}
- n = pcre_info(ri->re, NULL, NULL);
+ pcre_fullinfo(ri->re, NULL, PCRE_INFO_CAPTURECOUNT, &n);
if (n < 0) goto tf_reg_compile_error;
ri->ovecsize = 3 * (n + 1);
ri->ovector = dmalloc(NULL, sizeof(int) * ri->ovecsize, file, line);
diff --git a/src/pattern.h b/src/pattern.h
index 1eec0f9..cbe9af9 100644
--- a/src/pattern.h
+++ b/src/pattern.h
@@ -10,7 +10,7 @@
#ifndef PATTERN_H
#define PATTERN_H
-#include "pcre-2.08/pcre.h"
+#include <pcre.h>
typedef struct RegInfo {
pcre *re;

View File

@ -10,6 +10,7 @@ URL: http://tinyfugue.sourceforge.net/
Source: http://downloads.sourceforge.net/tinyfugue/tf-%{packageversion}.tar.gz
Patch0: tf-50b7.build.patch
Patch1: tf-50b8.x86_64.patch
Patch2: tf-50b8.pcre.patch
BuildRequires: ncurses-devel
BuildRequires: pcre-devel
BuildRequires: openssl-devel
@ -25,6 +26,9 @@ macros, and create hooks and triggers for automated responses to game messages.
%patch0 -p1
# x86_64 fix (#743468)
%patch1 -p1
# Unbundle the old PCRE and update to 8.30
%patch2 -p1
rm -rf src/pcre-2.08
%build
%configure --enable-core
@ -42,8 +46,8 @@ install -D -p -m 644 src/tf.1.nroffman %{buildroot}%{_mandir}/man1/tf.1
%{_mandir}/man1/tf.1*
%changelog
* Fri Feb 10 2012 Petr Pisar <ppisar@redhat.com> - 5.0-0.17.b8
- Rebuild against PCRE 8.30
* Fri Feb 10 2012 Petr Šabata <contyk@redhat.com> - 5.0-0.17.b8
- Unbundle pcre-2.08 (duh) and patch for 8.30
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0-0.16.b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild