blob: 70f2ba5392b6001519b04d0ef38c300fa3a174c9 (
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
--- compiler/execute.ml.orig 2009-02-19 20:28:11 UTC
+++ compiler/execute.ml
@@ -18,11 +18,11 @@
let htmlc_command htmlc_add_string src_name ob command_name =
let ic = Unix.open_process_in command_name in
- let ib = String.create Configuration.line_buffer_length in
+ let ib = Bytes.create Configuration.line_buffer_length in
let status =
let rec loop () =
let n = input ic ib 0 Configuration.line_buffer_length in
- if n > 0 then (htmlc_add_string ob (String.sub ib 0 n); loop ())
+ if n > 0 then (htmlc_add_string ob (Bytes.sub_string ib 0 n); loop ())
else raise End_of_file in
try loop () with
| End_of_file ->
--- compiler/htmlc.ml.orig 2009-08-13 14:27:53 UTC
+++ compiler/htmlc.ml
@@ -236,11 +236,11 @@ let decimal_to_hexa i =
;;
let hexa_char c =
- let s = String.make 3 '%'
+ let s = Bytes.make 3 '%'
and i = int_of_char c in
s.[1] <- decimal_to_hexa (i / 16);
s.[2] <- decimal_to_hexa (i mod 16);
- s
+ Bytes.to_string s
;;
let url_encode ob s =
--- compiler/lib_strings.ml.orig 2008-11-05 10:42:35 UTC
+++ compiler/lib_strings.ml
@@ -95,25 +95,25 @@ let center_gen c s len_in =
let len_s = String.length s in
if len_in < len_s then not_enough_room "center" len_s len_in else
let idx = (len_in - len_s) / 2 in
- let b = String.make len_in c in
+ let b = Bytes.make len_in c in
String.blit s 0 b idx len_s;
- b;;
+ Bytes.to_string b;;
let center s len_in = center_gen ' ' s len_in;;
let flush_left_gen c s len_in =
let len_s = String.length s in
if len_in < len_s then not_enough_room "flush_left" len_s len_in else
let idx = 0 in
- let b = String.make len_in c in
+ let b = Bytes.make len_in c in
String.blit s 0 b idx len_s;
- b;;
+ Bytes.to_string b;;
let flush_left s len_in = flush_left_gen ' ' s len_in;;
let flush_right_gen c s len_in =
let len_s = String.length s in
if len_in < len_s then not_enough_room "flush_right" len_s len_in else
let idx = len_in - len_s in
- let b = String.make len_in c in
+ let b = Bytes.make len_in c in
String.blit s 0 b idx len_s;
- b;;
+ Bytes.to_string b;;
let flush_right s len_in = flush_right_gen ' ' s len_in;;
|