[sword-svn] r1957 - trunk/src/modules/filters

scribe at www.crosswire.org scribe at www.crosswire.org
Wed Aug 16 21:17:30 MST 2006


Author: scribe
Date: 2006-08-16 21:17:05 -0700 (Wed, 16 Aug 2006)
New Revision: 1957

Modified:
   trunk/src/modules/filters/osisstrongs.cpp
Log:
Fixed sucky strcat code which didn't take into account empty words
resulting in <w ... / x="y">

Modified: trunk/src/modules/filters/osisstrongs.cpp
===================================================================
--- trunk/src/modules/filters/osisstrongs.cpp	2006-08-16 12:04:50 UTC (rev 1956)
+++ trunk/src/modules/filters/osisstrongs.cpp	2006-08-17 04:17:05 UTC (rev 1957)
@@ -177,10 +177,21 @@
 					module->getEntryAttributes()["Word"][wordstr]["MorphClass"] = morphClass;
 					if (src.length())
 						module->getEntryAttributes()["Word"][wordstr]["Src"] = src;
+
+					if (wtag.isEmpty()) {
+						int j;
+						for (j = strlen(token)-1; ((j>0) && (strchr(" /", token[j]))); j--);
+						token[j+1] = 0;
+					}
+					
 					strcat(token, " wn=\"");
 					strcat(token, wordstr);
 					strcat(token, "\"");
 
+					if (wtag.isEmpty()) {
+						strcat(token, "/");
+					}
+
 					wordNum++;
 				}
 
@@ -204,7 +215,7 @@
 				wordStart = 0;
 			}
 			
-			// if not a strongs token, keep token in text
+			// keep token in text
 			text.append('<');
 			text.append(token);
 			text.append('>');




More information about the sword-cvs mailing list