diff options
author | Robert Griesemer <gri@golang.org> | 2008-09-19 10:56:35 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2008-09-19 10:56:35 -0700 |
commit | 4b51a4f3a578e7650e38a02c34269e75b18ded5e (patch) | |
tree | 24e8c36eeb565a8756d44cec7e4a4a319157d58f /usr/gri/pretty | |
parent | 039f2c593efe8ce18f2a953df61fe71e27b6a375 (diff) | |
download | golang-4b51a4f3a578e7650e38a02c34269e75b18ded5e.tar.gz |
- fix for out-of-bounds error found by rsc
- removed tests that may have wrong Go code from Makefile
R=r
OCL=15532
CL=15532
Diffstat (limited to 'usr/gri/pretty')
-rw-r--r-- | usr/gri/pretty/Makefile | 2 | ||||
-rw-r--r-- | usr/gri/pretty/platform.go | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/usr/gri/pretty/Makefile b/usr/gri/pretty/Makefile index a6e355672..03f3e4f36 100644 --- a/usr/gri/pretty/Makefile +++ b/usr/gri/pretty/Makefile @@ -12,8 +12,6 @@ test: pretty pretty *.go pretty ../gosrc/*.go pretty $(GOROOT)/test/sieve.go - pretty $(GOROOT)/test/bugs/*.go # some files legally don't compile - pretty $(GOROOT)/test/fixedbugs/*.go # some files legally don't compile pretty $(GOROOT)/src/pkg/*.go pretty $(GOROOT)/src/lib/flag.go pretty $(GOROOT)/src/lib/fmt.go diff --git a/usr/gri/pretty/platform.go b/usr/gri/pretty/platform.go index c76d59150..6e96b4ada 100644 --- a/usr/gri/pretty/platform.go +++ b/usr/gri/pretty/platform.go @@ -21,7 +21,7 @@ func GetEnv(key string) string { n := len(key); for i := 0; i < sys.envc(); i++ { v := sys.envv(i); - if v[0 : n] == key { + if n < len(v) && v[0 : n] == key && v[n] == '=' { return v[n + 1 : len(v)]; // +1: trim "=" } } |