Skip to content

Commit

Permalink
[PATCH] Fix git-init-db creating crap directories.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Petr Baudis authored and Junio C Hamano committed Sep 20, 2005
1 parent bfb73b2 commit 1f961c1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions init-db.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1f961c1

Please sign in to comment.