summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_win.cpp
diff options
context:
space:
mode:
authorThomas Sondergaard <thomas.sondergaard@karoshealth.com>2017-06-11 18:41:57 +0200
committerThomas Sondergaard <thomas@sondergaard.cc>2017-06-13 06:09:40 +0000
commit65a317e6745ee267bef7295f4dfe31d5ec62f7aa (patch)
tree85a937b1a896bdeffd3d0bb602ee9791363e1006 /src/corelib/io/qprocess_win.cpp
parentb4381100280adbfa4cb6c4d8c84eed8f1dc126b9 (diff)
Use QMap in QProcessEnvironment so variables are sorted
The motivation for this change is to make it simple to pass a correctly sorted environment block to Win32 CreateProcess(). It is also nice in other contexts that the environment variables are sorted. The change is made for all platforms. This keeps it simple and the only ill effect is slightly slower lookups. Concerning the environment block passed to Win32 CreateProcess: The environment block that is passed to CreateProcess() must be sorted case-insensitively and without regard to locale. See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682009(v=vs.85).aspx The need for sorting the environment block is also mentioned in the CreateProcess() documentation, but with less details: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx Task-number: QTBUG-61315 Change-Id: Ie1edd443301de79cf5f699d45beab01b7c0f9de3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qprocess_win.cpp')
-rw-r--r--src/corelib/io/qprocess_win.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 9adb5138b7..05c9d6594c 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -390,11 +390,11 @@ static QString qt_create_commandline(const QString &program, const QStringList &
return args;
}
-static QByteArray qt_create_environment(const QProcessEnvironmentPrivate::Hash &environment)
+static QByteArray qt_create_environment(const QProcessEnvironmentPrivate::Map &environment)
{
QByteArray envlist;
if (!environment.isEmpty()) {
- QProcessEnvironmentPrivate::Hash copy = environment;
+ QProcessEnvironmentPrivate::Map copy = environment;
// add PATH if necessary (for DLL loading)
QProcessEnvironmentPrivate::Key pathKey(QLatin1String("PATH"));