[sword-devel] breakage in verse management at -r2785?

Greg Hellings greg.hellings at gmail.com
Thu Mar 21 16:51:57 MST 2013


On Thu, Mar 21, 2013 at 6:26 PM, Troy A. Griffitts <scribe at crosswire.org>wrote:

> Thanks Karl,
>
> Yes, each snippet was helpful. Nic's was a quick test which caused the bug
> and was easy to use for testing. Greg's snippet wasn't as helpful as all
> his comments and stack traces leading up to his patch. He is preventing
> book from getting to 0 which does alleviate the problem but also stops a
> book from becoming an intro. Hope that explains.
>

If the conditional in my code is changed to

if (book > (intros?0:1) ) {

Then my code corrects the problem that -- was moving a VerseKey from
Genesis 1:1 to [Testament 1 Intro] when intros is false. While not a
SegFault producing bug, this is still a bug. Similar checks should be made
through the same run of code to ensure moving to verse 0 and chapter 0 are
not possible when intros is false. Both your fix and an adapted form of
mine should be introduced. Additionally, the issue with OSISFootnotes
should probably be fixed.

I will write up a simple test case for that, if it helps, once I get back
to my development machine.

--Greg


>
> Troy
>
> Karl Kleinpaste <karl at kleinpaste.org> wrote:
>>
>> You didn't also need this snippet from Greg a couple days ago?
>>
>> --- src/keys/versekey.cpp (revision 2792)
>> +++ src/keys/versekey.cpp (working copy)
>> @@ -1347,7 +1347,9 @@
>>    }
>>    if (verse < (intros?0:1)) {
>>     if (--chapter < (intros?0:1)) {
>> -     --book;
>> +     if (book > 1) {
>> +      --book;
>> +     }
>>      chapter += (getChapterMax() + (intros?1:0));
>>     }
>>     verse += (getVerseMax() + (intros?1:0));
>>
>> ------------------------------
>>
>> sword-devel mailing list: sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>>
>>
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20130321/ff07220c/attachment.html>


More information about the sword-devel mailing list