From 1910d5af463ebc9e49cb53a14377f557288c6139 Mon Sep 17 00:00:00 2001 From: mathias Date: Fri, 24 Dec 2004 03:02:48 +0000 Subject: fix the no-writing-history issue for fbrun --- util/fbrun/FbRun.cc | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc index 4b51c4b..da3ee6b 100644 --- a/util/fbrun/FbRun.cc +++ b/util/fbrun/FbRun.cc @@ -140,20 +140,27 @@ void FbRun::run(const std::string &command) { } } - // now m_current_history_item points at the duplicate, or - // at m_history.size() if no duplicate fstream inoutfile(m_history_file.c_str(), ios::in|ios::out); if (inoutfile) { - int i = 0; - // read past history items before current - for (string line; !inoutfile.eof() && i < m_current_history_item; i++) - getline(inoutfile, line); - // write the history items that come after current - for (i++; i < m_history.size(); i++) - inoutfile<