diff options
author | Troy A. Griffitts <scribe@crosswire.org> | 2010-06-02 05:51:10 +0000 |
---|---|---|
committer | Troy A. Griffitts <scribe@crosswire.org> | 2010-06-02 05:51:10 +0000 |
commit | 1d7d78d110fb952872b423ab9cd4f990bbee23f5 (patch) | |
tree | 51030dc25ffbec37d2923c89fe17ff631ffaf047 /modules/nasb/cutil | |
parent | 72ceaae8227984f8a81aa502522c9b666514c5b7 (diff) | |
download | sword-tools-1d7d78d110fb952872b423ab9cd4f990bbee23f5.tar.gz |
finally found silly error with nasbosis conversion (find_first_of!!!)
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@277 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'modules/nasb/cutil')
-rw-r--r-- | modules/nasb/cutil/nasbosis.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/modules/nasb/cutil/nasbosis.cpp b/modules/nasb/cutil/nasbosis.cpp index 2532dab..b002388 100644 --- a/modules/nasb/cutil/nasbosis.cpp +++ b/modules/nasb/cutil/nasbosis.cpp @@ -254,7 +254,7 @@ int main(int argc, char **argv) { 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 @@ int main(int argc, char **argv) { // {{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 @@ int main(int argc, char **argv) { } } + // <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>"); |