Commit 595ab88b authored by Fabian Vogt's avatar Fabian Vogt
Browse files

Fix reading environment variables with newline

Use '\0' as separator as '\n' is likely to appear in values.

BUG: 413130

Test Plan:
/etc/profile.d/ exported an mc() function,
which resulted in "syntax error: unexpected end of file" in the Plasma session.
Now the mc function is correctly set in the environment.

Reviewers: #plasma, apol, davidedmundson, adridg

Reviewed By: #plasma, apol, davidedmundson, adridg

Subscribers: davidedmundson, plasma-devel

Tags: #plasma

Differential Revision:
parent 1be4bb88
......@@ -3,4 +3,4 @@ do
. $i >/dev/null
env -0
......@@ -91,7 +91,7 @@ void sourceFiles(const QStringList &files)
const auto fullEnv = p.readAllStandardOutput();
auto envs = fullEnv.split('\n');
auto envs = fullEnv.split('\0');
for (auto &env: envs) {
if (env.startsWith("_=") || env.startsWith("SHLVL"))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment