summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ocamldoc/odoc_analyse.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/ocamldoc/odoc_analyse.ml b/ocamldoc/odoc_analyse.ml
index b584576cf..9eec860a0 100644
--- a/ocamldoc/odoc_analyse.ml
+++ b/ocamldoc/odoc_analyse.ml
@@ -234,7 +234,11 @@ let process_file ppf sourcefile =
Location.input_name := file;
try
let mod_name =
- String.capitalize (Filename.basename (Filename.chop_extension file))
+ let s =
+ try Filename.chop_extension file
+ with _ -> file
+ in
+ String.capitalize (Filename.basename s)
in
let txt =
try Odoc_text.Texter.text_of_string (Odoc_misc.input_file_as_string file)