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 163622 - gcalctool 4.4.20 handles data incorrectly after a parenthesis
gcalctool 4.4.20 handles data incorrectly after a parenthesis
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
unspecified
Other FreeBSD
: Normal major
: ---
Assigned To: Rich Burridge
Rich Burridge
Depends on:
Blocks:
 
 
Reported: 2005-01-11 04:45 UTC by Adam Weinberger
Modified: 2005-01-12 19:57 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8



Description Adam Weinberger 2005-01-11 04:45:46 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.
Comment 1 Rich Burridge 2005-01-11 15:27:07 UTC
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.
Comment 2 Rich Burridge 2005-01-11 16:34:52 UTC
(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;
Comment 3 Adam Weinberger 2005-01-11 18:50:11 UTC
Nope. I still get the same behaviour with that patch applied.
Comment 4 Rich Burridge 2005-01-11 20:23:27 UTC
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/
Comment 5 Rich Burridge 2005-01-11 20:30:21 UTC
Bug #157277 reported a similar problem.
Still investigating...
Comment 6 Adam Weinberger 2005-01-11 20:57:29 UTC
I see this under en_CA, and others have tested it under C. The behaviour does
not appear with 5.5.x.
Comment 7 Joe Marcus Clarke 2005-01-11 21:14:01 UTC
My test was under en_US.ISO8859-1, and I saw the same problem that Adam
described (in 4.4.20).
Comment 8 Rich Burridge 2005-01-12 19:01:00 UTC
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.
Comment 9 Rich Burridge 2005-01-12 19:23:40 UTC
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?
Comment 10 Joe Marcus Clarke 2005-01-12 19:52:33 UTC
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.
Comment 11 Rich Burridge 2005-01-12 19:57:13 UTC
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.