diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2013-07-03 16:54:44 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-04 18:13:01 +0200 |
commit | b30273ec4a4ce65794fd402c6e3eb21de7bae1b9 (patch) | |
tree | fbbedc003f4c9118a4d2686edd0ebdd0065c6877 /qmake/library/qmakeglobals.cpp | |
parent | 35f79a2c1105f1b030b42fb60ab8857e291519d9 (diff) |
don't crash if builddir is suffix of sourcedir (or vice-versa)
Task-number: QTBUG-32145
Change-Id: I97a6e2ebd51350cbf39c86efa5c26a376c49da95
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'qmake/library/qmakeglobals.cpp')
-rw-r--r-- | qmake/library/qmakeglobals.cpp | 3 |
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); |