From 4ca6931c82f97ad8bc87b1cf7086a06dbedde591 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Sat, 22 Jun 2002 16:52:57 +0000 Subject: [PATCH] bug fix: wrapped some possible List.{hd,tl} failures raising an IllFormedUri exception --- helm/ocaml/urimanager/uriManager.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 ;; -- 2.39.2