remove unused and broken got_path_segment_count()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/lib/got_lib_path.h b/lib/got_lib_path.h
index 7fcd5f6..eabdbf9 100644
--- a/lib/got_lib_path.h
+++ b/lib/got_lib_path.h
@@ -33,7 +33,3 @@ char *got_path_get_absolute(const char *);
* 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);
diff --git a/lib/path.c b/lib/path.c
index 30be0f8..9996729 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -62,22 +62,3 @@ got_path_normalize(const char *path)
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;
-}