MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / ranges_cover_line

Function ranges_cover_line

tests/test_parse_coverage.c:667–680  ·  view source on GitHub ↗

Return 1 if the "a-b,c-d" range string covers 1-based `line`. */

Source from the content-addressed store, hash-verified

665
666/* Return 1 if the "a-b,c-d" range string covers 1-based `line`. */
667static int ranges_cover_line(const char *ranges, unsigned int line) {
668 const char *p = ranges;
669 while (p && *p) {
670 unsigned int s = 0, e = 0;
671 if (sscanf(p, "%u-%u", &s, &e) == 2 && line >= s && line <= e) {
672 return 1;
673 }
674 p = strchr(p, ',');
675 if (p) {
676 p++;
677 }
678 }
679 return 0;
680}
681
682/* Total lines covered by every range in the string. */
683static unsigned int ranges_total_span(const char *ranges) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected