Correctly handle -style options without all of a corresponding -fg/-bg/-attr.

This commit is contained in:
nicm
2017-01-16 23:45:08 +00:00
parent ef15b4195f
commit 6b6b0e91d0

View File

@ -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);
if (options_get(oo, newname) != NULL)
options_set_number(oo, newname, o->style.bg);
xsnprintf(newname, sizeof newname, "%.*s-fg", size, o->name);
if (options_get(oo, newname) != NULL)
options_set_number(oo, newname, o->style.fg);
xsnprintf(newname, sizeof newname, "%.*s-attr", size, o->name);
if (options_get(oo, newname) != NULL)
options_set_number(oo, newname, o->style.attr);
}