From: Stu T. <nos...@us...> - 2005-07-31 15:21:40
|
Update of /cvsroot/gaim/gaim/src/protocols/msn In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24418/protocols/msn Modified Files: utils.c Log Message: Fix a buglet in auto linkifying mailto: things, which was causing the MSN prpl to have kittens trying to parse what was being sent. Also fixup the MSN parsing code to be more accomodating in what it accepts from the core - as this code was originally borrowed from the Zephyr prpl, robustify Zephyr in a similar way. Unfortunately I have no way of testing the Zephyr fixes. Index: utils.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/msn/utils.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -p -r1.25 -r1.26 --- utils.c 27 Nov 2004 19:39:25 -0000 1.25 +++ utils.c 31 Jul 2005 15:21:31 -0000 1.26 @@ -221,22 +221,24 @@ msn_import_html(const char *html, char * if (!g_ascii_strncasecmp(c, "mailto:", 7)) c += 7; - while (g_ascii_strncasecmp(c, "\">", 2)) + while ((*c != '\0') && g_ascii_strncasecmp(c, "\">", 2)) msg[retcount++] = *c++; - c += 2; + if (*c != '\0') + c += 2; /* ignore descriptive string */ - while (g_ascii_strncasecmp(c, "</a>", 4)) + while ((*c != '\0') && g_ascii_strncasecmp(c, "</a>", 4)) c++; - c += 4; + if (*c != '\0') + c += 4; } else if (!g_ascii_strncasecmp(c + 1, "font", 4)) { c += 5; - while (!g_ascii_strncasecmp(c, " ", 1)) + while ((*c != '\0') && !g_ascii_strncasecmp(c, " ", 1)) c++; if (!g_ascii_strncasecmp(c, "color=\"#", 7)) @@ -273,18 +275,19 @@ msn_import_html(const char *html, char * else { /* Drop all unrecognized/misparsed font tags */ - while (g_ascii_strncasecmp(c, "\">", 2)) + while ((*c != '\0') && g_ascii_strncasecmp(c, "\">", 2)) c++; - c += 2; + if (*c != '\0') + c += 2; } } else { - while (g_ascii_strncasecmp(c, ">", 1)) + while ((*c != '\0') && (*c != '>')) + c++; + if (*c != '\0') c++; - - c++; } } else if (*c == '&') |