comparison src/protocols/msn/utils.c @ 11176:6932df31225f

[gaim-migrate @ 13283] 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. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sun, 31 Jul 2005 15:21:31 +0000
parents 3016b1b32339
children a1aa681f1448
comparison
equal deleted inserted replaced
11175:57af14280b5f 11176:6932df31225f
219 c += 9; 219 c += 9;
220 220
221 if (!g_ascii_strncasecmp(c, "mailto:", 7)) 221 if (!g_ascii_strncasecmp(c, "mailto:", 7))
222 c += 7; 222 c += 7;
223 223
224 while (g_ascii_strncasecmp(c, "\">", 2)) 224 while ((*c != '\0') && g_ascii_strncasecmp(c, "\">", 2))
225 msg[retcount++] = *c++; 225 msg[retcount++] = *c++;
226 226
227 c += 2; 227 if (*c != '\0')
228 c += 2;
228 229
229 /* ignore descriptive string */ 230 /* ignore descriptive string */
230 while (g_ascii_strncasecmp(c, "</a>", 4)) 231 while ((*c != '\0') && g_ascii_strncasecmp(c, "</a>", 4))
231 c++; 232 c++;
232 233
233 c += 4; 234 if (*c != '\0')
235 c += 4;
234 } 236 }
235 else if (!g_ascii_strncasecmp(c + 1, "font", 4)) 237 else if (!g_ascii_strncasecmp(c + 1, "font", 4))
236 { 238 {
237 c += 5; 239 c += 5;
238 240
239 while (!g_ascii_strncasecmp(c, " ", 1)) 241 while ((*c != '\0') && !g_ascii_strncasecmp(c, " ", 1))
240 c++; 242 c++;
241 243
242 if (!g_ascii_strncasecmp(c, "color=\"#", 7)) 244 if (!g_ascii_strncasecmp(c, "color=\"#", 7))
243 { 245 {
244 c += 8; 246 c += 8;
271 c = end + 2; 273 c = end + 2;
272 } 274 }
273 else 275 else
274 { 276 {
275 /* Drop all unrecognized/misparsed font tags */ 277 /* Drop all unrecognized/misparsed font tags */
276 while (g_ascii_strncasecmp(c, "\">", 2)) 278 while ((*c != '\0') && g_ascii_strncasecmp(c, "\">", 2))
277 c++; 279 c++;
278 280
279 c += 2; 281 if (*c != '\0')
282 c += 2;
280 } 283 }
281 } 284 }
282 else 285 else
283 { 286 {
284 while (g_ascii_strncasecmp(c, ">", 1)) 287 while ((*c != '\0') && (*c != '>'))
285 c++; 288 c++;
286 289 if (*c != '\0')
287 c++; 290 c++;
288 } 291 }
289 } 292 }
290 else if (*c == '&') 293 else if (*c == '&')
291 { 294 {
292 if (!g_ascii_strncasecmp(c, "&lt;", 4)) 295 if (!g_ascii_strncasecmp(c, "&lt;", 4))