summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-11-09 01:23:03 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:20 -0400
commitb2bb3b45109eeb4ee1b550e08d0477464b28ecc1 (patch)
tree517bde81263615b5c7bf5174c01bb64f1bb6f24c
parentc7d72a09af1ff0905cc421fa2d703c1f5d622081 (diff)
downloadfork-ledger-b2bb3b45109eeb4ee1b550e08d0477464b28ecc1.tar.gz
fork-ledger-b2bb3b45109eeb4ee1b550e08d0477464b28ecc1.tar.bz2
fork-ledger-b2bb3b45109eeb4ee1b550e08d0477464b28ecc1.zip
(parse_amount): Ignore inline math characters that are found quotes.
-rw-r--r--textual.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/textual.cc b/textual.cc
index f144bcb3..9b1322b9 100644
--- a/textual.cc
+++ b/textual.cc
@@ -134,12 +134,17 @@ void parse_amount(const char * text, amount_t& amt, unsigned short flags,
{
char * altbuf = NULL;
- if (*text)
+ if (*text) {
+ bool in_quote = false;
for (const char * p = text + 1; *p; p++)
- if (is_mathchr(*p)) {
+ if (*p == '"') {
+ in_quote = ! in_quote;
+ }
+ else if (! in_quote && is_mathchr(*p)) {
text = altbuf = parse_inline_math(text);
break;
}
+ }
if (*text != '(') {
amt.parse(text, flags);