Treat 'end\0', 'end\n', 'end\r\n' as trailer line, see rev 1.2

This commit is contained in:
Wolfram Schneider 1997-02-18 20:19:04 +00:00
parent 9b4e82f125
commit 3e4c0ae52d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22894

View File

@ -255,7 +255,9 @@ decode2(flag)
}
}
}
if (!fgets(buf, sizeof(buf), stdin) || strncmp(buf, "end", 3) || (buf[3] && buf[3] != '\n')) {
if (fgets(buf, sizeof(buf), stdin) == NULL ||
(strcmp(buf, "end") && strcmp(buf, "end\n") &&
strcmp(buf, "end\r\n"))) {
(void)fprintf(stderr, "uudecode: %s: no \"end\" line.\n",
filename);
return(1);