summaryrefslogtreecommitdiffstats
path: root/qmake/option.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-06-24 17:22:23 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-26 08:14:17 +0200
commited96d199f197b2f82fa3ad19484a809ec1c0a4a4 (patch)
treea70358c353ff5479468a33fde1d280014326fffd /qmake/option.cpp
parent9dc7f848392e374e1872063899bcbdcf369e9861 (diff)
fix somewhat common edge case in $$shadowed()
if source and build dir are direct children of the common root and we are shadowing the top-level source dir, there is of course no trailing slash to match. Change-Id: I8a34a6a72d16cb21d77d056e037235af9b32a008 Reviewed-by: Davide Pesavento <davidepesa@gmail.com> Reviewed-by: Andreas Hartmetz <ahartmetz@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'qmake/option.cpp')
-rw-r--r--qmake/option.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 6eeddfd154..714aebe6ef 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -604,10 +604,10 @@ void Option::prepareProject(const QString &pfile)
dstpath += QLatin1Char('/');
int srcLen = srcpath.length();
int dstLen = dstpath.length();
- int lastSl = 0;
+ int lastSl = -1;
while (++lastSl, srcpath.at(--srcLen) == dstpath.at(--dstLen))
if (srcpath.at(srcLen) == QLatin1Char('/'))
- lastSl = 1;
+ lastSl = 0;
mkfile::source_root = srcpath.left(srcLen + lastSl);
mkfile::build_root = dstpath.left(dstLen + lastSl);
} else {