From ab82107f25b1f3963b5475c3daf66262c9cf6734 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 20 Oct 2003 08:10:05 +0300 Subject: [PATCH] If input is empty, return only list with NULL. --HG-- branch : HEAD --- src/lib/strfuncs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/strfuncs.c b/src/lib/strfuncs.c index af2f119ab3..0543874d69 100644 --- a/src/lib/strfuncs.c +++ b/src/lib/strfuncs.c @@ -467,7 +467,12 @@ static const char **_strsplit(const char *data, const char *separators, char *str; size_t alloc_len, len; - i_assert(*separators != '\0'); + i_assert(*separators != '\0'); + + if (spaces) + while (*data == ' ') data++; + if (*data == '\0') + return t_new(const char *, 1); str = t_strdup_noconst(data); -- 2.47.3