lzmainfo: Use setmode() on DOS-like systems.
authorLasse Collin <lasse.collin@tukaani.org>
Sat, 9 Oct 2010 20:20:51 +0000 (23:20 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Sat, 9 Oct 2010 20:20:51 +0000 (23:20 +0300)
src/lzmainfo/lzmainfo.c

index b5f3632..8bd43af 100644 (file)
 #include "tuklib_progname.h"
 #include "tuklib_exit.h"
 
+#ifdef TUKLIB_DOSLIKE
+#      include <fcntl.h>
+#      include <io.h>
+#endif
+
 
 static void lzma_attribute((noreturn))
 help(void)
@@ -171,6 +176,10 @@ main(int argc, char **argv)
 
        parse_args(argc, argv);
 
+#ifdef TUKLIB_DOSLIKE
+       setmode(STDIN_FILENO, O_BINARY);
+#endif
+
        int ret = EXIT_SUCCESS;
 
        // We print empty lines around the output only when reading from