Commit ec7988073791f4ddb1c17661eb379ff607fa636b

Stefan Sperling 2018-06-17T11:37:43

remove unused and broken got_path_segment_count()

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;
-}