Commit 2a876beb authored by Benny Siegert's avatar Benny Siegert Committed by Alex Brainman

os/exec: make LookPath always search the current directory under Windows.

cmd.exe implicitly looks in "." before consulting PATH.
LookPath should match this behavior.

R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5434093
parent 517503da
......@@ -63,11 +63,10 @@ func LookPath(file string) (f string, err error) {
}
return ``, &Error{file, err}
}
if pathenv := os.Getenv(`PATH`); pathenv == `` {
if f, err = findExecutable(`.\`+file, exts); err == nil {
return
}
} else {
if pathenv := os.Getenv(`PATH`); pathenv != `` {
for _, dir := range strings.Split(pathenv, `;`) {
if f, err = findExecutable(dir+`\`+file, exts); err == nil {
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment