Mercurial > pidgin.yaz
diff src/protocols/msn/utils.c @ 7134:67f9b43c402a
[gaim-migrate @ 7701]
I think this is the fifth Yahoo authentication method Gaim's seen in its
days. Please tell me if anything stops working.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Fri, 03 Oct 2003 23:01:13 +0000 |
parents | b7e113a59b51 |
children | 06f57183e29f |
line wrap: on
line diff
--- a/src/protocols/msn/utils.c Fri Oct 03 21:57:44 2003 +0000 +++ b/src/protocols/msn/utils.c Fri Oct 03 23:01:13 2003 +0000 @@ -21,65 +21,6 @@ */ #include "msn.h" -char * -msn_url_decode(const char *str) -{ - static char buf[MSN_BUF_LEN]; - int i, j = 0; - char *bum; - - g_return_val_if_fail(str != NULL, NULL); - - for (i = 0; i < strlen(str); i++) { - char hex[3]; - - if (str[i] != '%') - buf[j++] = str[i]; - else { - strncpy(hex, str + ++i, 2); - hex[2] = '\0'; - - /* i is pointing to the start of the number */ - i++; - - /* - * Now it's at the end and at the start of the for loop - * will be at the next character. - */ - buf[j++] = strtol(hex, NULL, 16); - } - } - - buf[j] = '\0'; - - if (!g_utf8_validate(buf, -1, (const char **)&bum)) - *bum = '\0'; - - return buf; -} - -char * -msn_url_encode(const char *str) -{ - static char buf[MSN_BUF_LEN]; - int i, j = 0; - - g_return_val_if_fail(str != NULL, NULL); - - for (i = 0; i < strlen(str); i++) { - if (isalnum(str[i])) - buf[j++] = str[i]; - else { - sprintf(buf + j, "%%%02x", (unsigned char)str[i]); - j += 3; - } - } - - buf[j] = '\0'; - - return buf; -} - void msn_parse_format(const char *mime, char **pre_ret, char **post_ret) { @@ -146,7 +87,7 @@ } } - cur = g_strdup(msn_url_decode(pre->str)); + cur = g_strdup(gaim_url_decode(pre->str)); g_string_free(pre, TRUE); if (pre_ret != NULL) @@ -154,7 +95,7 @@ else g_free(cur); - cur = g_strdup(msn_url_decode(post->str)); + cur = g_strdup(gaim_url_decode(post->str)); g_string_free(post, TRUE); if (post_ret != NULL)