# HG changeset patch # User Christian Hammond # Date 1043950462 0 # Node ID 8fbf1c989f2bdd2ccc8379bbeac87585fabd5440 # Parent 7b0f6537da758a08543ee1eb0241d2103dad5e30 [gaim-migrate @ 4749] Reverting shx's patch. It uses a function that the man page claims should never be used, and it breaks things on Solaris and probably other platforms. committer: Tailor Script diff -r 7b0f6537da75 -r 8fbf1c989f2b src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Thu Jan 30 18:08:04 2003 +0000 +++ b/src/protocols/msn/msn.c Thu Jan 30 18:14:22 2003 +0000 @@ -154,7 +154,6 @@ while (*(tmp) && *(tmp) == ' ') \ (tmp)++; -#define GET_NEXT_LINE(tmp,s) strsep (&tmp, " "); s = strsep (&tmp, "\r"); static char *msn_normalize(const char *s) { @@ -786,10 +785,21 @@ char *cookie_s, *filesize_s; size_t filesize; - tmp = strstr(msg, "Invitation-Cookie:"); - GET_NEXT_LINE(tmp, cookie_s); - GET_NEXT_LINE(tmp, filename); - GET_NEXT_LINE(tmp, filesize_s); + tmp = strstr(msg, "Invitation-Cookie"); + GET_NEXT(tmp); + cookie_s = tmp; + GET_NEXT(tmp); + GET_NEXT(tmp); + filename = tmp; + + /* Needed for filenames with spaces */ + tmp = strchr(tmp, '\r'); + *tmp = '\0'; + tmp += 2; + + GET_NEXT(tmp); + filesize_s = tmp; + GET_NEXT(tmp); mft = g_new0(struct msn_file_transfer, 1); mft->gc = ms->gc; @@ -822,12 +832,19 @@ char *cookie_s, *ip, *port_s, *authcookie_s; - tmp = strstr(msg, "Invitation-Cookie:"); - GET_NEXT_LINE(tmp, cookie_s); - GET_NEXT_LINE(tmp, ip); - GET_NEXT_LINE(tmp, port_s); - GET_NEXT_LINE(tmp, authcookie_s); - GET_NEXT_LINE(tmp, authcookie_s); + tmp = strstr(msg, "Invitation-Cookie"); + GET_NEXT(tmp); + cookie_s = tmp; + GET_NEXT(tmp); + GET_NEXT(tmp); + ip = tmp; + GET_NEXT(tmp); + GET_NEXT(tmp); + port_s = tmp; + GET_NEXT(tmp); + GET_NEXT(tmp); + authcookie_s = tmp; + GET_NEXT(tmp); mft = find_mft_by_cookie(ms->gc, atoi(cookie_s));