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
  • sendlib.c

    r5397 r5457  
    15211521#define REF_INC 16 
    15221522 
    1523 #define TrimRef 10 
    1524  
    15251523/* need to write the list in reverse because they are stored in reverse order 
    15261524 * when parsed to speed up threading 
    15271525 */ 
    1528 static void write_references (LIST *r, FILE *f) 
     1526void mutt_write_references (LIST *r, FILE *f, int trim) 
    15291527{ 
    15301528  LIST **ref = NULL; 
    15311529  int refcnt = 0, refmax = 0; 
    15321530 
    1533   for ( ; (TrimRef == 0 || refcnt < TrimRef) && r ; r = r->next) 
     1531  for ( ; (trim == 0 || refcnt < trim) && r ; r = r->next) 
    15341532  { 
    15351533    if (refcnt == refmax) 
     
    18261824    { 
    18271825      fputs ("References:", fp); 
    1828       write_references (env->references, fp); 
     1826      mutt_write_references (env->references, fp, 10); 
    18291827      fputc('\n', fp); 
    18301828    } 
     
    18381836  { 
    18391837    fputs ("In-Reply-To:", fp); 
    1840     write_references (env->in_reply_to, fp); 
     1838    mutt_write_references (env->in_reply_to, fp, 1); 
    18411839    fputc ('\n', fp); 
    18421840  }