summaryrefslogtreecommitdiffstats
path: root/tools/linguist/shared/profileevaluator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linguist/shared/profileevaluator.cpp')
-rw-r--r--tools/linguist/shared/profileevaluator.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp
index 14355b3..5c83f7e 100644
--- a/tools/linguist/shared/profileevaluator.cpp
+++ b/tools/linguist/shared/profileevaluator.cpp
@@ -367,6 +367,9 @@ void ProFileEvaluator::Private::insertVariable(const QString &line, int *i)
{
ProVariable::VariableOperator opkind;
+ if (m_proitem.isEmpty()) // Line starting with '=', like a conflict marker
+ return;
+
switch (m_proitem.at(m_proitem.length() - 1).unicode()) {
case '+':
m_proitem.chop(1);
@@ -2022,7 +2025,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;