aboutsummaryrefslogtreecommitdiff
path: root/src/lib/libbible.cc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2024-01-30 10:13:21 -0500
committerYour Name <you@example.com>2024-01-30 10:13:21 -0500
commit6c516699d7622c9aac91ef5a309b815a5005817b (patch)
tree34b764cb555502195fad5c5508bcab258fa875be /src/lib/libbible.cc
parentb26cf10a2ffcd353d527cc8786ae955810fe4652 (diff)
downloadlibbible-1.0.6.tar.gz (sig)
libbible-1.0.6.tar.bz2 (sig)
libbible-1.0.6.zip (sig)
Fixed infinite loop at end of bible (Rev 22)v1.0.6
Diffstat (limited to 'src/lib/libbible.cc')
-rw-r--r--src/lib/libbible.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/libbible.cc b/src/lib/libbible.cc
index c6850f7..f3b9820 100644
--- a/src/lib/libbible.cc
+++ b/src/lib/libbible.cc
@@ -184,11 +184,11 @@ vector<libbible::text> libbible::getText(libbible::passage pass) {
string book = string(key->getBookName());
- for(; string(key->getBookName()) == book &&
+ /*for(; string(key->getBookName()) == book &&
(key->getChapter() < pass.chapterEnd
|| (key->getChapter() == pass.chapterEnd && key->getVerse() <= pass.verseEnd));
- (*key)++) {
-
+ (*key)++) {*/
+ while(true) {
string text = string(target->renderText());
//printf("Working with: %s\n", text.c_str());
@@ -276,6 +276,11 @@ vector<libbible::text> libbible::getText(libbible::passage pass) {
}
}
endOfParagraph = ! text.empty() and text.back() == '\n';
+ if(string(key->getBookName()) != book ||
+ (key->getChapter() >= pass.chapterEnd && key->getVerse() >= pass.verseEnd)) {
+ break;
+ }
+ (*key)++;
}
return texts;
}