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

Function get_path_prefix

archive-tar.c:206–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206static size_t get_path_prefix(const char *path, size_t pathlen, size_t maxlen)
207{
208 size_t i = pathlen;
209 if (i > 1 && path[i - 1] == '/')
210 i--;
211 if (i > maxlen)
212 i = maxlen;
213 do {
214 i--;
215 } while (i > 0 && path[i] != '/');
216 return i;
217}
218
219static void prepare_header(struct archiver_args *args,
220 struct ustar_header *header,

Callers 1

write_tar_entryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected