changeset 27545:397ba0a8d732

reset exit_status before getting input in pull parser input loop * interpreter.cc (interpreter::main_loop): Reset exit_status before getting input in pull parser loop.
author John W. Eaton <jwe@octave.org>
date Tue, 22 Oct 2019 23:13:50 -0400
parents ca4ab81a5601
children 56e8c41fb6d3
files libinterp/corefcn/interpreter.cc
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/interpreter.cc	Tue Oct 22 17:17:37 2019 -0700
+++ b/libinterp/corefcn/interpreter.cc	Tue Oct 22 23:13:50 2019 -0400
@@ -1027,6 +1027,13 @@
 
             do
               {
+                // Reset status each time through the read loop so that
+                // it won't be set to -1 and cause us to exit the outer
+                // loop early if there is an exception while reading
+                // input or parsing.
+
+                exit_status = 0;
+
                 bool eof = false;
                 std::string input_line = reader.get_input (prompt, eof);