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

Re: [PATCH 3/3] use xgetcwd() get the current directory or die

From
Duy Nguyen <pclouds@gmail.com>
Date
Jul 20, 2014, 12:45 UTC
Message-ID
<CACsJy8CX5iDejuKZSEoeP_mNCyGzpZ+vQteYfQosw6x6aBJvbw@mail.gmail.com>
In-Reply-To
<53CBA65B.7090504@web.de>
On Sun, Jul 20, 2014 at 6:22 PM, René Scharfe <l.s.r@web.de> wrote:
Show 11 quoted lines
> Convert several calls of getcwd() and die() to use xgetcwd() instead.
> This way we get rid of fixed-size buffers (which can be too small
> depending on the used file system) and gain consistent error messages.
>
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---
>  builtin/init-db.c   | 17 ++++++++---------
>  builtin/rev-parse.c |  6 +++---
>  dir.c               | 12 ++++++++----
>  trace.c             |  7 ++++---
>  4 files changed, 23 insertions(+), 19 deletions(-)

There should be a 4/3 to replace the remaining getcwd with strbuf_getcwd. But I guess we could add that to the low hanging fruit list.

-- 
Duy
Previous: René ScharfeNext: René Scharfe
Message 9 of 10 in “getcwd without PATH_MAX”
  1. 0/3 getcwd without PATH_MAXRené Scharfe, Jul 20, 2014
  2. 1/3 strbuf: add strbuf_add_cwd()René Scharfe, Jul 20, 2014
  3. Duy NguyenJul 20, 2014
  4. René ScharfeJul 20, 2014
  5. 2/3 wrapper: add xgetcwd()René Scharfe, Jul 20, 2014
  6. Duy NguyenJul 20, 2014
  7. René ScharfeJul 20, 2014
  8. 3/3 use xgetcwd() get the current directory or dieRené Scharfe, Jul 20, 2014
  9. Duy NguyenJul 20, 2014
  10. René ScharfeJul 20, 2014

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.