comparison src/protocols/msn/utils.c @ 8921:538a78ff9fdb

[gaim-migrate @ 9691] "MSN fix for sending certain copy-pasted text This basically does that. Send any thext from the paragraphs in http://gaim.sourceforge.net/about.php and you'll see the problem. In msn we can't send multiple font faced formatted text. So this one fixes that." --Felipe Contreras committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Thu, 13 May 2004 12:25:07 +0000
parents 0eb5161ef333
children 3ea82ab12cb9
comparison
equal deleted inserted replaced
8920:87fcb56feeca 8921:538a78ff9fdb
236 c += 8; 236 c += 8;
237 } 237 }
238 else if (!g_ascii_strncasecmp(c, "face=\"", 6)) 238 else if (!g_ascii_strncasecmp(c, "face=\"", 6))
239 { 239 {
240 const char *end = NULL; 240 const char *end = NULL;
241 const char *comma = NULL;
241 unsigned int namelen = 0; 242 unsigned int namelen = 0;
242 243
243 c += 6; 244 c += 6;
244 end = strchr(c, '\"'); 245 end = strchr(c, '\"');
245 namelen = (unsigned int)(end - c); 246 comma = strchr(c, ',');
247
248 namelen = (unsigned int)((comma != NULL ? comma : end) - c);
249
246 fontface = g_strndup(c, namelen); 250 fontface = g_strndup(c, namelen);
247 c = end + 2; 251 c = end + 2;
248 } 252 }
249 else 253 else
250 { 254 {
260 while (g_ascii_strncasecmp(c, ">", 1)) 264 while (g_ascii_strncasecmp(c, ">", 1))
261 c++; 265 c++;
262 266
263 c++; 267 c++;
264 } 268 }
265 } else if (*c == '&') { 269 }
266 if (!g_ascii_strncasecmp(c, "&lt;", 4)) { 270 else if (*c == '&')
271 {
272 if (!g_ascii_strncasecmp(c, "&lt;", 4))
273 {
267 msg[retcount++] = '<'; 274 msg[retcount++] = '<';
268 c += 4; 275 c += 4;
269 } else if (!g_ascii_strncasecmp(c, "&gt;", 4)) { 276 }
277 else if (!g_ascii_strncasecmp(c, "&gt;", 4))
278 {
270 msg[retcount++] = '>'; 279 msg[retcount++] = '>';
271 c += 4; 280 c += 4;
272 } else if (!g_ascii_strncasecmp(c, "&quot;", 6)) { 281 }
282 else if (!g_ascii_strncasecmp(c, "&quot;", 6))
283 {
273 msg[retcount++] = '"'; 284 msg[retcount++] = '"';
274 c += 6; 285 c += 6;
275 } else if (!g_ascii_strncasecmp(c, "&amp;", 5)) { 286 }
287 else if (!g_ascii_strncasecmp(c, "&amp;", 5))
288 {
276 msg[retcount++] = '&'; 289 msg[retcount++] = '&';
277 c += 5; 290 c += 5;
278 } 291 }
279 } else 292 }
293 else
280 msg[retcount++] = *c++; 294 msg[retcount++] = *c++;
281 } 295 }
282 296
283 if (fontface == NULL) 297 if (fontface == NULL)
284 fontface = g_strdup("MS Sans Serif"); 298 fontface = g_strdup("MS Sans Serif");