version 1.6, 2001/05/04 22:00:35 |
version 1.7, 2001/05/23 22:20:35 |
|
|
/* cheap */ |
/* cheap */ |
bp = curbp; |
bp = curbp; |
if (newname != (char *)NULL) |
if (newname != (char *)NULL) |
(VOID)strcpy(bp->b_fname, newname); |
(void)strcpy(bp->b_fname, newname); |
|
|
/* hard file open */ |
/* hard file open */ |
if ((s = ffropen(fname, needinfo ? bp : (BUFFER *) NULL)) == FIOERR) |
if ((s = ffropen(fname, needinfo ? bp : (BUFFER *) NULL)) == FIOERR) |
|
|
opos = curwp->w_doto; |
opos = curwp->w_doto; |
|
|
/* open a new line, at point, and start inserting after it */ |
/* open a new line, at point, and start inserting after it */ |
(VOID)lnewline(); |
(void)lnewline(); |
olp = lback(curwp->w_dotp); |
olp = lback(curwp->w_dotp); |
if (olp == curbp->b_linep) { |
if (olp == curbp->b_linep) { |
/* if at end of buffer, create a line to insert before */ |
/* if at end of buffer, create a line to insert before */ |
(VOID)lnewline(); |
(void)lnewline(); |
curwp->w_dotp = lback(curwp->w_dotp); |
curwp->w_dotp = lback(curwp->w_dotp); |
} |
} |
|
|
|
|
} |
} |
endoffile: |
endoffile: |
/* ignore errors */ |
/* ignore errors */ |
(VOID)ffclose((BUFFER *)NULL); |
(void)ffclose((BUFFER *)NULL); |
/* don't zap an error */ |
/* don't zap an error */ |
if (s == FIOEOF) { |
if (s == FIOEOF) { |
if (nline == 1) |
if (nline == 1) |
|
|
/* set mark at the end of the text */ |
/* set mark at the end of the text */ |
curwp->w_dotp = curwp->w_markp = lback(curwp->w_dotp); |
curwp->w_dotp = curwp->w_markp = lback(curwp->w_dotp); |
curwp->w_marko = llength(curwp->w_markp); |
curwp->w_marko = llength(curwp->w_markp); |
(VOID)ldelnewline(); |
(void)ldelnewline(); |
curwp->w_dotp = olp; |
curwp->w_dotp = olp; |
curwp->w_doto = opos; |
curwp->w_doto = opos; |
if (olp == curbp->b_linep) |
if (olp == curbp->b_linep) |
|
|
lp2 = curwp->w_dotp; |
lp2 = curwp->w_dotp; |
} else { |
} else { |
/* delete extraneous newline */ |
/* delete extraneous newline */ |
(VOID)ldelnewline(); |
(void)ldelnewline(); |
out: lp2 = NULL; |
out: lp2 = NULL; |
} |
} |
for (wp = wheadp; wp != NULL; wp = wp->w_wndp) { |
for (wp = wheadp; wp != NULL; wp = wp->w_wndp) { |
|
|
/* old attributes are no longer current */ |
/* old attributes are no longer current */ |
bzero(&curbp->b_fi, sizeof(curbp->b_fi)); |
bzero(&curbp->b_fi, sizeof(curbp->b_fi)); |
if ((s = writeout(curbp, adjfname)) == TRUE) { |
if ((s = writeout(curbp, adjfname)) == TRUE) { |
(VOID)strcpy(curbp->b_fname, adjfname); |
(void)strcpy(curbp->b_fname, adjfname); |
#ifndef NO_BACKUP |
#ifndef NO_BACKUP |
curbp->b_flag &= ~(BFBAK | BFCHG); |
curbp->b_flag &= ~(BFBAK | BFCHG); |
#else /* !NO_BACKUP */ |
#else /* !NO_BACKUP */ |
|
|
ewprintf("Wrote %s", fn); |
ewprintf("Wrote %s", fn); |
} else |
} else |
/* ignore close error if it is a write error */ |
/* ignore close error if it is a write error */ |
(VOID)ffclose(bp); |
(void)ffclose(bp); |
return s == FIOSUC; |
return s == FIOSUC; |
} |
} |
|
|
|
|
* Tag all windows for bp (all windows if bp == NULL) as needing their |
* Tag all windows for bp (all windows if bp == NULL) as needing their |
* mode line updated. |
* mode line updated. |
*/ |
*/ |
VOID |
void |
upmodes(bp) |
upmodes(bp) |
BUFFER *bp; |
BUFFER *bp; |
{ |
{ |