Markus Mottl avatar Markus Mottl committed a0f0a04

Replaced String.trim function in myocamlbuild.ml

Comments (0)

Files changed (5)

+2012-07-16:  Replaced String.trim function in myocamlbuild.ml to allow
+             compiling with OCaml 3.12.1.
+
 2012-07-15:  New major release version 2.0.0:
 
                * Upgraded to OCaml 4.00
 OASISFormat:      0.3
 Name:             sqlite3-ocaml
-Version:          2.0.0
+Version:          2.0.1
 Synopsis:         sqlite3-ocaml - bindings to the SQLite3 library
 Description:      sqlite3-ocaml offers library functions for accessing SQLite3 database
 Authors:          Markus Mottl <markus.mottl@gmail.com>,
 # OASIS_START
-# DO NOT EDIT (digest: 768ffc47dbd6ef43be07a7e558592c70)
-version = "2.0.0"
+# DO NOT EDIT (digest: 351f3ace294279ab0bc82513b0aa4dc8)
+version = "2.0.1"
 description = "sqlite3-ocaml - bindings to the SQLite3 library"
 archive(byte) = "sqlite3.cma"
 archive(byte, plugin) = "sqlite3.cma"
   | Some pos -> String.before s pos :: split_string (String.after s (pos + 1))
   | None -> [s]
 
+(* string_trim taken from OCaml 4.00 standard library (String.trim) *)
+let is_space = function
+  | ' ' | '\012' | '\n' | '\r' | '\t' -> true
+  | _ -> false
+
+let string_trim s =
+  let len = String.length s in
+  let i = ref 0 in
+  while !i < len && is_space s.[!i] do incr i done;
+  let j = ref (len - 1) in
+  while !j >= !i && is_space s.[!j] do decr j done;
+  if !i = 0 && !j = len - 1 then s
+  else if !j >= !i then String.sub s !i (!j - !i + 1)
+  else ""
+
 let () =
   let additional_rules = function
     | After_rules ->
         let rec split_string s =
           match try Some (String.index s ' ') with Not_found -> None with
           | Some pos ->
-              let before = String.trim (String.before s pos) in
+              let before = string_trim (String.before s pos) in
               let after = String.after s (pos + 1) in
               if before = "" then split_string after
               else before :: split_string after
 (* setup.ml generated for the first time by OASIS v0.3.0 *)
 
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 7a42b31ae5df4578d21e08f1b8d2b9a6) *)
+(* DO NOT EDIT (digest: 9b6d7bd3aef3e48cf56e2b3538263a82) *)
 (*
    Regenerated by OASIS v0.3.0
    Visit http://oasis.forge.ocamlcore.org for more information and
           ocaml_version = Some (OASISVersion.VGreaterEqual "3.12");
           findlib_version = Some (OASISVersion.VGreaterEqual "1.3.2");
           name = "sqlite3-ocaml";
-          version = "2.0.0";
+          version = "2.0.1";
           license =
             OASISLicense.DEP5License
               (OASISLicense.DEP5Unit
           };
      oasis_fn = Some "_oasis";
      oasis_version = "0.3.0";
-     oasis_digest = Some "\149�\026ݰ\132\154���SG\000\007\"\138";
+     oasis_digest = Some "���\157\005��\bE���C/\153p";
      oasis_exec = None;
      oasis_setup_args = [];
      setup_update = false;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.