]> git.ipfire.org Git - thirdparty/git.git/commit - imap-send.c
wrap_in_html(): process message in bulk rather than line-by-line
authorMichael Haggerty <mhagger@alum.mit.edu>
Sun, 25 Nov 2012 11:08:41 +0000 (12:08 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 2 Dec 2012 09:21:58 +0000 (01:21 -0800)
commit118a68f9ddbca6ffd87ab6e32b60771143d9d014
treed6d612ae7eb8bd438f6a7a40cd109dc826984e7c
parent3c64063558d57735384d3c547c0138aca7dfd3b8
wrap_in_html(): process message in bulk rather than line-by-line

Now that we can xml-quote an arbitrary string in O(N), there is no
reason to process the message line by line.  This change saves lots of
memory allocations and copying.

The old code would have created invalid output when there was no
body, emitting a closing </pre> without a blank line nor an opening
<pre> after the header.  The new code simply returns in this
situation without doing harm (even though either would not make much
sense in the context of imap-send that is meant to send out patches).

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c