changeset 20138:4ff975c58584

Check error_state before searching for help text (bug #44934). * help.cc (raw_help): Unwind multiple function calls joined by '||' operator with if tree that checks whether there was an error encountered in the previous function call. This prevents blindly continuing on after an error was encountered.
author Rik <rik@octave.org>
date Mon, 27 Apr 2015 09:03:31 -0700
parents 4ba6c61c8794
children bcf0a288aa6c 3797df921988
files libinterp/corefcn/help.cc
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/help.cc	Mon Apr 27 16:48:37 2015 +0200
+++ b/libinterp/corefcn/help.cc	Mon Apr 27 09:03:31 2015 -0700
@@ -932,10 +932,21 @@
   std::string w;
   std::string f;
 
-  (raw_help_from_symbol_table (nm, h, w, symbol_found)
-   || raw_help_from_file (nm, h, f, symbol_found)
-   || raw_help_from_map (nm, h, operators_map, symbol_found)
-   || raw_help_from_map (nm, h, keywords_map, symbol_found));
+  bool found;
+
+  found = raw_help_from_symbol_table (nm, h, w, symbol_found);
+  if (! found && ! error_state)
+    {
+      found = raw_help_from_file (nm, h, f, symbol_found);
+      if (! found && ! error_state)
+        {
+          found = raw_help_from_map (nm, h, operators_map, symbol_found);
+          if (! found && ! error_state)
+            {
+              raw_help_from_map (nm, h, keywords_map, symbol_found);
+            }
+        }
+    }
 
   return h;
 }