summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-01-29 14:15:25 -0700
committerCraig Earls <enderw88@gmail.com>2013-01-29 14:15:25 -0700
commite032bb1c31b4b501476b6dd0e4841ca4397ec0a5 (patch)
tree4c35c07b2d5cffe443d793b40a5711ace30ff91b
parent60e519088af90b4509b6547107cd0867334144b0 (diff)
parent1903ff7c2ebdc2cccd4898fd98c28a0c4a74d5af (diff)
downloadfork-ledger-e032bb1c31b4b501476b6dd0e4841ca4397ec0a5.tar.gz
fork-ledger-e032bb1c31b4b501476b6dd0e4841ca4397ec0a5.tar.bz2
fork-ledger-e032bb1c31b4b501476b6dd0e4841ca4397ec0a5.zip
Merge branch 'default-pricedb-bug' into kitchen-sink
-rw-r--r--src/session.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/session.cc b/src/session.cc
index 632002d4..0f9cca22 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -62,12 +62,7 @@ void set_session_context(session_t * session)
session_t::session_t()
: flush_on_next_data_file(false), journal(new journal_t)
{
- if (const char * home_var = std::getenv("HOME"))
- HANDLER(price_db_).on(none, (path(home_var) / ".pricedb").string());
- else
- HANDLER(price_db_).on(none, path("./.pricedb").string());
-
- parsing_context.push();
+ parsing_context.push();
TRACE_CTOR(session_t, "");
}
@@ -101,7 +96,13 @@ std::size_t session_t::read_data(const string& master_account)
if (HANDLED(price_db_)){
price_db_path = resolve_path(HANDLER(price_db_).str());
if (!exists(price_db_path.get())){
- throw_(parse_error, _f("Could not find specified price file %1%") % price_db_path);
+ throw_(parse_error, _f("Could not find specified price-db file %1%") % price_db_path);
+ }
+ } else {
+ if (const char * home_var = std::getenv("HOME")){
+ price_db_path = (path(home_var) / ".pricedb");
+ } else {
+ price_db_path = ("./.ledgerrc");
}
}