# HG changeset patch # User Mike Miller # Date 1373948266 14400 # Node ID aabe12e5fdc1fc6ab88845507e41d54438d76d6b # Parent df66488b8d438b4271a4564a56d69bc60fd7820b Allow exit/quit to properly pass all possible exit status values * toplev.cc (main_loop): Return zero when the parser returns EOF. (clean_up_and_exit): Remove special-case handling of EOF exit status. diff --git a/libinterp/corefcn/toplev.cc b/libinterp/corefcn/toplev.cc --- a/libinterp/corefcn/toplev.cc +++ b/libinterp/corefcn/toplev.cc @@ -634,6 +634,9 @@ } while (retval == 0); + if (retval == EOF) + retval = 0; + return retval; } @@ -751,7 +754,7 @@ else { if (octave_exit) - (*octave_exit) (retval == EOF ? 0 : retval); + (*octave_exit) (retval); } }