projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
mh.c
diff --git
a/mh.c
b/mh.c
index
a26579e
..
7028dbf
100644
(file)
--- a/
mh.c
+++ b/
mh.c
@@
-24,6
+24,10
@@
#include "buffy.h"
#include "sort.h"
#include "buffy.h"
#include "sort.h"
+#include "lib/mem.h"
+#include "lib/intl.h"
+#include "lib/str.h"
+
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
@@
-38,11
+42,17
@@
#include <string.h>
#include <utime.h>
#include <string.h>
#include <utime.h>
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
struct maildir {
HEADER *h;
char *canon_fname;
unsigned header_parsed:1;
struct maildir {
HEADER *h;
char *canon_fname;
unsigned header_parsed:1;
+#ifdef USE_INODESORT
ino_t inode;
ino_t inode;
+#endif /* USE_INODESORT */
struct maildir *next;
};
struct maildir *next;
};
@@
-628,7
+638,9
@@
static int maildir_parse_entry (CONTEXT * ctx, struct maildir ***last,
entry = safe_calloc (sizeof (struct maildir), 1);
entry->h = h;
entry->header_parsed = (ctx->magic == M_MH);
entry = safe_calloc (sizeof (struct maildir), 1);
entry->h = h;
entry->header_parsed = (ctx->magic == M_MH);
+#ifdef USE_INODESORT
entry->inode = inode;
entry->inode = inode;
+#endif /* USE_INODESORT */
**last = entry;
*last = &entry->next;
**last = entry;
*last = &entry->next;
@@
-738,6
+750,7
@@
static int maildir_move_to_context (CONTEXT * ctx, struct maildir **md)
return r;
}
return r;
}
+#ifdef USE_INODESORT
/*
* Merge two maildir lists according to the inode numbers.
*/
/*
* Merge two maildir lists according to the inode numbers.
*/
@@
-814,6
+827,7
@@
static struct maildir *maildir_sort_inode (struct maildir *list)
right = maildir_sort_inode (right);
return maildir_merge_inode (left, right);
}
right = maildir_sort_inode (right);
return maildir_merge_inode (left, right);
}
+#endif /* USE_INODESORT */
#if USE_HCACHE
static size_t maildir_hcache_keylen (const char *fn)
#if USE_HCACHE
static size_t maildir_hcache_keylen (const char *fn)
@@
-921,7
+935,9
@@
int mh_read_dir (CONTEXT * ctx, const char *subdir)
mhs_free_sequences (&mhs);
}
mhs_free_sequences (&mhs);
}
+#ifdef USE_INODESORT
md = maildir_sort_inode (md);
md = maildir_sort_inode (md);
+#endif /* USE_INODESORT */
if (ctx->magic == M_MAILDIR)
maildir_delayed_parsing (ctx, md);
if (ctx->magic == M_MAILDIR)
maildir_delayed_parsing (ctx, md);
@@
-980,7
+996,7
@@
static void maildir_flags (char *dest, size_t destlen, HEADER * hdr)
hdr->read ? "S" : "", hdr->deleted ? "T" : "",
NONULL (hdr->maildir_flags));
if (hdr->maildir_flags)
hdr->read ? "S" : "", hdr->deleted ? "T" : "",
NONULL (hdr->maildir_flags));
if (hdr->maildir_flags)
- qsort (tmp, strlen (tmp), 1, ch_compar);
+ qsort (tmp,
mutt_
strlen (tmp), 1, ch_compar);
snprintf (dest, destlen, ":2,%s", tmp);
}
}
snprintf (dest, destlen, ":2,%s", tmp);
}
}