X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Focaml%2Fextlib%2FhExtlib.ml;h=5f96e0f84e7fad3237394a835e68dfafe1311b31;hb=742332c845b599fbdaa86a02e21a5f223a4783f9;hp=15a459cdc0f1243c44d0017e6e1bffab0f5c0506;hpb=f28480139ee72d092a9405619c3bdf6d4ff155ee;p=helm.git diff --git a/helm/ocaml/extlib/hExtlib.ml b/helm/ocaml/extlib/hExtlib.ml index 15a459cdc..5f96e0f84 100644 --- a/helm/ocaml/extlib/hExtlib.ml +++ b/helm/ocaml/extlib/hExtlib.ml @@ -27,15 +27,14 @@ (** PROFILING *) -(* we should use a key in te registry, but we can't see the registry.. *) -let profiling_enabled = true +let profiling_enabled = ComponentsConf.profiling let profiling_printings = ref (fun () -> true) let set_profiling_printings f = profiling_printings := f type profiler = { profile : 'a 'b. ('a -> 'b) -> 'a -> 'b } let profile ?(enable = true) = - if profiling_enabled && enable then + if profiling_enabled && enable then function s -> let total = ref 0.0 in let profile f x = @@ -163,7 +162,8 @@ let mkdir path = let rec aux where = function | [] -> () | piece::tl -> - let path = where ^ "/" ^ piece in + let path = + if where = "" then piece else where ^ "/" ^ piece in (try Unix.mkdir path 0o755 with @@ -174,7 +174,8 @@ let mkdir path = ("Unix.mkdir " ^ path ^ " 0o755 :" ^ (Unix.error_message e)))); aux path tl in - aux "" components + let where = if path.[0] = '/' then "/" else "" in + aux where components (** {2 Filesystem} *)