From 342a47bc779a9c1391c11e77bde67b7262b736aa Mon Sep 17 00:00:00 2001 From: Micah Cowan Date: Wed, 28 Apr 2010 14:29:27 +0000 Subject: [PATCH] Avoid crashing in copy-mode during resize, when our history-viewing offset is larger than the new total number of history lines. --- window-copy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/window-copy.c b/window-copy.c index f563863c..2e7c4778 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1,4 +1,4 @@ -/* $Id: window-copy.c,v 1.115 2010-04-06 22:02:52 nicm Exp $ */ +/* $Id: window-copy.c,v 1.116 2010-04-28 14:29:27 micahcowan Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -340,6 +340,8 @@ window_copy_resize(struct window_pane *wp, u_int sx, u_int sy) data->cy = sy - 1; if (data->cx > sx) data->cx = sx; + if (data->oy > screen_hsize(data->backing)) + data->oy = screen_hsize(data->backing); window_copy_clear_selection(wp);