*/
static enum threestate is_falted(FILE *);
static size_t copyname(char *, char *);
+static int is_separator(char *);
/*
enum threestate falted;
nchars = getline(&tmpline, &len, msg);
- if (nchars == -1) {
+ if (nchars < 1) {
if (feof(msg)) {
return FILEEOF2;
} else {
return FMTERR2;
}
- if (nchars > 0 && (*tmpline == '\n' || *tmpline == '-')) {
+ if (is_separator(tmpline)) {
/* header/body separator found */
free(tmpline);
return m_getfld2(BODY2, f, msg);
return strlen(dst);
}
+
+static int
+is_separator(char *line)
+{
+ /*
+ ** In MH, lines that are consists of dashes only are
+ ** separators as well ... not so in RFC 822.
+ */
+ while (*line == '-') {
+ line++;
+ }
+ if (strcmp("\n", line)==0) {
+ return 1;
+ }
+ return 0;
+}