]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Remove an unnecessary comparison and minor tweaks.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 15 Jan 2012 08:27:19 +0000 (03:27 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 15 Jan 2012 08:27:19 +0000 (03:27 -0500)
SVN-Revision: 4154

libarchive/archive_read_disk_posix.c

index f296bb8cea94efebebef7d0519823cb3b75b476c..f73a3c0933fe4f8a1a2a26cb304f1658f4435687 100644 (file)
@@ -1025,16 +1025,13 @@ next_entry:
                }
        }
 
-       archive_entry_copy_sourcepath(entry, tree_current_access_path(t));
-
 #if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_FDOPENDIR)
        /*
         * Open the current file to freely gather its metadata anywhere in
         * working directory.
         * Note: A symbolic link file cannot be opened with O_NOFOLLOW.
         */
-       if (fd < 0 &&
-           (a->follow_symlinks || archive_entry_filetype(entry) != AE_IFLNK))
+       if (fd < 0 && archive_entry_filetype(entry) != AE_IFLNK)
                fd = openat(tree_current_dir_fd(t), tree_current_access_path(t),
                    O_RDONLY | O_NONBLOCK);
        /* Restore working directory if openat() operation failed or
@@ -1051,6 +1048,7 @@ next_entry:
        /*
         * Populate the archive_entry with metadata from the disk.
         */
+       archive_entry_copy_sourcepath(entry, tree_current_access_path(t));
        r = archive_read_disk_entry_from_file(&(a->archive), entry, fd, st);
 
        /* Close the file descriptor used for reding the current file
@@ -1060,6 +1058,7 @@ next_entry:
 
        /* Return to the initial directory. */
        tree_enter_initial_dir(t);
+       /* Overwrite the sourcepath based on the initial directory. */
        archive_entry_copy_sourcepath(entry, tree_current_path(t));
 
        /*