← Commit list

a04cc47f1

Denis Vlasenko
Denis Vlasenko
2008-06-25
FAILED Duration: 25s

Subject

b[un]zip2, g[un]zip: unlink destination if -f is given. Closes 3854

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/bbunzip.c+6 -0
@@ -73,6 +73,12 @@ int bbunpack(char **argv,
bb_error_msg("%s: unknown suffix - ignored", filename);
goto err;
}
+
+ /* -f: overwrite existing output files */
+ if (option_mask32 & OPT_FORCE) {
+ unlink(new_name);
+ }
+
/* O_EXCL: "real" bunzip2 doesn't overwrite files */
/* GNU gunzip does not bail out, but goes to next file */
if (open_to_or_warn(STDOUT_FILENO, new_name, O_WRONLY | O_CREAT | O_EXCL,