]> Cypherpunks repositories - gostls13.git/commitdiff
os/exec: document that LookPath's result may be a relative path
authorRob Pike <r@golang.org>
Thu, 15 Aug 2013 04:29:04 +0000 (14:29 +1000)
committerRob Pike <r@golang.org>
Thu, 15 Aug 2013 04:29:04 +0000 (14:29 +1000)
Fixes #3622

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/12971043

src/pkg/os/exec/lp_plan9.go
src/pkg/os/exec/lp_unix.go
src/pkg/os/exec/lp_windows.go

index 6846a35c85fe010fddec55f95eff40a5ff569619..5aa8a54ed81a1eb3edc091a5cfa82cc263e7d938 100644 (file)
@@ -28,6 +28,7 @@ func findExecutable(file string) error {
 // in the directories named by the path environment variable.
 // If file begins with "/", "#", "./", or "../", it is tried
 // directly and the path is not consulted.
+// The result may be an absolute path or a path relative to the current directory.
 func LookPath(file string) (string, error) {
        // skip the path lookup for these prefixes
        skip := []string{"/", "#", "./", "../"}
index 1d1ec07da4deeef06ae98907b534692959fe3d01..7aee50cb788c96c471cd458630898b2549e15c8a 100644 (file)
@@ -29,6 +29,7 @@ func findExecutable(file string) error {
 // LookPath searches for an executable binary named file
 // in the directories named by the PATH environment variable.
 // If file contains a slash, it is tried directly and the PATH is not consulted.
+// The result may be an absolute path or a path relative to the current directory.
 func LookPath(file string) (string, error) {
        // NOTE(rsc): I wish we could use the Plan 9 behavior here
        // (only bypass the path if file begins with / or ./ or ../)
index 7c7289bceea095627c74f9429571925a122b823b..7ec4c7404341d36630c4355263003b570db680d9 100644 (file)
@@ -47,6 +47,7 @@ func findExecutable(file string, exts []string) (string, error) {
 // If file contains a slash, it is tried directly and the PATH is not consulted.
 // LookPath also uses PATHEXT environment variable to match
 // a suitable candidate.
+// The result may be an absolute path or a path relative to the current directory.
 func LookPath(file string) (f string, err error) {
        x := os.Getenv(`PATHEXT`)
        if x == `` {