mirror of
https://github.com/reactos/CMake.git
synced 2025-02-23 05:22:26 +00:00
cmRST: Fix crash on empty markup block
This commit is contained in:
parent
2024327746
commit
a9b38a1757
@ -457,6 +457,12 @@ void cmRST::UnindentLines(std::vector<std::string>& lines)
|
||||
size_t trailingEmpty =
|
||||
std::distance(rit, cmFindNot(cmReverseRange(lines), std::string()));
|
||||
|
||||
if ((leadingEmpty + trailingEmpty) >= lines.size()) {
|
||||
// All lines are empty. The markup block is empty. Leave only one.
|
||||
lines.resize(1);
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<std::string>::iterator contentEnd = cmRotate(
|
||||
lines.begin(), lines.begin() + leadingEmpty, lines.end() - trailingEmpty);
|
||||
lines.erase(contentEnd, lines.end());
|
||||
|
@ -83,6 +83,10 @@ or after a paragraph ending in two colons::
|
||||
but not after a line ending in two colons::
|
||||
in the middle of a paragraph.
|
||||
|
||||
A literal block can be empty::
|
||||
|
||||
|
||||
|
||||
.. productionlist::
|
||||
grammar: `production`
|
||||
production: "content rendered"
|
||||
|
@ -90,6 +90,10 @@ or after a paragraph ending in two colons::
|
||||
but not after a line ending in two colons::
|
||||
in the middle of a paragraph.
|
||||
|
||||
A literal block can be empty::
|
||||
|
||||
|
||||
|
||||
.. productionlist::
|
||||
grammar: `production`
|
||||
production: "content rendered"
|
||||
|
Loading…
x
Reference in New Issue
Block a user