mirror of
https://github.com/golang/go
synced 2024-11-25 03:07:56 -07:00
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
This commit is contained in:
parent
3b3568ba49
commit
a75e5fc670
@ -60,10 +60,10 @@ func canonicalizePaths(list []string, filter func(path string) bool) []string {
|
|||||||
continue // ignore empty paths (don't assume ".")
|
continue // ignore empty paths (don't assume ".")
|
||||||
}
|
}
|
||||||
// len(path) > 0: normalize path
|
// len(path) > 0: normalize path
|
||||||
if path[0] != '/' {
|
if pathutil.IsAbs(path) {
|
||||||
path = pathutil.Join(cwd, path)
|
|
||||||
} else {
|
|
||||||
path = pathutil.Clean(path)
|
path = pathutil.Clean(path)
|
||||||
|
} else {
|
||||||
|
path = pathutil.Join(cwd, path)
|
||||||
}
|
}
|
||||||
// we have a non-empty absolute path
|
// we have a non-empty absolute path
|
||||||
if filter != nil && !filter(path) {
|
if filter != nil && !filter(path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user