{"thread":{"id":"5394","subject":"[PATCH] Use PATH_MAX instead of MAXPATHLEN","startedAt":"2006-08-26T14:09:17Z","lastAt":"2006-08-26T14:09:17Z","messageCount":1,"participants":["Jonas Fonseca"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"25936","messageId":"20060826140917.GA11601@diku.dk","threadId":"5394","inReplyTo":null,"subject":"[PATCH] Use PATH_MAX instead of MAXPATHLEN","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2006-08-26T14:09:17Z","receivedAt":"2006-08-26T14:09:17Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"According to sys/paramh.h it's a \"BSD name\" for values defined in\n<limits.h>. Besides PATH_MAX seems to be more commonly used.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n builtin-checkout-index.c |    2 +-\n dir.c                    |    2 +-\n entry.c                  |    4 +---\n git-compat-util.h        |    3 ---\n 4 files changed, 3 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin-checkout-index.c b/builtin-checkout-index.c\nindex 6b55f93..b097c88 100644\n--- a/builtin-checkout-index.c\n+++ b/builtin-checkout-index.c\n@@ -45,7 +45,7 @@ #define CHECKOUT_ALL 4\n static int line_termination = '\\n';\n static int checkout_stage; /* default to checkout stage0 */\n static int to_tempfile;\n-static char topath[4][MAXPATHLEN+1];\n+static char topath[4][PATH_MAX + 1];\n \n static struct checkout state;\n \ndiff --git a/dir.c b/dir.c\nindex 092d077..a686de6 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -293,7 +293,7 @@ static int read_directory_recursive(stru\n \tif (fdir) {\n \t\tint exclude_stk;\n \t\tstruct dirent *de;\n-\t\tchar fullname[MAXPATHLEN + 1];\n+\t\tchar fullname[PATH_MAX + 1];\n \t\tmemcpy(fullname, base, baselen);\n \n \t\texclude_stk = push_exclude_per_directory(dir, base, baselen);\ndiff --git a/entry.c b/entry.c\nindex 793724f..b2ea0ef 100644\n--- a/entry.c\n+++ b/entry.c\n@@ -135,7 +135,7 @@ static int write_entry(struct cache_entr\n \n int checkout_entry(struct cache_entry *ce, struct checkout *state, char *topath)\n {\n-\tstatic char path[MAXPATHLEN+1];\n+\tstatic char path[PATH_MAX + 1];\n \tstruct stat st;\n \tint len = state->base_dir_len;\n \n@@ -172,5 +172,3 @@ int checkout_entry(struct cache_entry *c\n \tcreate_directories(path, state);\n \treturn write_entry(ce, path, state, 0);\n }\n-\n-\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex b2e1895..91f2b0d 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -172,7 +172,4 @@ static inline int sane_case(int x, int h\n \treturn x;\n }\n \n-#ifndef MAXPATHLEN\n-#define MAXPATHLEN 256\n-#endif\n #endif\n-- \n1.4.2.GIT\n\n-- \nJonas Fonseca\n"}]}