You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Lee Crawford <le...@trintech.com> on 2001/11/29 22:24:57 UTC
BUG: org.apache.jasper.compiler.JspReader.skipUntil(String).
All,
There is a bug in org.apache.jasper.compiler.JspReader.skipUntil(String):
public Mark skipUntil(String limit)
throws ParseException {
Mark ret = null;
int limlen = limit.length();
int ch;
skip:
for (ret = mark(), ch = nextChar() ; ch != -1 ; ret = mark(), ch =
nextChar()) {
if ( ch == limit.charAt(0) ) {
for (int i = 1 ; i < limlen ; i++) {
if (Character.toLowerCase((char) nextChar()) !=
limit.charAt(i))
continue skip;
}
return ret;
}
}
return null;
}
The problem is that the inner loop cycles through the string to be skipped
but when it falls out because the wrong character was encountered it needs
to have saved the state it entered the inner loop with and restart just one
character past the point at which it entered the last time.
This causes it to fail to recognize things like:
<%-- this comment ends with an invisible tag (3-hyphens) ---%>
Cheers.
--lee
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>