aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-11-10 14:27:34 +0000
committerJeremias Maerki <jeremias@apache.org>2005-11-10 14:27:34 +0000
commitd5b1a063526e5560af3ab579974f1238a08525e0 (patch)
treebe7ec3f183f541f7eefed2c717476efecf37467d /src
parenta37a9acdf819f3bb45173bcde7ac0fa9ba477a5a (diff)
downloadxmlgraphics-fop-d5b1a063526e5560af3ab579974f1238a08525e0.tar.gz
xmlgraphics-fop-d5b1a063526e5560af3ab579974f1238a08525e0.zip
Fix for file: URL handling. The condition for adding a leading slash was wrong.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@332298 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/apps/FOURIResolver.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/apps/FOURIResolver.java b/src/java/org/apache/fop/apps/FOURIResolver.java
index a2b70346f..5a72e2d12 100644
--- a/src/java/org/apache/fop/apps/FOURIResolver.java
+++ b/src/java/org/apache/fop/apps/FOURIResolver.java
@@ -110,8 +110,12 @@ public class FOURIResolver
String scheme = baseURL.getProtocol() + ":";
if (href.startsWith(scheme)) {
href = href.substring(scheme.length());
- if ("file:".equals(scheme) && href.indexOf(':') >= 0) {
- href = "/" + href; //Absolute file URL doesn't have a leading slash
+ if ("file:".equals(scheme)) {
+ int colonPos = href.indexOf(':');
+ int slashPos = href.indexOf('/');
+ if (slashPos >= 0 && colonPos >= 0 && colonPos < slashPos) {
+ href = "/" + href; //Absolute file URL doesn't have a leading slash
+ }
}
}
absoluteURL = new URL(baseURL, href);