projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e18f9a
)
b[un]zip2, g[un]zip: unlink destination if -f is given. Closes 3854
author
Denis Vlasenko
<vda.linux@googlemail.com>
Wed, 25 Jun 2008 20:54:45 +0000
(20:54 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Wed, 25 Jun 2008 20:54:45 +0000
(20:54 -0000)
archival/bbunzip.c
patch
|
blob
|
history
diff --git
a/archival/bbunzip.c
b/archival/bbunzip.c
index 90d39f6828efb7996ba73ccc0e442eb8a0f4544e..09a4eb9eb38b092ad521174a5356710908973eb2 100644
(file)
--- a/
archival/bbunzip.c
+++ b/
archival/bbunzip.c
@@
-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,