Commit a62c5862 authored by David Faure's avatar David Faure

Add missing quoting around env var values in the generated shell script

This fixes TESTRUNNER_DB_ENVIRONMENT not being set because the multiline
value for QT_LOGGING_RULES broke the sourcing of the shell script.

Reviewed live by Dan Vratil.
parent cf7dcfe3
......@@ -33,9 +33,11 @@ void ShellScript::writeEnvironmentVariables()
foreach (const EnvVar &envvar, mEnvVars) {
mScript += QLatin1String("_old_") + QLatin1String(envvar.first) + QLatin1String("=") + QLatin1String(envvar.first) + QLatin1String("\n");
mScript.append(QLatin1String(envvar.first));
mScript.append(QLatin1Char('='));
mScript.append(QLatin1String(envvar.second));
mScript.append(QLatin1Char('\n'));
mScript.append(QLatin1String("=\""));
QString value = QString::fromLocal8Bit(envvar.second);
value = value.replace(QLatin1Char('"'), QLatin1String("\\\""));
mScript.append(value);
mScript.append(QLatin1String("\"\n"));
mScript.append(QLatin1String("export "));
mScript.append(QLatin1String(envvar.first));
......
Markdown is supported
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