[BusyBox] bug#1272: gunzip -c problem

Paul Hayter paul at lemoncube.com
Sun Sep 29 18:16:03 UTC 2002


Package: busybox
Version: 0.60.4
Severity: normal

gunzip -c tries to delete the source file instead of leaving it intact.
The problem code in gunzip.c is:

        if (delete_path && !(flags & gunzip_test)) {
                if (unlink(delete_path) < 0) {
                        error_msg_and_die("Couldn't remove %s",
                        delete_path);
                }
        }

The code should also check the gunzip_to_stdout flag. Here's my poor
hack to fix it:

        if (delete_path && !(flags & gunzip_test) && !(flags &
        gunzip_to_stdout)
) {
                if (unlink(delete_path) < 0) {
                        error_msg_and_die("Couldn't remove %s",
                        delete_path);
                }
        }


I am using Slackware 7.1 with glibc 2.1.3, with kernel 2.4.19

Cheers

Paul.



More information about the busybox mailing list