Fixed #585 (Preprocessor: Don't check the same configuration twice)

http://sourceforge.net/apps/trac/cppcheck/ticket/585
This commit is contained in:
Slava Semushin 2009-09-06 00:01:57 +07:00
parent a9273c9d39
commit 195cc9aae9
1 changed files with 9 additions and 3 deletions

View File

@ -643,9 +643,15 @@ std::list<std::string> Preprocessor::getcfgs(const std::string &filedata)
break;
if (*it == "1")
continue;
if (! def.empty())
def += ";";
def += *it;
// don't add "T;T":
// treat two and more similar nested conditions as one
if (def != *it)
{
if (! def.empty())
def += ";";
def += *it;
}
}
if (std::find(ret.begin(), ret.end(), def) == ret.end())