Re: [PATCH] archive-tar: split long paths more carefully
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jan 5, 2013, 23:31 UTC
- Message-ID
- <20130105233106.GA5686@elie.Belkin>
- In-Reply-To
- <50E8AE12.8040102@lsrfire.ath.cx>
René Scharfe wrote:
Show 8 quoted lines
> --- 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--;Beautiful.