neilg 2002/11/21 15:04:52
Modified: java/src/org/apache/xerces/impl XMLEntityManager.java
Log:
Fix for bug 13282. A great deal of thanks goes to Tim Bruce for
the patch and stand-alone test case, and to
Jean-Francois Arcand for much patience.
Revision Changes Path
1.53 +17 -7 xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java
Index: XMLEntityManager.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- XMLEntityManager.java 19 Nov 2002 01:41:37 -0000 1.52
+++ XMLEntityManager.java 21 Nov 2002 23:04:51 -0000 1.53
@@ -2924,12 +2924,22 @@
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
}
- else if (fCurrentEntity.position >= fCurrentEntity.count -
delimLen) {
- System.arraycopy(fCurrentEntity.ch, fCurrentEntity.position,
- fCurrentEntity.ch, 0, fCurrentEntity.count -
fCurrentEntity.position);
- load(fCurrentEntity.count - fCurrentEntity.position, false);
- fCurrentEntity.position = 0;
- }
+
+ boolean bNextEntity = false;
+
+ while ((fCurrentEntity.position >= fCurrentEntity.count - delimLen)
+ && (!bNextEntity))
+ {
+ System.arraycopy(fCurrentEntity.ch,
+ fCurrentEntity.position,
+ fCurrentEntity.ch,
+ 0,
+ fCurrentEntity.count - fCurrentEntity.position);
+
+ bNextEntity = load(fCurrentEntity.count -
fCurrentEntity.position, false);
+ fCurrentEntity.position = 0;
+ }
+
if (fCurrentEntity.position >= fCurrentEntity.count - delimLen) {
// something must be wrong with the input: e.g., file ends an
unterminated comment
int length = fCurrentEntity.count - fCurrentEntity.position;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]