string-util: move startswith_strv to strv

This commit is contained in:
Mike Yuan
2024-01-04 16:49:05 +08:00
parent 53190aa693
commit eba8b54130
4 changed files with 15 additions and 17 deletions
+10
View File
@@ -706,6 +706,16 @@ int strv_extendf(char ***l, const char *format, ...) {
return strv_consume(l, x);
}
char* startswith_strv(const char *s, char * const *l) {
STRV_FOREACH(i, l) {
char *found = startswith(s, *i);
if (found)
return found;
}
return NULL;
}
char** strv_reverse(char **l) {
size_t n;