Eliminate a redundant call to archive_entry_set_pathname()

This commit is contained in:
Tim Kientzle 2004-04-21 05:16:28 +00:00
parent 0f7d2bd380
commit fe44171ebd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128516

View File

@ -677,11 +677,6 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, struct stat *st,
fd = -1;
entry = archive_entry_new();
archive_entry_set_pathname(entry, pathname);
/* If there are hard links, record it for later use */
if (!S_ISDIR(st->st_mode) && (st->st_nlink > 1))
lookup_hardlink(bsdtar, entry, st);
/* Non-regular files get archived with zero size. */
if (!S_ISREG(st->st_mode))
@ -698,6 +693,11 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, struct stat *st,
if (pathname && pathname[0] == '/' && !bsdtar->option_absolute_paths)
pathname++;
archive_entry_set_pathname(entry, pathname);
if (!S_ISDIR(st->st_mode) && (st->st_nlink > 1))
lookup_hardlink(bsdtar, entry, st);
/* Display entry as we process it. This format is required by SUSv2. */
if (bsdtar->verbose)
safe_fprintf(stderr, "a %s", pathname);
@ -733,6 +733,7 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, struct stat *st,
}
#endif
archive_entry_copy_stat(entry, st);
setup_acls(bsdtar, entry, accpath);
/*
@ -752,9 +753,6 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, struct stat *st,
}
}
archive_entry_copy_stat(entry, st);
archive_entry_set_pathname(entry, pathname);
e = archive_write_header(a, entry);
if (e != ARCHIVE_OK) {
if (!bsdtar->verbose)