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

Function strip_path_suffix

path.c:1324–1329  ·  view source on GitHub ↗

* If path ends with suffix (complete path components), returns the * part before suffix (sans trailing directory separators). * Otherwise returns NULL. */

Source from the content-addressed store, hash-verified

1322 * Otherwise returns NULL.
1323 */
1324char *strip_path_suffix(const char *path, const char *suffix)
1325{
1326 ssize_t offset = stripped_path_suffix_offset(path, suffix);
1327
1328 return offset == -1 ? NULL : xstrndup(path, offset);
1329}
1330
1331int daemon_avoid_alias(const char *p)
1332{

Callers 2

system_prefixFunction · 0.85
cmd__path_utilsFunction · 0.85

Calls 2

xstrndupFunction · 0.85

Tested by 1

cmd__path_utilsFunction · 0.68