summaryrefslogtreecommitdiff
path: root/src/commodity.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-04 03:11:14 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-04 03:11:14 -0400
commit7f7243ff9360f1c44f9e7b16a0e93244645aa031 (patch)
treeb3a9b9257da948ff72bedb1c6e95703cc647a8f2 /src/commodity.cc
parent2ae2dc86c6bf88f512f905ff3b9ed9c170baf536 (diff)
downloadfork-ledger-7f7243ff9360f1c44f9e7b16a0e93244645aa031.tar.gz
fork-ledger-7f7243ff9360f1c44f9e7b16a0e93244645aa031.tar.bz2
fork-ledger-7f7243ff9360f1c44f9e7b16a0e93244645aa031.zip
Made the behavior of -V a bit more rational
It now only values non-primary commodities in terms of primary ones.
Diffstat (limited to 'src/commodity.cc')
-rw-r--r--src/commodity.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/commodity.cc b/src/commodity.cc
index 7aecc2bb..61fd0fe5 100644
--- a/src/commodity.cc
+++ b/src/commodity.cc
@@ -264,6 +264,10 @@ commodity_t::varied_history_t::find_price(const commodity_t& source,
if (comm == source)
continue;
+ // Only value secondary commodities in terms of primary ones
+ if (! commodity && ! comm.has_flags(COMMODITY_PRIMARY))
+ continue;
+
DEBUG_INDENT("commodity.prices.find", indent + 1);
DEBUG("commodity.prices.find",
"searching for price via commodity '" << comm << "'");