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

Re: [PATCH] abspath.c: use PATH_MAX in real_path_internal()

From
Duy Nguyen <pclouds@gmail.com>
Date
Jul 19, 2014, 12:51 UTC
Message-ID
<CACsJy8Dq9Em8qZtkep+iVE2M9GPM5RN0oyvyt-nWwK50kSmsQQ@mail.gmail.com>
In-Reply-To
<53C9387D.4090504@web.de>
On Fri, Jul 18, 2014 at 10:08 PM, René Scharfe <l.s.r@web.de> wrote:
Show 10 quoted lines
>> We could wrap this "get cwd, cd back" pattern as well. So "save_cwd"
>> returns an opaque pointer, "go_back" takes the pointer, (f)chdir back
>> and free the pointer if needed. On platforms that support fchdir, it
>> can be used, else we fall back to chdir. I think there are only four
>> places that follow this pattern, here, setup.c (.git discovery), git.c
>> (restore_env) and unix-socket.c. Enough call sites to make it worth
>> the effort?
>
> On a cursory look I didn't find any more potential users.  Something
> like this?
I think it looks nice.
> Applying it to setup.c looks difficult to impossible, though.

Yeah, setup.c needs cwd as a string because it does something else to cwd besides going back. Too bad.

-- 
Duy
Previous: René ScharfeNext: Karsten Blees
Message 7 of 17 in “abspath.c: use PATH_MAX in real_path_internal()”
  1. abspath.c: use PATH_MAX in real_path_internal()Nguyễn Thái Ngọc Duy, Jul 17, 2014
  2. René ScharfeJul 17, 2014
  3. Junio C HamanoJul 17, 2014
  4. Karsten BleesJul 17, 2014
  5. Duy NguyenJul 18, 2014
  6. René ScharfeJul 18, 2014
  7. Duy NguyenJul 19, 2014
  8. Karsten BleesJul 20, 2014
  9. René ScharfeJul 20, 2014
  10. Jeff KingJul 21, 2014
  11. René ScharfeJul 18, 2014
  12. Karsten BleesJul 19, 2014
  13. René ScharfeJul 20, 2014
  14. Junio C HamanoJul 17, 2014
  15. Karsten BleesJul 17, 2014
  16. Karsten BleesJul 17, 2014
  17. Junio C HamanoJul 18, 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.