diff options
author | albert-github <albert.tests@gmail.com> | 2018-09-18 08:52:39 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2018-09-18 08:52:39 (GMT) |
commit | c6ec3a813f61b1a5c15d959b923c4f26dd2f62c5 (patch) | |
tree | ede77599b0123c05ce4fc5388dd5629e9b3d38fc /src/configimpl.l | |
parent | 9b13cfe86e26c7282cea0e0ad5d253a507e1645b (diff) | |
download | Doxygen-c6ec3a813f61b1a5c15d959b923c4f26dd2f62c5.zip Doxygen-c6ec3a813f61b1a5c15d959b923c4f26dd2f62c5.tar.gz Doxygen-c6ec3a813f61b1a5c15d959b923c4f26dd2f62c5.tar.bz2 |
Difference between standard and used Doxyfile (list)
The default (string) list can contain an empty elements (e.g. INPUT, STRIP_FROM_PATH) giving false positives. Removed empty elements from the checks.
Diffstat (limited to 'src/configimpl.l')
-rw-r--r-- | src/configimpl.l | 65 |
1 files changed, 57 insertions, 8 deletions
diff --git a/src/configimpl.l b/src/configimpl.l index 72584d7..3fb1360 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -317,22 +317,71 @@ void ConfigList::writeTemplate(FTextStream &t,bool sl,bool) void ConfigList::compareDoxyfile(FTextStream &t) { - if ( m_value.count() != m_defaultValue.count()) + const char *p = m_value.first(); + const char *q = m_defaultValue.first(); + int defCnt = 0; + int valCnt = 0; + + // count non empty elements + while (p) + { + QCString s=p; + if (!s.stripWhiteSpace().isEmpty()) valCnt += 1; + p = m_value.next(); + } + + while (q) + { + QCString s=q; + if (!s.stripWhiteSpace().isEmpty()) defCnt += 1; + q = m_defaultValue.next(); + } + if ( valCnt != defCnt) { writeTemplate(t,TRUE,TRUE); return; } - const char *p = m_value.first(); - const char *q = m_defaultValue.first(); - while (p) + // get first non empry element + q = m_defaultValue.first(); + p = m_value.first(); + QCString sp = p; + while (p && sp.stripWhiteSpace().isEmpty()) { p = m_value.next(); - q = m_defaultValue.next(); - if (QCString(p).stripWhiteSpace() != QCString(q).stripWhiteSpace()) + sp = p; + } + QCString sq = q; + while (q && sq.stripWhiteSpace().isEmpty()) + { + q = m_value.next(); + sq = q; + } + while (p) + { + // skip empty elements + sp = p; + while (p && sp.stripWhiteSpace().isEmpty()) { - writeTemplate(t,TRUE,TRUE); - return; + p = m_value.next(); + sp = p; + } + sq = q; + while (q && sq.stripWhiteSpace().isEmpty()) + { + q = m_value.next(); + sq = q; + } + // be sure we have still an element (p and q have same number of 'filled' elements) + if (p) + { + if (sp.stripWhiteSpace() != sq.stripWhiteSpace()) + { + writeTemplate(t,TRUE,TRUE); + return; + } + p = m_value.next(); + q = m_defaultValue.next(); } } } |