From 2927892fbd98aff67adbd7f53b5339351187672e Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 22 May 2019 11:31:23 -0400 Subject: getenv: split on null terminator instead of newline --- source/conda.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/conda.d b/source/conda.d index 6ebb2bf..3ca5b62 100644 --- a/source/conda.d +++ b/source/conda.d @@ -13,7 +13,7 @@ import std.typecons; static auto getenv(string[string] base=null, string preface=null) { const char delim = '='; string[string] env; - string cmd = "env"; + string cmd = "env -0"; // Execute a command before dumping the environment if (preface !is null) { @@ -27,7 +27,7 @@ static auto getenv(string[string] base=null, string preface=null) { throw new Exception("Unable to read shell environment"); } - foreach (string line; splitLines(env_sh.output)) { + foreach (string line; split(env_sh.output, '\0')) { if (line.empty) { continue; } -- cgit