Changeset 5457:7729b1ad530c for copy.c

Show
Ignore:
Timestamp:
2008-07-10 06:38:25 (5 months ago)
Author:
Aron Griffis <agriffis@…>
Branch:
HEAD
Message:

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@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • copy.c

    r5456 r5457  
    370370      { 
    371371        LIST *listp = h->env->in_reply_to; 
    372         fputs ("In-Reply-To: ", out); 
     372        fputs ("In-Reply-To:", out); 
    373373        for (; listp; listp = listp->next) 
    374374        { 
     375          fputc (' ', out); 
    375376          fputs (listp->data, out); 
    376           fputc (' ', out); 
    377377        } 
    378378        fputc ('\n', out); 
     
    382382      { 
    383383        LIST *listp = h->env->references, *refs = NULL, *t; 
    384         fputs ("References: ", out); 
    385  
    386         /* Mutt stores references in reverse order, thus we create 
    387          * a reordered refs list that we can put in the headers */ 
    388         for (; listp; listp = listp->next, refs = t) 
    389         { 
    390           t = (LIST *)safe_malloc (sizeof (LIST)); 
    391           t->data = listp->data; 
    392           t->next = refs; 
    393         } 
    394  
    395         for (; refs; refs = refs->next) 
    396         { 
    397           fputs (refs->data, out); 
    398           fputc (' ', out); 
    399         } 
    400  
    401         /* clearing refs from memory */ 
    402         for (t = refs; refs; refs = t->next, t = refs) 
    403           FREE (&refs); 
    404  
     384        fputs ("References:", out); 
     385        mutt_write_references (h->env->references, out, 0); 
    405386        fputc ('\n', out); 
    406387      }