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()) { if (commandOnce.IsEmpty()) {
add_history(cline); add_history(cline);
historyfp.open(historyPath.CStr(), std::fstream::out | std::fstream::app); if (cline[0] != '\0') {
historyfp << cline << "\n"; historyfp.open(historyPath.CStr(), std::fstream::out | std::fstream::app);
historyfp.close(); historyfp << cline << "\n";
historyfp.close();
}
} }
line = cline; line = cline;