Limit cdUp to root

Task-number: QTCREATORBUG-10860

Change-Id: I22550b4415e07cac0d78f36595dc7ee781a837c0
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Orgad Shaneh
2013-12-03 08:15:44 +02:00
committed by Orgad Shaneh
parent a3f30b3d17
commit 0a71091260
6 changed files with 11 additions and 7 deletions

View File

@@ -1349,7 +1349,9 @@ bool CvsPlugin::managesDirectory(const QString &directory, QString *topLevel /*
* not have a "CVS" directory. The starting directory must be a managed
* one. Go up and try to find the first unmanaged parent dir. */
QDir lastDirectory = dir;
for (QDir parentDir = lastDirectory; parentDir.cdUp() ; lastDirectory = parentDir) {
for (QDir parentDir = lastDirectory;
!parentDir.isRoot() && parentDir.cdUp();
lastDirectory = parentDir) {
if (!checkCVSDirectory(parentDir)) {
*topLevel = lastDirectory.absolutePath();
break;