mirror of https://github.com/GNOME/gimp.git
Bug 776516 - Saving over existing GZ or BZ2 compressed files...
...does not truncate them Pass O_TRUNC to g_open() when creating the target files.
This commit is contained in:
parent
8111ad62da
commit
559a758581
|
@ -640,7 +640,7 @@ gzip_save (const char *infile,
|
|||
if (!in)
|
||||
goto out;
|
||||
|
||||
fd = g_open (outfile, O_CREAT | O_WRONLY | _O_BINARY, 0664);
|
||||
fd = g_open (outfile, O_CREAT | O_WRONLY | O_TRUNC | _O_BINARY, 0664);
|
||||
if (fd == -1)
|
||||
goto out;
|
||||
|
||||
|
@ -762,7 +762,7 @@ bzip2_save (const char *infile,
|
|||
if (!in)
|
||||
goto out;
|
||||
|
||||
fd = g_open (outfile, O_CREAT | O_WRONLY | _O_BINARY, 0664);
|
||||
fd = g_open (outfile, O_CREAT | O_WRONLY | O_TRUNC | _O_BINARY, 0664);
|
||||
if (fd == -1)
|
||||
goto out;
|
||||
|
||||
|
|
Loading…
Reference in New Issue