From bacd990184e05738f80865dd363add57c59384c0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 28 Apr 2015 10:28:52 +0200 Subject: [PATCH] lib: Fix strv_next for the anchor NULL entry I swear I have tested this somewhere.... Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- lib/util/strv.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/util/strv.c b/lib/util/strv.c index 2acd145add5..f5879c78a37 100644 --- a/lib/util/strv.c +++ b/lib/util/strv.c @@ -84,6 +84,13 @@ char *strv_next(char *strv, const char *entry) size_t len, entry_len; char *result; + if (entry == NULL) { + if (strv_valid_entry(strv, strv, &len, &entry_len)) { + return strv; + } + return NULL; + } + if (!strv_valid_entry(strv, entry, &len, &entry_len)) { return NULL; } -- 2.11.4.GIT