summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authoralainfrisch <alain@frisch.fr>2016-07-07 00:12:06 +0200
committeralainfrisch <alain@frisch.fr>2016-07-10 00:16:48 +0200
commitaa4f427591f3c283403053f83c0f961532872f65 (patch)
treed505b10907ad0c68a651579a7a7ee5e76a9bae73 /driver
parent0efbba1de4997d9b08747ea87b94c3519473a08f (diff)
downloadocaml-aa4f427591f3c283403053f83c0f961532872f65.tar.gz
Add Filename.extension and Filename.remove_extension.
The definition was suggested by Daniel Bunzli. It considers that ".", "..", ".foo" all have an empty extension. This commit also fixes chop_extension to align with this definition and adds remove_extension which behaves as chop_extension but does not fail when the extension is empty. There used to be a Misc.chop_extension_if_any in the compiler code base. The commit also replaces it with the new Filename.remove_extension.
Diffstat (limited to 'driver')
-rw-r--r--driver/compenv.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/compenv.ml b/driver/compenv.ml
index d9d7779e56..459afaa46a 100644
--- a/driver/compenv.ml
+++ b/driver/compenv.ml
@@ -20,7 +20,7 @@ let output_prefix name =
match !output_name with
| None -> name
| Some n -> if !compile_only then (output_name := None; n) else name in
- Misc.chop_extension_if_any oname
+ Filename.remove_extension oname
let print_version_and_library compiler =
Printf.printf "The OCaml %s, version " compiler;