Commit 01a0d39a authored by Gustavo Niemeyer's avatar Gustavo Niemeyer

os/exec: trivial allocation removal in LookPath

R=golang-dev, bsiegert, r
CC=golang-dev
https://golang.org/cl/5549043
parent ca3e6d13
......@@ -47,8 +47,9 @@ func LookPath(file string) (string, error) {
// Unix shell semantics: path element "" means "."
dir = "."
}
if err := findExecutable(dir + "/" + file); err == nil {
return dir + "/" + file, nil
path := dir + "/" + file
if err := findExecutable(path); err == nil {
return path, nil
}
}
return "", &Error{file, ErrNotFound}
......
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