Eliminate a redundant call to archive_entry_set_pathname()
This commit is contained in:
parent
0f7d2bd380
commit
fe44171ebd
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user