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

Function trim_trailing_spaces

dir.c:1029–1050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1027}
1028
1029static void trim_trailing_spaces(char *buf)
1030{
1031 char *p, *last_space = NULL;
1032
1033 for (p = buf; *p; p++)
1034 switch (*p) {
1035 case ' ':
1036 if (!last_space)
1037 last_space = p;
1038 break;
1039 case '\\':
1040 p++;
1041 if (!*p)
1042 return;
1043 /* fallthrough */
1044 default:
1045 last_space = NULL;
1046 }
1047
1048 if (last_space)
1049 *last_space = '\0';
1050}
1051
1052/*
1053 * Given a subdirectory name and "dir" of the current directory,

Callers 1

add_patterns_from_bufferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected