summaryrefslogtreecommitdiffstats
path: root/qmake/library
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-04-29 20:39:13 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-30 16:57:09 +0200
commitd52b00e1d3cc60c81b54a89d6da488dc4bbce384 (patch)
tree8934081e6e4acd14c6c1a8fa83cc8c4dd78ef984 /qmake/library
parentf73b9e4af8d410a54ea38385d9f1a0fe99ddedf4 (diff)
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>
Diffstat (limited to 'qmake/library')
-rw-r--r--qmake/library/qmakebuiltins.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index 5ae99bab92..7896688e54 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -1064,10 +1064,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;