[sword-svn] r3866 - trunk/src/modules

scribe at crosswire.org scribe at crosswire.org
Sun Oct 10 13:04:46 EDT 2021


Author: scribe
Date: 2021-10-10 13:04:46 -0400 (Sun, 10 Oct 2021)
New Revision: 3866

Modified:
   trunk/src/modules/swmodule.cpp
Log:
Fixed bug in logic to skip optimization of special filters are used
Safer isolation of stack frame memory in strip and render methods


Modified: trunk/src/modules/swmodule.cpp
===================================================================
--- trunk/src/modules/swmodule.cpp	2021-09-13 10:34:36 UTC (rev 3865)
+++ trunk/src/modules/swmodule.cpp	2021-10-10 17:04:46 UTC (rev 3866)
@@ -775,7 +775,7 @@
 					do {
 						if (stripped||specialStrips||multiVerse) {
 							testBuf = multiVerse ? lastBuf + ' ' + textBuf : textBuf;
-							if (stripped) testBuf = stripText(testBuf);
+							if (stripped||specialStrips) testBuf = stripText(testBuf);
 						}
 						else testBuf.setSize(0);
 						foundWords = 0;
@@ -1101,7 +1101,7 @@
 
 SWBuf SWModule::renderText(const SWKey *tmpKey) {
 	SWKey *saveKey;
-	const char *retVal;
+	SWBuf retVal;
 
 	if (!key->isPersist()) {
 		saveKey = createKey();
@@ -1333,7 +1333,8 @@
 		}
 
 		// get "content" field
-		const char *content = stripText();
+		SWBuf contentBuf = stripText();
+		const char *content = contentBuf;
 
 		bool good = false;
 
@@ -1436,7 +1437,8 @@
 //printf("building proxBuf from (%s).\nproxBuf.c_str(): %s\n", (const char *)*key, proxBuf.c_str());
 //printf("building proxBuf from (%s).\n", (const char *)*key);
 
-					content = stripText();
+					contentBuf = stripText();
+					content = contentBuf.c_str();
 					if (content && *content) {
 						// build "strong" field
 						strong = "";
@@ -1501,7 +1503,8 @@
 //printf("building proxBuf from (%s).\n", (const char *)*key);
 //fflush(stdout);
 
-						content = stripText();
+						contentBuf = stripText();
+						content = contentBuf.c_str();
 						if (content && *content) {
 							// build "strong" field
 							strong = "";



More information about the sword-cvs mailing list