summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoray Kilinc <kkilinc@teradici.com>2020-01-24 17:17:12 (GMT)
committerKoray Kilinc <kkilinc@teradici.com>2020-01-24 17:17:12 (GMT)
commit4a3a7d5f5d02ce6c160f3f56e94c7e8b84e69b44 (patch)
treef1399941930bfccc1305c7fa9f6d862fd3e06f9b
parentab2fc918216011a03f0fe7696e7bba67fc2627b3 (diff)
downloadCMake-4a3a7d5f5d02ce6c160f3f56e94c7e8b84e69b44.zip
CMake-4a3a7d5f5d02ce6c160f3f56e94c7e8b84e69b44.tar.gz
CMake-4a3a7d5f5d02ce6c160f3f56e94c7e8b84e69b44.tar.bz2
CPack/DragNDrop: Fix word corruption in BreakLongLines
When the lines are wrapped the leading characters of the next word were being lost
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 3516235..810ffb9 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -878,8 +878,9 @@ bool cmCPackDragNDropGenerator::BreakLongLine(const std::string& line,
std::string* error)
{
const size_t max_line_length = 512;
- for (size_t i = 0; i < line.size(); i += max_line_length) {
- size_t line_length = max_line_length;
+ size_t line_length = max_line_length;
+ for (size_t i = 0; i < line.size(); i += line_length) {
+ line_length = max_line_length;
if (i + line_length > line.size()) {
line_length = line.size() - i;
} else {