[sword-svn] r3314 - branches/sword-1-7-x/utilities

greg.hellings at crosswire.org greg.hellings at crosswire.org
Tue Dec 23 23:10:01 MST 2014


Author: greg.hellings
Date: 2014-12-23 23:10:01 -0700 (Tue, 23 Dec 2014)
New Revision: 3314

Modified:
   branches/sword-1-7-x/utilities/osis2mod.cpp
Log:
osis2mod infinite loop fix fixed.

Modified: branches/sword-1-7-x/utilities/osis2mod.cpp
===================================================================
--- branches/sword-1-7-x/utilities/osis2mod.cpp	2014-12-24 06:09:55 UTC (rev 3313)
+++ branches/sword-1-7-x/utilities/osis2mod.cpp	2014-12-24 06:10:01 UTC (rev 3314)
@@ -795,18 +795,20 @@
 				// This should never happen if the references are valid OSIS references
 				ListKey verseKeys = currentVerse.parseVerseList(keyVal, currentVerse, true);
 				int memberKeyCount = verseKeys.getCount();
-				if (memberKeyCount > 1) {
+				if (memberKeyCount) {
 					currentVerse = verseKeys.getElement(0);
 					// See if this osisID or annotateRef refers to more than one verse.
 					// If it does, save it until all verses have been seen.
 					// At that point we will output links.
 					// This can be done by incrementing, which will produce an error
 					// if there is only one verse.
-					verseKeys.setPosition(TOP);
-					verseKeys.increment(1);
-					if (!verseKeys.popError()) {
-					cout << "DEBUG(LINK): " << currentVerse.getOSISRef() << endl;
-						linkedVerses.push_back(verseKeys);
+					if (memberKeyCount > 1) {
+						verseKeys.setPosition(TOP);
+						verseKeys.increment(1);
+						if (!verseKeys.popError()) {
+							cout << "DEBUG(LINK): " << currentVerse.getOSISRef() << endl;
+							linkedVerses.push_back(verseKeys);
+						}
 					}
 				}
 				else {




More information about the sword-cvs mailing list