Skip to content

Commit

Permalink
Use PATH_MAX constant for --bare.
Browse files Browse the repository at this point in the history
For easier portability we prefer PATH_MAX over seemingly random
constants like 1024.  Make it so.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Dec 31, 2006
1 parent c869753 commit ef5ddb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ef5ddb2

Please sign in to comment.