donaldp     2002/08/30 20:57:02

  Modified:    io/src/java/org/apache/avalon/excalibur/io FileUtil.java
  Log:
  bracketing
  
  Revision  Changes    Path
  1.33      +15 -2     
jakarta-avalon-excalibur/io/src/java/org/apache/avalon/excalibur/io/FileUtil.java
  
  Index: FileUtil.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/io/src/java/org/apache/avalon/excalibur/io/FileUtil.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- FileUtil.java     31 Aug 2002 03:55:09 -0000      1.32
  +++ FileUtil.java     31 Aug 2002 03:57:02 -0000      1.33
  @@ -497,7 +497,9 @@
                       buff.setCharAt( i, '/' );
                   case '/':
                       if( lastSlash == i + 1 )
  +                    {
                           buff.deleteCharAt( i );
  +                    }
   
                       switch( ptCount )
                       {
  @@ -549,9 +551,13 @@
                   if( upLevel > 0 )
                   {
                       if( startsWithSlash )
  +                    {
                           return null;
  +                    }
                       else
  +                    {
                           upLevel = 1;
  +                    }
                   }
   
                   while( upLevel > 0 )
  @@ -567,12 +573,19 @@
           char firstChar = isLengthNull?(char)0:buff.charAt( 0 );
   
           if( !startsWithSlash && !isLengthNull && firstChar == '/' )
  +        {
               buff.deleteCharAt( 0 );
  -        else if( startsWithSlash && (isLengthNull || (!isLengthNull && firstChar != 
'/')) )
  +        }
  +        else if( startsWithSlash &&
  +            (isLengthNull || (!isLengthNull && firstChar != '/')) )
  +        {
               buff.insert( 0, '/' );
  +        }
   
           if( prefix != null )
  +        {
               buff.insert( 0, prefix );
  +        }
   
           return buff.toString();
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to