summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2016-03-27 12:34:17 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2016-03-27 12:34:17 +0200
commiteee0305d40d48a3612d49d7177d29947bf97a67a (patch)
treec6402c9bd5a5eb627d9c8529e8362fe7338ab251
parent565f01476b463149bbc04ed6a2f7362f884481d1 (diff)
Set stdin to binary mode on Windows
Fixes EOLs when reading from stdin. Fully fixes issue #113.
-rw-r--r--src/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index f9fa29c..a78c76a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -75,6 +75,7 @@ int main(int argc, char *argv[]) {
int options = CMARK_OPT_DEFAULT;
#if defined(_WIN32) && !defined(__CYGWIN__)
+ _setmode(_fileno(stdin), _O_BINARY);
_setmode(_fileno(stdout), _O_BINARY);
#endif