Browse Source

[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>
maint
Petr Baudis 20 years ago committed by Junio C Hamano
parent
commit
1f961c196c
  1. 1
      init-db.c

1
init-db.c

@ -154,6 +154,7 @@ static void copy_templates(const char *git_dir, int len, char *template_dir) @@ -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);

Loading…
Cancel
Save