From aaa487801794a7d65521bc6b2a89c96fe93a8b27 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 29 Jul 2016 13:55:07 +0200 Subject: [PATCH] Don't write empty lines to the history file refs #12234 --- lib/cli/consolecommand.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/cli/consolecommand.cpp b/lib/cli/consolecommand.cpp index 98d120cf9..5da45da65 100644 --- a/lib/cli/consolecommand.cpp +++ b/lib/cli/consolecommand.cpp @@ -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;