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

Diff for /src/usr.bin/mail/quit.c between version 1.4 and 1.5

version 1.4, 1997/07/13 21:21:16 version 1.5, 1997/07/13 23:54:02
Line 130 
Line 130 
 #ifdef APPEND  #ifdef APPEND
                 fseek(fbuf, (long)mailsize, 0);                  fseek(fbuf, (long)mailsize, 0);
                 while ((c = getc(fbuf)) != EOF)                  while ((c = getc(fbuf)) != EOF)
                         (void) putc(c, rbuf);                          (void)putc(c, rbuf);
 #else  #else
                 p = minfo.st_size - mailsize;                  p = minfo.st_size - mailsize;
                 while (p-- > 0) {                  while (p-- > 0) {
                         c = getc(fbuf);                          c = getc(fbuf);
                         if (c == EOF)                          if (c == EOF)
                                 goto newmail;                                  goto newmail;
                         (void) putc(c, rbuf);                          (void)putc(c, rbuf);
                 }                  }
 #endif  #endif
                 (void)Fclose(rbuf);                  (void)Fclose(rbuf);
Line 233 
Line 233 
                 rm(tempQuit);                  rm(tempQuit);
                 if ((abuf = Fopen(mbox, "r")) != NULL) {                  if ((abuf = Fopen(mbox, "r")) != NULL) {
                         while ((c = getc(abuf)) != EOF)                          while ((c = getc(abuf)) != EOF)
                                 (void) putc(c, obuf);                                  (void)putc(c, obuf);
                         (void)Fclose(abuf);                          (void)Fclose(abuf);
                 }                  }
                 if (ferror(obuf)) {                  if (ferror(obuf)) {
Line 284 
Line 284 
                 rewind(ibuf);                  rewind(ibuf);
                 c = getc(ibuf);                  c = getc(ibuf);
                 while (c != EOF) {                  while (c != EOF) {
                         (void) putc(c, obuf);                          (void)putc(c, obuf);
                         if (ferror(obuf))                          if (ferror(obuf))
                                 break;                                  break;
                         c = getc(ibuf);                          c = getc(ibuf);
Line 329 
Line 329 
                 if (abuf == NULL)                  if (abuf == NULL)
                         goto newmail;                          goto newmail;
                 while ((c = getc(rbuf)) != EOF)                  while ((c = getc(rbuf)) != EOF)
                         (void) putc(c, abuf);                          (void)putc(c, abuf);
                 (void)Fclose(rbuf);                  (void)Fclose(rbuf);
                 trunc(abuf);                  trunc(abuf);
                 (void)Fclose(abuf);                  (void)Fclose(abuf);
Line 373 
Line 373 
 #ifndef APPEND  #ifndef APPEND
         if (res != NULL)          if (res != NULL)
                 while ((c = getc(res)) != EOF)                  while ((c = getc(res)) != EOF)
                         (void) putc(c, obuf);                          (void)putc(c, obuf);
 #endif  #endif
         for (mp = &message[0]; mp < &message[msgCount]; mp++)          for (mp = &message[0]; mp < &message[msgCount]; mp++)
                 if ((mp->m_flag&MPRESERVE)||(mp->m_flag&MTOUCH)==0) {                  if ((mp->m_flag&MPRESERVE)||(mp->m_flag&MTOUCH)==0) {
Line 387 
Line 387 
 #ifdef APPEND  #ifdef APPEND
         if (res != NULL)          if (res != NULL)
                 while ((c = getc(res)) != EOF)                  while ((c = getc(res)) != EOF)
                         (void) putc(c, obuf);                          (void)putc(c, obuf);
 #endif  #endif
         fflush(obuf);          fflush(obuf);
         trunc(obuf);          trunc(obuf);
Line 467 
Line 467 
                 }                  }
                 fseek(ibuf, (long)mailsize, 0);                  fseek(ibuf, (long)mailsize, 0);
                 while ((c = getc(ibuf)) != EOF)                  while ((c = getc(ibuf)) != EOF)
                         (void) putc(c, obuf);                          (void)putc(c, obuf);
                 (void)Fclose(ibuf);                  (void)Fclose(ibuf);
                 (void)Fclose(obuf);                  (void)Fclose(obuf);
                 if ((ibuf = Fopen(tempname, "r")) == NULL) {                  if ((ibuf = Fopen(tempname, "r")) == NULL) {
Line 500 
Line 500 
         gotcha = (c == 0 && ibuf == NULL);          gotcha = (c == 0 && ibuf == NULL);
         if (ibuf != NULL) {          if (ibuf != NULL) {
                 while ((c = getc(ibuf)) != EOF)                  while ((c = getc(ibuf)) != EOF)
                         (void) putc(c, obuf);                          (void)putc(c, obuf);
                 (void)Fclose(ibuf);                  (void)Fclose(ibuf);
         }          }
         fflush(obuf);          fflush(obuf);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5