(parse_amount): Ignore inline math characters that are found quotes.

This commit is contained in:
John Wiegley 2005-11-09 01:23:03 +00:00
parent 7f0a1ac5a3
commit 6421f57469

View file

@ -134,12 +134,17 @@ void parse_amount(const char * text, amount_t& amt, unsigned short flags,
{ {
char * altbuf = NULL; char * altbuf = NULL;
if (*text) if (*text) {
bool in_quote = false;
for (const char * p = text + 1; *p; p++) 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); text = altbuf = parse_inline_math(text);
break; break;
} }
}
if (*text != '(') { if (*text != '(') {
amt.parse(text, flags); amt.parse(text, flags);