From: Timo Sirainen Date: Mon, 20 Oct 2003 05:10:05 +0000 (+0300) Subject: If input is empty, return only list with NULL. X-Git-Tag: 1.1.alpha1~4283 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab82107f25b1f3963b5475c3daf66262c9cf6734;p=thirdparty%2Fdovecot%2Fcore.git If input is empty, return only list with NULL. --HG-- branch : HEAD --- 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);