From 0dcbb8fbdfea6d31a253ed3a5ff3d783ec48370b Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Wed, 16 Feb 2000 14:05:08 +0000 Subject: [PATCH] Don't output empty header fields. This is made necessary by the addition of possibly empty my_hdr commands. --- sendlib.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sendlib.c b/sendlib.c index 2f1574c0..f6180791 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1274,6 +1274,7 @@ int mutt_write_rfc822_header (FILE *fp, ENVELOPE *env, BODY *attach, int mode, int privacy) { char buffer[LONG_STRING]; + char *p; LIST *tmp = env->userhdrs; if (mode == 0 && !privacy) @@ -1362,8 +1363,14 @@ int mutt_write_rfc822_header (FILE *fp, ENVELOPE *env, BODY *attach, /* Add any user defined headers */ for (; tmp; tmp = tmp->next) { - fputs (tmp->data, fp); - fputc ('\n', fp); + if ((p = strchr (tmp->data, ':'))) + { + p++; SKIPWS (p); + if (!*p) continue; /* don't emit empty fields. */ + + fputs (tmp->data, fp); + fputc ('\n', fp); + } } return (ferror (fp) == 0 ? 0 : -1); -- 2.50.1