From: Jonathan Nieder Date: Sat, 05 Jan 2013 23:31:06 GMT Subject: Re: [PATCH] archive-tar: split long paths more carefully Message-ID: <20130105233106.GA5686@elie.Belkin> In-Reply-To: <50E8AE12.8040102@lsrfire.ath.cx> René Scharfe wrote: > --- 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.