# HG changeset patch # User John W. Eaton # Date 1224792066 14400 # Node ID 2c1ba965b486994c619a508e0fb7c12df473a739 # Parent ed5811a1ec8f9a0c5dd094db5b666cd87e8a1dc7 skip reading history file with --no-history option diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2008-10-23 John W. Eaton + * oct-hist.c (initialize_history): New arg, read_history_file) + * oct-hist.h: Fix decl. + * octave.cc (octave_main): Set read_history_file to false if + --no-history option is specified. Pass read_history_file to + initialize_history. + * DLD-FUNCTIONS/fltk_backend.cc: Update initialization comment. 2008-10-22 John W. Eaton diff --git a/src/oct-hist.cc b/src/oct-hist.cc --- a/src/oct-hist.cc +++ b/src/oct-hist.cc @@ -529,12 +529,13 @@ } void -initialize_history (void) +initialize_history (bool read_history_file) { command_history::set_file (Vhistory_file); command_history::set_size (Vhistory_size); - command_history::read (false); + if (read_history_file) + command_history::read (false); } void diff --git a/src/oct-hist.h b/src/oct-hist.h --- a/src/oct-hist.h +++ b/src/oct-hist.h @@ -28,7 +28,7 @@ #include "cmd-hist.h" -extern void initialize_history (void); +extern void initialize_history (bool read_history_file = false); // Write timestamp to history file. extern void octave_history_write_timestamp (void); diff --git a/src/octave.cc b/src/octave.cc --- a/src/octave.cc +++ b/src/octave.cc @@ -628,12 +628,15 @@ bool forced_line_editing = false; + bool read_history_file = true; + int optc; while ((optc = args.getopt ()) != EOF) { switch (optc) { case 'H': + read_history_file = false; bind_internal_variable ("saving_history", false); break; @@ -776,7 +779,7 @@ execute_startup_files (); - initialize_history (); + initialize_history (read_history_file); if (! inhibit_startup_message && reading_startup_message_printed) std::cout << std::endl;