mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-23 01:14:52 +01:00
Make -C and -T work correctly together.
MFC after: 3 days Thanks to: Guy Helmer
This commit is contained in:
parent
5897f840f0
commit
cb7f04cf39
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134427
@ -427,14 +427,15 @@ static int
|
||||
archive_names_from_file_helper(struct bsdtar *bsdtar, const char *line)
|
||||
{
|
||||
if (bsdtar->next_line_is_dir) {
|
||||
if (chdir(line) != 0)
|
||||
bsdtar_errc(bsdtar, 1, errno,
|
||||
"chdir(%s) failed", line);
|
||||
set_chdir(bsdtar, line);
|
||||
bsdtar->next_line_is_dir = 0;
|
||||
} else if (!bsdtar->option_null && strcmp(line, "-C") == 0)
|
||||
bsdtar->next_line_is_dir = 1;
|
||||
else
|
||||
else {
|
||||
if (*line != '/')
|
||||
do_chdir(bsdtar); /* Handle a deferred -C */
|
||||
write_heirarchy(bsdtar, bsdtar->archive, line);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user