From ca0b524628bce1b24e381f25493e3e1b72eff211 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 20 Jan 2009 20:58:28 -0400 Subject: Don't use a cache file if it equals '' (when --no-cache is used). --- main.cc | 3 ++- parser.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.cc b/main.cc index 02a06f0c..8a3b1325 100644 --- a/main.cc +++ b/main.cc @@ -414,7 +414,8 @@ appending the output of this command to your Ledger file if you so choose." // Write out the binary cache, if need be if (config.use_cache && config.cache_dirty && - ! config.cache_file.empty()) { + ! config.cache_file.empty() && + config.cache_file != "") { TRACE_PUSH(binary_cache, "Writing journal file"); std::ofstream stream(config.cache_file.c_str()); diff --git a/parser.cc b/parser.cc index debe5558..9c660f8f 100644 --- a/parser.cc +++ b/parser.cc @@ -126,7 +126,7 @@ unsigned int parse_ledger_data(config_t& config, } if (config.use_cache && ! config.cache_file.empty() && - ! config.data_file.empty()) { + config.cache_file != "" && ! config.data_file.empty()) { DEBUG_PRINT("ledger.config.cache", "using_cache " << config.cache_file); config.cache_dirty = true; -- cgit v1.2.3