Mercurial > hg > octave-terminal
changeset 14074:f90c3facfac3 stable
don't reset parser when exiting (bug #35120)
* src/lex.ll (reset_parser): Don't call yyrestart if
quitting_gracefully is true.
* src/toplev.cc (octave_main): Set quitting_gracefully to true before
calling clean_up_and_exit.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 19 Dec 2011 23:14:41 -0500 |
parents | 5cbc978a27e8 |
children | 9aff66860e03 |
files | src/lex.ll src/octave.cc |
diffstat | 2 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lex.ll +++ b/src/lex.ll @@ -1141,9 +1141,11 @@ // Only ask for input from stdin if we are expecting interactive // input. - if ((interactive || forced_interactive) + + if (! quitting_gracefully + && (interactive || forced_interactive) && ! (reading_fcn_file - || reading_classdef_file + || reading_classdef_file || reading_script_file || get_input_from_eval_string || input_from_startup_file))
--- a/src/octave.cc +++ b/src/octave.cc @@ -901,7 +901,11 @@ execute_command_line_file (argv[last_arg_idx]); if (! persist) - clean_up_and_exit (error_state ? 1 : 0); + { + quitting_gracefully = true; + + clean_up_and_exit (error_state ? 1 : 0); + } } // Avoid counting commands executed from startup files. @@ -940,6 +944,8 @@ if (retval == 1 && ! error_state) retval = 0; + quitting_gracefully = true; + clean_up_and_exit (retval); return 0;