[dovecot-cvs] dovecot/src/lib strfuncs.c,1.36,1.37

cras at procontrol.fi cras at procontrol.fi
Mon Oct 20 09:10:07 EEST 2003


Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv27914/lib

Modified Files:
	strfuncs.c 
Log Message:
If input is empty, return only list with NULL.



Index: strfuncs.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/strfuncs.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- strfuncs.c	20 Oct 2003 04:53:23 -0000	1.36
+++ strfuncs.c	20 Oct 2003 05:10:05 -0000	1.37
@@ -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);
 



More information about the dovecot-cvs mailing list