From 30e6111b0feca122ae5f2d708d258ceddef91d4b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 18 Feb 2005 06:48:00 +0000 Subject: (parse): Updated the "D" command to take a regular amount, from which the default flags and precision for its commodity are determined. --- textual.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/textual.cc b/textual.cc index 10469ab7..4a6a839e 100644 --- a/textual.cc +++ b/textual.cc @@ -129,6 +129,7 @@ transaction_t * parse_transaction(char * line, account_t * account) price_str++; } } + parse_amount(skip_ws(cost_str), xact->amount, AMOUNT_PARSE_NO_REDUCE, *xact); if (price_str) { @@ -402,10 +403,12 @@ unsigned int textual_parser_t::parse(std::istream& in, break; #endif // TIMELOG_SUPPORT - case 'D': // a default commodity for "entry" - commodity_t::default_commodity = - commodity_t::find_commodity(skip_ws(line + 1), true); + case 'D': { // a default commodity for "entry" + amount_t amt; + amt.parse(skip_ws(line + 1)); + commodity_t::default_commodity = &amt.commodity(); break; + } case 'C': // a set of conversions if (char * p = std::strchr(line + 1, '=')) { -- cgit v1.2.3