summaryrefslogtreecommitdiffstats
path: root/options.c
diff options
context:
space:
mode:
authornicm <nicm>2017-01-16 23:45:08 +0000
committernicm <nicm>2017-01-16 23:45:08 +0000
commit6b6b0e91d0e3ee5d92f67f383172037bf1348880 (patch)
treec9a0392307c7c56c5b14587b0951f2884539957e /options.c
parentef15b4195f1453bf6f81cfd1e456c049922aa574 (diff)
Correctly handle -style options without all of a corresponding -fg/-bg/-attr.
Diffstat (limited to 'options.c')
-rw-r--r--options.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/options.c b/options.c
index ffea70be..9c260e26 100644
--- a/options.c
+++ b/options.c
@@ -647,11 +647,14 @@ options_style_update_old(struct options *oo, struct options_entry *o)
size = strrchr(o->name, '-') - o->name;
xsnprintf(newname, sizeof newname, "%.*s-bg", size, o->name);
- options_set_number(oo, newname, o->style.bg);
+ if (options_get(oo, newname) != NULL)
+ options_set_number(oo, newname, o->style.bg);
xsnprintf(newname, sizeof newname, "%.*s-fg", size, o->name);
- options_set_number(oo, newname, o->style.fg);
+ if (options_get(oo, newname) != NULL)
+ options_set_number(oo, newname, o->style.fg);
xsnprintf(newname, sizeof newname, "%.*s-attr", size, o->name);
- options_set_number(oo, newname, o->style.attr);
+ if (options_get(oo, newname) != NULL)
+ options_set_number(oo, newname, o->style.attr);
}