test/whom/test-whom \
test/cleanup ## The "cleanup" test should always be last.
-XFAIL_TESTS = \
- test/inc/test-eom-align \
- #
+XFAIL_TESTS =
check_SCRIPTS = test/common.sh
int i;
char text[MAX_DELIMITER_SIZE];
char *cp;
+ int adjust = 1;
for (i = 0, cp = text; i < s->edelimlen; ++i, ++cp) {
int c2;
*cp = '\0';
break;
}
- *cp = c2;
+ *cp = c2;
}
if (i != s->edelimlen ||
return 1;
}
+ if (i != s->edelimlen && ! strncmp(text, s->fdelim, i)) {
+ /* If all or part of fdelim appeared at the end of the file,
+ back up even more so that the bytes are included in the
+ message. */
+ adjust = 2;
+ }
+
/* Did not find delimiter, so restore the read position.
Note that on input, a character had already been read
with Getc(). It will be unget by m_getfld () on return. */
- s->readpos -= s->bytes_read - 1;
- s->bytes_read = 1;
+ s->readpos -= s->bytes_read - adjust;
+ s->bytes_read = adjust;
return 0;
}