Bug 7795
| Summary: | bugs in xcalc -rpn mode | ||
|---|---|---|---|
| Product: | [Retired] Red Hat Linux | Reporter: | redhat |
| Component: | X11R6-contrib | Assignee: | Preston Brown <pbrown> |
| Status: | CLOSED RAWHIDE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.0 | ||
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | i386 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2000-02-14 20:21:57 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
redhat
1999-12-13 21:08:19 UTC
I think I found the fix for the bug #7795 I reported yesterday. I found that there was a difference between decf() and eef() in math.c, and when I made the change, the calculator seems to function properly. The comment for lift_enabled on line 96 is not very helpful, but I think it determines whether the stack should be "lifted" when certain keys are pressed. The diff is very simple: krylov:contrib/programs/xcalc->diff math.c math.c.orig 400c400 < if (rpn && lift_enabled) --- > if (rpn) I found two more bugs in xcalc that I fixed.
1) From the man page:
BUGS
HP mode: A bug report claims that the sequence of keys 5,
ENTER, <- should clear the display, but it doesn't.
This is how _my_ HP calculator works. Admittedly, it's an 11C
rather than the 10C that's supposedly being emulated, but I
think the behavior is the same.
2) If you use the backspace in rpn mode to erase a decimal
point, the flag that prevents two decimals in a number is
not cleared, so you can't enter the decimal point after
correcting it.
The complete diff for these and the original bug is below.
-Geoffrey
krylov:contrib/programs/xcalc->diff math.c math.c.orig
377,378c377
< if (entered!=1) {
< clearf();
---
> if (entered!=1 || clrdisp)
380,385c379
< }
< if (clrdisp)
< return;
< if ((int) strlen(dispstr) > 0) {
< if (dispstr[strlen(dispstr)-1] == '.')
< Dpoint=0;
---
> if ((int) strlen(dispstr) > 0)
387d380
< }
407c400
< if (rpn && lift_enabled)
---
> if (rpn)
fixed for next release. I've applied your patches to the X11R6 in rawhide. However, this bug still appears to persist. If you have a chance, please look at the X11R6-contrib-3.3.2-7 package in rawhide in the next couple of days and give me your thoughts. closed due to lack of additional feedback. Please reopen if you have more information. Apparently, I didn't submit all the diff's in my previous reports. There are a few more lines below than in my last report. % diff math.c math.c.orig 3d2 < * $MIT: contrib/programs/xcalc/math.c,v 3.2 1999/12/14 18:53:00 gjcoram Exp$ 18,19d16 < * < * Geoffrey Coram fixed most of the HP mode bugs. 316,317c313,314 < entered = 2; < clrdisp++; --- > entered = 2; > clrdisp++; 325c322 < clrdisp++; --- > clrdisp = 0; 330,331c327,328 < entered = 2; < clrdisp++; --- > entered = 2; > clrdisp++; 369d365 < memop = keynum; 381,382c377 < if (entered!=1) { < clearf(); --- > if (entered!=1 || clrdisp) 384,389c379 < } < if (clrdisp) < return; < if ((int) strlen(dispstr) > 0) { < if (dispstr[strlen(dispstr)-1] == '.') < Dpoint=0; --- > if ((int) strlen(dispstr) > 0) 391d380 < } 411c400 < if (rpn && lift_enabled) --- > if (rpn) 814d802 < memop = keynum; Also, the man page should be updated, since the bug report
in the old man page has been fixed.
% diff xcalc.man xcalc.man.orig
425,426c425,426
< HP mode is not completely debugged. In particular, the stack is
< not handled properly after errors.
---
> HP mode: A bug report claims that the sequence of keys 5, ENTER, <-
> should clear the display, but it doesn't.
fixed in rawhide, pkg. version X11R6-contrib-3.3.2-11 and later. |