Mercurial > octave-nkf
changeset 16685:5c5c46a81ad5
Added default name usage for history -r,-w option (Bug #38986)
* libinterp/interpfcn/oct-hist.cc (do_history): Added usgage of default history file name if name not provided.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Sat, 18 May 2013 19:11:18 -0400 |
parents | d3619d4d267c |
children | c6c4847aaf67 |
files | libinterp/interpfcn/oct-hist.cc |
diffstat | 1 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/interpfcn/oct-hist.cc Sat May 18 16:21:32 2013 -0400 +++ b/libinterp/interpfcn/oct-hist.cc Sat May 18 19:11:18 2013 -0400 @@ -169,14 +169,19 @@ if (option == "-r" || option == "-w" || option == "-a" || option == "-n") { - if (i < nargin - 1 && args(i+1).is_string ()) - command_history::set_file (args(++i).string_value ()); + if (i < nargin - 1) + { + if (args(i+1).is_string ()) + command_history::set_file (args(++i).string_value ()); + else + { + error ("history: expecting file name for %s option", + option.c_str ()); + return hlist; + } + } else - { - error ("history: expecting file name for %s option", - option.c_str ()); - return hlist; - } + command_history::set_file ( default_history_file ()); if (option == "-a") // Append 'new' lines to file.