1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

config: Unsetting a missing option is not an error.

(cherry picked from commit 2c9d966c99)
This commit is contained in:
Kalle Olavi Niemitalo 2008-02-03 12:35:56 +02:00 committed by Kalle Olavi Niemitalo
parent 34c91ea021
commit 6ef4f017be

View File

@ -333,8 +333,15 @@ parse_unset(struct option *opt_tree, struct conf_parsing_state *state,
mem_free(optname_copy);
optname_copy = NULL;
if (!opt || (opt->flags & OPT_HIDDEN))
return show_parse_error(state, ERROR_OPTION);
if (!opt || (opt->flags & OPT_HIDDEN)) {
/* The user wanted to delete the option, and
* it has already been deleted; this is not an
* error. This might happen if a version of
* ELinks has a built-in URL rewriting rule,
* the user disables it, and a later version
* no longer has it. */
return ERROR_NONE;
}
if (!mirror) {
if (opt->flags & OPT_ALLOC) delete_option(opt);