From 97eca99d0bae6c4fdfc38a6f42d42f05c8faac4b Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 26 Nov 2007 22:22:18 +0000 Subject: [PATCH] Code tidying. --- screen-display.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/screen-display.c b/screen-display.c index 1fb137d9..1985570e 100644 --- a/screen-display.c +++ b/screen-display.c @@ -1,4 +1,4 @@ -/* $Id: screen-display.c,v 1.8 2007-11-26 22:18:57 nicm Exp $ */ +/* $Id: screen-display.c,v 1.9 2007-11-26 22:22:18 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -174,28 +174,25 @@ screen_display_scroll_region_up(struct screen *s) * XXX should this be done somewhere else? */ if (s->rupper == 0 && s->rlower == screen_last_y(s)) { - sy = screen_size_y(s) + s->hsize; if (s->hsize == s->hlimit) { /* If the limit is hit, free 10% and shift up. */ ny = s->hlimit / 10; if (ny < 1) ny = 1; + + sy = screen_size_y(s) + s->hsize; screen_free_lines(s, 0, ny); screen_move_lines(s, 0, ny, sy - ny); s->hsize -= ny; - sy -= ny; } s->hsize++; - s->grid_data = xrealloc( - s->grid_data, sy + 1, sizeof *s->grid_data); - s->grid_attr = xrealloc( - s->grid_attr, sy + 1, sizeof *s->grid_attr); - s->grid_colr = xrealloc( - s->grid_colr, sy + 1, sizeof *s->grid_colr); - s->grid_size = xrealloc( - s->grid_size, sy + 1, sizeof *s->grid_size); + sy = screen_size_y(s) + s->hsize; + s->grid_data = xrealloc(s->grid_data, sy, sizeof *s->grid_data); + s->grid_attr = xrealloc(s->grid_attr, sy, sizeof *s->grid_attr); + s->grid_colr = xrealloc(s->grid_colr, sy, sizeof *s->grid_colr); + s->grid_size = xrealloc(s->grid_size, sy, sizeof *s->grid_size); screen_display_make_lines(s, screen_last_y(s), 1); return; }