]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Force binary output when extracting to stdout on Windows.
authorTim Kientzle <kientzle@acm.org>
Mon, 26 Jan 2015 05:29:31 +0000 (21:29 -0800)
committerTim Kientzle <kientzle@acm.org>
Mon, 26 Jan 2015 05:29:31 +0000 (21:29 -0800)
tar/read.c

index 83815eda21700ffc778e71739b62961ce7e1263d..a4c063c7ee67e3ba9eca1344adb8587076f81bd6 100644 (file)
@@ -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 &&