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

Function strbuf_trim_trailing_newline

strbuf.c:137–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137void strbuf_trim_trailing_newline(struct strbuf *sb)
138{
139 if (sb->len > 0 && sb->buf[sb->len - 1] == '\n') {
140 if (--sb->len > 0 && sb->buf[sb->len - 1] == '\r')
141 --sb->len;
142 sb->buf[sb->len] = '\0';
143 }
144}
145
146void strbuf_ltrim(struct strbuf *sb)
147{

Callers 5

get_next_submoduleFunction · 0.85
patch_update_fileFunction · 0.85
git_config_val_globalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected