--col;   if ( row == crow ) j = Length(screen, crow, ccol, col); else {	 j += Length(screen, crow, ccol, screen->max_col) + 1; for(i = crow + 1; i < row; i++) j += Length(screen, i, 0, screen->max_col) + 1; if (col >= 0) j += Length(screen, row, 0, col); }    if (screen->selection_size <= j) { if((line = (char *)malloc((unsigned) j + 1)) == 0) SysError(ERROR_BMALLOC2); XtFree(screen->selection); screen->selection = line; screen->selection_size = j + 1; } else line = screen->selection; if (!line || j < 0) return;  line[j] = '\0';		 lp = line;		 if ( row == crow ) lp = SaveText(screen, row, ccol, col, lp, &eol); else { lp = SaveText(screen, crow, ccol, screen->max_col, lp, &eol); if (eol) *lp ++ = '\n';	 for(i = crow +1; i < row; i++) { lp = SaveText(screen, i, 0, screen->max_col, lp, &eol); if (eol) *lp ++ = '\n'; } if (col >= 0) lp = SaveText(screen, row, 0, col, lp, &eol); } *lp = '\0';		  TRACE(("Salted TEXT:%.*s\n", lp - line, line)) screen->selection_length = (lp - line); _OwnSelection(term, params, num_params);
TRACE(("Salted TEXT:%.*s\n", (char *)lp - line, line)); screen->selection_length = ((char *)lp - line); _OwnSelection(term, params, num_params);
SaltTextAway(    int crow, int ccol, int row, int col,    String *params,			/* selections */    Cardinal num_params)    /* Guaranteed that (crow, ccol) <= (row, col), and that both points are valid       (may have row = screen->max_row+1, col = 0) */{	register TScreen *screen = &term->screen;	register int i, j = 0;	int eol;	char *line, *lp;	if (crow == row && ccol > col) {	    int tmp = ccol;	    ccol = col;	    col = tmp;	}	--col;	/* first we need to know how long the string is before we can save it*/	if ( row == crow ) j = Length(screen, crow, ccol, col);	else {	/* two cases, cut is on same line, cut spans multiple lines */		j += Length(screen, crow, ccol, screen->max_col) + 1;		for(i = crow + 1; i < row; i++)			j += Length(screen, i, 0, screen->max_col) + 1;		if (col >= 0)			j += Length(screen, row, 0, col);	}	/* now get some memory to save it in */	if (screen->selection_size <= j) {	    if((line = (char *)malloc((unsigned) j + 1)) == 0)		SysError(ERROR_BMALLOC2);	    XtFree(screen->selection);	    screen->selection = line;	    screen->selection_size = j + 1;	} else line = screen->selection;	if (!line || j < 0) return;	line[j] = '\0';		/* make sure it is null terminated */	lp = line;		/* lp points to where to save the text */	if ( row == crow ) lp = SaveText(screen, row, ccol, col, lp, &eol);	else {		lp = SaveText(screen, crow, ccol, screen->max_col, lp, &eol);		if (eol)			*lp ++ = '\n';	/* put in newline at end of line */		for(i = crow +1; i < row; i++) {			lp = SaveText(screen, i, 0, screen->max_col, lp, &eol);			if (eol)				*lp ++ = '\n';			}		if (col >= 0)			lp = SaveText(screen, row, 0, col, lp, &eol);	}	*lp = '\0';		/* make sure we have end marked */	TRACE(("Salted TEXT:%.*s\n", lp - line, line))	screen->selection_length = (lp - line);	_OwnSelection(term, params, num_params);}