sb->buf[sb->len] = '\0';
}
+void strbuf_trim_trailing_newline(struct strbuf *sb)
+{
+ if (sb->len > 0 && sb->buf[sb->len - 1] == '\n') {
+ if (--sb->len > 0 && sb->buf[sb->len - 1] == '\r')
+ --sb->len;
+ sb->buf[sb->len] = '\0';
+ }
+}
+
void strbuf_ltrim(struct strbuf *sb)
{
char *b = sb->buf;