[SCM] GNU Mailutils branch, master, updated. release-2.2-385-g25934e9

"Sergey Poznyakoff" <[email protected]>
Newsgroups gmane.comp.gnu.mailutils.cvs
Message-ID <[email protected]>
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=25934e9ccda6d60b56f77125a6466e5c6b5de305

The branch, master has been updated
       via  25934e9ccda6d60b56f77125a6466e5c6b5de305 (commit)
      from  4c82a261bcfd422dba0a2ea68b4ea415b42c6217 (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 25934e9ccda6d60b56f77125a6466e5c6b5de305
Author: Sergey Poznyakoff <[email protected]>
Date:   Mon Aug 29 11:53:47 2011 +0300

    Make sure header reads always return the trailing \n, even for empty headers.
    
    * libmailutils/mailbox/header.c (header_read): Always return trailing \n.

-----------------------------------------------------------------------

Summary of changes:
 libmailutils/mailbox/header.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/libmailutils/mailbox/header.c b/libmailutils/mailbox/header.c
index 6913c8b..8c56f4a 100644
--- a/libmailutils/mailbox/header.c
+++ b/libmailutils/mailbox/header.c
@@ -993,6 +993,22 @@ header_read (mu_stream_t is, char *buffer, size_t buflen, size_t *pnread)
   status = mu_header_fill (header);
   if (status)
     return status;
+
+  if (header->spool_size == 0)
+    {
+      size_t len = 0;
+
+      if (hstr->off == 0 && buflen > 0)
+	{
+	  /* Provide the trailing \n */
+	  *buffer = '\n';
+	  hstr->off++;
+	  len = 1;
+	}
+      if (pnread)
+	*pnread = len;
+      return 0;
+    }
   
   if (mu_hdrent_find_stream_pos (header, hstr->off, &ent, &ent_off))
     {


hooks/post-receive
-- 
GNU Mailutils
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.