From 71ca16329d950bccd713a739ea430998b802aa23 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Sat, 24 Mar 2012 17:06:15 +0100 Subject: [PATCH] Replaced msg_style with the boolean ismbox. We only need to differ between mbox and MH-default (one msg per file). --- h/mh.h | 8 +------- sbr/m_getfld.c | 12 ++++++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/h/mh.h b/h/mh.h index 0738f42..6a5cf9f 100644 --- a/h/mh.h +++ b/h/mh.h @@ -230,13 +230,7 @@ struct msgs { #define BODYEOF 4 /* Body returned ending at eom */ #define FILEEOF 5 /* Reached end of input file */ -/* -** Maildrop styles -*/ -#define MS_DEFAULT 0 /* default (one msg per file) */ -#define MS_MBOX 1 /* Unix-style "from" lines */ - -extern int msg_count; /* m_getfld() indicators */ +extern int msg_count; /* m_getfld() indicators (That's a hack!) */ #define NOUSE 0 /* draft being re-used */ 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; -- 1.7.10.4