Skip to content

Commit

Permalink
Fix Trundle Path not properly resolving /
Browse files Browse the repository at this point in the history
Signed-off-by: TheSilkMiner <thesilkminer@outlook.com>
  • Loading branch information
TheSilkMiner committed May 27, 2022
1 parent 8821bb7 commit 9d1ebd3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static ParsedPath parse(final String path) {
final TrundlePathType type = path.length() > 0 && path.charAt(0) == '/'? TrundlePathType.ABSOLUTE : TrundlePathType.RELATIVE;
final String root = parseRoot(type, path);
final String rawPath = path.length() > 0 && type.isAbsolute()? path.substring(1) : path;
return new ParsedPath(type, root, rawPath);
return new ParsedPath(type, root, rawPath.isEmpty() && type.isAbsolute()? root : rawPath);
}

private static String parseRoot(final TrundlePathType type, @SuppressWarnings("unused") final String path) {
Expand Down Expand Up @@ -371,6 +371,9 @@ public Path toAbsolutePath() {
return this;
}
// TODO("Maybe something else?")
if (this.isEmptyPath()) {
return new TrundlePath(this.fs, TrundlePathType.ABSOLUTE, ABS_ROOT, ABS_ROOT);
}
return new TrundlePath(this.fs, TrundlePathType.ABSOLUTE, ABS_ROOT, this.path);
}

Expand Down

0 comments on commit 9d1ebd3

Please sign in to comment.