diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-28 02:34:40 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-28 02:34:40 -0400 |
commit | bd96928410124e70e70ada7fd05820e2cf781d2c (patch) | |
tree | a054e62051e8a2cdb7351f9b166a1fba5d5ba43f /src/session.cc | |
parent | ade0a8b6f3eeb893eda2ae7355d503bf6514f147 (diff) | |
parent | 65e8eca6cfd394390c1e2091cf8674a93d2eae2d (diff) | |
download | fork-ledger-bd96928410124e70e70ada7fd05820e2cf781d2c.tar.gz fork-ledger-bd96928410124e70e70ada7fd05820e2cf781d2c.tar.bz2 fork-ledger-bd96928410124e70e70ada7fd05820e2cf781d2c.zip |
Merge branch 'next'
Diffstat (limited to 'src/session.cc')
-rw-r--r-- | src/session.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/session.cc b/src/session.cc index b46d545e..2e728dd6 100644 --- a/src/session.cc +++ b/src/session.cc @@ -121,8 +121,16 @@ std::size_t session_t::read_journal(const path& pathname, std::size_t session_t::read_data(const string& master_account) { - if (HANDLER(file_).data_files.empty()) - throw_(parse_error, "No journal file was specified (please use -f)"); + if (HANDLER(file_).data_files.empty()) { + path file; + if (const char * home_var = std::getenv("HOME")) + file = path(home_var) / ".ledger"; + + if (! file.empty() && exists(file)) + HANDLER(file_).data_files.push_back(file); + else + throw_(parse_error, "No journal file was specified (please use -f)"); + } std::size_t xact_count = 0; |