# HG changeset patch # User Jordi Gutiérrez Hermoso # Date 1359754541 18000 # Node ID 9cb64bafa7bd4e06827dae625a9d1c31ca19c36e # Parent 696e82182eba3a647916c5c7b299b674657d148f# Parent afc4e08f214320e53a787dd10fac87f0925127bf Merge in Júlio's changes diff --git a/libinterp/interpfcn/oct-hist.cc b/libinterp/interpfcn/oct-hist.cc --- a/libinterp/interpfcn/oct-hist.cc +++ b/libinterp/interpfcn/oct-hist.cc @@ -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.