From: Michihiro NAKAJIMA Date: Wed, 8 Feb 2012 07:01:57 +0000 (+0900) Subject: Always overwrite comparson conditions if the pathname is the same X-Git-Tag: v3.0.4~2^2~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e67d6a948fc879f1b85aa88b04aa517ad590c4c0;p=thirdparty%2Flibarchive.git Always overwrite comparson conditions if the pathname is the same --- diff --git a/libarchive/archive_match.c b/libarchive/archive_match.c index e6d97153c..5a4e54f9c 100644 --- a/libarchive/archive_match.c +++ b/libarchive/archive_match.c @@ -1200,26 +1200,18 @@ add_entry(struct archive_match *a, int flag, f2 = (struct match_file *)__archive_rb_tree_find_node( &(a->newer_tree), pathname); - /* Overwrite mtime condision if it is newer than. */ + /* Overwrite comparison condision. */ if (f2 != NULL) { f2->flag = f->flag; - if ((f2->mtime_sec < f->mtime_sec) || - (f2->mtime_sec == f->mtime_sec && - f2->mtime_nsec < f->mtime_nsec)) { - f2->mtime_sec = f->mtime_sec; - f2->mtime_nsec = f->mtime_nsec; - } - if ((f2->ctime_sec < f->ctime_sec) || - (f2->ctime_sec == f->ctime_sec && - f2->ctime_nsec < f->ctime_nsec)) { - f2->ctime_sec = f->ctime_sec; - f2->ctime_nsec = f->ctime_nsec; - } - /* Release the duplicated file. */ - archive_mstring_clean(&(f->pathname)); - free(f); - return (ARCHIVE_OK); + f2->mtime_sec = f->mtime_sec; + f2->mtime_nsec = f->mtime_nsec; + f2->ctime_sec = f->ctime_sec; + f2->ctime_nsec = f->ctime_nsec; } + /* Release the duplicated file. */ + archive_mstring_clean(&(f->pathname)); + free(f); + return (ARCHIVE_OK); } entry_list_add(&(a->entry_list), f); a->setflag |= TIME_IS_SET;