diff liboctave/cmd-hist.cc @ 10314:07ebe522dac2

untabify liboctave C++ sources
author John W. Eaton <jwe@octave.org>
date Thu, 11 Feb 2010 12:23:32 -0500
parents 65b41bc71f09
children 479cc8a0a846
line wrap: on
line diff
--- a/liboctave/cmd-hist.cc	Thu Feb 11 12:16:43 2010 -0500
+++ b/liboctave/cmd-hist.cc	Thu Feb 11 12:23:32 2010 -0500
@@ -114,8 +114,8 @@
   if (! do_ignoring_entries ())
     {
       if (s.empty ()
-	  || (s.length () == 1 && (s[0] == '\r' || s[0] == '\n')))
-	return;
+          || (s.length () == 1 && (s[0] == '\r' || s[0] == '\n')))
+        return;
 
       ::octave_add_history (s.c_str ());
 
@@ -191,11 +191,11 @@
       char *line = ::octave_history_goto_mark (mark);
 
       if (line)
-	{
-	  command_editor::insert_text (line);
+        {
+          command_editor::insert_text (line);
 
-	  command_editor::clear_undo_list ();
-	}
+          command_editor::clear_undo_list ();
+        }
     }
 
   mark = 0;
@@ -214,13 +214,13 @@
       int status = ::octave_read_history (f.c_str ());
 
       if (status != 0 && must_exist)
-	error (status);
+        error (status);
       else
-	{
-	  lines_in_file = do_where ();
+        {
+          lines_in_file = do_where ();
 
-	  ::octave_using_history ();
-	}
+          ::octave_using_history ();
+        }
     }
   else
     error ("gnu_history::read: missing file name");
@@ -228,7 +228,7 @@
 
 void
 gnu_history::do_read_range (const std::string& f, int from, int to,
-			    bool must_exist)
+                            bool must_exist)
 {
   if (from < 0)
     from = lines_in_file;
@@ -238,13 +238,13 @@
       int status = ::octave_read_history_range (f.c_str (), from, to);
 
       if (status != 0 && must_exist)
-	error (status);
+        error (status);
       else
-	{
-	  lines_in_file = do_where ();
+        {
+          lines_in_file = do_where ();
 
-	  ::octave_using_history ();
-	}
+          ::octave_using_history ();
+        }
     }
   else
     error ("gnu_history::read_range: missing file name");
@@ -263,7 +263,7 @@
       int status = ::octave_write_history (f.c_str ());
 
       if (status != 0)
-	error (status);
+        error (status);
     }
   else
     error ("gnu_history::write: missing file name");
@@ -275,39 +275,39 @@
   if (lines_this_session)
     {
       if (lines_this_session < do_where ())
-	{
-	  // Create file if it doesn't already exist.
+        {
+          // Create file if it doesn't already exist.
 
-	  std::string f = f_arg;
+          std::string f = f_arg;
 
-	  if (f.empty ())
-	    f = xfile;
+          if (f.empty ())
+            f = xfile;
 
-	  if (! f.empty ())
-	    {
-	      file_stat fs (f);
+          if (! f.empty ())
+            {
+              file_stat fs (f);
 
-	      if (! fs)
-		{
-		  int tem;
+              if (! fs)
+                {
+                  int tem;
 
-		  tem = open (f.c_str (), O_CREAT, 0666);
-		  close (tem);
-		}
+                  tem = open (f.c_str (), O_CREAT, 0666);
+                  close (tem);
+                }
 
-	      int status
-		= ::octave_append_history (lines_this_session, f.c_str ());
+              int status
+                = ::octave_append_history (lines_this_session, f.c_str ());
 
-	      if (status != 0)
-		error (status);
-	      else
-		lines_in_file += lines_this_session;
+              if (status != 0)
+                error (status);
+              else
+                lines_in_file += lines_this_session;
 
-	      lines_this_session = 0;
-	    }
-	  else
-	    error ("gnu_history::append: missing file name");
-	}
+              lines_this_session = 0;
+            }
+          else
+            error ("gnu_history::append: missing file name");
+        }
     }
 }
 
@@ -366,7 +366,7 @@
   if (! f.empty ())
     {
       if (n < 0)
-	n = xsize;
+        n = xsize;
 
       stifle (n);
 
@@ -389,7 +389,7 @@
   if (! instance)
     {
       (*current_liboctave_error_handler)
-	("unable to create command history object!");
+        ("unable to create command history object!");
 
       retval = false;
     }
@@ -558,7 +558,7 @@
 
 void
 command_history::read_range (const std::string& f, int from, int to,
-			     bool must_exist) 
+                             bool must_exist) 
 {
   if (instance_ok ())
     instance->do_read_range (f, from, to, must_exist);
@@ -749,17 +749,17 @@
   if (lines_this_session)
     {
       if (lines_this_session < do_where ())
-	{
-	  // Create file if it doesn't already exist.
+        {
+          // Create file if it doesn't already exist.
 
-	  std::string f = f_arg;
+          std::string f = f_arg;
 
-	  if (f.empty ())
-	    f = xfile;
+          if (f.empty ())
+            f = xfile;
 
-	  if (f.empty ())
-	    error ("command_history::append: missing file name");
-	}
+          if (f.empty ())
+            error ("command_history::append: missing file name");
+        }
     }
 }