Commit 02bc3fa5 02bc3fa5df5826ab3f2e96095a78e20e2b0dfc1e by Sergey Poznyakoff

(mu_string_unfold): New function.

1 parent a69ba104
......@@ -119,6 +119,7 @@ extern int mu_rfc2822_in_reply_to __P((message_t msg, char **pstr));
/* Find NEEDLE in the HAYSTACK. Case insensitive comparison */
extern char *mu_strcasestr __P((const char *haystack, const char *needle));
extern int mu_string_unfold __P((char *text, size_t *plen));
#ifdef __cplusplus
}
......
......@@ -1097,3 +1097,20 @@ ret0:
#undef U
}
int
mu_string_unfold (char *text, size_t *plen)
{
char *p, *q;
if (!text)
return EINVAL;
for (p = q = text; *q; q++)
if (*q != '\n')
*p++ = *q;
*p++ = 0;
if (plen)
*plen = p - text;
return 0;
}
......