@matheusbsbs / matheus-bagliano / commits / 1f961c196c
Fork 0

[PATCH] Fix git-init-db creating crap directories.

The base target directory for the templates copying was initialized to git_dir, but git_dir[len] is not zero but / at the time we do the initialization. This is not what we want for our target directory string since we pass it to mkdir(), so make it zero-terminated manually. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>

Petr Baudis committed Sep 20, 2005 at 02:19 UTC 1f961c196cbb475e612a4fb082b33efde71e7a03
1 file changed +1
init-db.c
+1
@@ -154,6 +154,7 @@ static void copy_templates(const char *git_dir, int len, char *template_dir)
154 }
155
156 memcpy(path, git_dir, len);
157 + path[len] = 0;
158 copy_templates_1(path, len,
159 template_path, template_len,
160 dir);