]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: tiny bug fix - use correct filename when comparing files against the index...
authorRobert Griesemer <gri@golang.org>
Thu, 27 Jan 2011 22:11:58 +0000 (14:11 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 27 Jan 2011 22:11:58 +0000 (14:11 -0800)
This bug prevented files such as READMEs etc. from being included in the index.
For instance, now author names recorded in the AUTHORS file can be found with
a godoc query.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/4005047

src/cmd/godoc/index.go

index 399c5bd3ffa9d4a5ef1566c5155b2437fa351235..581409cde6814742cca7319d9075e2ed212222ee 100644 (file)
@@ -716,7 +716,8 @@ var whitelisted = map[string]bool{
 
 
 // isWhitelisted returns true if a file is on the list
-// of "permitted" files for indexing.
+// of "permitted" files for indexing. The filename must
+// be the directory-local name of the file.
 func isWhitelisted(filename string) bool {
        key := path.Ext(filename)
        if key == "" {
@@ -745,7 +746,7 @@ func (x *Indexer) visitFile(dirname string, f *os.FileInfo) {
                }
                goFile = true
 
-       case !includeNonGoFiles || !isWhitelisted(filename):
+       case !includeNonGoFiles || !isWhitelisted(f.Name):
                return
        }