fix_cpos;
static void erase_lots(Terminal *term,		       int line_only, int from_begin, int to_end){    pos start, end;    int erase_lattr;    int erasing_lines_from_top = 0;    if (line_only) {	start.y = term->curs.y;	start.x = 0;	end.y = term->curs.y + 1;	end.x = 0;	erase_lattr = FALSE;    } else {	start.y = 0;	start.x = 0;	end.y = term->rows;	end.x = 0;	erase_lattr = TRUE;    }    if (!from_begin) {	start = term->curs;    }    if (!to_end) {	end = term->curs;	incpos(end);    }    if (!from_begin || !to_end)	check_boundary(term, term->curs.x, term->curs.y);    check_selection(term, start, end);    /* Clear screen also forces a full window redraw, just in case. */    if (start.y == 0 && start.x == 0 && end.y == term->rows)	term_invalidate(term);    /* Lines scrolled away shouldn't be brought back on if the terminal     * resizes. */    if (start.y == 0 && start.x == 0 && end.x == 0 && erase_lattr)	erasing_lines_from_top = 1;    if (term->cfg.erase_to_scrollback && erasing_lines_from_top) {	/* If it's a whole number of lines, starting at the top, and	 * we're fully erasing them, erase by scrolling and keep the	 * lines in the scrollback. */	int scrolllines = end.y;	if (end.y == term->rows) {	    /* Shrink until we find a non-empty row.*/	    scrolllines = find_last_nonempty_line(term, term->screen) + 1;	}	if (scrolllines > 0)	    scroll(term, 0, scrolllines - 1, scrolllines, TRUE);	fix_cpos;    } else {	termline *ldata = scrlineptr(start.y);	while (poslt(start, end)) {	    if (start.x == term->cols) {		if (!erase_lattr)		    ldata->lattr &= ~(LATTR_WRAPPED | LATTR_WRAPPED2);		else		    ldata->lattr = LATTR_NORM;	    } else {		ldata->chars[start.x] = term->erase_char;	    }	    if (incpos(start) && start.y < term->rows) {		ldata = scrlineptr(start.y);	    }	}    }    /* After an erase of lines from the top of the screen, we shouldn't     * bring the lines back again if the terminal enlarges (since the user or     * application has explictly thrown them away). */    if (erasing_lines_from_top && !(term->alt_which))	term->tempsblines = 0;}