Skip to content

Commit

Permalink
Attempt to fix extend bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
kovzol committed Feb 23, 2025
1 parent fb623ea commit 24d7529
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions books.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1052,17 +1052,21 @@ string _extend(const string& moduleName1, const string& moduleName2, const strin
pos2S--;
citation = text1.at(pos1S) == text2.at(pos2S); // until there is no plausible verbatim citation anymore
}
pos1S++; // fix start pointer for the other edition
pos2S++; // fix start pointer for the edition of the input passage
if (!citation) {
pos1S++; // fix start pointer for the other edition
pos2S++; // fix start pointer for the edition of the input passage
}
citation = true;
int pos1E = pos1S + pos2E - pos2S;
while (citation && pos1E < text1.length() - 1 && pos2E < text2.length() - 1) { // shift right in both editions
pos1E++;
pos2E++;
citation = text1.at(pos1E) == text2.at(pos2E);
}
pos1E--; // fix end pointer for the other edition
pos2E--; // fix end pointer for the edition of the input passage
if (!citation) {
pos1E--; // fix end pointer for the other edition
pos2E--; // fix end pointer for the edition of the input passage
}
string verse1infoS = b1.getVerseInfoStart(pos1S);
string verse1infoE = b1.getVerseInfoEnd(pos1E);
string verse2infoS = b2.getVerseInfoStart(pos2S);
Expand Down

0 comments on commit 24d7529

Please sign in to comment.