MCPcopy Create free account
hub / github.com/F-Stack/f-stack / firstIsParentOrSameDirOfSecond

Function firstIsParentOrSameDirOfSecond

freebsd/contrib/zstd/programs/util.c:866–874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

864}
865
866static int
867firstIsParentOrSameDirOfSecond(const char* firstDir, const char* secondDir)
868{
869 size_t firstDirLen = strlen(firstDir),
870 secondDirLen = strlen(secondDir);
871 return firstDirLen <= secondDirLen &&
872 (secondDir[firstDirLen] == PATH_SEP || secondDir[firstDirLen] == '\0') &&
873 0 == strncmp(firstDir, secondDir, firstDirLen);
874}
875
876static int compareDir(const void* pathname1, const void* pathname2) {
877 /* sort it after remove the leading '/' or './'*/

Callers 1

Calls 1

strncmpFunction · 0.85

Tested by

no test coverage detected