chiark / gitweb /
pcre3 (1:8.30-5) unstable; urgency=low
[pcre3.git] / debian / patches / PCRE6_compatible_API.patch
1 From: Mark Baker <mark@mnb.org.uk>
2 Description: Include old interface to RE::Init() for PCRE 6.x compatibility
3
4 Index: pcre-8.30/pcrecpp.cc
5 ===================================================================
6 --- pcre-8.30.orig/pcrecpp.cc   2012-01-15 19:00:31.000000000 +0100
7 +++ pcre-8.30/pcrecpp.cc        2012-03-23 11:05:02.219693149 +0100
8 @@ -80,6 +80,12 @@
9  // If the user doesn't ask for any options, we just use this one
10  static RE_Options default_options;
11  
12 +// PCRE6.x compatible API
13 +void RE::Init(const char *c_pat, const RE_Options* options) {
14 +  const string cxx_pat(c_pat);
15 +  Init(cxx_pat, options);
16 +}
17 +
18  void RE::Init(const string& pat, const RE_Options* options) {
19    pattern_ = pat;
20    if (options == NULL) {
21 Index: pcre-8.30/pcrecpp.h
22 ===================================================================
23 --- pcre-8.30.orig/pcrecpp.h    2010-01-02 17:25:49.000000000 +0100
24 +++ pcre-8.30/pcrecpp.h 2012-03-23 11:05:02.223026534 +0100
25 @@ -658,6 +658,8 @@
26   private:
27  
28    void Init(const string& pattern, const RE_Options* options);
29 +  // Old version from PCRE 6.x, for compatibility
30 +  void Init(const char *pattern, const RE_Options* options);
31    void Cleanup();
32  
33    // Match against "text", filling in "vec" (up to "vecsize" * 2/3) with
34 Index: pcre-8.30/pcretest.c
35 ===================================================================
36 --- pcre-8.30.orig/pcretest.c   2012-02-04 15:35:53.000000000 +0100
37 +++ pcre-8.30/pcretest.c        2012-03-23 11:05:02.233026691 +0100
38 @@ -2152,7 +2152,7 @@
39  {
40  FILE *infile = stdin;
41  const char *version;
42 -int options = 0;
43 +long int options = 0;
44  int study_options = 0;
45  int default_find_match_limit = FALSE;
46  int op = 1;