mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
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 ab8ef9698f
)
This commit is contained in:
parent
2e71908995
commit
b2c11e21c9
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user