From e62e595e7a376740c894f281948e305ba2c0ffd1 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 22 Jul 2011 15:21:50 -0700 Subject: [PATCH] godoc/zip.go: fix another zip file system bug Don't report that a directory was found just because we found the list index where the directory would be if it were there... R=iant CC=golang-dev https://golang.org/cl/4812051 --- src/cmd/godoc/zip.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cmd/godoc/zip.go b/src/cmd/godoc/zip.go index 28789f8a0b..868aa1f02f 100644 --- a/src/cmd/godoc/zip.go +++ b/src/cmd/godoc/zip.go @@ -198,5 +198,9 @@ func (z zipList) lookup(name string) (index int, exact bool) { if j < 0 { return -1, false } - return i + j, false + if strings.HasPrefix(z[j].Name, name) { + return i + j, false + } + + return -1, false }