Mercurial > pidgin
changeset 8156:a0e7d0995156
[gaim-migrate @ 8868]
Thanks to Livio B. Soares, broken IRC servers are a bit better tolerated.
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Wed, 21 Jan 2004 04:06:00 +0000 |
parents | 77d1252b3803 |
children | 657b5acaec48 |
files | src/protocols/irc/irc.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/irc/irc.c Wed Jan 21 03:22:52 2004 +0000 +++ b/src/protocols/irc/irc.c Wed Jan 21 04:06:00 2004 +0000 @@ -366,9 +366,13 @@ irc->inbufused += len; irc->inbuf[irc->inbufused] = '\0'; - for (cur = irc->inbuf; cur < irc->inbuf + irc->inbufused && (end = strstr(cur, "\r\n")); cur = end + 2) { + cur = irc->inbuf; + while (cur < irc->inbuf + irc->inbufused && + ((end = strstr(cur, "\r\n")) || (end = strstr(cur, "\n")))) { + int step = (*end == '\r' ? 2 : 1); *end = '\0'; irc_parse_msg(irc, cur); + cur = end + step; } if (cur != irc->inbuf + irc->inbufused) { /* leftover */ irc->inbufused -= (cur - irc->inbuf);