cziegeler 01/10/30 00:51:27
Modified: src/org/apache/cocoon/util Tag: cocoon_20_branch
NetUtils.java
Log:
Fixed bug in relativizing urls
Revision Changes Path
No revision
No revision
1.1.1.1.2.7 +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.1.1.1.2.6
retrieving revision 1.1.1.1.2.7
diff -u -r1.1.1.1.2.6 -r1.1.1.1.2.7
--- NetUtils.java 2001/10/11 08:56:16 1.1.1.1.2.6
+++ NetUtils.java 2001/10/30 08:51:27 1.1.1.1.2.7
@@ -16,7 +16,7 @@
* utility methods
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.1.1.1.2.6 $ $Date: 2001/10/11 08:56:16 $
+ * @version CVS $Revision: 1.1.1.1.2.7 $ $Date: 2001/10/30 08:51:27 $
*/
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]