mirror of
https://github.com/golang/go
synced 2024-11-22 01:24:42 -07:00
godoc: Use IsAbs to test for absolute paths (fix for win32).
R=gri CC=golang-dev https://golang.org/cl/4129046
This commit is contained in:
parent
cf75c86cdf
commit
3b3568ba49
@ -217,7 +217,6 @@ func makeRx(names []string) (rx *regexp.Regexp) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Usage = usage
|
flag.Usage = usage
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
@ -318,7 +317,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
relpath := path
|
relpath := path
|
||||||
abspath := path
|
abspath := path
|
||||||
if len(path) > 0 && path[0] != '/' {
|
if !pathutil.IsAbs(path) {
|
||||||
abspath = absolutePath(path, pkgHandler.fsRoot)
|
abspath = absolutePath(path, pkgHandler.fsRoot)
|
||||||
} else {
|
} else {
|
||||||
relpath = relativePath(path)
|
relpath = relativePath(path)
|
||||||
@ -339,7 +338,7 @@ func main() {
|
|||||||
|
|
||||||
if info.Err != nil || info.PAst == nil && info.PDoc == nil && info.Dirs == nil {
|
if info.Err != nil || info.PAst == nil && info.PDoc == nil && info.Dirs == nil {
|
||||||
// try again, this time assume it's a command
|
// try again, this time assume it's a command
|
||||||
if len(path) > 0 && path[0] != '/' {
|
if !pathutil.IsAbs(path) {
|
||||||
abspath = absolutePath(path, cmdHandler.fsRoot)
|
abspath = absolutePath(path, cmdHandler.fsRoot)
|
||||||
}
|
}
|
||||||
info = cmdHandler.getPageInfo(abspath, relpath, "", mode)
|
info = cmdHandler.getPageInfo(abspath, relpath, "", mode)
|
||||||
|
Loading…
Reference in New Issue
Block a user