[gimp/gimp-2-8] Bug 776516 - Saving over existing GZ or BZ2 compressed files...



commit dd331a67d8552af4b52db1631c04be75075d670a
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jan 3 15:10:35 2017 +0100

    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.
    
    (cherry picked from commit 559a75858105bdcc04f24899bba1ade79523f8ea)

 plug-ins/file-compressor/file-compressor.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/file-compressor/file-compressor.c b/plug-ins/file-compressor/file-compressor.c
index 58812d8..62c8a8c 100644
--- a/plug-ins/file-compressor/file-compressor.c
+++ b/plug-ins/file-compressor/file-compressor.c
@@ -612,7 +612,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;
 
@@ -734,7 +734,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;
 


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