diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-01-27 22:38:21 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-01-27 22:38:21 +0100 |
commit | cba8922fd40b9eca203bc1d63bef72dd1edf302c (patch) | |
tree | 4d2329ba3a84ef23f09cee28b694c9fa647ea02c /strv.c | |
parent | 4a72ff34c62f18559e96b35d69c665e07290f228 (diff) |
introduce strv_contains()
Diffstat (limited to 'strv.c')
-rw-r--r-- | strv.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -145,3 +145,13 @@ fail: return NULL; } + +bool strv_contains(char **l, const char *s) { + char **i; + + STRV_FOREACH(i, l) + if (streq(*i, s)) + return true; + + return false; +} |