You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2017/12/07 20:44:28 UTC
svn commit: r1817416 - /subversion/trunk/subversion/libsvn_client/shelve.c
Author: julianfoad
Date: Thu Dec 7 20:44:28 2017
New Revision: 1817416
URL: http://svn.apache.org/viewvc?rev=1817416&view=rev
Log:
* subversion/libsvn_client/shelve.c
(svn_client_shelf_write_patch): When overwriting an existing file, truncate it.
Modified:
subversion/trunk/subversion/libsvn_client/shelve.c
Modified: subversion/trunk/subversion/libsvn_client/shelve.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/shelve.c?rev=1817416&r1=1817415&r2=1817416&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/shelve.c (original)
+++ subversion/trunk/subversion/libsvn_client/shelve.c Thu Dec 7 20:44:28 2017
@@ -102,7 +102,7 @@ svn_client_shelf_write_patch(const char
/* ### svn_stream_open_writable() doesn't work here: the buffering
goes wrong so that diff headers appear after their hunks.
For now, fix by opening the file without APR_BUFFERED. */
- flag = APR_FOPEN_WRITE | APR_FOPEN_CREATE;
+ flag = APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE;
if (! overwrite_existing)
flag |= APR_FOPEN_EXCL;
SVN_ERR(svn_io_file_open(&outfile, patch_abspath,