1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05: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 3131de4767
commit b81821a21c
2 changed files with 7 additions and 3 deletions

2
NEWS
View File

@ -40,6 +40,8 @@ Miscellaneous:
``Background and Notify'' via the download manager in some terminal,
reassociate the download with that terminal. These changes do not
apply to downloads to external handlers.
* Don't crash when the search-toggle-regex action is used and no regular
expression support is compiled in.
* Really retry forever when connection.retries = 0.
* enhancement: Session-specific options. Any options changed with
toggle-* actions no longer affect other tabs or other terminals.

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 */