diff src/help.cc @ 8672:2a49c32d4322

allow help to work with files containing only comments
author John W. Eaton <jwe@octave.org>
date Wed, 04 Feb 2009 17:06:32 -0500
parents 52956d669506
children 7d48766c21a5
line wrap: on
line diff
--- a/src/help.cc	Wed Feb 04 15:53:24 2009 -0500
+++ b/src/help.cc	Wed Feb 04 17:06:32 2009 -0500
@@ -66,6 +66,7 @@
 #include "symtab.h"
 #include "syswait.h"
 #include "toplev.h"
+#include "unwind-prot.h"
 #include "utils.h"
 #include "variables.h"
 #include "version.h"
@@ -652,8 +653,14 @@
 {
   bool retval = false;
 
+  // FIXME -- this is a bit of a kluge...
+  unwind_protect_bool (reading_script_file);
+  reading_script_file = true;
+
   h = get_help_from_file (nm, symbol_found, file);
 
+  unwind_protect::run ();
+
   if (h.length () > 0)
     retval = true;
 
@@ -816,6 +823,12 @@
 	      ? std::string ("script") : std::string ("function");
 	}
     }
+  else
+    {
+      // We might find a file that contains only a doc string.
+
+      file = load_path::find_fcn_file (name);
+    }
 
   return file;
 }