changeset 18191:f80d258a2c7d stable

get_first_help_sentence.m: avoid out-of-bound error (bug #41053) * get_first_help_sentence.m: avoid out-of-bound error (bug #41053)
author Philip Nienhuis <prnienhuis@users.sf.net>
date Thu, 02 Jan 2014 11:54:51 +0100
parents ab775508dff9
children a65934d0dc35
files scripts/help/get_first_help_sentence.m
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/help/get_first_help_sentence.m	Wed Jan 01 08:43:43 2014 -0500
+++ b/scripts/help/get_first_help_sentence.m	Thu Jan 02 11:54:51 2014 +0100
@@ -124,11 +124,11 @@
     sep_idx = min (space_idx, bracket_idx);
     def_type = help_text(def1+1:sep_idx-1);
 
-    end_idx = strfind (help_text, sprintf ("@end %s", def_type))(1);
+    end_idx = strfind (help_text, sprintf ("@end %s", def_type));
     if (isempty (end_idx))
       error ("get_first_help_sentence: couldn't parse texinfo");
     endif
-    keep(end_idx:end) = false;
+    keep(end_idx(1):end) = false;
 
     help_text = help_text(keep);
   endif