[sword-svn] r277 - trunk/modules/nasb/cutil

scribe at crosswire.org scribe at crosswire.org
Tue Jun 1 22:51:10 MST 2010


Author: scribe
Date: 2010-06-01 22:51:10 -0700 (Tue, 01 Jun 2010)
New Revision: 277

Modified:
   trunk/modules/nasb/cutil/nasbosis.cpp
Log:
finally found silly error with nasbosis conversion (find_first_of!!!)


Modified: trunk/modules/nasb/cutil/nasbosis.cpp
===================================================================
--- trunk/modules/nasb/cutil/nasbosis.cpp	2010-05-24 17:23:24 UTC (rev 276)
+++ trunk/modules/nasb/cutil/nasbosis.cpp	2010-06-02 05:51:10 UTC (rev 277)
@@ -254,7 +254,7 @@
 		if (!strncmp(buffer, "<SH>", 4)) {
 			outstring = "";
 			string heading = buffer+4;
-			heading = heading.substr(0, heading.find_first_of("</SH>"));
+			heading = heading.substr(0, heading.find("</SH>"));
 				
 			if (!strncmp(lookahead.c_str(), "<PM>", 4)) {
 				lookahead.erase(0, 4);
@@ -294,6 +294,7 @@
 
 
 		// {{x:y}}
+		// DUH, find_first_of looks for the first occurance of ANY single character of the supplied string
 //		int start = outstring.find_first_of("{{");	// this is whacked and fails on ">[{.." Try it!
 		const char *outstr = outstring.c_str();
 		const char *found = strstr(outstr, "{{");
@@ -358,6 +359,27 @@
 				}
 			}
 
+			//  <C>
+			outstr = outstring.c_str();
+			found = strstr(outstr, "<C>");
+			start = (found) ? (found - outstr) : -1;
+
+			if (start > -1) {
+				outstring.replace(start, 3, (string)"");
+				continue;
+				
+			}
+
+			//  <V>
+			outstr = outstring.c_str();
+			found = strstr(outstr, "<V>");
+			start = (found) ? (found - outstr) : -1;
+
+			if (start > -1) {
+				outstring.replace(start, 3, (string)"");
+				continue;
+				
+			}
 			//  <RS>
 			outstr = outstring.c_str();
 			found = strstr(outstr, "<RS>");




More information about the sword-cvs mailing list