mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -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.
This commit is contained in:
parent
6d55be2043
commit
ab8ef9698f
@ -877,8 +877,6 @@ create_config_string(unsigned char *prefix, unsigned char *name,
|
|||||||
touching = 0;
|
touching = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (savestyle == 2) watermark_deleted_options(options->value.tree);
|
|
||||||
|
|
||||||
/* Scaring. */
|
/* Scaring. */
|
||||||
if (savestyle == 2
|
if (savestyle == 2
|
||||||
|| (savestyle < 2
|
|| (savestyle < 2
|
||||||
|
@ -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
|
static int
|
||||||
check_nonempty_tree(LIST_OF(struct option) *options)
|
check_nonempty_tree(LIST_OF(struct option) *options)
|
||||||
{
|
{
|
||||||
|
@ -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 LIST_OF(struct option) *init_options_tree(void);
|
||||||
extern void unmark_options_tree(LIST_OF(struct option) *);
|
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,
|
extern void smart_config_string(struct string *, int, int,
|
||||||
LIST_OF(struct option) *, unsigned char *, int,
|
LIST_OF(struct option) *, unsigned char *, int,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user