]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Always overwrite comparson conditions if the pathname is the same
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 8 Feb 2012 07:01:57 +0000 (16:01 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 8 Feb 2012 07:01:57 +0000 (16:01 +0900)
libarchive/archive_match.c

index e6d97153c9273b98d01364baedd3971c6a2813d5..5a4e54f9cb91f9a88ae2fffda86b2d3b9b921e7b 100644 (file)
@@ -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;