Rainer Schuetze <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #1 from Rainer Schuetze <> ---
Here's a simple test:

import std.process;
import core.stdc.stdlib;
import core.stdc.stdio;

extern(C) int putenv(const char*);

void main()
        printf("1.DFLAGS=%s\n", getenv("DFLAGS"));
        environment["DLAGS"] = "2";
        printf("2.DFLAGS=%s\n", getenv("DFLAGS"));
        system("echo 3.DFLAGS=%DFLAGS%");

It prints "1" three times.

The issue is that the C runtime caches the environment changes, but
std.process.environment bypasses the cache. Subsequent C runtime calls like
getenv, system or spawn use the cached environment.


Reply via email to