costin      01/06/12 07:52:02

  Modified:    util/java/org/apache/tomcat/util/buf UDecoder.java
  Log:
  Small fix ( if the encoded string has only +, the second test would fail )
  
  Revision  Changes    Path
  1.2       +5 -3      
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/UDecoder.java
  
  Index: UDecoder.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/UDecoder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UDecoder.java     2001/05/29 06:22:53     1.1
  +++ UDecoder.java     2001/06/12 14:52:01     1.2
  @@ -92,9 +92,11 @@
        if( idx<0 && idx2<0 ) {
            return;
        }
  -     
  -     if( idx2 >= 0 && idx2 < idx ) idx=idx2; 
  -     
  +
  +     // idx will be the smallest positive inxes ( first % or + )
  +     if( idx2 >= 0 && idx2 < idx ) idx=idx2;
  +     if( idx < 0 ) idx=idx2;
  +
        for( int j=idx; j<end; j++, idx++ ) {
            if( buff[ j ] == '+' ) {
                buff[idx]= (byte)' ' ;
  
  
  

Reply via email to