cziegeler    01/10/30 00:51:44

  Modified:    src/org/apache/cocoon/util NetUtils.java
  Log:
  Fixed bug in relativizing urls
  
  Revision  Changes    Path
  1.8       +4 -1      xml-cocoon2/src/org/apache/cocoon/util/NetUtils.java
  
  Index: NetUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/util/NetUtils.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- NetUtils.java     2001/10/11 07:28:25     1.7
  +++ NetUtils.java     2001/10/30 08:51:44     1.8
  @@ -16,7 +16,7 @@
    * utility methods
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.7 $ $Date: 2001/10/11 07:28:25 $
  + * @version CVS $Revision: 1.8 $ $Date: 2001/10/30 08:51:44 $
    */
   
   public class NetUtils {
  @@ -108,6 +108,9 @@
               // resource is not direct descendant
               if (!slashPresent) path += "/";
               int index = StringUtils.matchStrings(path, absoluteResource);
  +            if (index > 0 && path.charAt(index-1) != '/') {
  +                index = 0;
  +            }
               String pathDiff = path.substring(index);
               String resource = absoluteResource.substring(index);
               int levels = StringUtils.count(pathDiff, '/');
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to