From aedccb96b16c18e0d3a73f36c28ebf5fc0086e1c Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Fri, 3 Oct 2014 21:29:23 +0400 Subject: Fix relative path. --- src/Utilities/Path.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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)) } -- cgit