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