From e78afec69f277159f4b821b02b2280cb05b270bb Mon Sep 17 00:00:00 2001 From: Philipp Takacs Date: Sun, 8 May 2016 18:21:34 +0200 Subject: [PATCH] don't warn if lenerr is ignored --- uip/mhparse.c | 1 - uip/pick.c | 5 ++++- uip/prompter.c | 2 +- uip/scansbr.c | 11 ++++++----- uip/slocal.c | 1 - uip/sortm.c | 5 ++++- uip/whom.c | 4 +++- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/uip/mhparse.c b/uip/mhparse.c index c250675..b860dcf 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -251,7 +251,6 @@ get_content(FILE *in, char *file, int toplevel) for (compnum = 1, state = FLD2;;) { switch (state = m_getfld2(state, &f, in)) { case LENERR2: - advise(NULL, "To long field"); state = FLD2; /* FALL */ case FLD2: diff --git a/uip/pick.c b/uip/pick.c index b0205fd..7d9c086 100644 --- a/uip/pick.c +++ b/uip/pick.c @@ -1249,6 +1249,10 @@ plist fseek(fp, start, SEEK_SET); for (state = FLD2, bp = NULL;;) { switch (state = m_getfld2(state, &f, fp)) { + case LENERR2: + state = FLD2; + /* FALL */ + case FLD2: if (bp) { mh_free0(&bp); @@ -1259,7 +1263,6 @@ plist } continue; - case LENERR2: case FMTERR2: advise(NULL, "format error in message %d", msgnum); state = FLD2; diff --git a/uip/prompter.c b/uip/prompter.c index bc7cd43..ea17b91 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -141,9 +141,9 @@ main(int argc, char **argv) for (state = FLD2;;) { switch (state = m_getfld2(state, &f, in)) { case LENERR2: - advise(NULL, "Header to long"); state = FLD2; /* FALL */ + case FLD2: /* ** Check if the value of field contains diff --git a/uip/scansbr.c b/uip/scansbr.c index feef5c0..0495838 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -107,6 +107,9 @@ scan(FILE *inb, int innum, int outnum, char *fmtstr, int width, int curflg, for (compnum = 1, state = FLD2; ; ) { state = m_getfld2(state, &f, inb); switch (state) { + case LENERR2: + state = FLD2; + /* FALL */ case FLD2: compnum++; if (incing) { @@ -191,16 +194,14 @@ body:; } goto finished; - case LENERR2: - advise(NULL, "line \"%s\" too long", trim(f.value)); - goto handleerror; - case FMTERR2: if (strncmp("From ", f.value, 5)==0) { state = FILEEOF2; goto finished; } - /* FALL */ + compnum++; + advise(NULL, "formate error in component #%d", compnum); + continue; case IOERR2: handleerror:; diff --git a/uip/slocal.c b/uip/slocal.c index 26cad52..bff4320 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -759,7 +759,6 @@ parse(int fd) for (i = 0, state = FLD2;;) { switch (state = m_getfld2(state, &f, in)) { case LENERR2: - advise(NULL, "format error in message"); state = FLD2; /* FALL */ diff --git a/uip/sortm.c b/uip/sortm.c index 061ae5a..ff69bc9 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -332,7 +332,6 @@ get_fields(char *datesw, int msg, struct smsg *smsg) for (compnum = 1, state = FLD2;; compnum++) { switch (state = m_getfld2(state, &f, in)) { case LENERR2: - admonish(NULL, "To long header field in message %d (header %s, #%d)", msg, f.name, compnum); state = FLD2; /* FALL */ case FLD2: @@ -355,6 +354,10 @@ get_fields(char *datesw, int msg, struct smsg *smsg) break; case FMTERR2: + admonish(NULL, "format error in message %d (header #%d)", msg, compnum); + state = FLD2; + continue; + case IOERR2: admonish(NULL, "format error in message %d (header #%d)", msg, compnum); if (datecomp) { diff --git a/uip/whom.c b/uip/whom.c index e02994f..7486dd8 100644 --- a/uip/whom.c +++ b/uip/whom.c @@ -216,7 +216,6 @@ process(char *file) for (compnum=1, state=FLD2;; compnum++) { switch (state = m_getfld2(state, &f, in)) { case LENERR2: - advise(NULL, "field %d contains a to long line", f.name); state = FLD2; /* FALL */ case FLD2: @@ -228,6 +227,9 @@ process(char *file) break; case FMTERR2: + advise(NULL, "message format error in component #%d", compnum); + continue; + case IOERR2: adios(EX_DATAERR, NULL, "message format error in component #%d", compnum); -- 1.7.10.4