Skip to content

Commit

Permalink
Use PATH_MAX instead of MAXPATHLEN
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jonas authored and Junio C Hamano committed Aug 27, 2006
1 parent eb950c1 commit 095c424
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion builtin-checkout-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}


3 changes: 0 additions & 3 deletions git-compat-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,4 @@ static inline int sane_case(int x, int high)
return x;
}

#ifndef MAXPATHLEN
#define MAXPATHLEN 256
#endif
#endif

0 comments on commit 095c424

Please sign in to comment.