summaryrefslogtreecommitdiff
path: root/amount.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-04-04 23:59:20 +0000
committerJohn Wiegley <johnw@newartisans.com>2004-04-04 23:59:20 +0000
commit42a1c0396865a7e606b9d0b35fee7aaa3ebf7166 (patch)
tree6811657dc08c2eb2b098b282c957283794005355 /amount.cc
parentf672024e06b7b03c2a9287bf75faf375955fa791 (diff)
downloadfork-ledger-42a1c0396865a7e606b9d0b35fee7aaa3ebf7166.tar.gz
fork-ledger-42a1c0396865a7e606b9d0b35fee7aaa3ebf7166.tar.bz2
fork-ledger-42a1c0396865a7e606b9d0b35fee7aaa3ebf7166.zip
*** empty log message ***
Diffstat (limited to 'amount.cc')
-rw-r--r--amount.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/amount.cc b/amount.cc
index 22c3816d..d6724640 100644
--- a/amount.cc
+++ b/amount.cc
@@ -229,19 +229,23 @@ amount * gmp_amount::street(bool get_quotes) const
int max = 10;
while (--max >= 0) {
- if (! amt->commdty()->price) {
+ if (! amt->commdty()->price && ! amt->commdty()->sought) {
if (get_quotes)
get_commodity_price(amt->commdty());
+ amt->commdty()->sought = true;
if (! amt->commdty()->price)
break;
}
amount * old = amt;
amt = amt->value(amt->commdty()->price);
- delete old;
- if (amt->commdty() == old->commdty())
+ if (amt->commdty() == old->commdty()) {
+ delete old;
break;
+ }
+
+ delete old;
}
return amt;