From: Michihiro NAKAJIMA Date: Sun, 15 Jan 2012 08:27:19 +0000 (-0500) Subject: Remove an unnecessary comparison and minor tweaks. X-Git-Tag: v3.0.4~2^2~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bc1d4fc35515d39cee0c48bd8645ef7bfc5010c;p=thirdparty%2Flibarchive.git Remove an unnecessary comparison and minor tweaks. SVN-Revision: 4154 --- diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index f296bb8ce..f73a3c093 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -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)); /*