mbox-open.c revision 429c1e6a778d7e84d6d2d2b506709566903445c9
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "iobuffer.h"
#include "mbox-index.h"
#include "mail-index-util.h"
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
{
char buf[7], *p;
/* check for inconsistency here, to avoid extra error messages */
if (index->inconsistent)
return NULL;
return NULL;
if (fd == -1) {
return NULL;
}
if (pos == -1) {
return NULL;
}
/* make sure message size is valid */
(off_t)stop_offset) {
/* and check that we end with either EOF or to
beginning of next message */
if (ret >= 6) {
/* "[\r]\nFrom " expected */
if (buf[0] != '\r')
p = buf;
else {
p = buf+1;
ret--;
}
} else {
p = buf;
if (ret > 0 && *p == '\r') {
p++;
ret--;
}
if (ret > 0 && *p == '\n')
ret--;
if (ret == 0)
}
}
}
if (!failed) {
}
} else {
/* file has been updated, rescan it */
}
if (failed) {
return NULL;
} else {
}
}