changeset 21359:8e94a86ca648

Do not print extra newlines to stdout on exit (bug #47258). * toplev.cc (main_loop): in case of exception, do not print a newline if we are exiting Octave. * octave.cc (safe_source_file, execute_eval_option_code): idem. But in this cases, there's no need to ever print a newline.
author Carnë Draug <carandraug@octave.org>
date Fri, 26 Feb 2016 13:06:39 +0000
parents f2ae78f5827f
children 06c2a109935c
files libinterp/corefcn/toplev.cc libinterp/octave.cc
diffstat 2 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/toplev.cc	Fri Feb 26 16:01:22 2016 +0100
+++ b/libinterp/corefcn/toplev.cc	Fri Feb 26 13:06:39 2016 +0000
@@ -736,10 +736,11 @@
         {
           recover_from_exception ();
 
-          octave_stdout << "\n";
-
           if (quitting_gracefully)
             return exit_status;
+
+          // Required newline when the user does Ctrl+C at the prompt.
+          octave_stdout << "\n";
         }
       catch (const index_exception& e)
         {
--- a/libinterp/octave.cc	Fri Feb 26 16:01:22 2016 +0100
+++ b/libinterp/octave.cc	Fri Feb 26 13:06:39 2016 +0000
@@ -285,8 +285,6 @@
     {
       recover_from_exception ();
 
-      octave_stdout << "\n";
-
       if (quitting_gracefully)
         clean_up_and_exit (exit_status);
     }
@@ -403,8 +401,6 @@
     {
       recover_from_exception ();
 
-      octave_stdout << "\n";
-
       if (quitting_gracefully)
         clean_up_and_exit (exit_status);
     }