MCPcopy Create free account
hub / github.com/RsyncProject/rsync / count_dir_elements

Function count_dir_elements

util1.c:938–950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

936}
937
938int count_dir_elements(const char *p)
939{
940 int cnt = 0, new_component = 1;
941 while (*p) {
942 if (*p++ == '/')
943 new_component = (*p != '.' || (p[1] != '/' && p[1] != '\0'));
944 else if (new_component) {
945 new_component = 0;
946 cnt++;
947 }
948 }
949 return cnt;
950}
951
952/* Turns multiple adjacent slashes into a single slash (possible exception:
953 * the preserving of two leading slashes at the start), drops all leading or

Callers 3

set_filter_dirFunction · 0.85
change_dirFunction · 0.85
recv_file_entryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected