commit - fe8df4c20ba7f071fe1ce416388a69c241201c69
commit + ec7988073791f4ddb1c17661eb379ff607fa636b
blob - 7fcd5f62f6c3cc3179fed12218f5e122f8ffde3b
blob + eabdbf935d8610815257c95226a9987a6e95b775
--- lib/got_lib_path.h
+++ lib/got_lib_path.h
* The result is allocated with malloc(3).
*/
char *got_path_normalize(const char *);
-
-/* Count the number of path segments separated by '/'. */
-const struct got_error *
-got_path_segment_count(int *count, const char *path);
blob - 30be0f88300d852efbfbef730e09f38d66a99b56
blob + 99967297bba6bcde7d6126012e0a62fb85809082
--- lib/path.c
+++ lib/path.c
return resolved;
}
-
-const struct got_error *
-got_path_segment_count(int *count, const char *path)
-{
- char *s = strdup(path), *p;
-
- *count = 0;
-
- if (s == NULL)
- return got_error_from_errno();
-
- do {
- p = strsep(&s, "/");
- if (s && *s != '/')
- (*count)++;
- } while (p);
-
- return NULL;
-}