diff options
author | Your Name <you@example.com> | 2021-02-09 16:38:19 -0500 |
---|---|---|
committer | Your Name <you@example.com> | 2021-02-09 16:38:19 -0500 |
commit | 3af6b0cb80be974079a4f723b8c1dfa2128f9d41 (patch) | |
tree | 5e09ce9a08805b510137b923282d0500a68a3f60 /libbible.cc | |
parent | 5056d76c49ffb5b9a2b8a915d8f83770e0374f76 (diff) | |
download | libbible-3af6b0cb80be974079a4f723b8c1dfa2128f9d41.tar.gz libbible-3af6b0cb80be974079a4f723b8c1dfa2128f9d41.tar.bz2 libbible-3af6b0cb80be974079a4f723b8c1dfa2128f9d41.zip |
Fixed bug accessing last chapter of a book
Diffstat (limited to 'libbible.cc')
-rw-r--r-- | libbible.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libbible.cc b/libbible.cc index 1401208..901ff4e 100644 --- a/libbible.cc +++ b/libbible.cc @@ -159,8 +159,11 @@ vector<libbible::text> 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()); |