From 3af6b0cb80be974079a4f723b8c1dfa2128f9d41 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 9 Feb 2021 16:38:19 -0500 Subject: Fixed bug accessing last chapter of a book --- libbible.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libbible.cc') diff --git a/libbible.cc b/libbible.cc index 1401208..901ff4e 100644 --- a/libbible.cc +++ b/libbible.cc @@ -159,8 +159,11 @@ vector libbible::getText(libbible::passage pass) { bool endOfParagraph = false; - for(; key->getChapter() < pass.chapterEnd || - (key->getChapter() == pass.chapterEnd && key->getVerse() <= pass.verseEnd); + string book = string(key->getBookName()); + + for(; string(key->getBookName()) == book && + (key->getChapter() < pass.chapterEnd + || (key->getChapter() == pass.chapterEnd && key->getVerse() <= pass.verseEnd)); (*key)++) { string text = string(target->renderText()); -- cgit v1.2.3