From ceab9b93675f523f25b1eea410cd42d408d8c020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 28 May 2021 17:42:09 +0200 Subject: [PATCH] grid: reflow: when determining row end coord, check *last* URI range --- grid.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grid.c b/grid.c index 6d8434ab..5212e5b6 100644 --- a/grid.c +++ b/grid.c @@ -553,7 +553,11 @@ grid_resize_and_reflow( struct row_uri_range *range; if (old_row->extra != NULL && tll_length(old_row->extra->uri_ranges) > 0) { range = &tll_front(old_row->extra->uri_ranges); - col_count = max(col_count, range->end + 1); + + /* Make sure the *last* URI range's end point is included in the copy */ + const struct row_uri_range *last_on_row = + &tll_back(old_row->extra->uri_ranges); + col_count = max(col_count, last_on_row->end + 1); } else range = NULL;