runtime: handle empty environment variables on Plan 9

LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/137920044
This commit is contained in:
David du Colombier 2014-09-03 00:56:31 +02:00
parent 3306d119b0
commit b3f224b280
1 changed files with 4 additions and 0 deletions

View File

@ -31,6 +31,10 @@ func gogetenv(key string) string {
return ""
}
n := seek(fd, 0, 2) - 1
if n <= 0 {
close(fd)
return ""
}
p := make([]byte, n)