aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-08-24 23:47:31 (GMT)
committerfluxgen <fluxgen>2003-08-24 23:47:31 (GMT)
commit05dc72b4971dbc9f05565d40088a9e4bf094bf54 (patch)
treefa1d333e5017d183b2e517db6af1a5e43ae1c296 /util
parentf1c45fdb015d123b5666659209b1884b00f037f2 (diff)
downloadfluxbox_paul-05dc72b4971dbc9f05565d40088a9e4bf094bf54.zip
fluxbox_paul-05dc72b4971dbc9f05565d40088a9e4bf094bf54.tar.bz2
indent
Diffstat (limited to 'util')
-rw-r--r--util/fbrun/FbRun.cc56
1 files changed, 28 insertions, 28 deletions
diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc
index 09f6075..a9e155d 100644
--- a/util/fbrun/FbRun.cc
+++ b/util/fbrun/FbRun.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbRun.cc,v 1.15 2003/07/25 11:17:41 rathnor Exp $ 22// $Id: FbRun.cc,v 1.16 2003/08/24 23:47:31 fluxgen Exp $
23 23
24#include "FbRun.hh" 24#include "FbRun.hh"
25 25
@@ -87,34 +87,34 @@ void FbRun::run(const std::string &command) {
87 // save command history to file 87 // save command history to file
88 if (m_runtext.size() != 0) { // no need to save empty command 88 if (m_runtext.size() != 0) { // no need to save empty command
89 89
90 // don't allow duplicates into the history file, first 90 // don't allow duplicates into the history file, first
91 // look for a duplicate 91 // look for a duplicate
92 if (m_current_history_item < m_history.size() 92 if (m_current_history_item < m_history.size()
93 && m_runtext == m_history[m_current_history_item]) { 93 && m_runtext == m_history[m_current_history_item]) {
94 // m_current_history_item is the duplicate 94 // m_current_history_item is the duplicate
95 } else { 95 } else {
96 int i; 96 int i;
97 for (i = 0; i < m_history.size(); i++) 97 for (i = 0; i < m_history.size(); i++)
98 if (m_runtext == m_history[i]) break; 98 if (m_runtext == m_history[i]) break;
99 m_current_history_item = i; 99 m_current_history_item = i;
100 } 100 }
101 101
102 // now m_current_history_item points at the duplicate, or 102 // now m_current_history_item points at the duplicate, or
103 // at m_history.size() if no duplicate 103 // at m_history.size() if no duplicate
104 fstream inoutfile(m_history_file.c_str(), ios::in|ios::out); 104 fstream inoutfile(m_history_file.c_str(), ios::in|ios::out);
105 if (inoutfile) { 105 if (inoutfile) {
106 int i = 0; 106 int i = 0;
107 // read past history items before current 107 // read past history items before current
108 for (string line; !inoutfile.eof() && i < m_current_history_item; i++) 108 for (string line; !inoutfile.eof() && i < m_current_history_item; i++)
109 getline(inoutfile, line); 109 getline(inoutfile, line);
110 // write the history items that come after current 110 // write the history items that come after current
111 for (i++; i < m_history.size(); i++) 111 for (i++; i < m_history.size(); i++)
112 inoutfile<<m_history[i]<<endl; 112 inoutfile<<m_history[i]<<endl;
113 // and append the current one back to the end 113 // and append the current one back to the end
114 inoutfile<<m_runtext<<endl; 114 inoutfile<<m_runtext<<endl;
115 inoutfile.close(); 115 inoutfile.close();
116 } else 116 } else
117 cerr<<"FbRun Warning: Can't write command history to file: "<<m_history_file<<endl; 117 cerr<<"FbRun Warning: Can't write command history to file: "<<m_history_file<<endl;
118 } 118 }
119 FbTk::App::instance()->end(); // end application 119 FbTk::App::instance()->end(); // end application
120 m_end = true; // mark end of processing 120 m_end = true; // mark end of processing