version 1.58, 2006/06/01 05:34:52 |
version 1.59, 2006/06/01 09:00:50 |
|
|
struct line *lp1, *lp2; |
struct line *lp1, *lp2; |
struct line *olp; /* line we started at */ |
struct line *olp; /* line we started at */ |
struct mgwin *wp; |
struct mgwin *wp; |
int nbytes, s, nline, siz, x = -1, x2; |
int nbytes, s, nline = 0, siz, x = -1, x2; |
int opos; /* offset we started at */ |
int opos; /* offset we started at */ |
|
int oline; /* original line number */ |
|
|
if (replacebuf == TRUE) |
if (replacebuf == TRUE) |
x = undo_enable(FALSE); |
x = undo_enable(FALSE); |
|
|
} |
} |
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. */ |
x2 = undo_enable(FALSE); |
x2 = undo_enable(FALSE); |
|
oline = curwp->w_dotline; |
(void)lnewline(); |
(void)lnewline(); |
olp = lback(curwp->w_dotp); |
olp = lback(curwp->w_dotp); |
if (olp == curbp->b_linep) { |
if (olp == curbp->b_linep) { |
|
|
siz += nbytes + 1; |
siz += nbytes + 1; |
switch (s) { |
switch (s) { |
case FIOSUC: |
case FIOSUC: |
++nline; |
|
/* FALLTHRU */ |
/* FALLTHRU */ |
case FIOEOF: |
case FIOEOF: |
/* the last line of the file */ |
/* the last line of the file */ |
|
++nline; |
if ((lp1 = lalloc(nbytes)) == NULL) { |
if ((lp1 = lalloc(nbytes)) == NULL) { |
/* keep message on the display */ |
/* keep message on the display */ |
s = FIOERR; |
s = FIOERR; |
|
|
} |
} |
} |
} |
endoffile: |
endoffile: |
undo_add_insert(olp, opos, siz-1); |
undo_add_insert(olp, opos, siz - 1); |
|
|
/* ignore errors */ |
/* ignore errors */ |
ffclose(NULL); |
ffclose(NULL); |
|
|
(void)ldelnewline(); |
(void)ldelnewline(); |
curwp->w_dotp = olp; |
curwp->w_dotp = olp; |
curwp->w_doto = opos; |
curwp->w_doto = opos; |
|
curwp->w_dotline = oline; |
if (olp == curbp->b_linep) |
if (olp == curbp->b_linep) |
curwp->w_dotp = lforw(olp); |
curwp->w_dotp = lforw(olp); |
if (newname != NULL) |
if (newname != NULL) |
|
|
} |
} |
} |
} |
} |
} |
|
bp->b_lines += nline; |
cleanup: |
cleanup: |
undo_enable(x); |
undo_enable(x); |
|
|
|
|
* Since we don't have variables (we probably should) this is a command |
* Since we don't have variables (we probably should) this is a command |
* processor for changing the value of the make backup flag. If no argument |
* processor for changing the value of the make backup flag. If no argument |
* is given, sets makebackup to true, so backups are made. If an argument is |
* is given, sets makebackup to true, so backups are made. If an argument is |
* given, no backup files are made when saving a new version of a file. Only |
* given, no backup files are made when saving a new version of a file. |
* used when BACKUP is #defined. |
|
*/ |
*/ |
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |