kinman 2002/07/18 13:18:56 Modified: jasper2/src/share/org/apache/jasper/compiler Tag: tomcat_4_branch JspReader.java Parser.java Log: - Fixed 10713. Modified on patch by [EMAIL PROTECTED] (Henner Zeller) Revision Changes Path No revision No revision 1.5.2.1 +31 -0 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspReader.java Index: JspReader.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspReader.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- JspReader.java 7 Jun 2002 20:04:27 -0000 1.5 +++ JspReader.java 18 Jul 2002 20:18:56 -0000 1.5.2.1 @@ -385,6 +385,37 @@ } /** + * Skip until the given string is matched in the stream, but ignoring + * chars initially escaped by a '\'. + * When returned, the context is positioned past the end of the match. + * @param s The String to match. + * @return A non-null <code>Mark</code> instance (positioned immediately + * before the search string) if found, <strong>null</strong> + * otherwise. + */ + public Mark skipUntilIgnoreEsc(String limit) throws JasperException { + Mark ret = null; + int limlen = limit.length(); + int ch; + int prev = 'x'; // Doesn't matter + + skip: + for (ret = mark(), ch = nextChar() ; ch != -1 ; + ret = mark(), prev = ch, ch = nextChar()) { + if (ch == limit.charAt(0) && prev != '\\') { + for (int i = 1 ; i < limlen ; i++) { + if (peekChar() == limit.charAt(i)) + nextChar(); + else + continue skip; + } + return ret; + } + } + return null; + } + + /** * Skip until the given end tag is matched in the stream. * When returned, the context is positioned past the end of the tag. * @param tag The name of the tag whose ETag (</tag>) to match. 1.7.2.1 +4 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java Index: Parser.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -r1.7 -r1.7.2.1 --- Parser.java 8 Jul 2002 23:47:55 -0000 1.7 +++ Parser.java 18 Jul 2002 20:18:56 -0000 1.7.2.1 @@ -212,7 +212,7 @@ */ private String parseAttributeValue(String watch) throws JasperException { Mark start = reader.mark(); - Mark stop = reader.skipUntil(watch); + Mark stop = reader.skipUntilIgnoreEsc(watch); if (stop == null) { err.jspError(start, "jsp.error.attribute.unterminated", watch); }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>