diff options
author | Kevin McCarthy <kevin@8t8.us> | 2019-06-27 11:06:19 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2019-06-27 11:06:19 -0700 |
commit | 4c728278f5ceb6b9ecf6cec7cf637475e77b4089 (patch) | |
tree | 4992b147f0d5f8bf8248b8f53cdf5db7ee365401 | |
parent | 793e0fc2c88a168cd551a749fb3dcc6998691f7e (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.h | 2 | ||||
-rw-r--r-- | hcache.c | 3 | ||||
-rw-r--r-- | init.h | 2 |
3 files changed, 4 insertions, 3 deletions
@@ -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; @@ -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); @@ -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, |