Bug#1000047: libsynthesis: depends on obsolete pcre3 library (2/2)
From
Bastian Germann@1:229/2 to
All on Wed Jun 11 11:30:02 2025
[continued from previous message]
+ "RegEx error at pattern pos %d: %s ",
+- errOffs,
+- errMsg ? errMsg : "<unknown>"
++ (int) errOffs,
++ *buffer ? (const char *) buffer : "<unknown>"
+ ));
+- return PCRE_ERROR_NULL; // -2, regexp did not compile
++ return PCRE2_ERROR_NULL; // -2, regexp did not compile
+ }
+ else {
++ pcre2_match_data *match_data;
+ // regExp is ok and can be executed against subject
+- int r = pcre_exec(regex, NULL, aSubject, aSubjLen, aSubjStart, 0, aOutVec, aOVSize);
+- pcre_free(regex);
++ match_data = pcre2_match_data_create_from_pattern(regex, NULL);
++ int r = pcre2_match(regex, (PCRE2_SPTR) aSubject, aSubjLen, 0, 0, match_data, NULL);
++ if (r > 0 && aOutVec != NULL) {
++ PCRE2_SIZE *ovector;
++ ovector = pcre2_get_ovector_pointer(match_data);
++ if (ovector[0] > ovector[1]) {
++ aOutVec[0] = ovector[1];
++ r = 1;
++ } else {
++ int ii;
++ for (ii = 0; ii < r && ii < aOVSize; ii++) {
++ aOutVec[ii] = (int) ovector[ii];
++ }
++ if (r > ii)
++ r = ii;
++ }
++ }
++ pcre2_match_data_free(match_data);
++ pcre2_code_free(regex);
+ return r;
+ }
+ } // run_pcre
diff -Nru libsynthesis-3.4.0.47.5+syncevolution-1.5.3/debian/patches/series libsynthesis-3.4.0.47.5+syncevolution-1.5.3/debian/patches/series
--- libsynthesis-3.4.0.47.5+syncevolution-1.5.3/debian/patches/series 2018-01-27 22:27:13.000000000 +0100
+++ libsynthesis-3.4.0.47.5+syncevolution-1.5.3/debian/patches/series 2025-06-11 00:38:40.000000000 +0200
@@ -1,2 +1,3 @@
# debian/source/git-patches exported from git by quilt-patches-deb-export-hook
0001-Make-sorting-independent-of-locale.patch
+0002-pcre2.patch
diff -Nru libsynthesis-3.4.0.47.5+syncevolution-1.5.3/debian/README.source libsynthesis-3.4.0.47.5+syncevolution-1.5.3/debian/README.source
--- libsynthesis-3.4.0.47.5+syncevolution-1.5.3/debian/README.source 2018-01-27 22:27:13.000000000 +0100
+++ libsynthesis-3.4.0.47.5+syncevolution-1.5.3/debian/README.source 1970-01-01 01:00:00.000000000 +0100
@@ -1,36 +0,0 @@
-Building libsynthesis for Debian
---------------------------------
-
-The source package needs no special instructions; the discussion here
-is about working with the git repository.
-
-Patches are exported based on debian/source/git-patches; each line is
-an argume