diff options
Diffstat (limited to 'src/basic/strv.c')
-rw-r--r-- | src/basic/strv.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/basic/strv.c b/src/basic/strv.c index 43a4f569bd..ff2f672c10 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -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; |