be parsed as well. Unfortunately the speed issue finally caught up with
us since this routine is at the very heart of MH.
be parsed as well. Unfortunately the speed issue finally caught up with
us since this routine is at the very heart of MH.
function called by the macro eom(). Unless we are bursting a maildrop,
the eom() macro returns FALSE saying we aren't at the end of the
message.
function called by the macro eom(). Unless we are bursting a maildrop,
the eom() macro returns FALSE saying we aren't at the end of the
message.
static char *matchc(int, char *, int, char *);
#define eom(c,s) (s->msg_style != MS_DEFAULT && \
static char *matchc(int, char *, int, char *);
#define eom(c,s) (s->msg_style != MS_DEFAULT && \
/* This replaces the old approach, with its direct access to stdio
* internals. It uses one fread() to load a buffer that we manage.
/* This replaces the old approach, with its direct access to stdio
* internals. It uses one fread() to load a buffer that we manage.
* separate messages in a maildrop, such as mbox "From ".
*
* Some of the tests in the test suite assume a MSG_INPUT_SIZE
* separate messages in a maildrop, such as mbox "From ".
*
* Some of the tests in the test suite assume a MSG_INPUT_SIZE
- if (s->end - s->readpos < 1) {
- if (read_more (s) == 0) {
- /* Pretend that we read a character. That's what stdio does. */
- ++s->readpos;
- return EOF;
- }
+ if (s->end - s->readpos < 1 && read_more (s) == 0) {
+ return EOF;
+ } else {
+ ++s->bytes_read;
+ return s->readpos < s->end ? (unsigned char) *s->readpos++ : EOF;
- if (s->end - s->readpos < 1) {
- if (read_more (s) == 0) {
- /* Pretend that we read a character. That's what stdio does. */
- ++s->readpos;
- return EOF;
- }
+ if (s->end - s->readpos < 1 && read_more (s) == 0) {
+ return EOF;
+ } else {
+ return s->readpos < s->end ? (unsigned char) *s->readpos : EOF;
s->msg_style = MS_UNKNOWN;
for (i = 0, cp = text; i < sizeof text; ++i, ++cp) {
s->msg_style = MS_UNKNOWN;
for (i = 0, cp = text; i < sizeof text; ++i, ++cp) {
{
register int i;
char text[MAX_DELIMITER_SIZE];
char *cp;
for (i = 0, cp = text; i < s->edelimlen; ++i, ++cp) {
{
register int i;
char text[MAX_DELIMITER_SIZE];
char *cp;
for (i = 0, cp = text; i < s->edelimlen; ++i, ++cp) {