mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
config: Let mirroring be implicit unless values are rewritten.
(cherry picked from commit 6d55be2043
)
This commit is contained in:
parent
bfa41cef38
commit
2e71908995
@ -226,13 +226,6 @@ parse_set(struct option *opt_tree, struct conf_parsing_state *state,
|
|||||||
optname_copy = memacpy(optname_orig, optname_len);
|
optname_copy = memacpy(optname_orig, optname_len);
|
||||||
if (!optname_copy) return show_parse_error(state, ERROR_NOMEM);
|
if (!optname_copy) return show_parse_error(state, ERROR_NOMEM);
|
||||||
|
|
||||||
/* Mirror what we already have */
|
|
||||||
if (mirror) {
|
|
||||||
add_bytes_to_string(mirror, state->mirrored,
|
|
||||||
state->pos.look - state->mirrored);
|
|
||||||
state->mirrored = state->pos.look;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Option value */
|
/* Option value */
|
||||||
{
|
{
|
||||||
struct option *opt;
|
struct option *opt;
|
||||||
@ -286,6 +279,9 @@ parse_set(struct option *opt_tree, struct conf_parsing_state *state,
|
|||||||
else
|
else
|
||||||
opt->flags |= OPT_WATERMARK;
|
opt->flags |= OPT_WATERMARK;
|
||||||
if (option_types[opt->type].write) {
|
if (option_types[opt->type].write) {
|
||||||
|
add_bytes_to_string(mirror, state->mirrored,
|
||||||
|
pos_before_value.look
|
||||||
|
- state->mirrored);
|
||||||
option_types[opt->type].write(opt, mirror);
|
option_types[opt->type].write(opt, mirror);
|
||||||
state->mirrored = state->pos.look;
|
state->mirrored = state->pos.look;
|
||||||
}
|
}
|
||||||
@ -323,13 +319,6 @@ parse_unset(struct option *opt_tree, struct conf_parsing_state *state,
|
|||||||
optname_copy = memacpy(optname_orig, optname_len);
|
optname_copy = memacpy(optname_orig, optname_len);
|
||||||
if (!optname_copy) return show_parse_error(state, ERROR_NOMEM);
|
if (!optname_copy) return show_parse_error(state, ERROR_NOMEM);
|
||||||
|
|
||||||
/* Mirror what we have */
|
|
||||||
if (mirror) {
|
|
||||||
add_bytes_to_string(mirror, state->mirrored,
|
|
||||||
state->pos.look - state->mirrored);
|
|
||||||
state->mirrored = state->pos.look;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
struct option *opt;
|
struct option *opt;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user