changeset 15991:9cb64bafa7bd

Merge in JĂșlio's changes
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Fri, 01 Feb 2013 16:35:41 -0500
parents 696e82182eba (diff) afc4e08f2143 (current diff)
children c4c46e1a086b
files
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/interpfcn/oct-hist.cc	Thu Jan 31 00:46:29 2013 -0600
+++ b/libinterp/interpfcn/oct-hist.cc	Fri Feb 01 16:35:41 2013 -0500
@@ -496,10 +496,18 @@
   volatile octave_interrupt_handler old_interrupt_handler
     = octave_ignore_interrupts ();
 
-  system (cmd.c_str ());
+  int status = system (cmd.c_str ());
 
   octave_set_interrupt_handler (old_interrupt_handler);
 
+  // Check if text edition was successfull.  Abort the operation
+  // in case of failure.
+  if (status != EXIT_SUCCESS)
+    {
+      error ("edit_history: text editor command failed");
+      return;
+    }
+
   // Write the commands to the history file since source_file
   // disables command line history while it executes.