summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-03-07 23:55:17 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-03-07 23:55:17 +0000
commit7b0bcaf525ebc1cc0f406f8320da0faa6c55c1a6 (patch)
tree948d8e9b2b29650db05a4d9b7266de0b4b8c61f6
parentf1ab809368396ce843eb430aa5044a3d98e520d3 (diff)
Prevent tiled producing a corrupt layout when only one column is needed,
from Karl Ferdinand Ebert.
-rw-r--r--usr.bin/tmux/layout-set.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/layout-set.c b/usr.bin/tmux/layout-set.c
index 5dbceb10b08..360acf2b10f 100644
--- a/usr.bin/tmux/layout-set.c
+++ b/usr.bin/tmux/layout-set.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: layout-set.c,v 1.8 2010/12/19 18:35:08 nicm Exp $ */
+/* $OpenBSD: layout-set.c,v 1.9 2011/03/07 23:55:16 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -519,7 +519,7 @@ layout_set_tiled(struct window *w)
TAILQ_INSERT_TAIL(&lc->cells, lcrow, entry);
/* If only one column, just use the row directly. */
- if (n - (j * columns) == 1) {
+ if (n - (j * columns) == 1 || columns == 1) {
layout_make_leaf(lcrow, wp);
wp = TAILQ_NEXT(wp, entry);
continue;