Use PATH_MAX instead of MAXPATHLEN
authorJonas Fonseca <fonseca@diku.dk>
Sat, 26 Aug 2006 14:09:17 +0000 (16:09 +0200)
committerJunio C Hamano <junkio@cox.net>
Sun, 27 Aug 2006 00:52:58 +0000 (17:52 -0700)
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>
builtin-checkout-index.c
dir.c
entry.c
git-compat-util.h

index 6b55f931cbd8b79a01057b55eb41a043a4db5e3b..b097c888a0da044d6dc78c9747eb18e45b46709d 100644 (file)
@@ -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 092d07736c60d4c6d86201ebeb841498c3be92a0..a686de660385f8991de2cb759b5994adca9e8b0f 100644 (file)
--- 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 793724fd52063157545f523f6d88953b96385c2c..b2ea0efa82e1a0511fe5aa798618c23827b59bab 100644 (file)
--- 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);
 }
-
-
index b2e18954c03ff502053cb74d142faab7d2a8dacb..91f2b0d3f0cf9d8539e7e09adc057dc337caae21 100644 (file)
@@ -172,7 +172,4 @@ static inline int sane_case(int x, int high)
        return x;
 }
 
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 256
-#endif
 #endif