summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kdab.com>2019-08-15 07:37:06 +0300
committerBogDan Vatra <bogdan@kdab.com>2019-08-19 10:27:41 +0300
commit77160d29234fe9ea570a515f32f53f864c947e4d (patch)
treee8cfd454dce8c75fb668bed0079cb483afac1f39 /src
parentc00487d588f9ae45d8a477a1c436fde69feca782 (diff)
Android: Fix env vars parsing
env var values might contain '=' char, so we can't use split. Change-Id: Iedf3ea46a847acaaf02f51bc80586a519fe7a310 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 70dde46ffa..915f7f0f5b 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -454,9 +454,9 @@ static jboolean startQtAndroidPlugin(JNIEnv *env, jobject /*object*/, jstring pa
const QList<QByteArray> envVars = QByteArray(nativeString).split('\t');
env->ReleaseStringUTFChars(environmentString, nativeString);
for (const QByteArray &envVar : envVars) {
- const QList<QByteArray> envVarPair = envVar.split('=');
- if (envVarPair.size() == 2 && ::setenv(envVarPair[0], envVarPair[1], 1) != 0)
- qWarning() << "Can't set environment" << envVarPair;
+ int pos = envVar.indexOf('=');
+ if (pos != -1 && ::setenv(envVar.left(pos), envVar.mid(pos + 1), 1) != 0)
+ qWarning() << "Can't set environment" << envVar;
}
}