From b2c11e21c96b591cf530380a92930eba22429b1f 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. (cherry picked from commit ab8ef9698fd1eba9f1e81e7413b5ed355077d4fa) --- 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 7dc5cc6f2..6e2a46150 100644 --- a/src/config/conf.c +++ b/src/config/conf.c @@ -875,8 +875,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 b797d437c..c581d0471 100644 --- a/src/config/options.c +++ b/src/config/options.c @@ -742,19 +742,6 @@ unmark_options_tree(struct list_head *tree) } } -void -watermark_deleted_options(struct list_head *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(struct list_head *options) { diff --git a/src/config/options.h b/src/config/options.h index 8a8a71f8b..11257089e 100644 --- a/src/config/options.h +++ b/src/config/options.h @@ -151,7 +151,6 @@ extern void register_change_hooks(struct change_hook_info *change_hooks); extern struct list_head *init_options_tree(void); extern void unmark_options_tree(struct list_head *); -void watermark_deleted_options(struct list_head *); extern void smart_config_string(struct string *, int, int, struct list_head *, unsigned char *, int, void (*)(struct string *, struct option *, unsigned char *, int, int, int, int));