MSYS2-packages/subversion/06-svnadmin-binary-mode.patch
2018-06-27 10:06:29 +03:00

49 lines
1.4 KiB
Diff
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Use binary mode for svnadmin dump/load.
From: David Rothenberger <d.rothenberger@entomo.com>
---
subversion/svnadmin/svnadmin.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/subversion/svnadmin/svnadmin.c b/subversion/svnadmin/svnadmin.c
index eb26c5a..6267224 100644
--- a/subversion/svnadmin/svnadmin.c
+++ b/subversion/svnadmin/svnadmin.c
@@ -52,6 +52,10 @@
#include "svn_private_config.h"
+#include <unistd.h>
+#include <io.h>
+#include <fcntl.h>
+
/*** Code. ***/
@@ -1359,7 +1363,10 @@ subcommand_dump(apr_getopt_t *os, void *baton, apr_pool_t *pool)
out_stream = svn_stream_from_aprfile2(file, FALSE, pool);
}
else
- SVN_ERR(svn_stream_for_stdout(&out_stream, pool));
+ {
+ setmode(STDOUT_FILENO, O_BINARY);
+ SVN_ERR(svn_stream_for_stdout(&out_stream, pool));
+ }
/* Progress feedback goes to STDERR, unless they asked to suppress it. */
if (! opt_state->quiet)
@@ -1635,7 +1642,10 @@ subcommand_load(apr_getopt_t *os, void *baton, apr_pool_t *pool)
SVN_ERR(svn_stream_open_readonly(&in_stream, opt_state->file,
pool, pool));
else
- SVN_ERR(svn_stream_for_stdin2(&in_stream, TRUE, pool));
+ {
+ setmode(STDIN_FILENO, O_BINARY);
+ SVN_ERR(svn_stream_for_stdin2(&in_stream, TRUE, pool));
+ }
/* Progress feedback goes to STDOUT, unless they asked to suppress it. */
if (! opt_state->quiet)