diff options
Diffstat (limited to 'src/os/exec/lp_windows.go')
-rw-r--r-- | src/os/exec/lp_windows.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/os/exec/lp_windows.go b/src/os/exec/lp_windows.go index da047585eb..ec45db7459 100644 --- a/src/os/exec/lp_windows.go +++ b/src/os/exec/lp_windows.go @@ -6,6 +6,7 @@ package exec import ( "errors" + "internal/godebug" "io/fs" "os" "path/filepath" @@ -102,6 +103,9 @@ func LookPath(file string) (string, error) { ) if _, found := syscall.Getenv("NoDefaultCurrentDirectoryInExePath"); !found { if f, err := findExecutable(filepath.Join(".", file), exts); err == nil { + if godebug.Get("execerrdot") == "0" { + return f, nil + } dotf, dotErr = f, &Error{file, ErrDot} } } @@ -124,7 +128,7 @@ func LookPath(file string) (string, error) { } } - if !filepath.IsAbs(f) { + if !filepath.IsAbs(f) && godebug.Get("execerrdot") != "0" { return f, &Error{file, ErrDot} } return f, nil |