Fixed #2793 (SIGABRT on filenames without file extension)
This commit is contained in:
parent
4433e621f8
commit
8d68981119
|
@ -3194,9 +3194,14 @@ void CheckOther::checkMisusedScopedObject()
|
||||||
// Skip this check for .c files
|
// Skip this check for .c files
|
||||||
{
|
{
|
||||||
const std::string fname = _tokenizer->getFiles()->at(0);
|
const std::string fname = _tokenizer->getFiles()->at(0);
|
||||||
const std::string ext = fname.substr(fname.rfind("."));
|
size_t position = fname.rfind(".");
|
||||||
if (ext == ".c" || ext == ".C")
|
|
||||||
return;
|
if (position != std::string::npos)
|
||||||
|
{
|
||||||
|
const std::string ext = fname.substr(position);
|
||||||
|
if (ext == ".c" || ext == ".C")
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const SymbolDatabase * const symbolDatabase = _tokenizer->getSymbolDatabase();
|
const SymbolDatabase * const symbolDatabase = _tokenizer->getSymbolDatabase();
|
||||||
|
|
Loading…
Reference in New Issue