# HG changeset patch # User Ethan Blanton # Date 1304267799 0 # Node ID 3b84151850902c67866b294d6272fe5553e185d4 # Parent 039867991a519adb66c45d24262a4445f6799dd5 Accept broken URLs from third-party GG clients same as official GG. This patch is r1096 upstream, thanks to tomkiewicz again. Fixes #13886. diff -r 039867991a51 -r 3b8415185090 ChangeLog --- a/ChangeLog Sat Apr 30 16:27:01 2011 +0000 +++ b/ChangeLog Sun May 01 16:36:39 2011 +0000 @@ -51,6 +51,9 @@ Wasilczyk) (#10268) * Support XML events, resulting in immediate update of other users' buddy icons. (Tomasz Wasilczyk) (#13739) + * Accept poorly formatted URLs from other third-party clients in + the same manner as the official client. (Tomasz Wasilczyk) + (#13886) ICQ: * Fix unsetting your mood when "None" is selected. (Dustin Gathmann) diff -r 039867991a51 -r 3b8415185090 libpurple/protocols/gg/lib/message.c --- a/libpurple/protocols/gg/lib/message.c Sat Apr 30 16:27:01 2011 +0000 +++ b/libpurple/protocols/gg/lib/message.c Sun May 01 16:36:39 2011 +0000 @@ -361,7 +361,7 @@ * \param src Dodawany tekst * \param len Długość dodawanego tekstu */ -static void gg_append(char *dst, int *pos, const void *src, int len) +static void gg_append(char *dst, size_t *pos, const void *src, int len) { if (dst != NULL) memcpy(&dst[*pos], src, len); @@ -394,7 +394,8 @@ int format_idx = 0; unsigned char old_attr = 0; const unsigned char *color = (const unsigned char*) "\x00\x00\x00"; - int len, i; + int i; + size_t len; const unsigned char *format_ = (const unsigned char*) format; len = 0; @@ -584,6 +585,11 @@ entity = NULL; for (src = html; *src != 0; src++) { + if (in_entity && !(isalnum(*src) || *src == '#' || *src == ';')) { + in_entity = 0; + gg_append(dst, &len, entity, src - entity); + } + if (*src == '<') { tag = src; in_tag = 1;