[1935] in testers
movemail fixes
daemon@ATHENA.MIT.EDU (Mark Rosenstein)
Tue May 26 19:12:47 1992
Date: Tue, 26 May 92 19:11:54 -0400
From: Mark Rosenstein <mar@MIT.EDU>
To: testers@MIT.EDU
OK, this fixes the problem I ran across. It doesn't count a period in
the middle of a long line as an end of message terminator, and won't
trash memory under certain obscure circumstances.
-Mark
*** /source/third/common/gnu/emacs/etc/movemail.c Tue May 26 10:13:42 1992
--- /afs/athena.mit.edu/user/m/a/mar/movemail.c Tue May 26 19:05:04 1992
***************
*** 358,363 ****
--- 358,364 ----
char ibuffer[BUFSIZ];
char obuffer[BUFSIZ];
char Errmsg[80];
+ int longline;
static int debug = 0;
***************
*** 673,678 ****
--- 674,681 ----
while (--n > 0 && (c = fgetc(f)) != EOF)
if ((*p++ = c) == '\n') break;
+ if (n < 0) longline++;
+
if (ferror(f)) {
strcpy(buf, "error on connection");
return (NOTOK);
***************
*** 684,691 ****
}
*p = NULL;
! if (*--p == '\n') *p = NULL;
! if (*--p == '\r') *p = NULL;
return(OK);
}
--- 687,694 ----
}
*p = NULL;
! if (p >= buf && *--p == '\n') *p = NULL;
! if (p >= buf && *--p == '\r') *p = NULL;
return(OK);
}
***************
*** 694,701 ****
register int n;
FILE *f;
{
if (getline(buf, n, f) != OK) return (NOTOK);
! if (*buf == '.') {
if (*(buf+1) == NULL) {
return (DONE);
} else {
--- 697,705 ----
register int n;
FILE *f;
{
+ longline = 0;
if (getline(buf, n, f) != OK) return (NOTOK);
! if (!longline && *buf == '.') {
if (*(buf+1) == NULL) {
return (DONE);
} else {