From: Junio C Hamano Date: Mon, 19 Sep 2011 16:43:52 GMT Subject: Re: [PATCH] abspath: increase array size of cwd variable to PATH_MAX Message-ID: <7v8vpkbhyv.fsf@alter.siamese.dyndns.org> In-Reply-To: <1316425872-30457-1-git-send-email-Hui.Wang@windriver.com> Wang Hui writes: > diff --git a/abspath.c b/abspath.c > index f04ac18..2ce1db9 100644 > --- a/abspath.c > +++ b/abspath.c > @@ -24,7 +24,7 @@ int is_directory(const char *path) > const char *real_path(const char *path) > { > static char bufs[2][PATH_MAX + 1], *buf = bufs[0], *next_buf = bufs[1]; > - char cwd[1024] = ""; > + char cwd[PATH_MAX] = ""; Thanks. This does not make things worse but in the longer term we should move away from using PATH_MAX in general.