cgo: interpret $CGOPKGDIR as absolute path if rooted

R=dho
CC=golang-dev
https://golang.org/cl/180099
This commit is contained in:
Russ Cox 2009-12-21 08:31:02 -08:00
parent fa98cf6eef
commit c276d87c6c
3 changed files with 16 additions and 5 deletions

View file

@ -126,8 +126,11 @@ func main() {
if nerrors > 0 {
os.Exit(2)
}
p.PackagePath = os.Getenv("CGOPKGPATH") + "/" + p.Package
pkg := p.Package
if dir := os.Getenv("CGOPKGPATH"); dir != "" {
pkg = dir + "/" + pkg
}
p.PackagePath = pkg
p.writeOutput(input)
}