Bug 676916: Filename garbled when you save .xcf.bz2...

or .xcf.gz files using non-ASCII characters
This commit is contained in:
Massimo Valentini 2012-05-31 19:35:21 +02:00
parent 2f10aee65d
commit 321a113212
1 changed files with 7 additions and 4 deletions

View File

@ -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;