fix $$shell_path() for mingw+sh

the msys shell expects unix-like paths with drives converted
from d:\ to /d/.

Change-Id: I09e25ed2c868702e5d7d8b9cc8c04cc13410eeff
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/d52b00e1d3cc60c81b54a89d6da488dc4bbce384)
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Oswald Buddenhagen
2014-04-29 20:39:13 +02:00
committed by Oswald Buddenhagen
parent 9b9c4a96aa
commit c394fc9a23

View File

@@ -1053,10 +1053,18 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
evalError(fL1S("shell_path(path) requires one argument."));
} else {
QString rstr = args.at(0).toQString(m_tmp1);
if (m_dirSep.startsWith(QLatin1Char('\\')))
if (m_dirSep.startsWith(QLatin1Char('\\'))) {
rstr.replace(QLatin1Char('/'), QLatin1Char('\\'));
else
} else {
rstr.replace(QLatin1Char('\\'), QLatin1Char('/'));
#ifdef Q_OS_WIN
// Convert d:/foo/bar to msys-style /d/foo/bar.
if (rstr.length() > 2 && rstr.at(1) == QLatin1Char(':') && rstr.at(2) == QLatin1Char('/')) {
rstr[1] = rstr.at(0);
rstr[0] = QLatin1Char('/');
}
#endif
}
ret << (rstr.isSharedWith(m_tmp1) ? args.at(0) : ProString(rstr).setSource(args.at(0)));
}
break;