mrglavas    2004/10/25 09:09:07

  Modified:    java/src/org/apache/xerces/impl XMLEntityScanner.java
  Log:
  Fixing JIRA Bug #1016:

  http://nagoya.apache.org/jira/browse/XERCESJ-1016

  

  Before scanning data we assert that the number of characters

  left in the current entity is at least as long as the end

  delimiter for the structure. Previously if the number of

  characters left in the entity was equal to the delimeter

  length we incorrectly flagged this as an error.
  
  Revision  Changes    Path
  1.24      +4 -4      xml-xerces/java/src/org/apache/xerces/impl/XMLEntityScanner.java
  
  Index: XMLEntityScanner.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLEntityScanner.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- XMLEntityScanner.java     4 Oct 2004 21:45:48 -0000       1.23
  +++ XMLEntityScanner.java     25 Oct 2004 16:09:07 -0000      1.24
  @@ -999,7 +999,7 @@
   
           boolean bNextEntity = false;
   
  -        while ((fCurrentEntity.position >= fCurrentEntity.count - delimLen)
  +        while ((fCurrentEntity.position > fCurrentEntity.count - delimLen)
               && (!bNextEntity))
           {
             System.arraycopy(fCurrentEntity.ch,
  @@ -1013,8 +1013,8 @@
             fCurrentEntity.startPosition = 0;
           }
   
  -        if (fCurrentEntity.position >= fCurrentEntity.count - delimLen) {
  -            // something must be wrong with the input:  e.g., file ends  an 
unterminated comment
  +        if (fCurrentEntity.position > fCurrentEntity.count - delimLen) {
  +            // something must be wrong with the input:  e.g., file ends in an 
unterminated comment
               int length = fCurrentEntity.count - fCurrentEntity.position;
               buffer.append (fCurrentEntity.ch, fCurrentEntity.position, length); 
               fCurrentEntity.columnNumber += fCurrentEntity.count;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to