Commit 727b83cb authored by Michael Natterer's avatar Michael Natterer 😴

tools: fix windows file handling in gimp-test-clipboard.c

Use g_open() for proper filename encoding and _O_BINARY to avoid line
ending conversions.

(cherry picked from commit a9b36245)
parent bf3ea753
......@@ -18,6 +18,11 @@
#include <unistd.h>
#endif
#include <glib/gstdio.h>
#ifndef _O_BINARY
#define _O_BINARY 0
#endif
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
......@@ -373,7 +378,7 @@ test_clipboard_paste (GtkClipboard *clipboard,
if (! strcmp (filename, "-"))
fd = 1;
else
fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
fd = g_open (filename, O_WRONLY | O_CREAT | O_TRUNC | _O_BINARY, 0666);
if (fd < 0)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment