Fix wrong relativized path

This commit is contained in:
huangyuhui
2018-07-17 20:56:49 +08:00
parent b5f72af513
commit 75270b8ad6

View File

@@ -80,7 +80,7 @@ public class FileItem extends BorderPane {
Path given = Paths.get(path).toAbsolutePath();
if (isConvertToRelativePath()) {
try {
return Paths.get(".").toAbsolutePath().relativize(given).normalize().toString();
return Paths.get(".").normalize().toAbsolutePath().relativize(given).normalize().toString();
} catch (IllegalArgumentException e) {
// the given path can't be relativized against current path
}