index-save.c revision 66251e6ab31e5cc153fe5cae608e416dacafe9cd
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "iobuffer.h"
#include "index-storage.h"
#include <stdlib.h>
#include <unistd.h>
{
int i, cr;
for (i = 0; i < (int)size; i++) {
if (data[i] == '\r')
cr = i;
/* missing CR */
return FALSE;
return FALSE;
/* skip the data so far. \n is left into buffer and
we'll continue from the next character. */
data += i;
size -= i;
i = 0; cr = -2;
}
}
}
{
unsigned char *data;
int ret;
if (ret == -1) {
"Error reading mail: %m");
return FALSE;
}
/* -2 = buffer full, ignore it since we're just emptying it.. */
if (size == 0)
continue;
"for file %s: %m", path);
return FALSE;
}
}
return TRUE;
}