1 From f61b5859d69c2d99264182f60f5ae1e430812b59 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Petr=20=C5=A0abata?= <contyk@redhat.com>
3 Date: Fri, 10 Feb 2012 13:55:46 +0100
4 Subject: [PATCH] Fix build with PCRE-8.30+
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 This patch fixes build with the latest PCRE release which removes some
10 obsolete code tinyfugue still uses, namely pcre_info().
12 Signed-off-by: Petr Ĺ abata <contyk@redhat.com>
17 3 files changed, 4 insertions(+), 3 deletions(-)
19 diff --git a/src/macro.c b/src/macro.c
20 index ac28fc9..b492717 100644
23 @@ -893,7 +893,8 @@ static int complete_macro(Macro *spec, unsigned int hash, int num,
25 spec->attr &= ~F_NONE;
27 - int n = pcre_info(spec->trig.ri->re, NULL, NULL);
29 + pcre_fullinfo(spec->trig.ri->re, NULL, PCRE_INFO_CAPTURECOUNT, &n);
30 for (i = 0; i < spec->nsubattr; i++) {
31 spec->subattr[i].attr &= ~F_NONE;
32 if (spec->subattr[i].subexp > n) {
33 diff --git a/src/pattern.c b/src/pattern.c
34 index 047a44a..a7228ff 100644
37 @@ -151,7 +151,7 @@ static RegInfo *tf_reg_compile_fl(const char *pattern, int optimize,
38 emsg ? emsg : "unknown error");
39 goto tf_reg_compile_error;
41 - n = pcre_info(ri->re, NULL, NULL);
42 + pcre_fullinfo(ri->re, NULL, PCRE_INFO_CAPTURECOUNT, &n);
43 if (n < 0) goto tf_reg_compile_error;
44 ri->ovecsize = 3 * (n + 1);
45 ri->ovector = dmalloc(NULL, sizeof(int) * ri->ovecsize, file, line);
46 diff --git a/src/pattern.h b/src/pattern.h
47 index 1eec0f9..cbe9af9 100644
54 -#include "pcre-2.08/pcre.h"
57 typedef struct RegInfo {