regex: Search on strings where possible
This commit is contained in:
parent
3e7194a215
commit
7492a7b846
@ -1811,7 +1811,7 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
is_shared_library = this->ExtractSharedLibraryName.find(file.c_str());
|
is_shared_library = this->ExtractSharedLibraryName.find(file);
|
||||||
|
|
||||||
if(!is_shared_library)
|
if(!is_shared_library)
|
||||||
{
|
{
|
||||||
|
@ -402,7 +402,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
|
|||||||
return compilerId ? compilerId : "";
|
return compilerId ? compilerId : "";
|
||||||
}
|
}
|
||||||
static cmsys::RegularExpression compilerIdValidator("^[A-Za-z0-9_]*$");
|
static cmsys::RegularExpression compilerIdValidator("^[A-Za-z0-9_]*$");
|
||||||
if (!compilerIdValidator.find(parameters.begin()->c_str()))
|
if (!compilerIdValidator.find(*parameters.begin()))
|
||||||
{
|
{
|
||||||
reportError(context, content->GetOriginalExpression(),
|
reportError(context, content->GetOriginalExpression(),
|
||||||
"Expression syntax not recognized.");
|
"Expression syntax not recognized.");
|
||||||
@ -509,7 +509,7 @@ struct CompilerVersionNode : public cmGeneratorExpressionNode
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cmsys::RegularExpression compilerIdValidator("^[0-9\\.]*$");
|
static cmsys::RegularExpression compilerIdValidator("^[0-9\\.]*$");
|
||||||
if (!compilerIdValidator.find(parameters.begin()->c_str()))
|
if (!compilerIdValidator.find(*parameters.begin()))
|
||||||
{
|
{
|
||||||
reportError(context, content->GetOriginalExpression(),
|
reportError(context, content->GetOriginalExpression(),
|
||||||
"Expression syntax not recognized.");
|
"Expression syntax not recognized.");
|
||||||
@ -710,7 +710,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
|
|||||||
return configurationNode.Evaluate(parameters, context, content, 0);
|
return configurationNode.Evaluate(parameters, context, content, 0);
|
||||||
}
|
}
|
||||||
static cmsys::RegularExpression configValidator("^[A-Za-z0-9_]*$");
|
static cmsys::RegularExpression configValidator("^[A-Za-z0-9_]*$");
|
||||||
if (!configValidator.find(parameters.begin()->c_str()))
|
if (!configValidator.find(*parameters.begin()))
|
||||||
{
|
{
|
||||||
reportError(context, content->GetOriginalExpression(),
|
reportError(context, content->GetOriginalExpression(),
|
||||||
"Expression syntax not recognized.");
|
"Expression syntax not recognized.");
|
||||||
@ -969,7 +969,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
|||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!propertyNameValidator.find(propertyName.c_str()))
|
if (!propertyNameValidator.find(propertyName))
|
||||||
{
|
{
|
||||||
::reportError(context, content->GetOriginalExpression(),
|
::reportError(context, content->GetOriginalExpression(),
|
||||||
"Property name not supported.");
|
"Property name not supported.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user