Skip to content

Conversation

@daveinglis
Copy link
Contributor

  • there where a couple case where relative(to:) would assert on windows when a path was long (>260) and when tailing slashes where not removed in some cases.

@daveinglis
Copy link
Contributor Author

@swift-ci test

@daveinglis
Copy link
Contributor Author

@swift-ci test linux

while !substring.isEmpty && substring.utf8.last == UInt8(ascii: "\\") {
substring = substring.dropLast()
}
if !substring.isEmpty && substring.last != ":" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kinda sketchy. The last character being : could be a malformed path, e.g. C:\file.txt:.

if !substring.isEmpty && substring.last != ":" {
// Drop the trailing '\', unless the string path only
// has '\', and unless the slashes are right after the drive letter.
path = String(substring)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm - C: and C:\ have completely different meanings. Is this logic preserving the trailing slash in the case where the path is pointing at a drive root?

…ssert

- there where a couple case where relative(to:) would assert on windows
  when a path was long (>206) and when tailing slashes where not removed
  in some cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants