summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/linguist/shared/profileevaluator.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp
index 98929c0..5440752 100644
--- a/tools/linguist/shared/profileevaluator.cpp
+++ b/tools/linguist/shared/profileevaluator.cpp
@@ -1476,7 +1476,13 @@ ProFile *ProFileEvaluator::parsedProFile(const QString &fileName)
{
QFileInfo fi(fileName);
if (fi.exists()) {
- ProFile *pro = new ProFile(fi.absoluteFilePath());
+ QString fn = QDir::cleanPath(fi.absoluteFilePath());
+ foreach (const ProFile *pf, d->m_profileStack)
+ if (pf->fileName() == fn) {
+ errorMessage(d->format("circular inclusion of %1").arg(fn));
+ return 0;
+ }
+ ProFile *pro = new ProFile(fn);
if (d->read(pro))
return pro;
delete pro;