GNOME Bugzilla – Bug 163622
gcalctool 4.4.20 handles data incorrectly after a parenthesis
Last modified: 2005-01-12 19:57:13 UTC
Please describe the problem: Not quite sure what the trigger is, but gcalctool seems unable to handle anything that begins with a parenthesis. This is not a crash like another previously filed bug; this is a data bug. I only get this in scientific mode, where there are parentheses. Steps to reproduce: Example 1: pi (Note: 8 pi should be about 25) 1. Select: ( 2. Select: 8 3. Select: pi 4. Screen shows: (888 Example 2: font error 1. Select: ( 2. Select: 3 3. Select: +/- 4. Screen shows: (3c 5. Select: CE 6. Select: Clr 7. Screen shows: http://people.freebsd.org/~adamw/gg-gcalctool.png Actual results: Expected results: Does this happen every time? Other information: This has only been tested on FreeBSD, but it's been seen across multiple O/S versions, by multiple members of the FreeBSD GNOME team.
This is probably a dup of bug #163468, which appears wasn't fixed by the patch to bug #106583. I notice that Wictor has added in some debug printout to bug #163468. I haven't had a chance to investigate this yet, but hopefully the solution is not far away.
(I'm unable to login to GNOME CVS at the moment to generate a proper CVS diff). Does the following one line change fix the problem for you? *** display.c.orig Tue Jan 11 08:19:40 2005 --- display.c Tue Jan 11 08:21:02 2005 *************** *** 452,458 **** */ n = strlen(v->display); ! if (c == -1) { /* Is it a Delete character? */ v->noparens = v->pending = v->opsptr = v->numsptr = 0; v->cur_op = '?'; i = 0; --- 452,458 ---- */ n = strlen(v->display); ! if (c == -1 || c == 127) { /* Is it a Delete character? */ v->noparens = v->pending = v->opsptr = v->numsptr = 0; v->cur_op = '?'; i = 0;
Nope. I still get the same behaviour with that patch applied.
Couple of comments: 1/ I'm simply not seeing this on my Solaris SPARC system. What locale are you running in? 2/ When you try these two example with the latest gcalctool under: http://ftp.gnome.org/pub/GNOME/sources/gcalctool/5.5/
Bug #157277 reported a similar problem. Still investigating...
I see this under en_CA, and others have tested it under C. The behaviour does not appear with 5.5.x.
My test was under en_US.ISO8859-1, and I saw the same problem that Adam described (in 4.4.20).
Okay, I think I understand why your seeing this problem and I'm not. There is a fix for bug #157277 in CVS (gcalctool v2.2.21) that I'm running with, that you are (because you are using v2.2.20): If you make the one line change in that bug report, plus the one line change listed above, does the problem go away? I think it will. If that is the case, then I'll create a new 4.2.22 tarball with these fixes in. thanks.
I went ahead and generated a new tarbal anyhow. That's how confident I am that I've already fixed this problem! Could you try out the gcalctool-4.4.22.tar.gz tarball under: http://ftp.gnome.org/pub/GNOME/sources/gcalctool/4.4/ when it shows up please?
4.4.22 solves both cases for me. I get the proper constant for pi, and I no longer get the font error when hitting Clr. Tested using en_US.ISO8859-1.
Thanks. I'll go ahead and close this bug. Adam, if you are still seeing this problem please just reopen it. I'll also go ahead and announce the new tarball.