summaryrefslogtreecommitdiff
path: root/src/pkg
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2014-09-03 00:56:31 +0200
committerDavid du Colombier <0intro@gmail.com>2014-09-03 00:56:31 +0200
commite414a75608fa918beb8e85da671b7803d292e79d (patch)
tree06221aa6a52dcce315aa4d4e0e9a8e726762caa8 /src/pkg
parent6a08fe1ea5f09581331512ebc47283da459d10f8 (diff)
downloadgo-e414a75608fa918beb8e85da671b7803d292e79d.tar.gz
runtime: handle empty environment variables on Plan 9
LGTM=bradfitz, rsc R=rsc, bradfitz CC=golang-codereviews https://codereview.appspot.com/137920044
Diffstat (limited to 'src/pkg')
-rw-r--r--src/pkg/runtime/env_plan9.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkg/runtime/env_plan9.go b/src/pkg/runtime/env_plan9.go
index b6dcb4c1e..76e9867e0 100644
--- a/src/pkg/runtime/env_plan9.go
+++ b/src/pkg/runtime/env_plan9.go
@@ -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)