Don't continue to parse the expression if we've already reached the end.

Fixes http://bugzilla.gnome.org/show_bug.cgi?id=166840.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13243 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Chris Shoemaker
2006-02-12 20:31:11 +00:00
parent 77099e3545
commit bcdf245a9b

View File

@@ -363,7 +363,7 @@
* Note: The parser/evaluator uses a simple recursive descent
* parser. I decided on this type for the simple reason that for a
* simple four function calculator a recursive descent parser is, in
* my opnion, the easiest to construct. I also think that recursive
* my opinion, the easiest to construct. I also think that recursive
* descent parsers are easier for the human to understand and thus
* maintain.
*
@@ -751,8 +751,11 @@ free_var (var_store_ptr value, parser_env_ptr pe)
static void
add_token (parser_env_ptr pe, char token)
{
*pe->token_tail = pe->Token = token;
pe->token_tail++;
pe->Token = token;
if ((token != EOS) || (*pe->token_tail != EOS)) {
*pe->token_tail = token;
pe->token_tail++;
}
}
/* parse next token from string */