[Gnucash-changes] r13243 - gnucash/trunk/src/calculation - Don't continue to parse the expression if we've already reached the end.

Derek Atkins warlord at MIT.EDU
Sun Feb 12 15:44:54 EST 2006


Chris,

You really should add ChangeLog entries for bugfixes so we have an
easy way to detect from the source code when a particular bug was
fixed.  It makes Wilddev's job of building the NEWS file MUCH easier.

I know you seem to really dislike the manual ChangeLog entry, but
it's what we do at the moment.  Could you please follow along?

Thanks!

-derek

Quoting Chris Shoemaker <chris at cvs.gnucash.org>:

> Author: chris
> Date: 2006-02-12 15:31:11 -0500 (Sun, 12 Feb 2006)
> New Revision: 13243
> Trac: http://svn.gnucash.org/trac/changeset/13243
>
> Modified:
>   gnucash/trunk/src/calculation/expression_parser.c
> Log:
>   Don't continue to parse the expression if we've already reached the end.
>   Fixes http://bugzilla.gnome.org/show_bug.cgi?id=166840.
>
>
> Modified: gnucash/trunk/src/calculation/expression_parser.c
> ===================================================================
> --- gnucash/trunk/src/calculation/expression_parser.c	2006-02-12 
> 20:29:05 UTC (rev 13242)
> +++ gnucash/trunk/src/calculation/expression_parser.c	2006-02-12 
> 20:31:11 UTC (rev 13243)
> @@ -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 @@
> 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 */
>
> _______________________________________________
> gnucash-changes mailing list
> gnucash-changes at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-changes
>



-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list