ap_count_dirs — count the number of slashes in a path
int ap_count_dirs(const char *path)
Returns the number of slashes in a path.