1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-21 00:25:37 +00:00

Fix crash on search-toggle-regex when RE disabled

Check the return value of get_opt_rec on "document.browse.search.regex"
before dereferencing it.  The option is not there if regular expression
support is disabled at build time.

This commit fixes a bug introduced in commit
b2d51c75ff0d6c52a4f6a2761801beb641cba3a2.
This commit is contained in:
Miciah Dashiel Butler Masters 2009-02-22 03:43:59 +00:00
parent 4a2fd2d964
commit 84259ff26a
2 changed files with 7 additions and 3 deletions

2
NEWS
View File

@ -31,6 +31,8 @@ Other changes:
title, note the charset. Don't truncate titles to the width of the
terminal.
* bug 1061: Correctly truncate UTF-8 titles in the tab bar.
* Don't crash when the search-toggle-regex action is used and no regular
expression support is compiled in.
* minor bug 761: When reading bookmarks from an XBEL file, distinguish
attribute names from attribute values.
* enhancement: Updated ISO 8859-7, ISO 8859-16, KOI8-R, and MacRoman.

View File

@ -1423,9 +1423,11 @@ text_typeahead_handler(struct input_line *line, int action_id)
get_opt_rec(config_options,
"document.browse.search.regex");
opt->value.number = (opt->value.number + 1)
% (opt->max + 1);
option_changed(ses, opt);
if (opt) {
opt->value.number = (opt->value.number + 1)
% (opt->max + 1);
option_changed(ses, opt);
}
}
/* Fall thru */