On Sat, Jan 5, 2013 at 1:35 AM, David Michael wrote:
> It is possible for this pointer of the GIT_DIR environment variable to
> survive unduplicated until further getenv calls are made. The standards
> allow for subsequent calls of getenv to overwrite the string located at
> its returned pointer,
Duy Nguyen writes:
> On Sat, Jan 5, 2013 at 11:38 AM, Junio C Hamano wrote:
>> I personally do not think a wrapper with limited slots is a healthy
>> direction to go. Most places we use getenv() do not let the return
>> value live across their scope, and those that do should explicitly
>> copy
On Sat, Jan 5, 2013 at 11:38 AM, Junio C Hamano wrote:
> I personally do not think a wrapper with limited slots is a healthy
> direction to go. Most places we use getenv() do not let the return
> value live across their scope, and those that do should explicitly
> copy the value away. It's betwe
Duy Nguyen writes:
> Maybe we could all this into a wrapper? If getenv() here has a
> problem, many other places may have the same problem too. This
> simplifies the change. But one has to check that getenv() must not be
> used in threaded code.
That needs to be done regardless, if we care; POSI
Junio C Hamano writes:
> ... So even if the standard allowed the
> returned value to be volatile across calls to getenv(3),...
> ...
> In fact,
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html
>
> says that only ...
Apparently I wasn't even reading what I was quotin
On Sat, Jan 5, 2013 at 7:35 AM, David Michael wrote:
> -if (gitdirenv)
> -return setup_explicit_git_dir(gitdirenv, cwd, len, nongit_ok);
> +if (gitdirenv) {
> +gitdirenv = xstrdup(gitdirenv);
> +ret = setup_explicit_git_dir(gitdirenv, cwd, len, nongit_ok);
> +
Hi,
On Fri, Jan 4, 2013 at 8:17 PM, Junio C Hamano wrote:
> In fact,
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html
>
> says that only setenv(), unsetenv() and putenv() may invalidate
> previous return values. Note that getenv() is not listed as a
> function that i
David Michael writes:
> I have encountered an issue with consecutive calls to getenv
> overwriting earlier values. Most notably, it prevents a plain "git
> clone" from working.
>
> Long story short: This value of GIT_DIR gets passed around setup.c
> until it reaches check_repository_format_gentl
It is possible for this pointer of the GIT_DIR environment variable to
survive unduplicated until further getenv calls are made. The standards
allow for subsequent calls of getenv to overwrite the string located at
its returned pointer, and this can result in broken git operations on
certain platf
9 matches
Mail list logo