Don't add empty lines to libedit's history

refs #12234
This commit is contained in:
Gunnar Beutner 2016-08-08 08:01:52 +02:00
parent 52f83ca7e6
commit 26821d1a79
1 changed files with 4 additions and 6 deletions

View File

@ -268,14 +268,12 @@ incomplete:
if (!cline)
break;
if (commandOnce.IsEmpty()) {
if (commandOnce.IsEmpty() && cline[0] != '\0') {
add_history(cline);
if (cline[0] != '\0') {
historyfp.open(historyPath.CStr(), std::fstream::out | std::fstream::app);
historyfp << cline << "\n";
historyfp.close();
}
historyfp.open(historyPath.CStr(), std::fstream::out | std::fstream::app);
historyfp << cline << "\n";
historyfp.close();
}
line = cline;