From 0e8a27e931e66a4823b761983dca38a59fa6f37f Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Fri, 2 Jan 2015 16:45:39 +0100 Subject: [PATCH] Fix loading fbrun-history Previous code add one additional entry on loading the history. This commit is one part of the patch #162 (see [1] and [2]), written by Ulrich Eckhardt . [1]: https://sourceforge.net/p/fluxbox/patches/162/ [2]: https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=fbrun-bug636632.patch;att=1;bug=636632 --- util/fbrun/FbRun.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc index 66a5fec0..a8584878 100644 --- a/util/fbrun/FbRun.cc +++ b/util/fbrun/FbRun.cc @@ -211,13 +211,11 @@ bool FbRun::loadHistory(const char *filename) { } return false; } - // clear old history and load new one from file + m_history.clear(); - // each line is a command string line; - while (!infile.eof()) { - getline(infile, line); - if (line.size()) // don't add empty lines + while (getline(infile, line)) { + if (!line.empty()) // don't add empty lines m_history.push_back(line); } // set no current histor to display