diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-09-03 14:23:29 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-09-03 14:23:29 +0000 |
commit | 5f698a69678ee6ac7e499f6482d3fbc745ac4ef4 (patch) | |
tree | a9f7e6c318e749875288358c963d53c25fab681a /archival/unzip.c | |
parent | afa7ad2c499937777aeea52414006d5db63c172a (diff) | |
download | busybox-w32-5f698a69678ee6ac7e499f6482d3fbc745ac4ef4.tar.gz busybox-w32-5f698a69678ee6ac7e499f6482d3fbc745ac4ef4.tar.bz2 busybox-w32-5f698a69678ee6ac7e499f6482d3fbc745ac4ef4.zip |
archival: added O_TRUNC so that when we overwrite files on unpack,
we truncate them. Also spotted & fixed hard to trigger bug
with extension handling.
git-svn-id: svn://busybox.net/trunk/busybox@16042 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'archival/unzip.c')
-rw-r--r-- | archival/unzip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/archival/unzip.c b/archival/unzip.c index 6dd1d3597..709ebf81a 100644 --- a/archival/unzip.c +++ b/archival/unzip.c | |||
@@ -333,7 +333,7 @@ int unzip_main(int argc, char **argv) | |||
333 | overwrite = o_always; | 333 | overwrite = o_always; |
334 | case 'y': /* Open file and fall into unzip */ | 334 | case 'y': /* Open file and fall into unzip */ |
335 | unzip_create_leading_dirs(dst_fn); | 335 | unzip_create_leading_dirs(dst_fn); |
336 | dst_fd = xopen3(dst_fn, O_WRONLY | O_CREAT, 0777); | 336 | dst_fd = xopen3(dst_fn, O_WRONLY | O_CREAT | O_TRUNC, 0777); |
337 | case -1: /* Unzip */ | 337 | case -1: /* Unzip */ |
338 | if (verbosity == v_normal) { | 338 | if (verbosity == v_normal) { |
339 | printf(" inflating: %s\n", dst_fn); | 339 | printf(" inflating: %s\n", dst_fn); |