From: Stefano Zacchiroli Date: Sat, 22 Jun 2002 16:52:57 +0000 (+0000) Subject: bug fix: wrapped some possible List.{hd,tl} failures raising an X-Git-Tag: V_0_3_0_debian_8~25 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=4ca6931c82f97ad8bc87b1cf7086a06dbedde591;p=helm.git bug fix: wrapped some possible List.{hd,tl} failures raising an IllFormedUri exception --- diff --git a/helm/ocaml/urimanager/uriManager.ml b/helm/ocaml/urimanager/uriManager.ml index 0fa24cfcd..f45e65bf3 100644 --- a/helm/ocaml/urimanager/uriManager.ml +++ b/helm/ocaml/urimanager/uriManager.ml @@ -96,7 +96,11 @@ let mk_prefixes str = in let tokens = (Str.split (Str.regexp "/") str) in (* ty = "cic:" *) - let (ty, sp) = (List.hd tokens, List.tl tokens) in + let (ty, sp) = + (try (List.hd tokens, List.tl tokens) + with Failure "hd" | Failure "tl" -> + raise (IllFormedUri str)) + in aux ty sp ;;