-
Notifications
You must be signed in to change notification settings - Fork 57
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
Correctly handle paths containing whitespace character #248
Conversation
I was incorrect in terms of My own tests were not removing the trailing slashes when instantiating things.
EDIT: So, the issue seems to be with Java behavior: println("'${File("path////")}'")
// 'path' kotlinx-io behavior (Native): println("'${Path("path////")}'")
// 'path////' Need something like private inline fun String.removeTrailingSlashes(): String {
var l = length
while (l > 0) {
if (this[l - 1] == SystemPathSeparator) {
l--
} else {
break
}
}
return when (l) {
0 -> ""
length -> this
else -> substring(0, l)
}
} |
…latform specific tests as NodeJS handles UNC path differently
Fixes #246