]> CyberLeo.Net >> Repos - CDN/cdn-ports-overlay.git/blob - cdn/ports/net/tinyfugue-unicode/files/patch-modern-pcre
net/tinyfugue-unicode: Tinyfugue with kruton unicode patch
[CDN/cdn-ports-overlay.git] / cdn / ports / net / tinyfugue-unicode / files / patch-modern-pcre
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+
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 This patch fixes build with the latest PCRE release which removes some
10 obsolete code tinyfugue still uses, namely pcre_info().
11
12 Signed-off-by: Petr Ĺ abata <contyk@redhat.com>
13 ---
14  src/macro.c   |    3 ++-
15  src/pattern.c |    2 +-
16  src/pattern.h |    2 +-
17  3 files changed, 4 insertions(+), 3 deletions(-)
18
19 diff --git a/src/macro.c b/src/macro.c
20 index ac28fc9..b492717 100644
21 --- src/macro.c
22 +++ src/macro.c
23 @@ -893,7 +893,8 @@ static int complete_macro(Macro *spec, unsigned int hash, int num,
24      }
25      spec->attr &= ~F_NONE;
26      if (spec->nsubattr) {
27 -       int n = pcre_info(spec->trig.ri->re, NULL, NULL);
28 +       int n;
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
35 --- src/pattern.c
36 +++ src/pattern.c
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;
40      }
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
48 --- src/pattern.h
49 +++ src/pattern.h
50 @@ -10,7 +10,7 @@
51  #ifndef PATTERN_H
52  #define PATTERN_H
53  
54 -#include "pcre-2.08/pcre.h"
55 +#include <pcre.h>
56  
57  typedef struct RegInfo {
58      pcre *re;
59 -- 
60 1.7.7.6
61