]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: godoc: Use IsAbs to test for absolute paths (fix for win32).
authorRobert Griesemer <gri@golang.org>
Fri, 11 Feb 2011 00:32:51 +0000 (16:32 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 11 Feb 2011 00:32:51 +0000 (16:32 -0800)
One more case.

R=r, r2
CC=golang-dev
https://golang.org/cl/4170044

src/cmd/godoc/utils.go

index a032bd3311ad7fa245500fddb3bf66728a18c2de..cc028cc4d78f5b36a54d417cb8a67dd665632b03 100644 (file)
@@ -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) {