Show
Ignore:
Timestamp:
2007-04-02 14:33:29 (22 months ago)
Author:
Brendan Cully <brendan@…>
Branch:
HEAD
Message:

Fix a segfault in the new mboxcache hcache lookup.
idata may not have an associated context, so the cache path must use
the account info instead. For harmony with the other hcache callers,
make them all canonify the path the same way with imap_hcache_open.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • imap/util.c

    r4973 r5046  
    6767} 
    6868 
     69#ifdef USE_HCACHE 
     70void* imap_hcache_open (IMAP_DATA* idata, const char* path) 
     71{ 
     72  IMAP_MBOX mx; 
     73  ciss_url_t url; 
     74  char cachepath[LONG_STRING]; 
     75 
     76  if (imap_parse_path (path, &mx) < 0) 
     77    return NULL; 
     78 
     79  mutt_account_tourl (&idata->conn->account, &url); 
     80  url.path = mx.mbox; 
     81  url_ciss_tostring (&url, cachepath, sizeof (cachepath), 0); 
     82  FREE (&mx.mbox); 
     83 
     84  return mutt_hcache_open (HeaderCache, cachepath); 
     85} 
     86#endif 
     87 
    6988/* imap_parse_path: given an IMAP mailbox name, return host, port 
    7089 *   and a path IMAP servers will recognise.