| 775 | } |
| 776 | |
| 777 | static size_t find_next_line(struct strbuf *sb, size_t offset) |
| 778 | { |
| 779 | char *eol; |
| 780 | |
| 781 | if (offset >= sb->len) |
| 782 | BUG("looking for next line beyond buffer (%d >= %d)\n%s", |
| 783 | (int)offset, (int)sb->len, sb->buf); |
| 784 | |
| 785 | eol = memchr(sb->buf + offset, '\n', sb->len - offset); |
| 786 | if (!eol) |
| 787 | return sb->len; |
| 788 | return eol - sb->buf + 1; |
| 789 | } |
| 790 | |
| 791 | static void render_hunk(struct add_p_state *s, struct hunk *hunk, |
| 792 | ssize_t delta, int colored, struct strbuf *out) |
no outgoing calls
no test coverage detected