From 78f3b0ada415296434dd0474b3f1dd305f35e383 Mon Sep 17 00:00:00 2001 From: simonb Date: Mon, 17 Apr 2006 08:04:12 +0000 Subject: fix compiler warnings in fbrun too --- ChangeLog | 3 +++ util/fbrun/FbRun.cc | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index cca8d66..88b8a88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 0.9.16: +*06/04/17: + * patchset missed my fbrun -Wall fixes (Simon) + util/fbrun/FbRun.cc *06/04/16: * Add option to reverse desktop wheeling, patch #1034287 session.screen0.reversewheeling: true|false diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc index 385f2b1..281b35f 100644 --- a/util/fbrun/FbRun.cc +++ b/util/fbrun/FbRun.cc @@ -145,7 +145,7 @@ void FbRun::run(const std::string &command) { // now m_current_history_item points at the duplicate, or // at m_history.size() if no duplicate if (m_current_history_item != m_history.size()) { - int i = 0; + unsigned int i = 0; // read past history items before current for (; inoutfile.good() && i < m_current_history_item; i++) inoutfile.ignore(1, '\n'); @@ -342,16 +342,16 @@ void FbRun::tabCompleteHistory() { XBell(m_display, 0); } else { unsigned int nr= 0; - int history_item = m_current_history_item - 1; + unsigned int history_item = m_current_history_item - 1; string prefix = text().substr(0, textStartPos() + cursorPosition()); while (history_item != m_current_history_item && nr++ < m_history.size()) { - if (history_item <= -1 ) - history_item= m_history.size() - 1; if (m_history[history_item].find(prefix) == 0) { m_current_history_item = history_item; setText(m_history[m_current_history_item]); break; } + if (history_item == 0) // loop + history_item = m_history.size(); history_item--; } if (history_item == m_current_history_item) XBell(m_display, 0); -- cgit v0.11.2