* "Complete" the contents of `sb` by ensuring that either it ends with the * character `term`, or it is empty. This can be used, for example, * to ensure that text ends with a newline, but without creating an empty * blank line if there is no content in the first place. */
| 659 | * blank line if there is no content in the first place. |
| 660 | */ |
| 661 | static inline void strbuf_complete(struct strbuf *sb, char term) |
| 662 | { |
| 663 | if (sb->len && sb->buf[sb->len - 1] != term) |
| 664 | strbuf_addch(sb, term); |
| 665 | } |
| 666 | |
| 667 | static inline void strbuf_complete_line(struct strbuf *sb) |
| 668 | { |
no test coverage detected