summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2008-01-01 17:09:47 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2008-01-01 17:09:47 +0000
commitaf657a56008c40e3220d1cbcc43893d902568d86 (patch)
tree2215d777bc1b50f7343a97de4a3090048a242cae
parentf3aa60a0a318e6c20b645a63cf0bd84a04e318f8 (diff)
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
-rw-r--r--Build/source/utils/lzma-utils/src/lzmadec/lzmadec.c12
1 files changed, 12 insertions, 0 deletions
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 <fcntl.h>
+#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;