We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
AbsolutePath.relative(to:)
1 parent 499d7bc commit a77a2e2Copy full SHA for a77a2e2
Sources/TSCBasic/Path.swift
@@ -396,9 +396,12 @@ extension AbsolutePath {
396
var relFilePath = FilePath()
397
var filepath = filepath
398
#if os(Windows)
399
- /// TODO: DOS relative path may change the root.
400
- if root != base.root {
401
- throw PathValidationError.differentRoot(pathString, base.pathString)
+ if self.root != base.root {
+ guard self.root.count == 3,
+ self.root!.hasSuffix(":\\") else {
402
+ throw PathValidationError.differentRoot(pathString, base.pathString)
403
+ }
404
+ relFilePath.root = .init(String(self.dropLast()))
405
}
406
#endif
407
filepath.root = base.filepath.root
0 commit comments