From 1f961c196cbb475e612a4fb082b33efde71e7a03 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Tue, 20 Sep 2005 02:19:50 +0200 Subject: [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 Signed-off-by: Junio C Hamano --- init-db.c | 1 + 1 file changed, 1 insertion(+) diff --git a/init-db.c b/init-db.c index 902bdfaafb..da2bc8f42b 100644 --- a/init-db.c +++ b/init-db.c @@ -154,6 +154,7 @@ static void copy_templates(const char *git_dir, int len, char *template_dir) } memcpy(path, git_dir, len); + path[len] = 0; copy_templates_1(path, len, template_path, template_len, dir); -- cgit v1.2.3