diff options
-rw-r--r-- | src/Utilities/Path.kt | 4 |
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)) } |