summaryrefslogtreecommitdiff
path: root/devel/ocaml-annexlib/files/patch-glob.ml
blob: e4afaa33407474352ef27913e239ebf0cffad7a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- glob.ml.orig	2006-02-23 06:34:35 UTC
+++ glob.ml
@@ -100,13 +100,13 @@ let rec optimize_pattern pat res =
 	let s = String.create 2 in
 	  s.[0] <- c2;
 	  s.[1] <- c1;
-	  optimize_pattern (String s :: cdr) res
+	  optimize_pattern (String (Bytes.unsafe_to_string s) :: cdr) res
     | String s :: Char c :: cdr ->
 	let len = String.length s in
 	let ns = String.create (len + 1) in
 	  ns.[0] <- c;
 	  String.blit s 0 ns 1 (String.length s);
-	  optimize_pattern (String ns :: cdr) res
+	  optimize_pattern (String (Bytes.unsafe_to_string ns) :: cdr) res
     | Star :: Star :: cdr -> optimize_pattern (Star :: cdr) res
     | cons :: cdr  -> optimize_pattern cdr (cons :: res)
 
@@ -245,7 +245,7 @@ let quote_str s =
     | c ->
         buf.[!pos] <- c; pos := !pos + 1
   done;
-  String.sub buf 0 !pos
+  Bytes.sub_string buf 0 !pos
 
 let rec conv_str buf pat =
   match pat with