From d0bab08f15c768c07bc88547043e26237b69085e Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sat, 19 Oct 2019 11:47:07 +0100 Subject: [PATCH] Don't ever call stop_user_input in line_loop The caller is now always responsible for calling stop_user_input, rather than only responsible for calling it on error. --- debugger/command_line.ml | 3 ++- debugger/main.ml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debugger/command_line.ml b/debugger/command_line.ml index 381700d38..0a1fb7ceb 100644 --- a/debugger/command_line.ml +++ b/debugger/command_line.ml @@ -210,7 +210,7 @@ let line_loop ppf line_buffer = done with | Exit -> - stop_user_input () + () (* | Sys_error s -> error ("System error: " ^ s) *) @@ -571,6 +571,7 @@ let instr_source ppf lexbuf = interactif := false; user_channel := io_chan; line_loop ppf (Lexing.from_function read_user_input); + stop_user_input (); close_io io_chan; interactif := old_state; user_channel := old_channel diff --git a/debugger/main.ml b/debugger/main.ml index 53959a769..ec99786e5 100644 --- a/debugger/main.ml +++ b/debugger/main.ml @@ -29,7 +29,7 @@ open Primitives let line_buffer = Lexing.from_function read_user_input -let loop ppf = line_loop ppf line_buffer +let loop ppf = line_loop ppf line_buffer; stop_user_input () let current_duration = ref (-1L) @@ -130,7 +130,8 @@ let execute_file_if_any () = let len = Buffer.length buffer in if len > 0 then let commands = Buffer.sub buffer 0 (pred len) in - line_loop Format.std_formatter (Lexing.from_string commands) + line_loop Format.std_formatter (Lexing.from_string commands); + stop_user_input () let toplevel_loop () = interactif := false;