Mercurial > hg > octave-nkf
changeset 2659:5ea93b07a88b
[project @ 1997-02-03 05:16:45 by jwe]
author | jwe |
---|---|
date | Mon, 03 Feb 1997 05:16:45 +0000 |
parents | dd71eb0bb414 |
children | 9f37d42eeeac |
files | liboctave/cmd-hist.cc liboctave/cmd-hist.h |
diffstat | 2 files changed, 8 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/cmd-hist.cc +++ b/liboctave/cmd-hist.cc @@ -185,13 +185,8 @@ } void -command_history::read (const string& f_arg, bool must_exist) +command_history::read (const string& f, bool must_exist) { - string f = f_arg; - - if (f.empty ()) - f = xfile; - if (! f.empty ()) { int status = ::read_history (f.c_str ()); @@ -209,23 +204,19 @@ error ("command_history::read: missing file name"); } +void command_history::read_range (int from, int to, bool must_exist) { read_range (xfile, from, to, must_exist); } void -command_history::read_range (const string& f_arg, int from, int to, +command_history::read_range (const string& f, int from, int to, bool must_exist) { if (from < 0) from = lines_in_file; - string f = f_arg; - - if (f.empty ()) - f = xfile; - if (! f.empty ()) { int status = ::read_history_range (f.c_str (), from, to);
--- a/liboctave/cmd-hist.h +++ b/liboctave/cmd-hist.h @@ -32,9 +32,7 @@ { public: - command_history (const string& = string (), int = -1, bool = false) - - command_history (const string& = string (), int = -1) + command_history (const string& = string (), int = -1); ~command_history (void) { initialized = false; } @@ -68,12 +66,12 @@ void read (bool = true); - void read (const string& = string (), bool = true) + void read (const string&, bool = true); - void read_range (int = -1, int = -1, bool = true) + void read_range (int = -1, int = -1, bool = true); - void read_range (const string& = string (), int = -1, int = -1, - bool = true) + void read_range (const string&, int = -1, int = -1, + bool = true); void write (const string& = string ());