comparison src/oct-hist.cc @ 11586:12df7854fa7c

strip trailing whitespace from source files
author John W. Eaton <jwe@octave.org>
date Thu, 20 Jan 2011 17:24:59 -0500
parents 7d6d8c1e471f
children f96b9b9f141b
comparison
equal deleted inserted replaced
11585:1473d0cf86d2 11586:12df7854fa7c
151 151
152 // Display, save, or load history. Stolen and modified from bash. 152 // Display, save, or load history. Stolen and modified from bash.
153 // 153 //
154 // Arg of -w FILENAME means write file, arg of -r FILENAME 154 // Arg of -w FILENAME means write file, arg of -r FILENAME
155 // means read file, arg of -q means don't number lines. Arg of N 155 // means read file, arg of -q means don't number lines. Arg of N
156 // means only display that many items. 156 // means only display that many items.
157 157
158 static void 158 static void
159 do_history (int argc, const string_vector& argv) 159 do_history (int argc, const string_vector& argv)
160 { 160 {
161 int numbered_output = 1; 161 int numbered_output = 1;
326 if (! line.empty ()) 326 if (! line.empty ())
327 { 327 {
328 std::string tmp = line; 328 std::string tmp = line;
329 329
330 int len = tmp.length (); 330 int len = tmp.length ();
331 331
332 if (len > 0 && tmp[len-1] == '\n') 332 if (len > 0 && tmp[len-1] == '\n')
333 tmp.resize (len - 1); 333 tmp.resize (len - 1);
334 334
335 if (! tmp.empty ()) 335 if (! tmp.empty ())
336 command_history::add (tmp); 336 command_history::add (tmp);
337 } 337 }
338 } 338 }
339 339
340 static std::string 340 static std::string
341 mk_tmp_hist_file (int argc, const string_vector& argv, 341 mk_tmp_hist_file (int argc, const string_vector& argv,
342 int insert_curr, const char *warn_for) 342 int insert_curr, const char *warn_for)
343 { 343 {
344 std::string retval; 344 std::string retval;
345 345
346 string_vector hlist = command_history::list (); 346 string_vector hlist = command_history::list ();
347 347