X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fm_getfld.c;h=cefedec6a1a1e32f9d1fc49119f96bd52a0a03bb;hp=5dd697397f6d3bed44fb6834a7f9e07aaedc4247;hb=71ca16329d950bccd713a739ea430998b802aa23;hpb=be6a3c548620f6d908ccaff321c8fb372b615406 diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index 5dd6973..cefedec 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -144,7 +144,7 @@ static int m_Eom(int, FILE *); static unsigned char *matchc(int, char *, int, char *); static unsigned char *locc(int, unsigned char *, unsigned char); -#define eom(c,iob) (msg_style == MS_MBOX && \ +#define eom(c,iob) (ismbox && \ (((c) == *msg_delim && m_Eom(c,iob)) ||\ (eom_action && (*eom_action)(c)))) @@ -157,7 +157,7 @@ static unsigned char **pat_map; */ int msg_count = 0; -int msg_style = MS_DEFAULT; +int ismbox = FALSE; /* ** The "full" delimiter string for a packed maildrop consists @@ -505,7 +505,7 @@ m_getfld(int state, unsigned char *name, unsigned char *buf, cnt = ++iob->_cnt; #endif c = (cnt < i ? cnt : i); - if (msg_style == MS_MBOX && c > 1) { + if (ismbox && c > 1) { /* ** packed maildrop - only take up to the (possible) ** start of the next message. This "matchc" should @@ -642,7 +642,7 @@ m_unknown(FILE *iob) if (strncmp(text, "From ", 5)!=0) { adios(NULL, "No Unix style (mbox) maildrop."); } - msg_style = MS_MBOX; + ismbox = TRUE; delimstr = "\nFrom "; cp = unixbuf; while ((c = getc(iob)) != '\n' && cp - unixbuf < BUFSIZ - 1) @@ -689,7 +689,7 @@ m_Eom(int c, FILE *iob) pos = ftell(iob); if ((i = fread(text, sizeof *text, edelimlen, iob)) != edelimlen || (strncmp(text, (char *)edelim, edelimlen)!=0)) { - if (i == 0 && msg_style == MS_MBOX) + if (i == 0 && ismbox) /* ** the final newline in the (brain damaged) unix-format ** maildrop is part of the delimitter - delete it. @@ -701,7 +701,7 @@ m_Eom(int c, FILE *iob) return 0; } - if (msg_style == MS_MBOX) { + if (ismbox) { cp = unixbuf; while ((c = getc(iob)) != '\n' && c >= 0 && cp - unixbuf < BUFSIZ - 1) *cp++ = c;