summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-02-18 06:48:00 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:05 -0400
commit30e6111b0feca122ae5f2d708d258ceddef91d4b (patch)
tree267ca79884b143dd0b836494c97fe67c5600c611 /textual.cc
parentd83008166aaa702587861949ab53e37343ad0211 (diff)
downloadfork-ledger-30e6111b0feca122ae5f2d708d258ceddef91d4b.tar.gz
fork-ledger-30e6111b0feca122ae5f2d708d258ceddef91d4b.tar.bz2
fork-ledger-30e6111b0feca122ae5f2d708d258ceddef91d4b.zip
(parse): Updated the "D" command to take a regular amount, from which
the default flags and precision for its commodity are determined.
Diffstat (limited to 'textual.cc')
-rw-r--r--textual.cc9
1 files 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, '=')) {