projects
/
platform
/
upstream
/
xz.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9cba97
)
Set stdin and stdout to binary mode on Windows. This patch is
author
Lasse Collin
<lasse.collin@tukaani.org>
Fri, 18 Jan 2008 12:17:37 +0000
(14:17 +0200)
committer
Lasse Collin
<lasse.collin@tukaani.org>
Fri, 18 Jan 2008 12:17:37 +0000
(14:17 +0200)
a forward port of
b7b22fcb979a16d3a47c8001f058c9f7d4416068
from lzma-utils-legacy.git. I don't know if the new code base
builds on Windows, but this is a start.
src/lzmadec/lzmadec.c
patch
|
blob
|
history
diff --git
a/src/lzmadec/lzmadec.c
b/src/lzmadec/lzmadec.c
index
10d5cc6
..
eca58b9
100644
(file)
--- a/
src/lzmadec/lzmadec.c
+++ b/
src/lzmadec/lzmadec.c
@@
-28,6
+28,10
@@
extern int errno;
#include <stdio.h>
#include <unistd.h>
+#ifdef WIN32
+# include <fcntl.h>
+#endif
+
#include "getopt.h"
#include "physmem.h"
@@
-489,6
+493,11
@@
main(int argc, char **argv)
allocator.opaque = mem_limitter;
strm.allocator = &allocator;
+#ifdef WIN32
+ setmode(fileno(stdin), O_BINARY);
+ setmode(fileno(stdout), O_BINARY);
+#endif
+
if (optind == argc) {
file = stdin;
filename = "(stdin)";