changeset 21077:40f931a63a91

Undo incorrect if/else inversion in cset 3aa293be0e8d. * debug.cc (do_dbtype): Undo incorrect if/else inversion since the code does not use error.
author Rik <rik@octave.org>
date Fri, 15 Jan 2016 10:52:48 -0800
parents b433f9990452
children 49852ff04747
files libinterp/corefcn/debug.cc
diffstat 1 files changed, 17 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/debug.cc	Fri Jan 15 12:46:58 2016 -0500
+++ b/libinterp/corefcn/debug.cc	Fri Jan 15 10:52:48 2016 -0800
@@ -847,24 +847,28 @@
 {
   std::string ff = fcn_file_in_path (name);
 
-  if (! ff.empty ())
+  if (ff.empty ())
     os << "dbtype: unknown function " << name << "\n";
-
-  std::ifstream fs (ff.c_str (), std::ios::in);
-
-  if (! fs)
-    os << "dbtype: unable to open '" << ff << "' for reading!\n";
+  else
+  {
+    std::ifstream fs (ff.c_str (), std::ios::in);
 
-  int line = 1;
-  std::string text;
-
-  while (std::getline (fs, text) && line <= end)
+    if (! fs)
+      os << "dbtype: unable to open '" << ff << "' for reading!\n";
+    else
     {
-      if (line >= start)
-        os << line << "\t" << text << "\n";
+      int line = 1;
+      std::string text;
 
-      line++;
+      while (std::getline (fs, text) && line <= end)
+        {
+          if (line >= start)
+            os << line << "\t" << text << "\n";
+
+          line++;
+        }
     }
+  }
 
   os.flush ();
 }