/*
- Copyright (c) 2004 Joey Schulze <joey@infodrom.org>
+ Copyright (c) 2004,8 Joey Schulze <joey@infodrom.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* #define FROM_DETECTION */
+#define HDR_LEN 1024
+
struct mail {
- char from[128];
- char subject[128];
+ char from[HDR_LEN];
+ char subject[HDR_LEN];
int priority;
off_t size;
};
-#define HDR_LEN 1024
#define TAB 0x09
#define LWSP 0x20
buf[strlen(buf)-1] = '\0';
if (inheader && !feof(f)) {
- lookahead = fgetc(f);
- if (lookahead == TAB || lookahead == LWSP) {
+ while ((lookahead=fgetc(f)) == TAB || lookahead == LWSP) {
if (buf[strlen(buf)-1] != LWSP)
strncat (buf, " ", sizeof(buf)-strlen(buf)-1);
if ((cp = fgets(tmp, sizeof(tmp), f)) != NULL) {
}
}
}
- } else
- /* Rewind by one character for next read */
- if (lookahead != EOF)
- fseek(f, -1, SEEK_CUR);
+ }
+ /* Rewind by one character for next read */
+ if (lookahead != EOF)
+ fseek(f, -1, SEEK_CUR);
}
} else {
/* Read the remainder */