MCPcopy Create free account
hub / github.com/git/git / sane_truncate_line

Function sane_truncate_line

diff.c:2408–2422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2406}
2407
2408static unsigned long sane_truncate_line(char *line, unsigned long len)
2409{
2410 const char *cp;
2411 unsigned long allot;
2412 size_t l = len;
2413
2414 cp = line;
2415 allot = l;
2416 while (0 < l) {
2417 (void) utf8_width(&cp, &l);
2418 if (!cp)
2419 break; /* truncated in the middle? */
2420 }
2421 return allot - l;
2422}
2423
2424static void find_lno(const char *line, struct emit_callback *ecbdata)
2425{

Callers 1

fn_out_consumeFunction · 0.85

Calls 1

utf8_widthFunction · 0.85

Tested by

no test coverage detected