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
This commit is contained in:
Junio C Hamano 2013-01-10 13:47:35 -08:00
Родитель 63d1cf6526 22f0dcd963
Коммит f12f3af726
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -153,6 +153,8 @@ static unsigned int ustar_header_chksum(const struct ustar_header *header)
static size_t get_path_prefix(const char *path, size_t pathlen, size_t maxlen)
{
size_t i = pathlen;
if (i > 1 && path[i - 1] == '/')
i--;
if (i > maxlen)
i = maxlen;
do {