aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2023-09-13 11:41:00 -0400
committerGopher Robot <gobot@golang.org>2023-09-13 19:38:10 +0000
commit07d4de9312aef72d1bd7427316a2ac21b83e4a20 (patch)
tree23446b5b952000e1b5ef568d2ad877ad6f4afe02 /src/os/exec/exec.go
parentd66fc90a0daf879ca0b4d9be43c123b13ed59853 (diff)
downloadgo-07d4de9312aef72d1bd7427316a2ac21b83e4a20.tar.xz
os/exec: fix edge cases in Windows PATH resolution
- Ignore empty entries in PATH, like PowerShell does. - If we resolve a path using an explicit relative entry in PATH, treat it the same as we do for the implicit "." search path, by allowing a later (absolute) PATH entry that resolves to the same executable to return the absolute version of its path. - If the requested path does not end with an extension matching PATHEXT, return ErrNotFound (indicating that we potentially searched for multiple alternatives and did not find one) instead of ErrNotExist (which would imply that we know the exact intended path but couldn't find it). Fixes #61493. Change-Id: I5b539d8616e3403825749d8eccf46725fa808a17 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-race,gotip-windows-amd64-race,gotip-windows-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/528037 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/os/exec/exec.go')
0 files changed, 0 insertions, 0 deletions