systemctl: move strv_skip_first() out of systemctl.c

Make it generic, call it strv_skip() and move it to strv.[ch]
This commit is contained in:
Lennart Poettering
2015-09-29 21:55:52 +02:00
parent 56a730fa56
commit e3ead6bb42
4 changed files with 44 additions and 13 deletions
+12
View File
@@ -733,3 +733,15 @@ char ***strv_free_free(char ***l) {
free(l);
return NULL;
}
char **strv_skip(char **l, size_t n) {
while (n > 0) {
if (strv_isempty(l))
return l;
l++, n--;
}
return l;
}
+2
View File
@@ -156,3 +156,5 @@ static inline bool strv_fnmatch_or_empty(char* const* patterns, const char *s, i
}
char ***strv_free_free(char ***l);
char **strv_skip(char **l, size_t n);