This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Mailutils".
http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=80bb8b2fc30ba04dda9eb652519c65897542437e The branch, master has been updated via 80bb8b2fc30ba04dda9eb652519c65897542437e (commit) from 08ee8ee88d79d84ddc12b8bed8a4e297580a2887 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 80bb8b2fc30ba04dda9eb652519c65897542437e Author: Sergey Poznyakoff <g...@gnu.org.ua> Date: Thu Nov 25 00:30:29 2010 +0200 mhn: minor changes. * mh/etc/mhl.headers: New file. * mh/etc/Makefile.am (MH_FILES): Add mhl.headers. * mh/mhn.c (opt_handler): Use mh_find_file to resolve format file name. (mhn_show): Always open the formfile. (copy_header_to_stream): Rewrite using mu_stream_copy + HEADER filter. ----------------------------------------------------------------------- Summary of changes: mh/etc/Makefile.am | 1 + mh/etc/{mhl.format => mhl.headers} | 17 +++++------ mh/mhn.c | 54 ++++++++++++++++------------------- 3 files changed, 34 insertions(+), 38 deletions(-) copy mh/etc/{mhl.format => mhl.headers} (50%) diff --git a/mh/etc/Makefile.am b/mh/etc/Makefile.am index f8c0f3c..b4d4397 100644 --- a/mh/etc/Makefile.am +++ b/mh/etc/Makefile.am @@ -26,6 +26,7 @@ MH_FILES = \ forwcomps\ mhl.format\ mhl.forward\ + mhl.headers\ mhl.repl\ mhl.usenet\ replcomps\ diff --git a/mh/etc/mhl.format b/mh/etc/mhl.headers similarity index 50% copy from mh/etc/mhl.format copy to mh/etc/mhl.headers index 4b6b7cb..7ae5943 100644 --- a/mh/etc/mhl.format +++ b/mh/etc/mhl.headers @@ -1,21 +1,20 @@ -; This is the default mhl.format file for Mailutils MH. +; mhl.headers ; ; GNU Mailutils -- a suite of utilities for electronic mail -; Copyright (C) 2003, 2010 Free Software Foundation, Inc. +; Copyright (C) 2010 Free Software Foundation, Inc. ; Distributed under GPLv3+. See <http://gnu.org/licenses/gpl.html>. ; -: -- using template mhl.format -- +; Mhn uses this format file for displaying headers in MIME messages. +; overflowtext="***",overflowoffset=5 leftadjust,compwidth=9 -ignores=msgid,message-id,received +ignores=msgid,message-id,received,content-type,content-transfer-encoding,content-id Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>" To: cc: -: -From: -Subject: +From:decode +Subject:decode : extras:nocomponent : -body:nocomponent,overflowtext=,overflowoffset=0,noleftadjust -; End of mhl.format \ No newline at end of file +; End of mhl.headers diff --git a/mh/mhn.c b/mh/mhn.c index 5ddfece..69aa832 100644 --- a/mh/mhn.c +++ b/mh/mhn.c @@ -96,6 +96,7 @@ static struct argp_option options[] = { /* Traditional MH options */ struct mh_option mh_option[] = { { "file", MH_OPT_ARG, "filename" }, + { "compose" }, { "list", MH_OPT_BOOL }, { "headers", MH_OPT_BOOL }, { "realsize", MH_OPT_BOOL }, @@ -357,7 +358,7 @@ opt_handler (int key, char *arg, struct argp_state *state) break; case ARG_FORM: - formfile = arg; + mh_find_file (arg, &formfile); break; /* Common options */ @@ -390,6 +391,11 @@ opt_handler (int key, char *arg, struct argp_state *state) charset = arg; break; + case ARGP_KEY_FINI: + if (!formfile) + mh_find_file ("mhl.headers", &formfile); + break; + default: return ARGP_ERR_UNKNOWN; } @@ -1444,22 +1450,7 @@ mhn_show () exit (1); } - if (formfile) - { - char *s = mh_expand_name (MHLIBDIR, "mhl.headers", 0); - if (access (s, R_OK) == 0) - formfile = "mhl.headers"; - free (s); - } - - if (formfile) - { - char *s = mh_expand_name (MHLIBDIR, formfile, 0); - mhl_format = mhl_format_compile (s); - if (!mhl_format) - exit (1); - free (s); - } + mhl_format = mhl_format_compile (formfile); if (message) rc = show_message (message, 0, ostr); @@ -1895,22 +1886,27 @@ copy_header (mu_message_t msg, mu_header_t out) void copy_header_to_stream (mu_message_t msg, mu_stream_t stream) { + int rc; mu_header_t hdr; - mu_stream_t in; - char *buf = NULL; - size_t bufsize = 0, n = 0; - + mu_stream_t flt, str; + mu_message_get_header (msg, &hdr); - mu_header_get_streamref (hdr, &in); - /* FIXME: Use mu_stream_copy */ - while (mu_stream_getline (in, &buf, &bufsize, &n) == 0 && n > 0) + mu_header_get_streamref (hdr, &str); + rc = mu_filter_create (&flt, str, "HEADER", + MU_FILTER_DECODE, MU_STREAM_READ); + mu_stream_unref (str); + if (rc) { - if (n == 1 && buf[0] == '\n') - break; - mu_stream_write (stream, buf, n, NULL); + mu_error (_("cannot open filter stream: %s"), mu_strerror (rc)); + exit (1); } - mu_stream_destroy (&in); - free (buf); + rc = mu_stream_copy (stream, flt, 0, NULL); + if (rc) + { + mu_error (_("error reading headers: %s"), mu_strerror (rc)); + exit (1); + } + mu_stream_destroy (&flt); } void hooks/post-receive -- GNU Mailutils _______________________________________________ Commit-mailutils mailing list Commit-mailutils@gnu.org http://lists.gnu.org/mailman/listinfo/commit-mailutils