From 6a081b969a1b62e127f45369db4ea9d4cbd34384 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 18 Aug 2013 11:35:39 -0500 Subject: [PATCH] wimlib-imagex: Set stdout to binary mode when appropriate --- programs/imagex.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/programs/imagex.c b/programs/imagex.c index d005a12b..d6479b4f 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -1720,6 +1720,7 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd) wimfile = argv[1]; if (!tstrcmp(wimfile, T("-"))) { + /* Writing captured WIM to standard output. */ #if 0 if (!(write_flags & WIMLIB_WRITE_FLAG_PIPABLE)) { imagex_error("Can't write a non-pipable WIM to " @@ -1739,6 +1740,7 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd) wim_fd = STDOUT_FILENO; wimfile = NULL; imagex_info_file = stderr; + set_fd_to_binary_mode(wim_fd); } if (argc >= 3) { @@ -2178,6 +2180,7 @@ imagex_export(int argc, tchar **argv, int cmd) dest_wimfile = NULL; dest_wim_fd = STDOUT_FILENO; imagex_info_file = stderr; + set_fd_to_binary_mode(dest_wim_fd); } errno = ENOENT; if (dest_wimfile != NULL && tstat(dest_wimfile, &stbuf) == 0) { -- 2.43.0