d = dump_int (0xdeadbeef, d, off);
while (a) {
-#ifdef EXACT_ADDRESS
- d = dump_char (a->val, d, off);
-#endif
d = dump_char (a->personal, d, off);
d = dump_char (a->mailbox, d, off);
d = dump_int (a->group, d, off);
while (counter) {
*a = safe_malloc (sizeof (ADDRESS));
-#ifdef EXACT_ADDRESS
- restore_char (&(*a)->val, d, off);
-#endif
restore_char (&(*a)->personal, d, off);
restore_char (&(*a)->mailbox, d, off);
restore_int ((unsigned int *) &(*a)->group, d, off);
safe_strlen ("HAVE_LANGINFO_CODESET"));
#endif
-#if EXACT_ADDRESS
- crc =
- crc32 (crc, (unsigned char const *) "EXACT_ADDRESS",
- safe_strlen ("EXACT_ADDRESS"));
-#endif
-
#ifdef USE_POP
crc =
crc32 (crc, (unsigned char const *) "USE_POP", safe_strlen ("USE_POP"));
mutt_hcache_open(const char *path, const char *folder)
{
struct header_cache *h = safe_calloc(1, sizeof (HEADER_CACHE));
- int flags = 0;
-#if 0 /* FIXME */
- int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384;
-#endif
+ int flags = VL_OWRITER | VL_OCREAT;
h->db = NULL;
h->folder = safe_strdup(folder);
h->crc = generate_crc32();
path = mutt_hcache_per_folder(path, folder);
if (option(OPTHCACHECOMPRESS))
- flags = VL_OZCOMP;
+ flags |= VL_OZCOMP;
- h->db = vlopen(path, flags | VL_OWRITER | VL_OCREAT, VL_CMPLEX);
- if (h->db)
- return h;
-
- /* if rw failed try ro */
- h->db = vlopen(path, flags | VL_OREADER, VL_CMPLEX);
+ h->db = vlopen(path, flags, VL_CMPLEX);
if (h->db)
return h;
else
if (! crc32_matches(data, h->crc))
{
- if (data) {
- FREE(&data);
- }
+ FREE(&data);
return NULL;
}
data = gdbm_fetch (h->db, key);
if (!crc32_matches (data.dptr, h->crc)) {
- free (data.dptr);
+ FREE(&data.dptr);
return NULL;
}
h->db->get (h->db, NULL, &key, &data, 0);
if (!crc32_matches (data.data, h->crc)) {
- free (data.data);
+ FREE(&data.data);
return NULL;
}