aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2005-09-20 02:19:50 +0200
committerJunio C Hamano <junkio@cox.net>2005-09-19 17:41:13 -0700
commit1f961c196cbb475e612a4fb082b33efde71e7a03 (patch)
treeb1fe84edf1de96c7c82574586b9e9d774d81d065
parentbfb73b2ebc2d50c8e14133ad15137604fc54563d (diff)
downloadgit-1f961c196cbb475e612a4fb082b33efde71e7a03.tar.gz
git-1f961c196cbb475e612a4fb082b33efde71e7a03.tar.xz
[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>
-rw-r--r--init-db.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/init-db.c b/init-db.c
index 902bdfaaf..da2bc8f42 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);