[Lldb-commits] [lldb] [lldb] Improve ansi::OutputWordWrappedLines (PR #181165)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 17 01:56:19 PST 2026


================
@@ -329,9 +332,10 @@ inline void OutputWordWrappedLines(Stream &strm,
       start++;
 
     end = start + max_text_width;
-    if (end > final_end) {
+    if (end > final_end)
       end = final_end;
-    } else {
+
+    if (end != final_end) {
       // If we're not at the end of the text, make sure we break the line on
       // white space.
       while (end > start && text[end] != ' ' && text[end] != '\t' &&
----------------
DavidSpickett wrote:

Yes, I said newline but I meant null. It worked out for the logic we had but stringref doesn't count the null.

https://github.com/llvm/llvm-project/pull/181165


More information about the lldb-commits mailing list