diff options
author | 2017-01-16 23:45:08 +0000 | |
---|---|---|
committer | 2017-01-16 23:45:08 +0000 | |
commit | 6fe3b30c62512dd5606bac1e5f4428093a98e9f4 (patch) | |
tree | a7b0fe35bac9c930c285f921aa2895671dc701ff | |
parent | SIGTERM does not reliably terminate mountd(8), use -KILL for cleanup. (diff) | |
download | wireguard-openbsd-6fe3b30c62512dd5606bac1e5f4428093a98e9f4.tar.xz wireguard-openbsd-6fe3b30c62512dd5606bac1e5f4428093a98e9f4.zip |
Correctly handle -style options without all of a corresponding -fg/-bg/-attr.
-rw-r--r-- | usr.bin/tmux/options.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/tmux/options.c b/usr.bin/tmux/options.c index 672d8c21491..a70db4e9201 100644 --- a/usr.bin/tmux/options.c +++ b/usr.bin/tmux/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.27 2017/01/16 14:49:14 nicm Exp $ */ +/* $OpenBSD: options.c,v 1.28 2017/01/16 23:45:08 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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); } |