Fix the native toplevel too...

master
David Allsopp 2020-04-17 16:54:37 +01:00
parent b14539572a
commit 221fee0d85
1 changed files with 3 additions and 3 deletions

View File

@ -490,16 +490,16 @@ let use_output ppf command =
fprintf ppf "Command exited with code %d.@." n; fprintf ppf "Command exited with code %d.@." n;
false) false)
let use_file ppf wrap_mode name = let use_file ppf wrap_mod name =
match name with match name with
| "" -> | "" ->
use_channel ppf wrap_mode stdin name "(stdin)" use_channel ppf wrap_mod stdin name "(stdin)"
| _ -> | _ ->
match Load_path.find name with match Load_path.find name with
| filename -> | filename ->
let ic = open_in_bin filename in let ic = open_in_bin filename in
Misc.try_finally ~always:(fun () -> close_in ic) Misc.try_finally ~always:(fun () -> close_in ic)
(fun () -> use_channel ppf false ic name filename) (fun () -> use_channel ppf wrap_mod ic name filename)
| exception Not_found -> | exception Not_found ->
fprintf ppf "Cannot find file %s.@." name; fprintf ppf "Cannot find file %s.@." name;
false false