From 6421f57469e6f2417b3789eaee1a9502dd312045 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 9 Nov 2005 01:23:03 +0000 Subject: (parse_amount): Ignore inline math characters that are found quotes. --- textual.cc | 9 +++++++-- 1 file 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); -- cgit v1.2.3