From: Stefano Zacchiroli Date: Tue, 5 Jul 2005 05:57:02 +0000 (+0000) Subject: handle Not_found exception in extension X-Git-Tag: PRE_GETTER_STORAGE~1 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=a83e0e4b2cf4d0cd378b5f2f451aa857507e0a01;p=helm.git handle Not_found exception in extension --- diff --git a/helm/ocaml/getter/http_getter_misc.ml b/helm/ocaml/getter/http_getter_misc.ml index 4149d4603..0430c1b48 100644 --- a/helm/ocaml/getter/http_getter_misc.ml +++ b/helm/ocaml/getter/http_getter_misc.ml @@ -289,6 +289,8 @@ let rec list_uniq = function | h1::tl (* when h1 <> h2 *) -> h1 :: list_uniq tl let extension s = - let idx = String.rindex s '.' in - String.sub s idx (String.length s - idx) + try + let idx = String.rindex s '.' in + String.sub s idx (String.length s - idx) + with Not_found -> ""