changeset 16987:aabe12e5fdc1

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.
author Mike Miller <mtmiller@ieee.org>
date Tue, 16 Jul 2013 00:17:46 -0400
parents df66488b8d43
children 54b75bed4bc7
files libinterp/corefcn/toplev.cc
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/toplev.cc	Sun Jul 14 16:00:26 2013 -0700
+++ b/libinterp/corefcn/toplev.cc	Tue Jul 16 00:17:46 2013 -0400
@@ -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);
     }
 }