diff options
author | Robert Griesemer <gri@golang.org> | 2011-02-24 11:13:20 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2011-02-24 11:13:20 -0800 |
commit | c9021a1afec280134638a1ffb15597354fee269c (patch) | |
tree | 9553b3f80ae46ade67f07c42d747fd4963cf32f1 | |
parent | 11bda7df47de8cb02d77750351e90419cc946173 (diff) | |
download | go-c9021a1afec280134638a1ffb15597354fee269c.tar.gz go-c9021a1afec280134638a1ffb15597354fee269c.zip |
godoc: fix writeFileAtomically utility function
If the filename was absolute, writeFileAtomically
used the wrong filename for ioutil.TempFile leading
to non-existent directories and the TempFile would
fail.
R=r, r2
CC=golang-dev
https://golang.org/cl/4224043
-rw-r--r-- | src/cmd/godoc/utils.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/godoc/utils.go b/src/cmd/godoc/utils.go index cc028cc4d7..d21e7e9863 100644 --- a/src/cmd/godoc/utils.go +++ b/src/cmd/godoc/utils.go @@ -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(pathutil.Split(filename)) if err != nil { return err } |