{"thread":{"id":"6168","subject":"[PATCH 1/4] Use PATH_MAX constant for --bare.","startedAt":"2006-12-31T04:28:53Z","lastAt":"2006-12-31T04:28:53Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"30544","messageId":"20061231042853.GA5823@spearce.org","threadId":"6168","inReplyTo":null,"subject":"[PATCH 1/4] Use PATH_MAX constant for --bare.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-12-31T04:28:53Z","receivedAt":"2006-12-31T04:28:53Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"For easier portability we prefer PATH_MAX over seemingly random\nconstants like 1024.  Make it so.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n git.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git.c b/git.c\nindex 50ebd86..ec897dc 100644\n--- a/git.c\n+++ b/git.c\n@@ -69,8 +69,8 @@ static int handle_options(const char*** argv, int* argc)\n \t\t} else if (!strncmp(cmd, \"--git-dir=\", 10)) {\n \t\t\tsetenv(\"GIT_DIR\", cmd + 10, 1);\n \t\t} else if (!strcmp(cmd, \"--bare\")) {\n-\t\t\tstatic char git_dir[1024];\n-\t\t\tsetenv(\"GIT_DIR\", getcwd(git_dir, 1024), 1);\n+\t\t\tstatic char git_dir[PATH_MAX+1];\n+\t\t\tsetenv(\"GIT_DIR\", getcwd(git_dir, sizeof(git_dir)), 1);\n \t\t} else {\n \t\t\tfprintf(stderr, \"Unknown option: %s\\n\", cmd);\n \t\t\tusage(git_usage_string);\n-- \n1.5.0.rc0.g6bb1\n"}]}