Use PATH_MAX instead of MAXPATHLEN
According to sys/paramh.h it's a "BSD name" for values defined in <limits.h>. Besides PATH_MAX seems to be more commonly used. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jonas Fonseca committed
Aug 26, 2006 at 16:09 UTC
095c424d08d96a5f9ee3ca53ae952e92c5cff99b
4 files changed
+3
-8
builtin-checkout-index.c
+1
-1
@@ -45,7 +45,7 @@
45
static int line_termination = '\n';
46
static int checkout_stage; /* default to checkout stage0 */
47
static int to_tempfile;
48
-static char topath[4][MAXPATHLEN+1];
48
+static char topath[4][PATH_MAX + 1];
49
50
static struct checkout state;
51
dir.c
+1
-1
@@ -293,7 +293,7 @@ static int read_directory_recursive(struct dir_struct *dir, const char *path, co
293
if (fdir) {
294
int exclude_stk;
295
struct dirent *de;
296
- char fullname[MAXPATHLEN + 1];
296
+ char fullname[PATH_MAX + 1];
297
memcpy(fullname, base, baselen);
298
299
exclude_stk = push_exclude_per_directory(dir, base, baselen);
entry.c
+1
-3
@@ -135,7 +135,7 @@ static int write_entry(struct cache_entry *ce, char *path, struct checkout *stat
135
136
int checkout_entry(struct cache_entry *ce, struct checkout *state, char *topath)
137
{
138
- static char path[MAXPATHLEN+1];
138
+ static char path[PATH_MAX + 1];
139
struct stat st;
140
int len = state->base_dir_len;
141
@@ -172,5 +172,3 @@ int checkout_entry(struct cache_entry *ce, struct checkout *state, char *topath)
172
create_directories(path, state);
173
return write_entry(ce, path, state, 0);
174
}
175
-
176
-
git-compat-util.h
-3
@@ -172,7 +172,4 @@ static inline int sane_case(int x, int high)
172
return x;
173
}
174
175
-#ifndef MAXPATHLEN
176
-#define MAXPATHLEN 256
177
-#endif
175
#endif