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

[PATCH 0/1] Safe-guard the Windows code a bit more against getenv() problems

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 15, 2019, 15:17 UTC
Message-ID
<pull.127.git.gitgitgadget@gmail.com>

We saw a couple of getenv() cleanups, where we now immediately duplicate the return value of getenv() in order to avoid problems. However, I am really uncomfortable with the current value (30) of GETENV_MAX_RETAIN in compat/mingw.c: it strikes me as low, given that the average number of getenv() call per Git process in Git's test suite is already 40.

I'd really like to increase it, even if it won't help problems where getenv() is called in a loop whose number of iteration depends on user input (like the problem fixed in 6776a84dae (diff: ensure correct lifetime of external_diff_cmd, 2019-01-11)). It will still fend off plenty of other cases, I believe.

And yes, it's in my TODOs to look back over those getenv() issues after v2.21.0 (see https://github.com/git-for-windows/git/pull/2019 for my progress).

Johannes Schindelin (1):
  mingw: safe-guard a bit more against getenv() problems
 compat/mingw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
base-commit: 2d08f3deb9feb73dc8d21d75bfd367839fc1322c
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-127%2Fdscho%2Fmingw-retain-more-getenv-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-127/dscho/mingw-retain-more-getenv-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/127
-- 
gitgitgadget
Next: Johannes Schindelin via GitGitGadget
Message 1 of 7 in “Safe-guard the Windows code a bit more against getenv() problems”
  1. 0/1 Safe-guard the Windows code a bit more against getenv() problemsJohannes Schindelin via GitGitGadget, Feb 15, 2019
  2. 1/1 mingw: safe-guard a bit more against getenv() problemsJohannes Schindelin via GitGitGadget, Feb 15, 2019
  3. Jeff HostetlerFeb 15, 2019
  4. Junio C HamanoFeb 15, 2019
  5. Johannes SchindelinFeb 18, 2019
  6. Jeff KingFeb 21, 2019
  7. Jeff KingFeb 21, 2019

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.