New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix for relativeTo with paths containing dots #1469
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Early return feels better to me!
@@ -250,6 +250,11 @@ internal inline fun Path.commonRelativeTo(other: Path): Path { | |||
"Impossible relative path to resolve: $this and $other" | |||
} | |||
|
|||
if (other.segmentsBytes.size == 1 && other.segmentsBytes.first() == DOT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
if (other.segmentsBytes.size == 1 && other.segmentsBytes.first() == DOT) { | |
if (other.singleOrNull() == DOT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or this:
if (other.segmentsBytes.size == 1 && other.segmentsBytes.first() == DOT) { | |
if (other.bytes == DOT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
LMAO (?) but Jvm8 doesn't do the "right" thing and fails with |
dcb0fea
to
4df5c8c
Compare
Fixes #1468
Fix A (this PR)
Fix B (if you prefer)