GNOME Bugzilla – Bug 334811
spaces in amounts are parsed as random numbers
Last modified: 2018-06-29 20:59:59 UTC
Enter in the register amount '2 3'. That string is parsed as: 13,467,226,438,893,569.00 Note: there's actually a (failing) test-case in the expression parser test code, but it's commented out at the moment. Solution: The register should do the same as described in bug#119078.
Errr... then why don't you close this one as duplicate and maybe raise the severity in the other bug? I think that's more suitable for bugzilla...
Because they are two different bugs, with two very different symptoms, and two different fixes. In bug#119078, the expression parser correctly recognized the parse error, so the bug is just that the register doesn't report the error. This bug is not actually a register bug, but a bug in the expression parser. (Maybe the engine component would be better, but I think the register is the only user of the expression parser.) These two bugs don't even depend on each other. Bug#119078 can be closed as soon as the register can report parsing errors. This bug can be closed as soon as the expression parser does the right thing with "2 3".
I can't reproduce this "2 3" case being parsed into a random value ... it parses as "0" here, and leaves the register cell empty.
Still fails for me. What is actually displayed is somewhat random. It shows different numbers when I restart GnuCash. But, once GnuCash is started, it shows the same value for any case with a space. If you want a simpler reproduction case, try uncommenting this line: //add_fail_test ("bad expression", "1 2", 2); in test-exp-parser.c, which was added here: http://svn.gnucash.org/trac/changeset/7328
Note that bug#308554 is related.
Fixed in r13715 (1.9.4): "2 3" is no longer allowed as a valid expression.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=334811. Please update any external references or bookmarks.