summaryrefslogtreecommitdiff
path: root/subversion/libsvn_subr/subst.c
diff options
context:
space:
mode:
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 3545289baf81a..223b269a71077 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);