summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-03-13 21:39:22 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-03-13 21:39:22 +0000
commit65159a271d375162a3ac3bc089677dc09b8185dc (patch)
treefbdb616a60a7944290dbe503c18d4eec788abf1a /usr.bin/tmux
parent6e81bed7e73cc9f54a8b8d4fc0da3f9ff0b9dc68 (diff)
The pane's style should be initialized to default before parsing the
argument.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/cmd-select-pane.c5
-rw-r--r--usr.bin/tmux/colour.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-select-pane.c b/usr.bin/tmux/cmd-select-pane.c
index 12c606cc67e..4b7fdfe3cf4 100644
--- a/usr.bin/tmux/cmd-select-pane.c
+++ b/usr.bin/tmux/cmd-select-pane.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-select-pane.c,v 1.45 2018/10/18 08:38:01 nicm Exp $ */
+/* $OpenBSD: cmd-select-pane.c,v 1.46 2019/03/13 21:39:21 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -19,6 +19,7 @@
#include <sys/types.h>
#include <stdlib.h>
+#include <string.h>
#include "tmux.h"
@@ -143,6 +144,8 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(self->args, 'P') || args_has(self->args, 'g')) {
if (args_has(args, 'P')) {
style = args_get(args, 'P');
+ memcpy(&wp->colgc, &grid_default_cell,
+ sizeof wp->colgc);
if (style_parse(&grid_default_cell, &wp->colgc,
style) == -1) {
cmdq_error(item, "bad style: %s", style);
diff --git a/usr.bin/tmux/colour.c b/usr.bin/tmux/colour.c
index 63dfaa22846..0683fa14276 100644
--- a/usr.bin/tmux/colour.c
+++ b/usr.bin/tmux/colour.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: colour.c,v 1.16 2018/10/25 15:13:38 nicm Exp $ */
+/* $OpenBSD: colour.c,v 1.17 2019/03/13 21:39:21 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -160,7 +160,7 @@ colour_tostring(int c)
case 97:
return ("brightwhite");
}
- return (NULL);
+ return ("invalid");
}
/* Convert colour from string. */