From: David du Colombier <0intro@gmail.com> Date: Tue, 2 Sep 2014 22:56:31 +0000 (+0200) Subject: runtime: handle empty environment variables on Plan 9 X-Git-Tag: go1.4beta1~571 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b3f224b2801059bf6b2d1b4001ffd8d34c91d19e;p=gostls13.git runtime: handle empty environment variables on Plan 9 LGTM=bradfitz, rsc R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/137920044 --- diff --git a/src/pkg/runtime/env_plan9.go b/src/pkg/runtime/env_plan9.go index b6dcb4c1ea..76e9867e03 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)