Show
Ignore:
Timestamp:
2000-05-16 12:00:15 (9 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Some fixes to the size calculation code.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • compose.c

    r1792 r1794  
    418418 * cum_attachs_size: Cumulative Attachments Size 
    419419 * 
     420 * Returns the total number of bytes used by the attachments in the 
     421 * attachment list _after_ content-transfer-encodings have been 
     422 * applied. 
    420423 *  
    421  * Returns the total number of bytes used by the attachments in the 
    422  * attachment list. 
    423424 */ 
    424425 
     
    429430  ATTACHPTR **idx = menu->data; 
    430431  CONTENT *info; 
     432  BODY *b; 
    431433   
    432434  for (i = 0, s = 0; i < menu->max; i++) 
    433435  { 
    434     if ((info = idx[i]->content->content)) 
     436    b = idx[i]->content; 
     437 
     438    if (!b->content) 
     439      b->content = mutt_get_content_info (b->filename, b); 
     440 
     441    if ((info = b->content)) 
    435442    { 
    436       switch (idx[i]->content->encoding) 
     443      switch (b->encoding) 
    437444      { 
    438445        case ENCQUOTEDPRINTABLE: 
    439           s += 3 * (info->lobin + info->hibin) + info->ascii; 
     446          s += 3 * (info->lobin + info->hibin) + info->ascii + info->crlf; 
    440447          break; 
    441448        case ENCBASE64: 
    442           s += (4 * (info->lobin + info->hibin + info->ascii)) / 3; 
     449          s += (4 * (info->lobin + info->hibin + info->ascii + info->crlf)) / 3; 
    443450          break; 
    444451        default: 
    445           s += info->lobin + info->hibin + info->ascii; 
     452          s += info->lobin + info->hibin + info->ascii + info->crlf; 
    446453          break; 
    447454      }