From fb35ac8a853d6a2b4e72f9b7449f74ea94fcad8d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 6 Apr 2017 17:30:39 +0100 Subject: Handle paths on Windows properly --- Mammoth/Couscous/java/net/URI.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Mammoth/Couscous/java/net/URI.cs b/Mammoth/Couscous/java/net/URI.cs index 818d694..6a18c23 100644 --- a/Mammoth/Couscous/java/net/URI.cs +++ b/Mammoth/Couscous/java/net/URI.cs @@ -31,11 +31,8 @@ namespace Mammoth.Couscous.java.net { return new URI(new Uri(_uri, relativeUri)); } else { var path = _uri.ToString(); - var lastSlashIndex = path.LastIndexOf("/"); - var basePath = lastSlashIndex == -1 - ? "." - : path.Substring(0, lastSlashIndex + 1); - return new URI(basePath + relativeUri); + var basePath = System.IO.Path.GetDirectoryName(path); + return new URI(System.IO.Path.Combine(basePath, relativeUri)); } } } -- cgit v1.2.3