Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle empty path on Windows
Browse files Browse the repository at this point in the history
stevapple committed Feb 23, 2021
1 parent 2954e55 commit ec0cb88
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/TSCBasic/Path.swift
Original file line number Diff line number Diff line change
@@ -685,6 +685,9 @@ private struct UNIXPath: Path {

init(validatingAbsolutePath path: String) throws {
#if os(Windows)
if path == "" {
return false
}
let fsr: UnsafePointer<Int8> = path.fileSystemRepresentation
defer { fsr.deallocate() }

@@ -707,6 +710,9 @@ private struct UNIXPath: Path {

init(validatingRelativePath path: String) throws {
#if os(Windows)
if path == "" {
return true
}
let fsr: UnsafePointer<Int8> = path.fileSystemRepresentation
defer { fsr.deallocate() }

0 comments on commit ec0cb88

Please sign in to comment.