aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2011-02-10 16:00:24 -0800
committerRobert Griesemer <gri@golang.org>2011-02-10 16:00:24 -0800
commit3b3568ba498e1e7f08565ab0f3592ae83e540d46 (patch)
treeb2fac149ea1e099655d3de56bbc6076ce81cfcf2
parentcf75c86cdf16b3c100068e102235c94316e8b92e (diff)
downloadgo-3b3568ba498e1e7f08565ab0f3592ae83e540d46.tar.gz
go-3b3568ba498e1e7f08565ab0f3592ae83e540d46.zip
godoc: Use IsAbs to test for absolute paths (fix for win32).
R=gri CC=golang-dev https://golang.org/cl/4129046
-rw-r--r--src/cmd/godoc/main.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cmd/godoc/main.go b/src/cmd/godoc/main.go
index 7494b339af..145eeac346 100644
--- a/src/cmd/godoc/main.go
+++ b/src/cmd/godoc/main.go
@@ -217,7 +217,6 @@ func makeRx(names []string) (rx *regexp.Regexp) {
return
}
-
func main() {
flag.Usage = usage
flag.Parse()
@@ -318,7 +317,7 @@ func main() {
}
relpath := path
abspath := path
- if len(path) > 0 && path[0] != '/' {
+ if !pathutil.IsAbs(path) {
abspath = absolutePath(path, pkgHandler.fsRoot)
} else {
relpath = relativePath(path)
@@ -339,7 +338,7 @@ func main() {
if info.Err != nil || info.PAst == nil && info.PDoc == nil && info.Dirs == nil {
// try again, this time assume it's a command
- if len(path) > 0 && path[0] != '/' {
+ if !pathutil.IsAbs(path) {
abspath = absolutePath(path, cmdHandler.fsRoot)
}
info = cmdHandler.getPageInfo(abspath, relpath, "", mode)