summaryrefslogtreecommitdiffstats
path: root/copy.c
diff options
context:
space:
mode:
authorAron Griffis <agriffis@n01se.net>2008-07-10 09:38:25 -0400
committerAron Griffis <agriffis@n01se.net>2008-07-10 09:38:25 -0400
commitab70b12289a42e3591d25bbea9ad417ff5290588 (patch)
tree060df97cff1aaca1370f3229aaf4a83dc6139207 /copy.c
parente9eadb389aa4bf7c69407d378254273008a8482e (diff)
Unify mutt_write_references
copy.c and sendlib.c have independent and different implementations of writing references to a file. Choose the one in sendlib since it's conservative with mallocs and supports trimming the list. Signed-off-by: Aron Griffis <agriffis@n01se.net>
Diffstat (limited to 'copy.c')
-rw-r--r--copy.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/copy.c b/copy.c
index d7a96667..04484173 100644
--- a/copy.c
+++ b/copy.c
@@ -369,11 +369,11 @@ mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix)
if (h->env->irt_changed && h->env->in_reply_to)
{
LIST *listp = h->env->in_reply_to;
- fputs ("In-Reply-To: ", out);
+ fputs ("In-Reply-To:", out);
for (; listp; listp = listp->next)
{
- fputs (listp->data, out);
fputc (' ', out);
+ fputs (listp->data, out);
}
fputc ('\n', out);
}
@@ -381,27 +381,8 @@ mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix)
if (h->env->refs_changed && h->env->references)
{
LIST *listp = h->env->references, *refs = NULL, *t;
- fputs ("References: ", out);
-
- /* Mutt stores references in reverse order, thus we create
- * a reordered refs list that we can put in the headers */
- for (; listp; listp = listp->next, refs = t)
- {
- t = (LIST *)safe_malloc (sizeof (LIST));
- t->data = listp->data;
- t->next = refs;
- }
-
- for (; refs; refs = refs->next)
- {
- fputs (refs->data, out);
- fputc (' ', out);
- }
-
- /* clearing refs from memory */
- for (t = refs; refs; refs = t->next, t = refs)
- FREE (&refs);
-
+ fputs ("References:", out);
+ mutt_write_references (h->env->references, out, 0);
fputc ('\n', out);
}