aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-10-03 21:29:23 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-10-03 21:29:23 +0400
commitaedccb96b16c18e0d3a73f36c28ebf5fc0086e1c (patch)
tree79000f8c444a7fcc54194008fe7426a16f77e0a1
parentd6fd04521ba4c4c430286078dd56309111c180e6 (diff)
downloaddokka-aedccb96b16c18e0d3a73f36c28ebf5fc0086e1c.tar.gz
dokka-aedccb96b16c18e0d3a73f36c28ebf5fc0086e1c.tar.bz2
dokka-aedccb96b16c18e0d3a73f36c28ebf5fc0086e1c.zip
Fix relative path.
-rw-r--r--src/Utilities/Path.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Utilities/Path.kt b/src/Utilities/Path.kt
index 5498d36e..63240e98 100644
--- a/src/Utilities/Path.kt
+++ b/src/Utilities/Path.kt
@@ -8,11 +8,11 @@ fun File.getRelativePath(name: File): File {
if (parent == null)
throw IOException("No common directory");
- val basePath = getCanonicalPath();
+ val basePath = getCanonicalPath() + File.separator;
val targetPath = name.getCanonicalPath();
if (targetPath.startsWith(basePath)) {
- return File(targetPath.substring(basePath.length() + 1))
+ return File(targetPath.substring(basePath.length()))
} else {
return File(".." + File.separator + parent.getRelativePath(name))
}