[gimp] Bug 676916: Filename garbled when you save .xcf.bz2...



commit 321a113212957cb4608fc5e405528963e61e1479
Author: Massimo Valentini <mvalentini src gnome org>
Date:   Thu May 31 19:35:21 2012 +0200

    Bug 676916: Filename garbled when you save .xcf.bz2...
    
    or .xcf.gz files using non-ASCII characters

 plug-ins/file-compressor/file-compressor.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/file-compressor/file-compressor.c b/plug-ins/file-compressor/file-compressor.c
index 492be36..8bfcc38 100644
--- a/plug-ins/file-compressor/file-compressor.c
+++ b/plug-ins/file-compressor/file-compressor.c
@@ -77,6 +77,9 @@
 #endif
 
 #include <glib/gstdio.h>
+#ifndef _O_BINARY
+#define _O_BINARY 0
+#endif
 
 #include <libgimp/gimp.h>
 
@@ -541,7 +544,7 @@ gzip_load (const char *infile,
   in = NULL;
   out = NULL;
 
-  fd = g_open (infile, O_RDONLY, 0);
+  fd = g_open (infile, O_RDONLY | _O_BINARY, 0);
   if (fd == -1)
     goto out;
 
@@ -603,7 +606,7 @@ gzip_save (const char *infile,
   if (!in)
     goto out;
 
-  fd = g_open (outfile, O_CREAT | O_WRONLY, 0664);
+  fd = g_open (outfile, O_CREAT | O_WRONLY | _O_BINARY, 0664);
   if (fd == -1)
     goto out;
 
@@ -659,7 +662,7 @@ bzip2_load (const char *infile,
   in = NULL;
   out = NULL;
 
-  fd = g_open (infile, O_RDONLY, 0);
+  fd = g_open (infile, O_RDONLY | _O_BINARY, 0);
   if (fd == -1)
     goto out;
 
@@ -721,7 +724,7 @@ bzip2_save (const char *infile,
   if (!in)
     goto out;
 
-  fd = g_open (outfile, O_CREAT | O_WRONLY, 0664);
+  fd = g_open (outfile, O_CREAT | O_WRONLY | _O_BINARY, 0664);
   if (fd == -1)
     goto out;
 



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