git: 0c9022ff6b73 - main - devel/ocaml-xstr: unbreak the build against safe strings in OCaml 4.06+

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Fri, 04 Feb 2022 16:05:59 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0c9022ff6b73ee9e48aec7a545d9db31e16a11f4

commit 0c9022ff6b73ee9e48aec7a545d9db31e16a11f4
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-02-04 16:05:04 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-02-04 16:05:04 +0000

    devel/ocaml-xstr: unbreak the build against safe strings in OCaml 4.06+
    
    Obtained from:  Debian
---
 devel/ocaml-xstr/files/patch-xstr__match.ml  | 26 ++++++++++++++++++++++++++
 devel/ocaml-xstr/files/patch-xstr__search.ml | 11 +++++++++++
 2 files changed, 37 insertions(+)

diff --git a/devel/ocaml-xstr/files/patch-xstr__match.ml b/devel/ocaml-xstr/files/patch-xstr__match.ml
new file mode 100644
index 000000000000..1af5534357d2
--- /dev/null
+++ b/devel/ocaml-xstr/files/patch-xstr__match.ml
@@ -0,0 +1,26 @@
+--- xstr_match.ml.orig	2002-07-07 11:27:16 UTC
++++ xstr_match.ml
+@@ -137,12 +137,12 @@ let noword_set() =
+     
+ 
+ let set_as_string set =
+-  let s = String.make 32 ' ' in
++  let s = Bytes.make 32 ' ' in
+   for i = 0 to 15 do
+     s.[i+i]   <- Char.chr (set.(i) land 0xff);
+     s.[i+i+1] <- Char.chr (set.(i) lsr 8);
+   done;
+-  s
++  Bytes.to_string s
+ ;;
+ 
+ 
+@@ -592,7 +592,7 @@ let replace_matched_substrings ml rl fl s =
+   let length = total_length 0 transformer in
+   let target = String.create length in
+   form_replacement_ltor target transformer length;
+-  target, !n_repl
++  Bytes.to_string target, !n_repl
+ ;;
+   
+ 
diff --git a/devel/ocaml-xstr/files/patch-xstr__search.ml b/devel/ocaml-xstr/files/patch-xstr__search.ml
new file mode 100644
index 000000000000..00ccee7fe661
--- /dev/null
+++ b/devel/ocaml-xstr/files/patch-xstr__search.ml
@@ -0,0 +1,11 @@
+--- xstr_search.ml.orig	1999-06-27 23:03:38 UTC
++++ xstr_search.ml
+@@ -119,7 +119,7 @@ let rev_concat sep sl =
+   in
+ 
+   fill_in len sl;
+-  t
++  Bytes.to_string t
+ ;;
+ 
+