Mercurial > dovecot > original-hg > dovecot-1.2
changeset 1823:cf9fa86e2a91 HEAD
If input is empty, return only list with NULL.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 20 Oct 2003 08:10:05 +0300 |
parents | 7aff4dec4e9b |
children | 1acb38d177cf |
files | src/lib/strfuncs.c |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/strfuncs.c Mon Oct 20 08:01:57 2003 +0300 +++ b/src/lib/strfuncs.c Mon Oct 20 08:10:05 2003 +0300 @@ -467,7 +467,12 @@ 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);