]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
If input is empty, return only list with NULL.
authorTimo Sirainen <tss@iki.fi>
Mon, 20 Oct 2003 05:10:05 +0000 (08:10 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 20 Oct 2003 05:10:05 +0000 (08:10 +0300)
--HG--
branch : HEAD

src/lib/strfuncs.c

index af2f119ab381613470954135058e41e1da4159ff..0543874d690d478b1cdbc67a68b3febad3303567 100644 (file)
@@ -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);