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

Function unfold_value

trailer.c:989–1009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

987}
988
989static void unfold_value(struct strbuf *val)
990{
991 size_t i;
992 size_t pos = 0;
993
994 i = 0;
995 while (i < val->len) {
996 char c = val->buf[i++];
997 if (c == '\n') {
998 /* Collapse continuation down to a single space. */
999 while (i < val->len && isspace(val->buf[i]))
1000 i++;
1001 c = ' ';
1002 }
1003 val->buf[pos++] = c;
1004 }
1005 strbuf_setlen(val, pos);
1006
1007 /* Empty lines may have left us with whitespace cruft at the edges */
1008 strbuf_trim(val);
1009}
1010
1011static struct trailer_block *trailer_block_new(void)
1012{

Callers 2

parse_trailersFunction · 0.85
trailer_iterator_advanceFunction · 0.85

Calls 2

strbuf_setlenFunction · 0.85
strbuf_trimFunction · 0.85

Tested by

no test coverage detected