diff options
Diffstat (limited to 'Source/cmRST.cxx')
-rw-r--r-- | Source/cmRST.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index 7f4abf9..c39d162 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(); |