chiark / gitweb /
Import debian/ directory from 2:8.38-3.1
[pcre3.git] / debian / patches / PCRE6_compatible_API.patch
diff --git a/debian/patches/PCRE6_compatible_API.patch b/debian/patches/PCRE6_compatible_API.patch
new file mode 100644 (file)
index 0000000..f13a763
--- /dev/null
@@ -0,0 +1,40 @@
+From: Mark Baker <mark@mnb.org.uk>
+Description: Include old interface to RE::Init() for PCRE 6.x compatibility
+
+--- a/pcrecpp.cc
++++ b/pcrecpp.cc
+@@ -80,6 +80,12 @@
+ // If the user doesn't ask for any options, we just use this one
+ static RE_Options default_options;
++// PCRE6.x compatible API
++void RE::Init(const char *c_pat, const RE_Options* options) {
++  const string cxx_pat(c_pat);
++  Init(cxx_pat, options);
++}
++
+ void RE::Init(const string& pat, const RE_Options* options) {
+   pattern_ = pat;
+   if (options == NULL) {
+--- a/pcrecpp.h
++++ b/pcrecpp.h
+@@ -658,6 +658,8 @@
+  private:
+   void Init(const string& pattern, const RE_Options* options);
++  // Old version from PCRE 6.x, for compatibility
++  void Init(const char *pattern, const RE_Options* options);
+   void Cleanup();
+   // Match against "text", filling in "vec" (up to "vecsize" * 2/3) with
+--- a/pcretest.c
++++ b/pcretest.c
+@@ -2976,7 +2976,7 @@
+ {
+ FILE *infile = stdin;
+ const char *version;
+-int options = 0;
++long int options = 0;
+ int study_options = 0;
+ int default_find_match_limit = FALSE;
+ pcre_uint32 default_options = 0;