changeset 17236:6a6e3f1a824c

save history on exec (bug #39734) * syscalls.cc (Fexec): Save history before exec.
author John W. Eaton <jwe@octave.org>
date Tue, 13 Aug 2013 16:45:22 -0400
parents 96a1c132e3c6
children 5f14fc8feba3
files libinterp/corefcn/syscalls.cc
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/syscalls.cc	Tue Aug 13 17:40:50 2013 +0100
+++ b/libinterp/corefcn/syscalls.cc	Tue Aug 13 16:45:22 2013 -0400
@@ -38,6 +38,7 @@
 
 #include <fcntl.h>
 
+#include "cmd-hist.h"
 #include "file-ops.h"
 #include "file-stat.h"
 #include "oct-env.h"
@@ -48,6 +49,7 @@
 #include "error.h"
 #include "gripes.h"
 #include "lo-utils.h"
+#include "oct-hist.h"
 #include "oct-map.h"
 #include "oct-obj.h"
 #include "oct-stdstrm.h"
@@ -220,6 +222,11 @@
 
           if (! error_state)
             {
+              octave_history_write_timestamp ();
+
+              if (! command_history::ignoring_entries ())
+                command_history::clean_up_and_save ();
+
               std::string msg;
 
               int status = octave_syscalls::execvp (exec_file, exec_args, msg);