From d5b1a063526e5560af3ab579974f1238a08525e0 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 10 Nov 2005 14:27:34 +0000 Subject: 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 --- src/java/org/apache/fop/apps/FOURIResolver.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/java/org/apache/fop') 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); -- cgit v1.2.3