summaryrefslogtreecommitdiff
path: root/src/report.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/report.cc')
-rw-r--r--src/report.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/report.cc b/src/report.cc
index 03b35b71..22ed926c 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -128,26 +128,22 @@ value_t report_t::fn_market_value(call_scope_t& scope)
scoped_array<char> buf(new char[args.get<string>(2).length() + 1]);
std::strcpy(buf.get(), args.get<string>(2).c_str());
- bool primary_only = false;
for (char * p = std::strtok(buf.get(), ",");
p;
p = std::strtok(NULL, ",")) {
if (commodity_t * commodity = amount_t::current_pool->find(trim_ws(p))) {
value_t result =
- args.value_at(0).value(primary_only, args.has(1) ?
+ args.value_at(0).value(false, args.has(1) ?
args.get<datetime_t>(1) :
optional<datetime_t>(), *commodity);
if (! result.is_null())
return result;
}
- // For subsequent, secondary commodities, don't convert primaries
- primary_only = true;
}
} else {
value_t result =
- args.value_at(0).value(! args.has(2), args.has(1) ?
- args.get<datetime_t>(1) :
- optional<datetime_t>());
+ args.value_at(0).value(true, args.has(1) ?
+ args.get<datetime_t>(1) : optional<datetime_t>());
if (! result.is_null())
return result;
}