]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: No need to use filepath.IsAbs()
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Fri, 18 Mar 2011 16:28:23 +0000 (09:28 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 18 Mar 2011 16:28:23 +0000 (09:28 -0700)
R=golang-dev, brainman, gri
CC=golang-dev
https://golang.org/cl/4277062

src/cmd/godoc/dirtrees.go

index c13ff235dd68d5493250b0e92b5cf2c14e4ef498..97737ca5acf4252b9ebc1e41718131009039da66 100644 (file)
@@ -343,7 +343,7 @@ func (root *Directory) listing(skipRoot bool) *DirList {
                        path = d.Path[len(root.Path):]
                }
                // remove trailing separator if any - path must be relative
-               if len(path) > 0 && filepath.IsAbs(path) {
+               if len(path) > 0 && path[0] == filepath.Separator {
                        path = path[1:]
                }
                p.Path = path