| 936 | } |
| 937 | |
| 938 | int 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 |
no outgoing calls
no test coverage detected