From af657a56008c40e3220d1cbcc43893d902568d86 Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Tue, 1 Jan 2008 17:09:47 +0000 Subject: Patch to prevent lf/crlf conversion. According to Lasse Collin, this patch has also been applied in their repository. git-svn-id: svn://tug.org/texlive/trunk@6020 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/utils/lzma-utils/src/lzmadec/lzmadec.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Build/source/utils/lzma-utils/src') diff --git a/Build/source/utils/lzma-utils/src/lzmadec/lzmadec.c b/Build/source/utils/lzma-utils/src/lzmadec/lzmadec.c index c4f035d5204..457e9a8e730 100644 --- a/Build/source/utils/lzma-utils/src/lzmadec/lzmadec.c +++ b/Build/source/utils/lzma-utils/src/lzmadec/lzmadec.c @@ -12,6 +12,12 @@ #define CHUNKSIZE_IN 4096 #define CHUNKSIZE_OUT (1024*512) + +/* for O_BINARY: */ +#ifdef WIN32 +#include +#endif + int main(int argc, char **argv) { int ret; @@ -38,6 +44,12 @@ int main(int argc, char **argv) return 0; } + /* + * Windows: set stdin/stdout to binary mode */ + #ifdef WIN32 + setmode(fileno(stdout), O_BINARY); + setmode(fileno(stdin), O_BINARY); + #endif if (buffer_in == NULL || buffer_out == NULL) { fprintf (stderr, "%s: Not enough memory.\n", argv[0]); return 5; -- cgit v1.2.3