summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-06-27 11:06:19 -0700
committerKevin McCarthy <kevin@8t8.us>2019-06-27 11:06:19 -0700
commit4c728278f5ceb6b9ecf6cec7cf637475e77b4089 (patch)
tree4992b147f0d5f8bf8248b8f53cdf5db7ee365401
parent793e0fc2c88a168cd551a749fb3dcc6998691f7e (diff)
Convert $header_cache_pagesize to type DT_LNUM.
Prior to commit 4bc76c2f there was no LNUM type, and so the workaround was to store it as a string, converting in the hcache_open_gdbm() call. This will not affect the user interface or config file, because DT_NUM and DT_LNUM read in a string from the config file and convert to a number. Quotes are used for escaping style, not passed through to the variable setter. So essentially this simply moves the conversion to parse_set(), and provides feedback for a non-numeric type immediately.
-rw-r--r--globals.h2
-rw-r--r--hcache.c3
-rw-r--r--init.h2
3 files changed, 4 insertions, 3 deletions
diff --git a/globals.h b/globals.h
index f5c08a5c..4d508221 100644
--- a/globals.h
+++ b/globals.h
@@ -79,7 +79,7 @@ WHERE char *MessageCachedir;
#if USE_HCACHE
WHERE char *HeaderCache;
#if HAVE_GDBM || HAVE_DB4
-WHERE char *HeaderCachePageSize;
+WHERE long HeaderCachePageSize;
#endif /* HAVE_GDBM || HAVE_DB4 */
#endif /* USE_HCACHE */
WHERE char *MarkMacroPrefix;
diff --git a/hcache.c b/hcache.c
index 492d5701..2f601102 100644
--- a/hcache.c
+++ b/hcache.c
@@ -1188,7 +1188,8 @@ hcache_open_gdbm (struct header_cache* h, const char* path)
{
int pagesize;
- if (mutt_atoi (HeaderCachePageSize, &pagesize) < 0 || pagesize <= 0)
+ pagesize = HeaderCachePageSize;
+ if (pagesize <= 0)
pagesize = 16384;
h->db = gdbm_open((char *) path, pagesize, GDBM_WRCREAT, 00600, NULL);
diff --git a/init.h b/init.h
index 7d530ef5..041806b1 100644
--- a/init.h
+++ b/init.h
@@ -1167,7 +1167,7 @@ struct option_t MuttVars[] = {
*/
#endif /* HAVE_QDBM */
#if defined(HAVE_GDBM) || defined(HAVE_DB4)
- { "header_cache_pagesize", DT_STR, R_NONE, {.p=&HeaderCachePageSize}, {.p="16384"} },
+ { "header_cache_pagesize", DT_LNUM, R_NONE, {.p=&HeaderCachePageSize}, {.l=16384} },
/*
** .pp
** When mutt is compiled with either gdbm or bdb4 as the header cache backend,