summaryrefslogtreecommitdiff
path: root/src/global.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-08 19:54:16 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-08 19:54:16 -0400
commit455b6e27cbede32571af20f21d47817fdadfd330 (patch)
treec0f5bb4f2036516a1d7d45995e681f2e98a28c8f /src/global.cc
parent22ac8165f4cbad0bfc365af94393d1894a2c664c (diff)
downloadfork-ledger-455b6e27cbede32571af20f21d47817fdadfd330.tar.gz
fork-ledger-455b6e27cbede32571af20f21d47817fdadfd330.tar.bz2
fork-ledger-455b6e27cbede32571af20f21d47817fdadfd330.zip
If LEDGER_FILE was seen, ignore LEDGER.
Diffstat (limited to 'src/global.cc')
-rw-r--r--src/global.cc18
1 files 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