Mercurial > octave
changeset 28088:8565d950a3ca stable
allow history_timestamp_format_string to be empty (bug #57843)
* oct-hist.cc (history_system::timestamp_format_string): Allow value to be
empty. Add tests.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Mon, 17 Feb 2020 23:37:12 -0800 |
parents | 739045a86cfd |
children | c8e40b19c499 |
files | libinterp/corefcn/oct-hist.cc |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/oct-hist.cc Sun Feb 16 21:08:35 2020 -0500 +++ b/libinterp/corefcn/oct-hist.cc Mon Feb 17 23:37:12 2020 -0800 @@ -312,7 +312,7 @@ int nargout) { return set_internal_variable (m_timestamp_format_string, args, nargout, - "timestamp_format_string", false); + "timestamp_format_string"); } // Display, save, or load history. Stolen and modified from bash. @@ -884,6 +884,15 @@ return history_sys.timestamp_format_string (args, nargout); } +/* +%!test +%! history_timestamp_format_string ("# Example history marker", "local"); +%! assert (history_timestamp_format_string (), "# Example history marker") +%!test <*57843> +%! history_timestamp_format_string ("", "local"); +%! assert (history_timestamp_format_string (), "") +*/ + DEFUN (history_save, args, nargout, doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} history_save ()