Mercurial > pidgin
diff src/dialogs.c @ 1267:9cff8ff01d37
[gaim-migrate @ 1277]
WHAT THE FUCK. Why do people use goto? It pisses me off. To no end. Let me say right now, if anyone submits a patch that has a goto in it, they'll probably be very ridiculed, possibly publicly, before i put them on my block list and refuse to accept any patches from them. Ever. Even if they don't have gotos in them. You can't excuse a goto. Ever. X-Chat has them all over. Read src/common/inbound.c. It made me do no fewer than three full-body shivers.
Oh yeah, and i moved blist files from %s.blist to %d.blist. gaim will take care of moving it for you.
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Thu, 14 Dec 2000 13:22:58 +0000 |
| parents | b5783215b245 |
| children | babea41afa7e |
line wrap: on
line diff
--- a/src/dialogs.c Thu Dec 14 12:26:56 2000 +0000 +++ b/src/dialogs.c Thu Dec 14 13:22:58 2000 +0000 @@ -2767,12 +2767,21 @@ file = gaim_user_dir(); if ( file != (char *) NULL ) { - sprintf(path, "%s/%s.blist", file, g_screenname); + g_snprintf(path, sizeof path, "%s/%s.%d.blist", file, g_screenname, gc->protocol); if ( !stat(path, &sbuf) ) { debug_printf("%s exists.\n", path); ret = TRUE; } else { + char path2[PATHSIZE]; debug_printf("%s does not exist.\n", path); + g_snprintf(path2, sizeof path2, "%s/%s.blist", file, g_screenname); + if (!stat(path2, &sbuf)) { + debug_printf("%s exists, moving to %s\n", path2, path); + if (rename(path2, path)) + debug_printf("rename didn't work!\n"); + else + ret = TRUE; + } } g_free(file); } @@ -2830,7 +2839,7 @@ for (i = 0; i < strlen(g->username); i++) g_screenname[i] = toupper(g->username[i]); g_screenname[i] = '\0'; - sprintf(path, "%s/%s.blist", file, g_screenname); + sprintf(path, "%s/%s.%d.blist", file, g_screenname, g->protocol); if ((f = fopen(path,"w"))) { debug_printf("writing %s\n", path); toc_build_config(g, buf, 8192 - 1, TRUE); @@ -2907,15 +2916,14 @@ /* FIXME : import buddy list file. moderately important */ gc = connections->data; from_dialog = TRUE; - } - else { + } else { for (i = 0; i < strlen(gc->username); i++) g_screenname[i] = toupper(gc->username[i]); g_screenname[i] = '\0'; file = gaim_user_dir(); if ( file != (char *) NULL ) { - sprintf( path, "%s/%s.blist", file, g_screenname); + sprintf( path, "%s/%s.%d.blist", file, g_screenname, gc->protocol); g_free(file); } else { return;
