Commit 821bc8cd authored by Oswald Buddenhagen's avatar Oswald Buddenhagen Committed by Tim Jenssen

QMake: fix filename normalization

apart from various project tree related issues, we've also seen crashes.

Task-number: QTCREATORBUG-17364
Change-Id: I61bb8aff301a048646ed97f8fa2c825cbff8d2cb
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 1a6e6ed5
......@@ -83,7 +83,7 @@ QVector<ProFileEvaluator::SourceFile> ProFileEvaluator::fixifiedValues(
foreach (const ProString &str, d->values(ProKey(variable))) {
const QString &el = d->m_option->expandEnvVars(str.toQString());
if (IoUtils::isAbsolutePath(el)) {
result << SourceFile{ el, str.sourceFile() };
result << SourceFile{ QDir::cleanPath(el), str.sourceFile() };
} else {
QString fn = QDir::cleanPath(baseDirectory + QLatin1Char('/') + el);
if (IoUtils::exists(fn))
......@@ -132,16 +132,17 @@ QVector<ProFileEvaluator::SourceFile> ProFileEvaluator::absoluteFileValues(
const QString &el = d->m_option->expandEnvVars(str.toQString());
QString absEl;
if (IoUtils::isAbsolutePath(el)) {
if (m_vfs->exists(el, flags)) {
result << SourceFile{ el, str.sourceFile() };
QString fn = QDir::cleanPath(el);
if (m_vfs->exists(fn, flags)) {
result << SourceFile{ fn, str.sourceFile() };
goto next;
}
absEl = el;
absEl = fn;
} else {
foreach (const QString &dir, searchDirs) {
QString fn = QDir::cleanPath(dir + QLatin1Char('/') + el);
if (m_vfs->exists(fn, flags)) {
result << SourceFile{ QDir::cleanPath(fn), str.sourceFile() };
result << SourceFile{ fn, str.sourceFile() };
goto next;
}
}
......
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