[BACK]Return to file.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/file.c between version 1.6 and 1.7

version 1.6, 2001/05/04 22:00:35 version 1.7, 2001/05/23 22:20:35
Line 182 
Line 182 
         /* 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)
Line 198 
Line 198 
         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);
         }          }
   
Line 262 
Line 262 
         }          }
 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)
Line 273 
Line 273 
         /* 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)
Line 298 
Line 298 
                 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) {
Line 340 
Line 340 
         /* 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 */
Line 472 
Line 472 
                         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;
 }  }
   
Line 480 
Line 480 
  * 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;
 {  {

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7