X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=imap-send.c;h=a6a65680ee6daf062180d2580e83616cfff4cda4;hb=3bf9d57051845cee996f73b5402a07cbeda84c88;hp=362e4743740435dc0e5b08933c0e05c53b7b62af;hpb=284fe4beb6b4835ef6857cd56b34c70c1d12b14d;p=git.git diff --git a/imap-send.c b/imap-send.c index 362e47437..a6a65680e 100644 --- a/imap-send.c +++ b/imap-send.c @@ -272,7 +272,7 @@ buffer_gets( buffer_t * b, char **s ) n = b->bytes - start; if (n) - memcpy( b->buf, b->buf + start, n ); + memmove(b->buf, b->buf + start, n); b->offset -= start; b->bytes = n; start = 0; @@ -1226,6 +1226,14 @@ split_msg( msg_data_t *all_msgs, msg_data_t *msg, int *ofs ) if (msg->len < 5 || strncmp( data, "From ", 5 )) return 0; + p = strchr( data, '\n' ); + if (p) { + p = &p[1]; + msg->len -= p-data; + *ofs += p-data; + data = p; + } + p = strstr( data, "\nFrom " ); if (p) msg->len = &p[1] - data;