# HG changeset patch # User Mike Miller # Date 1582011432 28800 # Node ID 8565d950a3ca0b9251fee0069582e93cfcfb34f3 # Parent 739045a86cfdd84490c8dbec402f272d0bb82a0f 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. diff -r 739045a86cfd -r 8565d950a3ca libinterp/corefcn/oct-hist.cc --- 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 ()