summaryrefslogtreecommitdiff
path: root/amount.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-17 07:34:09 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:35:36 -0400
commit21bd83a2f9fb8ed3a515f46a15a5a6ecc35bdd14 (patch)
tree7e4276f4675e443c7a7de1871928c98be7eca037 /amount.cc
parentf63ce064612b0fb98b21ff3e36203c56fb081a7c (diff)
downloadledger-21bd83a2f9fb8ed3a515f46a15a5a6ecc35bdd14.tar.gz
ledger-21bd83a2f9fb8ed3a515f46a15a5a6ecc35bdd14.tar.bz2
ledger-21bd83a2f9fb8ed3a515f46a15a5a6ecc35bdd14.zip
Added some missing code.
Diffstat (limited to 'amount.cc')
-rw-r--r--amount.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/amount.cc b/amount.cc
index f143a70c..a3a7fb40 100644
--- a/amount.cc
+++ b/amount.cc
@@ -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)