www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15783] New: Junk is written into environment variable after

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 puremagic.com
          Reporter: freeslave93 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.

--
Mar 10 2016