Don't write empty lines to the history file

refs #12234
This commit is contained in:
Gunnar Beutner 2016-07-29 13:55:07 +02:00
parent a02d7d7502
commit aaa4878017
1 changed files with 5 additions and 3 deletions

View File

@ -271,9 +271,11 @@ incomplete:
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;