diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-14 07:34:12 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-14 07:34:12 -0800 |
commit | f0c103b49cc5957de5c332d0ca9915fdb96a26cf (patch) | |
tree | 3c5bf30ec91a547d29f3d940d95b779f31a6e250 | |
parent | 32e820bdc5ca66d53605bfdcb0751b21a2372de2 (diff) | |
parent | 22f0dcd9634a818a0c83f23ea1a48f2d620c0546 (diff) | |
download | git-f0c103b49cc5957de5c332d0ca9915fdb96a26cf.tar.gz git-f0c103b49cc5957de5c332d0ca9915fdb96a26cf.tar.xz |
Merge branch 'rs/leave-base-name-in-name-field-of-tar' into maint
A tar archive created by "git archive" recorded a directory in a
way that made NetBSD's implementation of "tar" sometimes unhappy.
* rs/leave-base-name-in-name-field-of-tar:
archive-tar: split long paths more carefully
-rw-r--r-- | archive-tar.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/archive-tar.c b/archive-tar.c index 0ba3f25cf..d1cce46e3 100644 --- a/archive-tar.c +++ b/archive-tar.c @@ -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 { |