]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Added i_strchr_to_next()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 20 Oct 2016 09:08:09 +0000 (12:08 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 1 Mar 2017 11:09:29 +0000 (13:09 +0200)
src/lib/strfuncs.h

index d48d28950da0bbf30b184908f7199eb495788570..0195af439e41f99cad62932e821b2008d5313334 100644 (file)
@@ -67,6 +67,12 @@ int i_memcasecmp(const void *p1, const void *p2, size_t size) ATTR_PURE;
 int i_strcmp_p(const char *const *p1, const char *const *p2) ATTR_PURE;
 int i_strcasecmp_p(const char *const *p1, const char *const *p2) ATTR_PURE;
 
+static inline char *i_strchr_to_next(const char *str, char chr)
+{
+       char *tmp = (char *)strchr(str, chr);
+       return tmp == NULL ? NULL : tmp+1;
+}
+
 /* separators is an array of separator characters, not a separator string.
    an empty data string results in an array containing only NULL. */
 char **p_strsplit(pool_t pool, const char *data, const char *separators)