[BusyBox] Small bug in zcat/gunzip -c

Jean Wolter jw5 at os.inf.tu-dresden.de
Mon Sep 30 06:37:09 UTC 2002


Hello,

the man page of gzip states:

       -c --stdout --to-stdout
              Write  output  on  standard  output;  keep original
              files unchanged.  

zcat/gunzip -c tries to delete the .gz file after decompression. The
folling patch leads to the correct behaviour:

--- ../busybox-0.60.4/gunzip.c  Tue Apr 30 06:00:23 2002
+++ ./gunzip.c  Mon Sep 30 11:23:33 2002
@@ -144,7 +144,7 @@
        fclose(out_file);
        fclose(in_file);
 
-       if (delete_path && !(flags & gunzip_test)) {
+       if (delete_path && !(flags & (gunzip_test | gunzip_to_stdout))) {
                if (unlink(delete_path) < 0) {
                        error_msg_and_die("Couldn't remove %s", delete_path);
                }

Regards,
Jean



More information about the busybox mailing list