[sword-cvs] sword/src/modules/filters osislemma.cpp, 1.9,
1.10 osismorph.cpp, 1.14, 1.15
sword at www.crosswire.org
sword at www.crosswire.org
Wed Jul 28 05:00:48 MST 2004
Committed by: joachim
Update of /cvs/core/sword/src/modules/filters
In directory www:/tmp/cvs-serv25226/src/modules/filters
Modified Files:
osislemma.cpp osismorph.cpp
Log Message:
fixed missing tag problems in two OSIS filters
Index: osislemma.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/osislemma.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- osislemma.cpp 16 Apr 2004 20:10:34 -0000 1.9
+++ osislemma.cpp 28 Jul 2004 12:00:46 -0000 1.10
@@ -55,19 +55,21 @@
if ((*token == 'w') && (token[1] == ' ')) {
start = strstr(token, "lemma=\""); //we leave out the "w " at the start
- end = (start && (strlen(start)>7)) ? strchr(start+7, '"') : 0;
+ end = start ? strchr(start+7, '"') : 0;
+
if (start && end) { //we want to leave out the morph attribute
text.append('<');
text.append(token, start-token); //the text before the morph attr
- text.append(end+1, strlen(token) - (end+1 - token)); //text after the morph attr
+ text.append(end+1);
text.append('>');
+
+ continue;
}
}
- else {
- text.append('<');
- text.append(token);
- text.append('>');
- }
+
+ text.append('<');
+ text.append(token);
+ text.append('>');
continue;
}
Index: osismorph.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/osismorph.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- osismorph.cpp 16 Apr 2004 20:10:34 -0000 1.14
+++ osismorph.cpp 28 Jul 2004 12:00:46 -0000 1.15
@@ -55,20 +55,21 @@
if ((*token == 'w') && (token[1] == ' ')) {
start = strstr(token+2, "morph=\""); //we leave out "w " at the start
- end = (start && (strlen(start)>7)) ? strchr(start+7, '"') : 0;
+ end = start ? strchr(start+7, '"') : 0; //search the end of the morph value
- if (start && end) {
+ if (start && end) { //start and end of the morph tag found
text.append('<');
text.append(token, start-token); //the text before the morph attr
- text.append(end+1, strlen(token)-(end+1 - token)); //text after the morph attr
+ text.append(end+1); //text after the morph attr
text.append('>');
+
+ continue; //next loop
}
}
- else {
- text.append('<');
- text.append(token);
- text.append('>');
- }
+
+ text.append('<');
+ text.append(token);
+ text.append('>');
continue;
}
More information about the sword-cvs
mailing list