Resolve Windows rooted search paths with Go

This commit is contained in:
2026-10-24 19:24:30 +00:00
parent 2fedb0307f
commit 0369111d30
3 changed files with 84 additions and 5 deletions

View File

@@ -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()