summaryrefslogtreecommitdiff
path: root/src/cmd/godoc/utils.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-04-20 15:44:41 +0200
committerOndřej Surý <ondrej@sury.org>2011-04-20 15:44:41 +0200
commit50104cc32a498f7517a51c8dc93106c51c7a54b4 (patch)
tree47af80be259cc7c45d0eaec7d42e61fa38c8e4fb /src/cmd/godoc/utils.go
parentc072558b90f1bbedc2022b0f30c8b1ac4712538e (diff)
downloadgolang-50104cc32a498f7517a51c8dc93106c51c7a54b4.tar.gz
Imported Upstream version 2011.03.07.1upstream/2011.03.07.1
Diffstat (limited to 'src/cmd/godoc/utils.go')
-rw-r--r--src/cmd/godoc/utils.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/godoc/utils.go b/src/cmd/godoc/utils.go
index cc028cc4d..9517aee7a 100644
--- a/src/cmd/godoc/utils.go
+++ b/src/cmd/godoc/utils.go
@@ -10,7 +10,7 @@ import (
"io"
"io/ioutil"
"os"
- pathutil "path"
+ "path/filepath"
"sort"
"strings"
"sync"
@@ -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 pathutil.IsAbs(path) {
- path = pathutil.Clean(path)
+ if filepath.IsAbs(path) {
+ path = filepath.Clean(path)
} else {
- path = pathutil.Join(cwd, path)
+ path = filepath.Join(cwd, path)
}
// we have a non-empty absolute path
if filter != nil && !filter(path) {
@@ -95,7 +95,7 @@ func canonicalizePaths(list []string, filter func(path string) bool) []string {
// atomically renames that file to the file named by filename.
//
func writeFileAtomically(filename string, data []byte) os.Error {
- f, err := ioutil.TempFile(cwd, filename)
+ f, err := ioutil.TempFile(filepath.Split(filename))
if err != nil {
return err
}
@@ -149,7 +149,7 @@ var textExt = map[string]bool{
//
func isTextFile(filename string) bool {
// if the extension is known, use it for decision making
- if isText, found := textExt[pathutil.Ext(filename)]; found {
+ if isText, found := textExt[filepath.Ext(filename)]; found {
return isText
}