summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--amount.cc22
-rw-r--r--quotes.cc2
-rwxr-xr-xscripts/bal2
-rwxr-xr-xscripts/bal-huquq2
4 files changed, 14 insertions, 14 deletions
diff --git a/amount.cc b/amount.cc
index d0c9f6a8..4d95b3bd 100644
--- a/amount.cc
+++ b/amount.cc
@@ -1141,21 +1141,19 @@ amount_t commodity_t::value(const std::time_t moment)
std::time_t age = 0;
amount_t price;
- if (! history)
- return price;
-
- for (history_map::reverse_iterator i = history->prices.rbegin();
- i != history->prices.rend();
- i++)
- if (moment == 0 || std::difftime(moment, (*i).first) >= 0) {
- age = (*i).first;
- price = (*i).second;
- break;
- }
+ if (history)
+ for (history_map::reverse_iterator i = history->prices.rbegin();
+ i != history->prices.rend();
+ i++)
+ if (moment == 0 || std::difftime(moment, (*i).first) >= 0) {
+ age = (*i).first;
+ price = (*i).second;
+ break;
+ }
if (updater)
(*updater)(*this, moment, age,
- (history->prices.size() > 0 ?
+ (history && history->prices.size() > 0 ?
(*history->prices.rbegin()).first : 0), price);
return price;
diff --git a/quotes.cc b/quotes.cc
index 65dc7316..99b031bf 100644
--- a/quotes.cc
+++ b/quotes.cc
@@ -46,6 +46,8 @@ void quotes_by_script::operator()(commodity_t& commodity,
success = false;
if (pclose(fp) != 0)
success = false;
+ } else {
+ success = false;
}
if (success && buf[0]) {
diff --git a/scripts/bal b/scripts/bal
index be7c3a0a..423e3e41 100755
--- a/scripts/bal
+++ b/scripts/bal
@@ -18,4 +18,4 @@ else
limit=""
fi
-ledger -VQ $switch $limit -s -S "-AT" balance $accts
+ledger -VQ $switch $limit -s -S "-UT" balance $accts
diff --git a/scripts/bal-huquq b/scripts/bal-huquq
index c17c84a2..fad2854a 100755
--- a/scripts/bal-huquq
+++ b/scripts/bal-huquq
@@ -18,4 +18,4 @@ else
limit=""
fi
-ledger -VQ $switch $limit -s -S "-AT" balance $accts
+ledger -VQ $switch $limit -s -S "-UT" balance $accts