Skip to content

Commit f12f3af

Browse files
committed
Merge branch 'rs/leave-base-name-in-name-field-of-tar'
Improve compatibility with implementations of "tar" that do not like empty name field in header (with the additional prefix field holding everything). * rs/leave-base-name-in-name-field-of-tar: archive-tar: split long paths more carefully
2 parents 63d1cf6 + 22f0dcd commit f12f3af

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

archive-tar.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ static unsigned int ustar_header_chksum(const struct ustar_header *header)
153153
static size_t get_path_prefix(const char *path, size_t pathlen, size_t maxlen)
154154
{
155155
size_t i = pathlen;
156+
if (i > 1 && path[i - 1] == '/')
157+
i--;
156158
if (i > maxlen)
157159
i = maxlen;
158160
do {

0 commit comments

Comments
 (0)