diff -u mutt-header-cache-8/Makefile.am mutt-header-cache-dropstat/Makefile.am --- mutt-header-cache-8/Makefile.am Wed May 19 08:52:17 2004 +++ mutt-header-cache-dropstat/Makefile.am Wed May 19 08:52:39 2004 @@ -17,6 +17,7 @@ bin_PROGRAMS = mutt @DOTLOCK_TARGET@ @PGPAUX_TARGET@ @SMIMEAUX_TARGET@ mutt_SOURCES = $(BUILT_SOURCES) \ + hcache.c \ addrbook.c alias.c attach.c base64.c browser.c buffy.c color.c \ crypt.c cryptglue.c \ commands.c complete.c compose.c copy.c curs_lib.c curs_main.c date.c \ @@ -62,7 +63,7 @@ mutt_tunnel.c pop.c pop_auth.c pop_lib.c smime.c pgp.c pgpinvoke.c pgpkey.c \ pgplib.c sha1.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c \ browser.h mbyte.h remailer.h url.h mutt_ssl_nss.c \ - pgppacket.c mutt_idna.h hcache.c + pgppacket.c mutt_idna.h EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \ configure acconfig.h account.h \ diff -u mutt-header-cache-8/configure.in mutt-header-cache-dropstat/configure.in --- mutt-header-cache-8/configure.in Wed May 19 08:52:17 2004 +++ mutt-header-cache-dropstat/configure.in Wed May 19 08:52:39 2004 @@ -772,7 +772,6 @@ AC_ARG_ENABLE(hcache, [ --enable-hcache Enable header caching for Maildir folders], [if test x$enableval = xyes; then AC_DEFINE(USE_HCACHE, 1, [Enable header caching for Maildir style mailboxes]) - MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS hcache.o" LIBS="$LIBS -lgdbm" AC_CACHE_CHECK(for gdbm_open, ac_cv_gdbmopen, [ac_cv_gdbmopen=no diff -u mutt-header-cache-8/init.h mutt-header-cache-dropstat/init.h --- mutt-header-cache-8/init.h Wed May 19 08:52:17 2004 +++ mutt-header-cache-dropstat/init.h Wed May 19 08:52:39 2004 @@ -993,6 +993,13 @@ ** .pp ** Path to the maildir cache file. If unset no cache will be used. */ + { "maildir_cache_verify", DT_BOOL, R_NONE, OPTHCACHEVERIFY, 1 }, + /* + ** .pp + ** Check for programs other than mutt having modified maildir + ** files when the header cache is in use. This incurs one stat() + ** per message every time the folder is opened. + */ #endif /* USE_HCACHE */ { "maildir_trash", DT_BOOL, R_NONE, OPTMAILDIRTRASH, 0 }, /* diff -u mutt-header-cache-8/mh.c mutt-header-cache-dropstat/mh.c --- mutt-header-cache-8/mh.c Wed May 19 08:52:17 2004 +++ mutt-header-cache-dropstat/mh.c Wed May 19 08:52:40 2004 @@ -812,7 +812,6 @@ unsigned int size; struct timeval *when = NULL; struct stat lastchanged; - int ret; db = mutt_hcache_open(MaildirCache); @@ -828,11 +827,11 @@ when = (struct timeval *) data.dptr; snprintf(fn, sizeof (fn), "%s/%s", ctx->path, p->h->path); - ret = stat(fn, &lastchanged); if (data.dptr != NULL - && ret == 0 - && lastchanged.st_mtime <= when->tv_sec + && (!option(OPTHCACHEVERIFY) || + (stat(fn, &lastchanged) == 0 + && lastchanged.st_mtime <= when->tv_sec)) #if HAVE_LANGINFO_CODESET && mutt_hcache_charset_matches(data.dptr) #endif /* HAVE_LANGINFO_CODESET */ only in patch2: unchanged: --- mutt/mutt.h Tue Apr 13 10:02:12 2004 +++ mutt-header-cache-dropstat/mutt.h Wed May 19 08:52:40 2004 @@ -428,6 +428,9 @@ OPTWRAPSEARCH, OPTWRITEBCC, /* write out a bcc header? */ OPTXMAILER, +#if USE_HCACHE + OPTHCACHEVERIFY, +#endif /* PGP options */