for (;;) {
snprintf (path, _POSIX_PATH_MAX, "%s/.mutt-%s-%d-%d",
- dest->path, NONULL (Hostname), (int) getpid (), Counter++);
+ dest->path, NONULL(MCore.shorthost), (int) getpid (), Counter++);
umask (Umask);
if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) {
if (errno != EEXIST) {
int count;
#ifdef USE_HCACHE
- void *hc = NULL;
+ hcache_t *hc = NULL;
void *data;
struct timeval *when = NULL;
struct stat lastchanged;
snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path);
#ifdef USE_HCACHE
- if (option (OPTHCACHEVERIFY)) {
- ret = stat (fn, &lastchanged);
- }
- else {
- lastchanged.st_mtime = 0;
- ret = 0;
- }
-
- if (data != NULL && !ret && lastchanged.st_mtime <= when->tv_sec) {
- p->h = mutt_hcache_restore ((unsigned char *) data, &p->h);
+ ret = stat(fn, &lastchanged);
+ if (data && !ret && lastchanged.st_mtime <= when->tv_sec) {
+ p->h = mutt_hcache_restore(data, &p->h);
maildir_parse_flags (p->h, fn);
- }
- else
+ } else
#endif
if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h)) {
p->header_parsed = 1;
#ifdef USE_HCACHE
mutt_hcache_store (hc, p->h->path + 3, p->h, 0, &maildir_hcache_keylen);
#endif
- }
- else
+ } else {
header_delete(&p->h);
+ }
#ifdef USE_HCACHE
p_delete(&data);
#endif
}
#ifdef USE_HCACHE
- mutt_hcache_close (hc);
+ mutt_hcache_close (&hc);
#endif
}
for (;;) {
snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s",
dest->path, subdir, (long) time (NULL),
- (unsigned int) getpid (), Counter++, NONULL (Hostname), suffix);
+ (unsigned int) getpid (), Counter++, NONULL (MCore.shorthost), suffix);
umask (Umask);
if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) {
for (;;) {
snprintf (path, _POSIX_PATH_MAX, "%s/%ld.%u_%d.%s%s", subdir,
(long) time (NULL), (unsigned int) getpid (), Counter++,
- NONULL (Hostname), suffix);
+ NONULL (MCore.shorthost), suffix);
snprintf (full, _POSIX_PATH_MAX, "%s/%s", ctx->path, path);
if (safe_rename (msg->path, full) == 0) {
struct maildir *md; /* list of messages in the mailbox */
struct maildir **last, *p;
int i;
- HASH *fnames; /* hash table for quickly looking up the base filename
+ hash_t *fnames; /* hash table for quickly looking up the base filename
for a maildir message */
if (!option (OPTCHECKNEW))
* of each message we scanned. This is used in the loop over the
* existing messages below to do some correlation.
*/
- fnames = hash_create (1031, 0);
+ fnames = hash_new (1031, 0);
for (p = md; p; p = p->next) {
maildir_canon_filename (buf, p->h->path, sizeof (buf));
}
/* destroy the file name hash */
- hash_destroy (&fnames, NULL);
+ hash_delete (&fnames, NULL);
/* If we didn't just get new mail, update the tables. */
if (occult)
struct maildir *md, *p;
struct maildir **last = NULL;
struct mh_sequences mhs;
- HASH *fnames;
+ hash_t *fnames;
int i;
if (!option (OPTCHECKNEW))
mhs_free_sequences (&mhs);
/* check for modifications and adjust flags */
- fnames = hash_create (1031, 0);
+ fnames = hash_new (1031, 0);
for (p = md; p; p = p->next)
hash_insert (fnames, p->h->path, p);
/* destroy the file name hash */
- hash_destroy (&fnames, NULL);
+ hash_delete (&fnames, NULL);
/* If we didn't just get new mail, update the tables. */
if (occult)