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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user