Skip to content

Commit

Permalink
Don't write empty lines to the history file
Browse files Browse the repository at this point in the history
refs #12234
  • Loading branch information
gunnarbeutner committed Jul 29, 2016
1 parent a02d7d7 commit aaa4878
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/cli/consolecommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,11 @@ int ConsoleCommand::RunScriptConsole(ScriptFrame& scriptFrame, const String& add
if (commandOnce.IsEmpty()) {
add_history(cline);

historyfp.open(historyPath.CStr(), std::fstream::out | std::fstream::app);
historyfp << cline << "\n";
historyfp.close();
if (cline[0] != '\0') {
historyfp.open(historyPath.CStr(), std::fstream::out | std::fstream::app);
historyfp << cline << "\n";
historyfp.close();
}
}

line = cline;
Expand Down

0 comments on commit aaa4878

Please sign in to comment.