Mercurial > hg > octave-lyh
diff libinterp/interpfcn/input.cc @ 16336:0ce49f9fb171
"\n" is the new empty string (bug #38552)
* input.cc (last_debugging_command): Initialize to "\n".
(octave_gets): Reset last_debugging_command to "\n", not "".
Take "\n" to mean 'no input' instead of "".
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 19 Mar 2013 17:28:53 -0400 |
parents | fe3b9a51e625 |
children | bf8397caeff1 |
line wrap: on
line diff
--- a/libinterp/interpfcn/input.cc +++ b/libinterp/interpfcn/input.cc @@ -112,7 +112,7 @@ // If we are in debugging mode, this is the last command entered, so // that we can repeat the previous command if the user just types RET. -static std::string last_debugging_command; +static std::string last_debugging_command = "\n"; // TRUE if we are running in the Emacs GUD mode. static bool Vgud_mode = false; @@ -215,7 +215,7 @@ // There is no need to update the load_path cache if there is no // user input. - if (! retval.empty () + if (retval != "\n" && retval.find_first_not_of (" \t\n\r") != std::string::npos) { load_path::update (); @@ -223,7 +223,7 @@ if (Vdebugging) last_debugging_command = retval; else - last_debugging_command = std::string (); + last_debugging_command = "\n"; } else if (Vdebugging) { @@ -231,7 +231,7 @@ history_skip_auto_repeated_debugging_command = true; } - if (! retval.empty ()) + if (retval != "\n") { if (! history_skip_auto_repeated_debugging_command) command_history::add (retval);