[poppler] utils/pdftocairo.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 10 23:16:08 UTC 2020


 utils/pdftocairo.cc |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 928df1f3cf1184e802d07ae444bc11ee084edadd
Author: Salvo Miosi <salvo.ilmiosi at gmail.com>
Date:   Thu Dec 10 18:24:06 2020 +0100

    pdftocairo: Setmode binary for windows

diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc
index d3302c7b..bf854603 100644
--- a/utils/pdftocairo.cc
+++ b/utils/pdftocairo.cc
@@ -48,6 +48,7 @@
 #include <cstdio>
 #include <cmath>
 #include <cstring>
+#include <fcntl.h>
 #include "parseargs.h"
 #include "goo/gmem.h"
 #include "goo/GooString.h"
@@ -385,9 +386,12 @@ static void writePageImage(GooString *filename)
     if (!writer)
         return;
 
-    if (filename->cmp("fd://0") == 0)
+    if (filename->cmp("fd://0") == 0) {
+#ifdef _WIN32
+        setmode(fileno(stdout), O_BINARY);
+#endif
         file = stdout;
-    else
+    } else
         file = fopen(filename->c_str(), "wb");
 
     if (!file) {


More information about the poppler mailing list