From: Jonas Fonseca Date: Sat, 26 Aug 2006 14:09:17 +0000 (+0200) Subject: Use PATH_MAX instead of MAXPATHLEN X-Git-Tag: v1.4.3-rc1~183 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=095c424d08d96a5f9ee3ca53ae952e92c5cff99b;p=git.git Use PATH_MAX instead of MAXPATHLEN According to sys/paramh.h it's a "BSD name" for values defined in . Besides PATH_MAX seems to be more commonly used. Signed-off-by: Jonas Fonseca Signed-off-by: Junio C Hamano --- diff --git a/builtin-checkout-index.c b/builtin-checkout-index.c index 6b55f931c..b097c888a 100644 --- a/builtin-checkout-index.c +++ b/builtin-checkout-index.c @@ -45,7 +45,7 @@ static int line_termination = '\n'; static int checkout_stage; /* default to checkout stage0 */ static int to_tempfile; -static char topath[4][MAXPATHLEN+1]; +static char topath[4][PATH_MAX + 1]; static struct checkout state; diff --git a/dir.c b/dir.c index 092d07736..a686de660 100644 --- a/dir.c +++ b/dir.c @@ -293,7 +293,7 @@ static int read_directory_recursive(struct dir_struct *dir, const char *path, co if (fdir) { int exclude_stk; struct dirent *de; - char fullname[MAXPATHLEN + 1]; + char fullname[PATH_MAX + 1]; memcpy(fullname, base, baselen); exclude_stk = push_exclude_per_directory(dir, base, baselen); diff --git a/entry.c b/entry.c index 793724fd5..b2ea0efa8 100644 --- a/entry.c +++ b/entry.c @@ -135,7 +135,7 @@ static int write_entry(struct cache_entry *ce, char *path, struct checkout *stat int checkout_entry(struct cache_entry *ce, struct checkout *state, char *topath) { - static char path[MAXPATHLEN+1]; + static char path[PATH_MAX + 1]; struct stat st; int len = state->base_dir_len; @@ -172,5 +172,3 @@ int checkout_entry(struct cache_entry *ce, struct checkout *state, char *topath) create_directories(path, state); return write_entry(ce, path, state, 0); } - - diff --git a/git-compat-util.h b/git-compat-util.h index b2e18954c..91f2b0d3f 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -172,7 +172,4 @@ static inline int sane_case(int x, int high) return x; } -#ifndef MAXPATHLEN -#define MAXPATHLEN 256 -#endif #endif