summaryrefslogtreecommitdiff
path: root/src/cmd/godoc/dirtrees.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-04-26 09:55:32 +0200
committerOndřej Surý <ondrej@sury.org>2011-04-26 09:55:32 +0200
commit7b15ed9ef455b6b66c6b376898a88aef5d6a9970 (patch)
tree3ef530baa80cdf29436ba981f5783be6b4d2202b /src/cmd/godoc/dirtrees.go
parent50104cc32a498f7517a51c8dc93106c51c7a54b4 (diff)
downloadgolang-7b15ed9ef455b6b66c6b376898a88aef5d6a9970.tar.gz
Imported Upstream version 2011.04.13upstream/2011.04.13
Diffstat (limited to 'src/cmd/godoc/dirtrees.go')
-rw-r--r--src/cmd/godoc/dirtrees.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/godoc/dirtrees.go b/src/cmd/godoc/dirtrees.go
index 3ad7c8cfc..97737ca5a 100644
--- a/src/cmd/godoc/dirtrees.go
+++ b/src/cmd/godoc/dirtrees.go
@@ -266,8 +266,8 @@ func (dir *Directory) lookupLocal(name string) *Directory {
// lookup looks for the *Directory for a given path, relative to dir.
func (dir *Directory) lookup(path string) *Directory {
- d := strings.Split(dir.Path, "/", -1)
- p := strings.Split(path, "/", -1)
+ d := strings.Split(dir.Path, string(filepath.Separator), -1)
+ p := strings.Split(path, string(filepath.Separator), -1)
i := 0
for i < len(d) {
if i >= len(p) || d[i] != p[i] {
@@ -342,8 +342,8 @@ func (root *Directory) listing(skipRoot bool) *DirList {
if strings.HasPrefix(d.Path, root.Path) {
path = d.Path[len(root.Path):]
}
- // remove trailing '/' if any - path must be relative
- if len(path) > 0 && path[0] == '/' {
+ // remove trailing separator if any - path must be relative
+ if len(path) > 0 && path[0] == filepath.Separator {
path = path[1:]
}
p.Path = path