summaryrefslogtreecommitdiffstats
path: root/layout-set.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2011-03-19 23:31:08 +0000
committerTiago Cunha <tcunha@gmx.com>2011-03-19 23:31:08 +0000
commit20e17604b5bb7c89be1182428ed94dfe7e2b1d37 (patch)
treed446ea221184702b3439d323b2cca4d627e6965c /layout-set.c
parenta0295b4c2f648c008b732f7981304ae6e2df322b (diff)
Sync OpenBSD patchset 867:
Prevent tiled producing a corrupt layout when only one column is needed, from Karl Ferdinand Ebert.
Diffstat (limited to 'layout-set.c')
-rw-r--r--layout-set.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/layout-set.c b/layout-set.c
index 1a155db8..80cc95ba 100644
--- a/layout-set.c
+++ b/layout-set.c
@@ -1,4 +1,4 @@
-/* $Id: layout-set.c,v 1.8 2010-12-22 15:23:59 tcunha Exp $ */
+/* $Id: layout-set.c,v 1.9 2011-03-19 23:31:08 tcunha 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;