Author: knoaman
Date: Thu Feb 11 20:32:18 2010
New Revision: 909135

URL: http://svn.apache.org/viewvc?rev=909135&view=rev
Log:
Fix problem in Regex, in normal mode with multi-line option, when last 
character is a new line and we are matching a '^'. The match should fail.

Modified:
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/regex/RegularExpression.java

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/regex/RegularExpression.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/regex/RegularExpression.java?rev=909135&r1=909134&r2=909135&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/regex/RegularExpression.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/regex/RegularExpression.java
 Thu Feb 11 20:32:18 2010
@@ -959,7 +959,7 @@
                 case '^':
                     if (isSet(opts, MULTIPLE_LINES)) {
                         if (!(offset == con.start
-                              || offset > con.start && isEOLChar( target [  
offset-1 ] )))
+                              || offset > con.start && offset < con.limit && 
isEOLChar( target [  offset-1 ] )))
                             return -1;
                     } else {
                         if (offset != con.start)
@@ -1646,7 +1646,7 @@
                 case '^':
                     if (isSet(opts, MULTIPLE_LINES)) {
                         if (!(offset == con.start
-                              || offset > con.start && isEOLChar( target 
.charAt(  offset-1 ) )))
+                              || offset > con.start && offset < con.limit && 
isEOLChar( target .charAt(  offset-1 ) )))
                             return -1;
                     } else {
                         if (offset != con.start)
@@ -2258,7 +2258,7 @@
                 case '^':
                     if (isSet(opts, MULTIPLE_LINES)) {
                         if (!(offset == con.start
-                              || offset > con.start && isEOLChar( target 
.setIndex(  offset-1 ) )))
+                              || offset > con.start && offset < con.limit && 
isEOLChar( target .setIndex(  offset-1 ) )))
                             return -1;
                     } else {
                         if (offset != con.start)



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to