From a83e0e4b2cf4d0cd378b5f2f451aa857507e0a01 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Tue, 5 Jul 2005 05:57:02 +0000 Subject: [PATCH] handle Not_found exception in extension --- helm/ocaml/getter/http_getter_misc.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -> "" -- 2.39.2