Commit dd2425eb authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

make setting a bad $$[QMAKEFEATURES] not crash qmake



Task-number: QTBUG-29642
Change-Id: I9cc209eb313f03bf342bcb64b1de3005755700a7
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/50a90720be7d67dcdfe704a82fb3b1138edd2aab)
parent 4d75cb93
......@@ -1445,8 +1445,8 @@ void QMakeEvaluator::updateFeaturePaths()
feature_roots += m_qmakefeatures;
feature_roots += m_option->propertyValue(ProKey("QMAKEFEATURES")).toQString(m_mtmp).split(
m_option->dirlist_sep, QString::SkipEmptyParts);
feature_roots += m_option->splitPathList(
m_option->propertyValue(ProKey("QMAKEFEATURES")).toQString(m_mtmp));
QStringList feature_bases;
if (!m_buildRoot.isEmpty()) {
......
......@@ -258,6 +258,19 @@ QString QMakeGlobals::shadowedPath(const QString &fileName) const
return QString();
}
QStringList QMakeGlobals::splitPathList(const QString &val) const
{
QStringList ret;
if (!val.isEmpty()) {
QDir bdir;
QStringList vals = val.split(dirlist_sep);
ret.reserve(vals.length());
foreach (const QString &it, vals)
ret << QDir::cleanPath(bdir.absoluteFilePath(it));
}
return ret;
}
QString QMakeGlobals::getEnv(const QString &var) const
{
#ifdef PROEVALUATOR_SETENV
......@@ -269,16 +282,7 @@ QString QMakeGlobals::getEnv(const QString &var) const
QStringList QMakeGlobals::getPathListEnv(const QString &var) const
{
QStringList ret;
QString val = getEnv(var);
if (!val.isEmpty()) {
QDir bdir;
QStringList vals = val.split(dirlist_sep);
ret.reserve(vals.length());
foreach (const QString &it, vals)
ret << QDir::cleanPath(bdir.absoluteFilePath(it));
}
return ret;
return splitPathList(getEnv(var));
}
QString QMakeGlobals::expandEnvVars(const QString &str) const
......
......@@ -135,6 +135,7 @@ public:
QString expandEnvVars(const QString &str) const;
QString shadowedPath(const QString &fileName) const;
QStringList splitPathList(const QString &value) const;
private:
QString getEnv(const QString &) const;
......
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