[librsvg] gitlab#117 - (Windows) Set stdout to O_BINARY in rsvg-convert.



commit a3de426ced7ac90b934fda04e04744202d0da958
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Jan 15 21:19:05 2018 -0600

    gitlab#117 - (Windows) Set stdout to O_BINARY in rsvg-convert.
    
    Thanks to Bakhtiar Hasmanan for the fix.
    
    https://gitlab.gnome.org/GNOME/librsvg/issues/117

 rsvg-convert.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/rsvg-convert.c b/rsvg-convert.c
index a5504b6..ef4ead6 100644
--- a/rsvg-convert.c
+++ b/rsvg-convert.c
@@ -44,6 +44,7 @@
 #ifdef G_OS_WIN32
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
+#include <fcntl.h>
 
 #include <gio/gwin32inputstream.h>
 #endif
@@ -211,6 +212,11 @@ main (int argc, char **argv)
 
         g_free (output);
     }
+#ifdef G_OS_WIN32
+    else {
+        setmode (fileno (stdout), O_BINARY);
+    }
+#endif   
 
     if (args)
         while (args[n_args] != NULL)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]