| 604 | } |
| 605 | |
| 606 | static bool gf_line(const cbm_git_bytes_t *bytes, const unsigned char **text, size_t *length) { |
| 607 | if (!bytes->length || bytes->data[bytes->length - 1] != '\n') |
| 608 | return false; |
| 609 | size_t n = bytes->length - 1; |
| 610 | #ifdef _WIN32 |
| 611 | if (n && bytes->data[n - 1] == '\r') |
| 612 | n--; |
| 613 | #endif |
| 614 | if (memchr(bytes->data, '\0', n) || memchr(bytes->data, '\n', n) || |
| 615 | memchr(bytes->data, '\r', n)) |
| 616 | return false; |
| 617 | *text = bytes->data; |
| 618 | *length = n; |
| 619 | return true; |
| 620 | } |
| 621 | |
| 622 | static bool gf_active_line(cbm_git_facts_t *facts, const cbm_git_bytes_t *bytes, |
| 623 | const unsigned char **text, size_t *length, |
no outgoing calls
no test coverage detected