[med-svn] [Git][med-team/phast][master] Fix pcre2 patch

Andreas Tille (@tille) gitlab at salsa.debian.org
Fri Nov 19 12:11:41 GMT 2021



Andreas Tille pushed to branch master at Debian Med / phast


Commits:
b829d862 by Andreas Tille at 2021-11-19T13:11:22+01:00
Fix pcre2 patch

- - - - -


1 changed file:

- debian/patches/pcre2.patch


Changes:

=====================================
debian/patches/pcre2.patch
=====================================
@@ -126,7 +126,10 @@
 -int str_re_match_sub(String *s, Regex *re, List *l, int offset, int nsubexp, 
 +int str_re_match_sub(String *s, pcre2_code *re, List *l, int offset, int nsubexp, 
  		     int *first_match) {
-   int i, len, rc, ovector[OVECCOUNT], rv;
+-  int i, len, rc, ovector[OVECCOUNT], rv;
++  int i, len, rc, rv;
++  PCRE2_SIZE *ovector;
++
    String *substr;
 +  pcre2_match_data *match_data = pcre2_match_data_create(OVECCOUNT, NULL);
  
@@ -138,12 +141,10 @@
 -  rc = pcre_exec(re, NULL, s->chars, s->length, offset, 0, ovector, OVECCOUNT);
 -  if (rc == PCRE_ERROR_NOMATCH) return -1;
 +  rc = pcre2_match(re, s->chars, s->length, offset, 0, match_data, NULL);
-+  /* FIXME: The following code is broken and needs to be ported properly
-+   *        to replace ovector used by pcre3 by match_data as in pcre2.
-+   */
 +  if (rc == PCRE2_ERROR_NOMATCH) return -1;
    if (rc < 0) return -2;  //any other error
    if (first_match != NULL) (*first_match) = ovector[0];
++  ovector = pcre2_get_ovector_pointer(match_data);
    rv = ovector[1]-ovector[0];
    if (rc >= 0 && l != NULL) {
      if (rc == 0) {



View it on GitLab: https://salsa.debian.org/med-team/phast/-/commit/b829d862de1622cab13628b79414e3e52b8e9ca1

-- 
View it on GitLab: https://salsa.debian.org/med-team/phast/-/commit/b829d862de1622cab13628b79414e3e52b8e9ca1
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20211119/2577a40d/attachment.htm>


More information about the debian-med-commit mailing list