1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:20:22 -07:00

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
This commit is contained in:
Robert Griesemer 2011-07-22 15:21:50 -07:00
parent fa497796f5
commit e62e595e7a

View File

@ -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
}