summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2017-10-25 16:34:14 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2017-10-25 16:34:14 +0200
commitba764e239bdd5f2361c8e6ab3272709516c6ef11 (patch)
tree1e5be5b47f41b22c00f318b03d4ba395191e02d0
parent8760bb227604ed8e096fdc3cee249fb655c7cdbc (diff)
downloadlibxslt-ba764e239bdd5f2361c8e6ab3272709516c6ef11.tar.gz
Fix xsltproc newlines on Windows
Set stdout and stderr to binary.
-rw-r--r--xsltproc/xsltproc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c
index 096ae30c..26ad36a4 100644
--- a/xsltproc/xsltproc.c
+++ b/xsltproc/xsltproc.c
@@ -31,6 +31,9 @@
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <fcntl.h>
+#endif
#include <libxml/xmlmemory.h>
#include <libxml/debugXML.h>
#include <libxml/HTMLtree.h>
@@ -557,6 +560,10 @@ main(int argc, char **argv)
srand(time(NULL));
xmlInitMemory();
+#if defined(_WIN32) && !defined(__CYGINW__)
+ setmode(fileno(stdout), O_BINARY);
+ setmode(fileno(stderr), O_BINARY);
+#endif
#if defined(_MSC_VER) && _MSC_VER < 1900
_set_output_format(_TWO_DIGIT_EXPONENT);
#endif