git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] abspath: increase array size of cwd variable to PATH_MAX

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 19, 2011, 16:43 UTC
Message-ID
<7v8vpkbhyv.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1316425872-30457-1-git-send-email-Hui.Wang@windriver.com>
Wang Hui <Hui.Wang@windriver.com> writes:
Show 10 quoted lines
> 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.

Previous: Wang HuiNext: Ramsay Jones
Message 2 of 6 in “abspath: increase array size of cwd variable to PATH_MAX”
  1. abspath: increase array size of cwd variable to PATH_MAXWang Hui, Sep 19, 2011
  2. Junio C HamanoSep 19, 2011
  3. Ramsay JonesSep 20, 2011
  4. Junio C HamanoSep 21, 2011
  5. wanghuiSep 22, 2011
  6. wanghuiSep 22, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.