From: Alex Brainman Date: Thu, 23 Jun 2011 00:56:53 +0000 (+1000) Subject: exec: LookPath should not search %PATH% for files like c:cmd.exe X-Git-Tag: weekly.2011-06-23~9 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5d53aab4a25d315ef94b31c70d85cb805a8acc2e;p=gostls13.git exec: LookPath should not search %PATH% for files like c:cmd.exe R=golang-dev CC=golang-dev https://golang.org/cl/4632055 --- diff --git a/src/pkg/exec/lp_windows.go b/src/pkg/exec/lp_windows.go index 5a74c8ee5b..47763458f8 100644 --- a/src/pkg/exec/lp_windows.go +++ b/src/pkg/exec/lp_windows.go @@ -56,7 +56,7 @@ func LookPath(file string) (f string, err os.Error) { } exts = append(exts, e) } - if strings.Contains(file, `\`) || strings.Contains(file, `/`) { + if strings.IndexAny(file, `:\/`) != -1 { if f, err = findExecutable(file, exts); err == nil { return }