# HG changeset patch # User Tim Ringenbach # Date 1087877269 0 # Node ID cf5b5b63228dfc60a00e7a46f185082cce9b8440 # Parent 7fa8eff579b5365a2ed0a869e8a1de8d16aa338f [gaim-migrate @ 10149] rizzo, with i think some help from wing, who approves this patch, fixed an issue with his previous patch, where basicly gaim_url_fetch would fail on a link like http://foo.bar/blah@blah because it mistook the foo.bar/blah@ part for a user name. The most notable thing this fixes is Get Info on MSN people, which wing's earlier patch made pretty cool, except for the not working part due to rizzo's earlier patch. So everyone Get Info on their msn buddies and oooh and aaah at the pictures and stuff. committer: Tailor Script diff -r 7fa8eff579b5 -r cf5b5b63228d src/util.c --- a/src/util.c Tue Jun 22 01:05:42 2004 +0000 +++ b/src/util.c Tue Jun 22 04:07:49 2004 +0000 @@ -2443,10 +2443,6 @@ /************************************************************************** * URI/URL Functions **************************************************************************/ -/* - * Would be nice when dissecting an environmental variable - * that specifies proxy information. - */ gboolean gaim_url_parse(const char *url, char **ret_host, int *ret_port, char **ret_path, char **ret_user, char **ret_passwd) @@ -2454,7 +2450,7 @@ char scan_info[255]; char port_str[6]; int f; - const char *at; + const char *at, *slash; const char *turl; char host[256], path[256], user[256], passwd[256]; int port = 0; @@ -2475,7 +2471,12 @@ } /* parse out authentication information if supplied */ - if ((at = strchr(url, '@')) != NULL) { + /* Only care about @ char BEFORE the first / */ + at = strchr(url, '@'); + slash = strchr(url, '/'); + if ((at != NULL) && + (((slash != NULL) && (strlen(at) > strlen(slash))) || + (slash == NULL))) { g_snprintf(scan_info, sizeof(scan_info), "%%255[%s]:%%255[%s]^@", user_ctrl, passwd_ctrl); f = sscanf(url, scan_info, user, passwd);