On Monday, August 05, 2002 10:54 am, Aric wrote:
> On Monday, August 05, 2002 09:25 am, Carl wrote:
> > Using an account register, I was entering a transaction. I entered the
> > date <tab>, <tab> (skipping check #), Payee <tab>, Payment Amount <tab>,
> > transfer account <tab>, memo. At this point, pressing <ctrl><Enter>
> > should save the transaction. However, when I pressed <ctrl><Enter>, the
> > Transfer Account got cleared, then I was asked if the program should save
> > the transaction anyway. The Transfer Account does NOT get cleared if the
> > <ctrl><Enter> is pressed while the cursor is in that field.
>
> Ah you have reported the bug that has sucked away far too many days of
> my time to no avail.
> For some reason I have yet to determine. If you select the memo field
> then the Category field gets cleared.
Well, after a day of wading through a whole lot of --debugmsg +all logs, I've
figured out what's going on with this...
EDIT_WM_GetText (in controls/edit.c) is "blindly" setting the last byte of the
string buffer being past to it to NULL:
textA[count - 1] = 0; /* ensure 0 termination */
Apparently, in this particular case, the buffer size (the 'count' veriable) is
not correct, and the location of textA[count - 1] just happens to correspond
to the first byte of the Category field, which (obviously) CHANGES IT TO A
NULL STRING! Voila!
Now, since I have just found this, I have not had a chance to determine of the
erroneous value of "count" is a bug in Wine, or in Quicken! Doing so may
take an awfully loooooong time, particularly since I don't have the source
for Quicken. (Since this does not seem to be a pervasive bug, I'm suspecting
Quicken...)
So, here's what I see as my choices...
1) Forget the origin of the bug, and change EDIT_WM_GetText to only set the
last byte to a NULL only if there is not a NULL byte prior to [count - 1].
I'm guessing the most efficient way (I'm no C guru) would be to change the
line to something like:
if (strlen(textA) >= count) textA[count - 1] = 0;
If this is reasonable, the question that I would have is "What functions
should I use in place of the strlen() above [for A and W strings] (or is
strlen() good enough for both)?"
2) Take some time to try to track down if the bug is Wine related. I'm
willing to spend a day (maybe two) on this, but my gut tells me it's futile.
Obviously, if I find a related Wine bug, I'd fix it, which indirectly would
fix this issue. But if I don't find a related bug, I guess I would have to
revert to (1) anyway...
Suggestions?? Comments??
Carl