summaryrefslogtreecommitdiffstats
path: root/qmake/library/qmakeglobals.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/library/qmakeglobals.cpp')
-rw-r--r--qmake/library/qmakeglobals.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qmake/library/qmakeglobals.cpp b/qmake/library/qmakeglobals.cpp
index 42bb85bb02..3570aa70b7 100644
--- a/qmake/library/qmakeglobals.cpp
+++ b/qmake/library/qmakeglobals.cpp
@@ -249,7 +249,8 @@ void QMakeGlobals::setDirectories(const QString &input_dir, const QString &outpu
int srcLen = srcpath.length();
int dstLen = dstpath.length();
int lastSl = -1;
- while (++lastSl, srcpath.at(--srcLen) == dstpath.at(--dstLen))
+ while (++lastSl, --srcLen, --dstLen,
+ srcLen && dstLen && srcpath.at(srcLen) == dstpath.at(dstLen))
if (srcpath.at(srcLen) == QLatin1Char('/'))
lastSl = 0;
source_root = srcpath.left(srcLen + lastSl);