Mercurial > octave-nkf
comparison scripts/help/get_first_help_sentence.m @ 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 | d63878346099 |
children | 9ac2357f19bc |
comparison
equal
deleted
inserted
replaced
18190:ab775508dff9 | 18191:f80d258a2c7d |
---|---|
122 error ("get_first_help_sentence: couldn't parse texinfo"); | 122 error ("get_first_help_sentence: couldn't parse texinfo"); |
123 endif | 123 endif |
124 sep_idx = min (space_idx, bracket_idx); | 124 sep_idx = min (space_idx, bracket_idx); |
125 def_type = help_text(def1+1:sep_idx-1); | 125 def_type = help_text(def1+1:sep_idx-1); |
126 | 126 |
127 end_idx = strfind (help_text, sprintf ("@end %s", def_type))(1); | 127 end_idx = strfind (help_text, sprintf ("@end %s", def_type)); |
128 if (isempty (end_idx)) | 128 if (isempty (end_idx)) |
129 error ("get_first_help_sentence: couldn't parse texinfo"); | 129 error ("get_first_help_sentence: couldn't parse texinfo"); |
130 endif | 130 endif |
131 keep(end_idx:end) = false; | 131 keep(end_idx(1):end) = false; |
132 | 132 |
133 help_text = help_text(keep); | 133 help_text = help_text(keep); |
134 endif | 134 endif |
135 | 135 |
136 ## Run makeinfo to generate plain text | 136 ## Run makeinfo to generate plain text |