[sword-svn] r3004 - trunk/src/modules/filters
scribe at crosswire.org
scribe at crosswire.org
Wed Jan 8 20:00:28 MST 2014
Author: scribe
Date: 2014-01-08 20:00:28 -0700 (Wed, 08 Jan 2014)
New Revision: 3004
Modified:
trunk/src/modules/filters/osishtmlhref.cpp
trunk/src/modules/filters/osisrtf.cpp
trunk/src/modules/filters/osisxhtml.cpp
Log:
fixed serious bug in recent patch
need to check type attribute exists on a tag before attempting to compare its value
Modified: trunk/src/modules/filters/osishtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/osishtmlhref.cpp 2014-01-03 23:04:32 UTC (rev 3003)
+++ trunk/src/modules/filters/osishtmlhref.cpp 2014-01-09 03:00:28 UTC (rev 3004)
@@ -371,7 +371,7 @@
}
// <lb.../>
- else if (!strcmp(tag.getName(), "lb") && (strcmp(tag.getAttribute("type"), "x-optional"))) {
+ else if (!strcmp(tag.getName(), "lb") && (!tag.getAttribute("type") || strcmp(tag.getAttribute("type"), "x-optional"))) {
outText("<br />", buf, u);
userData->supressAdjacentWhitespace = true;
}
Modified: trunk/src/modules/filters/osisrtf.cpp
===================================================================
--- trunk/src/modules/filters/osisrtf.cpp 2014-01-03 23:04:32 UTC (rev 3003)
+++ trunk/src/modules/filters/osisrtf.cpp 2014-01-09 03:00:28 UTC (rev 3004)
@@ -326,7 +326,7 @@
}
// <milestone type="line"/> or <lb.../>
- else if ((!strcmp(tag.getName(), "lb") && (strcmp(tag.getAttribute("type"), "x-optional"))) || ((!strcmp(tag.getName(), "milestone")) && (tag.getAttribute("type")) && (!strcmp(tag.getAttribute("type"), "line")))) {
+ else if ((!strcmp(tag.getName(), "lb") && (!tag.getAttribute("type") || strcmp(tag.getAttribute("type"), "x-optional"))) || ((!strcmp(tag.getName(), "milestone")) && (tag.getAttribute("type")) && (!strcmp(tag.getAttribute("type"), "line")))) {
outText("{\\par}", buf, u);
userData->supressAdjacentWhitespace = true;
}
Modified: trunk/src/modules/filters/osisxhtml.cpp
===================================================================
--- trunk/src/modules/filters/osisxhtml.cpp 2014-01-03 23:04:32 UTC (rev 3003)
+++ trunk/src/modules/filters/osisxhtml.cpp 2014-01-09 03:00:28 UTC (rev 3004)
@@ -415,7 +415,7 @@
}
// <lb.../>
- else if (!strcmp(tag.getName(), "lb") && (strcmp(tag.getAttribute("type"), "x-optional"))) {
+ else if (!strcmp(tag.getName(), "lb") && (!tag.getAttribute("type") || strcmp(tag.getAttribute("type"), "x-optional"))) {
u->outputNewline(buf);
}
// <milestone type="line"/>
More information about the sword-cvs
mailing list