summaryrefslogtreecommitdiff
path: root/subversion/libsvn_subr/subst.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2014-02-20 19:26:10 +0000
committerPeter Wemm <peter@FreeBSD.org>2014-02-20 19:26:10 +0000
commit219f5ebf8fca3572d8d4265d78d0e4670ca35a27 (patch)
treee6232088e2faabbf0f1a6e568df3285323f27c5c /subversion/libsvn_subr/subst.c
parenteeb88685bfa4ef1c0639f1136d83ff19de1b4595 (diff)
Notes
Diffstat (limited to 'subversion/libsvn_subr/subst.c')
-rw-r--r--subversion/libsvn_subr/subst.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/subversion/libsvn_subr/subst.c b/subversion/libsvn_subr/subst.c
index 3545289baf81..223b269a7107 100644
--- a/subversion/libsvn_subr/subst.c
+++ b/subversion/libsvn_subr/subst.c
@@ -1702,9 +1702,19 @@ create_special_file_from_stream(svn_stream_t *source, const char *dst,
### this only writes the first line!
*/
if (create_using_internal_representation)
- SVN_ERR(svn_io_write_unique(&dst_tmp, svn_dirent_dirname(dst, pool),
- contents->data, contents->len,
- svn_io_file_del_none, pool));
+ {
+ apr_file_t *new_file;
+ SVN_ERR(svn_io_open_unique_file3(&new_file, &dst_tmp,
+ svn_dirent_dirname(dst, pool),
+ svn_io_file_del_none,
+ pool, pool));
+
+ SVN_ERR(svn_io_file_write_full(new_file,
+ contents->data, contents->len, NULL,
+ pool));
+
+ SVN_ERR(svn_io_file_close(new_file, pool));
+ }
/* Do the atomic rename from our temporary location. */
return svn_io_file_rename(dst_tmp, dst, pool);