1
0
mirror of https://github.com/golang/go synced 2024-11-19 16:14:49 -07:00

exec: LookPath should not search %PATH% for files like c:cmd.exe

R=golang-dev
CC=golang-dev
https://golang.org/cl/4632055
This commit is contained in:
Alex Brainman 2011-06-23 10:56:53 +10:00
parent 96731619ce
commit 5d53aab4a2

View File

@ -56,7 +56,7 @@ func LookPath(file string) (f string, err os.Error) {
} }
exts = append(exts, e) exts = append(exts, e)
} }
if strings.Contains(file, `\`) || strings.Contains(file, `/`) { if strings.IndexAny(file, `:\/`) != -1 {
if f, err = findExecutable(file, exts); err == nil { if f, err = findExecutable(file, exts); err == nil {
return return
} }