# HG changeset patch # User John W. Eaton # Date 1363728533 14400 # Node ID 0ce49f9fb1713c74bc988b7aa7a4b9707de5ef95 # Parent bef822a80ffbac86e6100588c49bc555a232e0c4 "\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 "". diff --git a/libinterp/interpfcn/input.cc b/libinterp/interpfcn/input.cc --- 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);