aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-04-06 17:30:39 +0100
committerMichael Williamson <mike@zwobble.org>2017-04-06 17:30:39 +0100
commitfb35ac8a853d6a2b4e72f9b7449f74ea94fcad8d (patch)
tree110f2df59b668ec6579deb8d7e825a160ac00680
parent1529de75d1af00fc5c57f8f08faff3361c6b8c3c (diff)
Handle paths on Windows properly
-rw-r--r--Mammoth/Couscous/java/net/URI.cs7
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));
}
}
}