diff options
| author | Rob Pike <r@golang.org> | 2009-06-26 20:28:41 -0700 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2009-06-26 20:28:41 -0700 |
| commit | d330c712c12397f50261ca30666b5cb35383a33d (patch) | |
| tree | 2e0686297383ebaa5c2d998726a235075bb2c593 /src/pkg/exec/exec.go | |
| parent | ac7f2152eb21cf605e291c3b06199751a0f1d5d2 (diff) | |
| download | go-d330c712c12397f50261ca30666b5cb35383a33d.tar.xz | |
Getenv: almost no one wants the error, so make it return a string that may be empty.
Getenverror is the new name for the old routine that returns an error too.
R=rsc
DELTA=35 (7 added, 7 deleted, 21 changed)
OCL=30818
CL=30821
Diffstat (limited to 'src/pkg/exec/exec.go')
| -rw-r--r-- | src/pkg/exec/exec.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/pkg/exec/exec.go b/src/pkg/exec/exec.go index 7ddb98b508..a50f9dc13a 100644 --- a/src/pkg/exec/exec.go +++ b/src/pkg/exec/exec.go @@ -208,12 +208,7 @@ func LookPath(file string) (string, os.Error) { } return "", os.ENOENT; } - pathenv, err := os.Getenv("PATH"); - if err != nil { - // Unix shell semantics: no $PATH means assume PATH="" - // (equivalent to PATH="."). - pathenv = ""; - } + pathenv := os.Getenv("PATH"); for i, dir := range strings.Split(pathenv, ":", 0) { if dir == "" { // Unix shell semantics: path element "" means "." |
