summaryrefslogtreecommitdiffstats
path: root/Source/cmRST.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmRST.cxx')
-rw-r--r--Source/cmRST.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index 7f4abf9..26e93bb 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -89,7 +89,8 @@ void cmRST::ProcessModule(std::istream& is)
this->ProcessLine(line);
} else {
if (line[0] != '#') {
- this->ProcessLine(line.substr(0, pos));
+ line.resize(pos);
+ this->ProcessLine(line);
}
rst.clear();
this->Reset();
@@ -102,8 +103,9 @@ void cmRST::ProcessModule(std::istream& is)
this->ProcessLine("");
continue;
}
- if (line.substr(0, 2) == "# ") {
- this->ProcessLine(line.substr(2));
+ if (cmHasLiteralPrefix(line, "# ")) {
+ line.erase(0, 2);
+ this->ProcessLine(line);
continue;
}
rst.clear();
@@ -164,6 +166,8 @@ void cmRST::ProcessLine(std::string const& line)
this->Markup =
(line.find_first_not_of(" \t", 2) == std::string::npos ? MarkupEmpty
: MarkupNormal);
+ // XXX(clang-tidy): https://bugs.llvm.org/show_bug.cgi?id=44165
+ // NOLINTNEXTLINE(bugprone-branch-clone)
if (this->CMakeDirective.find(line)) {
// Output cmake domain directives and their content normally.
this->NormalLine(line);