提交 ef5ddb2f 编写于 作者: S Shawn O. Pearce 提交者: Junio C Hamano

Use PATH_MAX constant for --bare.

For easier portability we prefer PATH_MAX over seemingly random
constants like 1024.  Make it so.
Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 c869753e
......@@ -69,8 +69,8 @@ static int handle_options(const char*** argv, int* argc)
} else if (!strncmp(cmd, "--git-dir=", 10)) {
setenv("GIT_DIR", cmd + 10, 1);
} else if (!strcmp(cmd, "--bare")) {
static char git_dir[1024];
setenv("GIT_DIR", getcwd(git_dir, 1024), 1);
static char git_dir[PATH_MAX+1];
setenv("GIT_DIR", getcwd(git_dir, sizeof(git_dir)), 1);
} else {
fprintf(stderr, "Unknown option: %s\n", cmd);
usage(git_usage_string);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册