diff options
author | John Wiegley <johnw@newartisans.com> | 2013-05-19 04:16:12 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2013-05-19 04:16:12 -0500 |
commit | 6b52a1684f6f828b1d0ba5f212523b0086c4eb31 (patch) | |
tree | bb2a9bbbbaf66409599efac6bd23d9465677952c /src/pool.cc | |
parent | 82345899f76ad35cb979bf8750740d6b9ac8382b (diff) | |
download | fork-ledger-6b52a1684f6f828b1d0ba5f212523b0086c4eb31.tar.gz fork-ledger-6b52a1684f6f828b1d0ba5f212523b0086c4eb31.tar.bz2 fork-ledger-6b52a1684f6f828b1d0ba5f212523b0086c4eb31.zip |
Fixed parsing of the "fixed" directive
Diffstat (limited to 'src/pool.cc')
-rw-r--r-- | src/pool.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pool.cc b/src/pool.cc index b9e64c4b..2627c816 100644 --- a/src/pool.cc +++ b/src/pool.cc @@ -311,7 +311,8 @@ commodity_pool_t::exchange(const amount_t& amount, } optional<std::pair<commodity_t *, price_point_t> > -commodity_pool_t::parse_price_directive(char * line, bool do_not_add_price) +commodity_pool_t::parse_price_directive + (char * line, bool do_not_add_price, bool no_date) { char * date_field_ptr = line; char * time_field_ptr = next_element(date_field_ptr); @@ -322,13 +323,13 @@ commodity_pool_t::parse_price_directive(char * line, bool do_not_add_price) datetime_t datetime; string symbol; - if (std::isdigit(time_field_ptr[0])) { + if (! no_date && std::isdigit(time_field_ptr[0])) { symbol_and_price = next_element(time_field_ptr); if (! symbol_and_price) return none; datetime = parse_datetime(date_field + " " + time_field_ptr); } - else if (std::isdigit(date_field_ptr[0])) { + else if (! no_date && std::isdigit(date_field_ptr[0])) { symbol_and_price = time_field_ptr; datetime = datetime_t(parse_date(date_field)); } |