From ed96d199f197b2f82fa3ad19484a809ec1c0a4a4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sun, 24 Jun 2012 17:22:23 +0200 Subject: 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 Reviewed-by: Andreas Hartmetz Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- qmake/option.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qmake/option.cpp') 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 { -- cgit v1.2.3