summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-03-06 00:58:05 -0500
committerJohn Wiegley <johnw@newartisans.com>2010-03-06 00:58:05 -0500
commit7e79cd82cd4ad5f87f40e6beebdb53e65bb11168 (patch)
tree73dc2c658e2f4ab0a342794756a0016ed462d48c
parent93e0d8c67a1123d0b4eefcc53d00ba892142fd49 (diff)
downloadfork-ledger-7e79cd82cd4ad5f87f40e6beebdb53e65bb11168.tar.gz
fork-ledger-7e79cd82cd4ad5f87f40e6beebdb53e65bb11168.tar.bz2
fork-ledger-7e79cd82cd4ad5f87f40e6beebdb53e65bb11168.zip
Corrected a case for value < value
-rw-r--r--src/value.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/value.cc b/src/value.cc
index a1316568..54798162 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -857,7 +857,9 @@ bool value_t::is_less_than(const value_t& val) const
case INTEGER:
return as_amount() < val.as_long();
case AMOUNT:
- if (as_amount().commodity() == val.as_amount().commodity())
+ if (as_amount().commodity() == val.as_amount().commodity() ||
+ ! as_amount().has_commodity() ||
+ ! val.as_amount().has_commodity())
return as_amount() < val.as_amount();
else
return commodity_t::compare_by_commodity()(&as_amount(), &val.as_amount());