Resolve Windows rooted search paths with Go
This commit is contained in:
@@ -370,7 +370,9 @@ func (iterator *searchCandidateIterator) absoluteCandidate(path string) (string,
|
||||
if filepath.IsAbs(path) {
|
||||
return filepath.Clean(path), nil
|
||||
}
|
||||
if filepath.VolumeName(path) != "" {
|
||||
// Drive-relative and drive-root-relative Windows paths need native
|
||||
// resolution; joining a rooted path to the whole working directory changes it.
|
||||
if filepath.VolumeName(path) != "" || runtime.GOOS == "windows" && len(path) > 0 && os.IsPathSeparator(path[0]) {
|
||||
return filepath.Abs(path)
|
||||
}
|
||||
working, err := iterator.helpers.workingDir()
|
||||
|
||||
Reference in New Issue
Block a user