Show
Ignore:
Timestamp:
2007-04-10 17:40:11 (21 months ago)
Author:
Brendan Cully <brendan@…>
Branch:
HEAD
Message:

Make IMAP header cache layout match body cache.
You can now make them point to the same directory. Each folder will
have a folder.hcache file for the header cache.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • imap/message.c

    r5112 r5115  
    120120 
    121121#if USE_HCACHE 
    122   imap_hcache_open (idata); 
     122  idata->hcache = imap_hcache_open (idata, NULL); 
    123123 
    124124  if (idata->hcache && !msgbegin) 
     
    848848static body_cache_t *msg_cache_open (IMAP_DATA *idata) 
    849849{ 
    850   char *s; 
    851   char *p = idata->mailbox; 
    852850  char mailbox[_POSIX_PATH_MAX]; 
    853   size_t mlen = sizeof (mailbox); 
    854851 
    855852  if (idata->bcache) 
    856853    return idata->bcache; 
    857854 
    858   mailbox[0] = '\0'; 
    859  
    860   for (s = mailbox; p && *p && mlen; mlen--) 
    861   { 
    862     if (*p == idata->delim) 
    863     { 
    864       *s = '/'; 
    865       /* simple way to avoid collisions with UIDs */ 
    866       if (*(p + 1) >= '0' && *(p + 1) <= '9') 
    867       { 
    868         mlen--; 
    869         if (mlen) 
    870           *++s = '_'; 
    871       } 
    872     } 
    873     else 
    874       *s = *p; 
    875     p++; 
    876     s++; 
    877   } 
    878   *s = '\0'; 
     855  imap_cachepath (idata, idata->mailbox, mailbox, sizeof (mailbox)); 
    879856 
    880857  return mutt_bcache_open (&idata->conn->account, mailbox);