MCPcopy Index your code
hub / github.com/git/git / cleanup

Function cleanup

strbuf.c:1068–1078  ·  view source on GitHub ↗

* Returns the length of a line, without trailing spaces. * * If the line ends with newline, it will be removed too. */

Source from the content-addressed store, hash-verified

1066 * If the line ends with newline, it will be removed too.
1067 */
1068static size_t cleanup(char *line, size_t len)
1069{
1070 while (len) {
1071 unsigned char c = line[len - 1];
1072 if (!isspace(c))
1073 break;
1074 len--;
1075 }
1076
1077 return len;
1078}
1079
1080/*
1081 * Remove empty lines from the beginning and end

Callers 1

strbuf_stripspaceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected