diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-17 07:34:09 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:35:36 -0400 |
commit | 21bd83a2f9fb8ed3a515f46a15a5a6ecc35bdd14 (patch) | |
tree | 7e4276f4675e443c7a7de1871928c98be7eca037 /amount.cc | |
parent | f63ce064612b0fb98b21ff3e36203c56fb081a7c (diff) | |
download | ledger-21bd83a2f9fb8ed3a515f46a15a5a6ecc35bdd14.tar.gz ledger-21bd83a2f9fb8ed3a515f46a15a5a6ecc35bdd14.tar.bz2 ledger-21bd83a2f9fb8ed3a515f46a15a5a6ecc35bdd14.zip |
Added some missing code.
Diffstat (limited to 'amount.cc')
-rw-r--r-- | amount.cc | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1163,6 +1163,8 @@ static void parse_commodity(std::istream& in, std::string& symbol) bool parse_annotations(std::istream& in, amount_t& price, datetime_t& date, std::string& tag) { + bool has_date = false; + do { char buf[256]; char c = peek_next_nonws(in); @@ -1200,6 +1202,7 @@ bool parse_annotations(std::istream& in, amount_t& price, throw new amount_error("Commodity date lacks closing bracket"); date = buf; + has_date = true; } else if (c == '(') { if (! tag.empty()) @@ -1224,6 +1227,8 @@ bool parse_annotations(std::istream& in, amount_t& price, << " price " << price << " " << " date " << date << " " << " tag " << tag); + + return has_date; } void amount_t::parse(std::istream& in, unsigned char flags) |