commit ec7988073791f4ddb1c17661eb379ff607fa636b from: Stefan Sperling date: Sun Jun 17 09:37:43 2018 UTC remove unused and broken got_path_segment_count() commit - fe8df4c20ba7f071fe1ce416388a69c241201c69 commit + ec7988073791f4ddb1c17661eb379ff607fa636b blob - 7fcd5f62f6c3cc3179fed12218f5e122f8ffde3b blob + eabdbf935d8610815257c95226a9987a6e95b775 --- lib/got_lib_path.h +++ 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); blob - 30be0f88300d852efbfbef730e09f38d66a99b56 blob + 99967297bba6bcde7d6126012e0a62fb85809082 --- lib/path.c +++ 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; -}