From 48485d8d8a027f2411198a62c58111b64ac5245f Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Tue, 9 Oct 2001 14:56:23 +0000 Subject: [PATCH] Mieux sauter #! au debut des scripts git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3871 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- toplevel/toploop.ml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/toplevel/toploop.ml b/toplevel/toploop.ml index 21ca822b8..de43098fb 100644 --- a/toplevel/toploop.ml +++ b/toplevel/toploop.ml @@ -298,10 +298,7 @@ let use_file ppf name = let ic = open_in_bin filename in let lb = Lexing.from_channel ic in (* Skip initial #! line if any *) - let buffer = String.create 2 in - if input ic buffer 0 2 = 2 && buffer = "#!" - then ignore(input_line ic) - else seek_in ic 0; + Lexer.skip_sharp_bang lb; let success = protect Location.input_name filename (fun () -> try