[sword-devel] Bug in Torrey Module / RawLd.cpp
Troy A. Griffitts
sword-devel@crosswire.org
Tue, 18 Jan 2000 21:45:11 -0700
Torsten,
Thank you for tracking this down. I've changed rawld.cpp in CVS.
Could someone verify that this fixed the issue in bibletime? Thanks.
> according to a mail in sword-support, the module Torrey does not work
> with BibleTime. I verified this and it is true. Though it _does_ work
> with cheatah. The seg fault occurs in rawld.cpp (changed member
> attached). Since all other modules work this way I would ask you to look
> into the Torrey module whether there are keys that have no text or
> something. The problem is, the driver doe not return any text for a
> given (probably wrong) key. cheatah gives an empty key when first
> displaying the module thats why it works there.
>
> I changed the sword-1.5.x branch. I don't know if the patch is according
> to your design rules, but please have a look at the problem
> anyway. Thanks.
> So here's my hyper smart patch :)
>
> /******************************************************************************
> * RawLD::operator char * - Returns the correct entry when char * cast
> * is requested
> *
> * RET: string buffer with entry
> */
>
> RawLD::operator char*()
> {
> getEntry();
> if (!entrybuf) {
> entrybuf = new char [ 1 ];
> entrybuf[0] = '\0';
> } else {
> preptext(entrybuf);
> RenderText(entrybuf, strlen(entrybuf) * 2);
> }
> return entrybuf;
> }
>
> --
>
> best regards,
> Torsten Uhlmann
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> TUhlmann@gmx.de
> TUhlmann@debis.com
>
> http://www.tuhlmann.purespace.de
> http://www.bibletime.de
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Wise men still seek him!