diff options
author | Robert Griesemer <gri@golang.org> | 2011-02-10 16:32:51 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2011-02-10 16:32:51 -0800 |
commit | a75e5fc670acb860dda0ded0646f5d2bcab26122 (patch) | |
tree | 7599a2b7115eaa8b068e2934e1995af6caf95c66 | |
parent | 3b3568ba498e1e7f08565ab0f3592ae83e540d46 (diff) | |
download | go-a75e5fc670acb860dda0ded0646f5d2bcab26122.tar.gz go-a75e5fc670acb860dda0ded0646f5d2bcab26122.zip |
godoc: godoc: Use IsAbs to test for absolute paths (fix for win32).
One more case.
R=r, r2
CC=golang-dev
https://golang.org/cl/4170044
-rw-r--r-- | src/cmd/godoc/utils.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/godoc/utils.go b/src/cmd/godoc/utils.go index a032bd3311..cc028cc4d7 100644 --- a/src/cmd/godoc/utils.go +++ b/src/cmd/godoc/utils.go @@ -60,10 +60,10 @@ func canonicalizePaths(list []string, filter func(path string) bool) []string { continue // ignore empty paths (don't assume ".") } // len(path) > 0: normalize path - if path[0] != '/' { - path = pathutil.Join(cwd, path) - } else { + if pathutil.IsAbs(path) { path = pathutil.Clean(path) + } else { + path = pathutil.Join(cwd, path) } // we have a non-empty absolute path if filter != nil && !filter(path) { |