From 455b6e27cbede32571af20f21d47817fdadfd330 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 8 Feb 2009 19:54:16 -0400 Subject: If LEDGER_FILE was seen, ignore LEDGER. --- src/global.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/global.cc b/src/global.cc index a8d288cc..33c8fcd8 100644 --- a/src/global.cc +++ b/src/global.cc @@ -300,12 +300,18 @@ void global_scope_t::read_environment_settings(char * envp[]) #if 1 // These are here for backwards compatability, but are deprecated. - if (const char * p = std::getenv("LEDGER")) - process_option("file", report(), p, "LEDGER"); - if (const char * p = std::getenv("LEDGER_INIT")) - process_option("init-file", report(), p, "LEDGER_INIT"); - if (const char * p = std::getenv("PRICE_HIST")) - process_option("price-db", report(), p, "PRICE_HIST"); + if (const char * p = std::getenv("LEDGER")) { + if (! std::getenv("LEDGER_FILE")) + process_option("file", report(), p, "LEDGER"); + } + if (const char * p = std::getenv("LEDGER_INIT")) { + if (! std::getenv("LEDGER_INIT_FILE")) + process_option("init-file", report(), p, "LEDGER_INIT"); + } + if (const char * p = std::getenv("PRICE_HIST")) { + if (! std::getenv("LEDGER_PRICEDB")) + process_option("price-db", report(), p, "PRICE_HIST"); + } if (const char * p = std::getenv("PRICE_EXP")) process_option("price-exp", report(), p, "PRICE_EXP"); #endif -- cgit v1.2.3