aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-24 01:16:12 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-24 01:16:12 +0100
commit6ccaa23f2be25b3e1ff4c6f5f9bef69a4cb36f8c (patch)
tree205ed7d89c8427d1fb5b80767ac05723196fafdd
parent8d580c72f4eaf5bb6cfec21ef473723c74c3382d (diff)
downloadbusybox-w32-6ccaa23f2be25b3e1ff4c6f5f9bef69a4cb36f8c.tar.gz
busybox-w32-6ccaa23f2be25b3e1ff4c6f5f9bef69a4cb36f8c.tar.bz2
busybox-w32-6ccaa23f2be25b3e1ff4c6f5f9bef69a4cb36f8c.zip
libunarchive: fix reversed test for older/newer
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--archival/libunarchive/data_extract_all.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c
index 294024bbb..2fcddc404 100644
--- a/archival/libunarchive/data_extract_all.c
+++ b/archival/libunarchive/data_extract_all.c
@@ -30,13 +30,13 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
30 } 30 }
31 else if (archive_handle->ah_flags & ARCHIVE_EXTRACT_NEWER) { 31 else if (archive_handle->ah_flags & ARCHIVE_EXTRACT_NEWER) {
32 /* Remove the existing entry if its older than the extracted entry */ 32 /* Remove the existing entry if its older than the extracted entry */
33 struct stat statbuf; 33 struct stat existing_sb;
34 if (lstat(file_header->name, &statbuf) == -1) { 34 if (lstat(file_header->name, &existing_sb) == -1) {
35 if (errno != ENOENT) { 35 if (errno != ENOENT) {
36 bb_perror_msg_and_die("can't stat old file"); 36 bb_perror_msg_and_die("can't stat old file");
37 } 37 }
38 } 38 }
39 else if (statbuf.st_mtime <= file_header->mtime) { 39 else if (existing_sb.st_mtime >= file_header->mtime) {
40 if (!(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)) { 40 if (!(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)) {
41 bb_error_msg("%s not created: newer or " 41 bb_error_msg("%s not created: newer or "
42 "same age file exists", file_header->name); 42 "same age file exists", file_header->name);