diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-04-06 17:30:39 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-04-06 17:30:39 +0100 |
| commit | fb35ac8a853d6a2b4e72f9b7449f74ea94fcad8d (patch) | |
| tree | 110f2df59b668ec6579deb8d7e825a160ac00680 /Mammoth/Couscous/java/net | |
| parent | 1529de75d1af00fc5c57f8f08faff3361c6b8c3c (diff) | |
Handle paths on Windows properly
Diffstat (limited to 'Mammoth/Couscous/java/net')
| -rw-r--r-- | Mammoth/Couscous/java/net/URI.cs | 7 |
1 files 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)); } } } |
