| 142 | } |
| 143 | |
| 144 | static bool changes_line(const unsigned char *bytes, size_t length, size_t *offset, |
| 145 | changes_slice_t *line) { |
| 146 | if (*offset == length) { |
| 147 | return false; |
| 148 | } |
| 149 | const unsigned char *first = bytes + *offset; |
| 150 | const unsigned char *end = memchr(first, '\n', length - *offset); |
| 151 | line->bytes = first; |
| 152 | line->length = end ? (size_t)(end - first) : length - *offset; |
| 153 | *offset += line->length + (end ? 1 : 0); |
| 154 | return true; |
| 155 | } |
| 156 | |
| 157 | static bool changes_header_path(changes_slice_t line, changes_slice_t *path) { |
| 158 | static const char prefix[] = "diff --git a/"; |
no outgoing calls
no test coverage detected