[Issue 15783] New: Junk is written into environment variable after assigning null to it

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Mar 10 03:02:43 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15783

          Issue ID: 15783
           Summary: Junk is written into environment variable after
                    assigning null to it
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: freeslave93 at gmail.com

import std.stdio;
import std.process;
import std.path;

void test(string envvar)
{   
    environment[envvar] = "myvalue";
    writefln("check env: %s=%s (%s)", envvar, environment.get(envvar),
environment.get(envvar).length);
    environment[envvar] = null;
    writefln("check env: %s=%s (%s)", envvar, environment.get(envvar),
environment.get(envvar).length);
}

void main(string[] args)
{
    test("TEST_VAR1");
    test("TEST_VAR2");
}

This seems to be random. Sometimes it writes junk only to the second variable.

--


More information about the Digitalmars-d-bugs mailing list