From ab8ef9698fd1eba9f1e81e7413b5ed355077d4fa Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 3 Feb 2008 13:19:05 +0200 Subject: [PATCH] config: In saving style 2, save deleted options too. Previously, ELinks set the OPT_WATERMARK flag in all deleted options when config.saving_style was 2, thus mostly preventing them from being saved. This had the unfortunate consequence that if you started with no elinks.conf, set config.saving_style = 2, deleted some built-in option (e.g. a URL rewriting rule), saved the settings, and restarted ELinks, then the built-in option would reappear. --- src/config/conf.c | 2 -- src/config/options.c | 13 ------------- src/config/options.h | 1 - 3 files changed, 16 deletions(-) diff --git a/src/config/conf.c b/src/config/conf.c index ab0a54937..afe485587 100644 --- a/src/config/conf.c +++ b/src/config/conf.c @@ -877,8 +877,6 @@ create_config_string(unsigned char *prefix, unsigned char *name, touching = 0; } - if (savestyle == 2) watermark_deleted_options(options->value.tree); - /* Scaring. */ if (savestyle == 2 || (savestyle < 2 diff --git a/src/config/options.c b/src/config/options.c index 313e3c7f2..c93552bb0 100644 --- a/src/config/options.c +++ b/src/config/options.c @@ -748,19 +748,6 @@ unmark_options_tree(LIST_OF(struct option) *tree) } } -void -watermark_deleted_options(LIST_OF(struct option) *tree) -{ - struct option *option; - - foreach (option, *tree) { - if (option->flags & OPT_DELETED) - option->flags |= OPT_WATERMARK; - else if (option->type == OPT_TREE) - watermark_deleted_options(option->value.tree); - } -} - static int check_nonempty_tree(LIST_OF(struct option) *options) { diff --git a/src/config/options.h b/src/config/options.h index 15d9d7949..68198d9be 100644 --- a/src/config/options.h +++ b/src/config/options.h @@ -162,7 +162,6 @@ extern void register_change_hooks(const struct change_hook_info *change_hooks); extern LIST_OF(struct option) *init_options_tree(void); extern void unmark_options_tree(LIST_OF(struct option) *); -void watermark_deleted_options(LIST_OF(struct option) *); extern void smart_config_string(struct string *, int, int, LIST_OF(struct option) *, unsigned char *, int,