| 987 | } |
| 988 | |
| 989 | static 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 | |
| 1011 | static struct trailer_block *trailer_block_new(void) |
| 1012 | { |
no test coverage detected