forked from qt-creator/qt-creator
don't crash if builddir is suffix of sourcedir (or vice-versa)
Change-Id: I97a6e2ebd51350cbf39c86efa5c26a376c49da95 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> (cherry picked from qtbase/b30273ec4a4ce65794fd402c6e3eb21de7bae1b9)
This commit is contained in:
@@ -237,7 +237,8 @@ void QMakeGlobals::setDirectories(const QString &input_dir, const QString &outpu
|
|||||||
int srcLen = srcpath.length();
|
int srcLen = srcpath.length();
|
||||||
int dstLen = dstpath.length();
|
int dstLen = dstpath.length();
|
||||||
int lastSl = -1;
|
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('/'))
|
if (srcpath.at(srcLen) == QLatin1Char('/'))
|
||||||
lastSl = 0;
|
lastSl = 0;
|
||||||
source_root = srcpath.left(srcLen + lastSl);
|
source_root = srcpath.left(srcLen + lastSl);
|
||||||
|
Reference in New Issue
Block a user