]> Cypherpunks repositories - gostls13.git/commitdiff
exec: LookPath should not search %PATH% for files like c:cmd.exe
authorAlex Brainman <alex.brainman@gmail.com>
Thu, 23 Jun 2011 00:56:53 +0000 (10:56 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Thu, 23 Jun 2011 00:56:53 +0000 (10:56 +1000)
R=golang-dev
CC=golang-dev
https://golang.org/cl/4632055

src/pkg/exec/lp_windows.go

index 5a74c8ee5b435f9a8fd2eff22bb75c255524fed6..47763458f81607cbd71826b5f9d03fa625ff68ab 100644 (file)
@@ -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
                }