mirror of
https://github.com/golang/go
synced 2024-11-20 08:04:42 -07:00
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
This commit is contained in:
parent
11bda7df47
commit
c9021a1afe
@ -95,7 +95,7 @@ func canonicalizePaths(list []string, filter func(path string) bool) []string {
|
|||||||
// atomically renames that file to the file named by filename.
|
// atomically renames that file to the file named by filename.
|
||||||
//
|
//
|
||||||
func writeFileAtomically(filename string, data []byte) os.Error {
|
func writeFileAtomically(filename string, data []byte) os.Error {
|
||||||
f, err := ioutil.TempFile(cwd, filename)
|
f, err := ioutil.TempFile(pathutil.Split(filename))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user