Commits

Anonymous committed 3457ec5 Draft

string_map for ocaml<4

  • Participants
  • Parent commits 2a088a2

Comments (0)

Files changed (1)

File src/post_template.ml

     ; assure_dir buildconf_work_src
     )
 
+  let string_map f s =
+    let s = String.copy s in
+    let imax = String.length s - 1 in
+    let () =
+      for i = 0 to imax
+      do
+        s.[i] <- f s.[i]
+      done
+    in
+      s
+
   let work_dir_of_pkg_name n =
-    String.map
+    string_map
       (fun c ->
          match c with
          | 'a'..'z' | 'A'..'Z' | '0'..'9' | '_' | '-' -> c