diff options
author | Daniel Teske <daniel.teske@digia.com> | 2013-02-08 12:32:14 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-08 15:24:13 +0100 |
commit | e7a242b27b961c64613542c75c69954d1c7bd315 (patch) | |
tree | d10187d8dcce690a7f69d8d0a222d578eac8cd08 /src/corelib/io/qprocess_win.cpp | |
parent | 67bed5616bf4743b432566130d1f3cfb6a2dc0c1 (diff) |
QProcessEnvironment: Permit magic cmd variables
The cmd shell inserts magic variables starting with a = into the
environment.
Task-number: QTCREATORBUG-8716
Change-Id: I2f140032aea4fb1d77633c6baf90d7b536e2812a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/corelib/io/qprocess_win.cpp')
-rw-r--r-- | src/corelib/io/qprocess_win.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index d249bb17fb..693778e629 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -364,7 +364,8 @@ QProcessEnvironment QProcessEnvironment::systemEnvironment() if (wchar_t *envStrings = GetEnvironmentStringsW()) { for (const wchar_t *entry = envStrings; *entry; ) { const int entryLen = int(wcslen(entry)); - if (const wchar_t *equal = wcschr(entry, L'=')) { + // + 1 to permit magic cmd variable names starting with = + if (const wchar_t *equal = wcschr(entry + 1, L'=')) { int nameLen = equal - entry; QString name = QString::fromWCharArray(entry, nameLen); QString value = QString::fromWCharArray(equal + 1, entryLen - nameLen - 1); |