# HG changeset patch # User John Donoghue # Date 1368918678 14400 # Node ID 5c5c46a81ad51109ce32da2bc24027c4463bbb61 # Parent d3619d4d267cfe733bec1e2b4496af490557ff58 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. diff -r d3619d4d267c -r 5c5c46a81ad5 libinterp/interpfcn/oct-hist.cc --- 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.