| 6674 | /* Split a text buffer into line spans. content_end excludes CR/LF so callers |
| 6675 | * can print or compare line content without newline spelling differences. */ |
| 6676 | static void agent_split_lines(const char *data, size_t len, agent_line_spans *spans) { |
| 6677 | size_t pos = 0; |
| 6678 | while (pos < len) { |
| 6679 | size_t start = pos; |
| 6680 | while (pos < len && data[pos] != '\n' && data[pos] != '\r') pos++; |
| 6681 | size_t content_end = pos; |
| 6682 | if (pos < len) { |
| 6683 | if (data[pos] == '\r' && pos + 1 < len && data[pos + 1] == '\n') |
| 6684 | pos += 2; |
| 6685 | else |