From: H. Peter Anvin Date: Tue, 20 Sep 2005 03:27:32 GMT Subject: Re: [PATCH] Fix git-init-db creating crap directories (zeroth try) Message-ID: <432F81A4.10107@zytor.com> In-Reply-To: <20050920015154.GA25115@pasky.or.cz> Petr Baudis wrote: >> >>But if len is the index of the '/', then you're not. > > But fortunately len is not the index of the '/', len-1 is. len is the length > of the leading path fragment including the trailing slash. > Then you'd need len-1 both inside the memcpy() and the assignment, of course. -hpa