After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 334811 - spaces in amounts are parsed as random numbers
spaces in amounts are parsed as random numbers
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Register
git-master
Other Linux
: Normal normal
: ---
Assigned To: David Hampton
Chris Shoemaker
Depends on:
Blocks:
 
 
Reported: 2006-03-16 21:27 UTC by Chris Shoemaker
Modified: 2018-06-29 20:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Chris Shoemaker 2006-03-16 21:27:41 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.
Comment 1 Christian Stimming 2006-03-17 16:36:36 UTC
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...
Comment 2 Chris Shoemaker 2006-03-18 00:30:07 UTC
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".
Comment 3 Josh Sled 2006-03-24 00:48:23 UTC
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.
Comment 4 Chris Shoemaker 2006-03-24 01:44:38 UTC
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
Comment 5 Chris Shoemaker 2006-03-27 20:02:03 UTC
Note that bug#308554 is related.
Comment 6 Josh Sled 2006-03-30 19:49:51 UTC
Fixed in r13715 (1.9.4): "2 3" is no longer allowed as a valid expression.
Comment 7 John Ralls 2018-06-29 20:59:59 UTC
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.