tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compiler ServletWriter.java
Date Sat, 25 Aug 2001 18:31:48 GMT
costin      01/08/25 11:31:48

  Modified:    src/share/org/apache/jasper/compiler ServletWriter.java
  Log:
  Fix escaping of \, bug 3176.
  
  Thanks bruce@filgate.com (Bruce Filgate) for the report.
  
  Revision  Changes    Path
  1.2       +6 -7      jakarta-tomcat/src/share/org/apache/jasper/compiler/ServletWriter.java
  
  Index: ServletWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/ServletWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServletWriter.java	1999/10/09 00:20:38	1.1
  +++ ServletWriter.java	2001/08/25 18:31:48	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/ServletWriter.java,v
1.1 1999/10/09 00:20:38 duncan Exp $
  - * $Revision: 1.1 $
  - * $Date: 1999/10/09 00:20:38 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/ServletWriter.java,v
1.2 2001/08/25 18:31:48 costin Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/08/25 18:31:48 $
    *
    * ====================================================================
    * 
  @@ -137,10 +137,9 @@
   	sb.append('"');
   	for (int i = 0 ; i < len ; i++) {
   	    char ch = s.charAt(i);
  -	    if ( ch == '\\' && i+1 < len) {
  -		sb.append('\\');
  -		sb.append('\\');
  -		sb.append(s.charAt(++i));
  +	    if ( ch == '\\' ) {
  +		// double the \, doesn't matter what follows ( #3176 )
  +		sb.append("\\\\"); 
   	    } else if ( ch == '"' ) {
   		sb.append('\\');
   		sb.append('"');
  
  
  

Mime
View raw message