line = resizeline(line, cols);
static void scroll(int topline, int botline, int lines, int sb){    unsigned long *line, *line2;    int i;    if (topline != 0 || alt_which != 0)	sb = FALSE;    if (lines < 0) {	while (lines < 0) {	    line = delpos234(screen, botline);	    for (i = 0; i < cols; i++)		line[i + 1] = erase_char;	    line[cols + 1] = 0;	    addpos234(screen, line, topline);	    if (selstart.y >= topline && selstart.y <= botline) {		selstart.y++;		if (selstart.y > botline) {		    selstart.y = botline;		    selstart.x = 0;		}	    }	    if (selend.y >= topline && selend.y <= botline) {		selend.y++;		if (selend.y > botline) {		    selend.y = botline;		    selend.x = 0;		}	    }	    lines++;	}    } else {	while (lines > 0) {	    line = delpos234(screen, topline);	    if (sb && savelines > 0) {		int sblen = count234(scrollback);		/*		 * We must add this line to the scrollback. We'll		 * remove a line from the top of the scrollback to		 * replace it, or allocate a new one if the		 * scrollback isn't full.		 */		if (sblen == savelines) {		    sblen--, line2 = delpos234(scrollback, 0);		} else {		    line2 = smalloc(TSIZE * (cols + 2));		    line2[0] = cols;		}		addpos234(scrollback, line, sblen);		line = line2;	    }	    for (i = 0; i < cols; i++)		line[i + 1] = erase_char;	    line[cols + 1] = 0;	    addpos234(screen, line, botline);	    if (selstart.y >= topline && selstart.y <= botline) {		selstart.y--;		if (selstart.y < topline) {		    selstart.y = topline;		    selstart.x = 0;		}	    }	    if (selend.y >= topline && selend.y <= botline) {		selend.y--;		if (selend.y < topline) {		    selend.y = topline;		    selend.x = 0;		}	    }	    lines--;	}    }}