Commit c9021a1a authored by Robert Griesemer's avatar Robert Griesemer

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
parent 11bda7df
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment