version 1.4, 1997/07/13 21:21:16 |
version 1.5, 1997/07/13 23:54:02 |
|
|
#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); |
|
|
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)) { |
|
|
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); |
|
|
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); |
|
|
#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) { |
|
|
#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); |
|
|
} |
} |
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) { |
|
|
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); |