We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31875b1 commit 69c27e9Copy full SHA for 69c27e9
1 file changed
lib/suppressions.cpp
@@ -669,10 +669,10 @@ polyspace::Parser::Parser(const Settings &settings)
669
if (pos == std::string::npos)
670
return false;
671
672
- if (pos > 0 && args[pos - 1] != ' ')
673
- return false;
+ const char prevChar = (pos > 0) ? args[pos - 1] : ' ';
+ const char nextChar = (pos + arg.size() < args.size()) ? args[pos + arg.size()] : ' ';
674
675
- return pos == args.size() - arg.size() || args[pos + arg.size()] == ' ';
+ return prevChar == ' ' && (nextChar == ' ' || nextChar == ':');
676
};
677
678
if (matchArg("--misra-c-2012")) {
0 commit comments