From e3ead6bb42f7c0f18d0ac100d33b71913fe4dcca Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 24 Sep 2015 12:23:21 +0200 Subject: systemctl: move strv_skip_first() out of systemctl.c Make it generic, call it strv_skip() and move it to strv.[ch] --- src/basic/strv.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/basic/strv.c') diff --git a/src/basic/strv.c b/src/basic/strv.c index 92f900936e..9524e80a6f 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -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; +} -- cgit v1.2.3-54-g00ecf