Przeglądaj źródła

CPack/DragNDrop: Fix word corruption in BreakLongLines

When the lines are wrapped the leading characters of the next word were being lost
Koray Kilinc 5 lat temu
rodzic
commit
4a3a7d5f5d
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      Source/CPack/cmCPackDragNDropGenerator.cxx

+ 3 - 2
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 {