Dear diary, on Tue, Sep 20, 2005 at 02:42:47AM CEST, I got a letter
where "H. Peter Anvin" [off-list ref] told me that...
Petr Baudis wrote:
quoted
quoted
quoted
- memcpy(path, git_dir, len);
+ memcpy(path, git_dir, len-1);
+ path[len] = 0;
copy_templates_1(path, len,
Wrong! You're not initializing path[len-1]!
Oops, sorry. That's what you get when you want to make things marginally
better. ;-) We indeed want to pass copy_templates_1() the trailing slash
as well.
Let's just settle with the original patch then.
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.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.