From 7b0bcaf525ebc1cc0f406f8320da0faa6c55c1a6 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 7 Mar 2011 23:55:17 +0000 Subject: Prevent tiled producing a corrupt layout when only one column is needed, from Karl Ferdinand Ebert. --- usr.bin/tmux/layout-set.c | 4 ++-- 1 file 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 @@ -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; -- cgit v1.2.3