From: Tim Kientzle Date: Mon, 26 Jan 2015 05:29:31 +0000 (-0800) Subject: Force binary output when extracting to stdout on Windows. X-Git-Tag: v3.1.900a~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d0ce3d9c618f8ecd9cebd574e4527b4723e7e45;p=thirdparty%2Flibarchive.git Force binary output when extracting to stdout on Windows. --- diff --git a/tar/read.c b/tar/read.c index 83815eda2..a4c063c7e 100644 --- a/tar/read.c +++ b/tar/read.c @@ -237,6 +237,12 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer) #endif } +#if defined(_WIN32) && !defined(__CYGWIN__) + if (mode == 'x' && bsdtar->option_stdout) { + _setmode(1, _O_BINARY); + } +#endif + for (;;) { /* Support --fast-read option */ if (bsdtar->option_fast_read &&