comparison 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
comparison
equal deleted inserted replaced
1266:aac04affc65d 1267:9cff8ff01d37
2765 g_screenname[i] = toupper(gc->username[i]); 2765 g_screenname[i] = toupper(gc->username[i]);
2766 g_screenname[i] = '\0'; 2766 g_screenname[i] = '\0';
2767 2767
2768 file = gaim_user_dir(); 2768 file = gaim_user_dir();
2769 if ( file != (char *) NULL ) { 2769 if ( file != (char *) NULL ) {
2770 sprintf(path, "%s/%s.blist", file, g_screenname); 2770 g_snprintf(path, sizeof path, "%s/%s.%d.blist", file, g_screenname, gc->protocol);
2771 if ( !stat(path, &sbuf) ) { 2771 if ( !stat(path, &sbuf) ) {
2772 debug_printf("%s exists.\n", path); 2772 debug_printf("%s exists.\n", path);
2773 ret = TRUE; 2773 ret = TRUE;
2774 } else { 2774 } else {
2775 char path2[PATHSIZE];
2775 debug_printf("%s does not exist.\n", path); 2776 debug_printf("%s does not exist.\n", path);
2777 g_snprintf(path2, sizeof path2, "%s/%s.blist", file, g_screenname);
2778 if (!stat(path2, &sbuf)) {
2779 debug_printf("%s exists, moving to %s\n", path2, path);
2780 if (rename(path2, path))
2781 debug_printf("rename didn't work!\n");
2782 else
2783 ret = TRUE;
2784 }
2776 } 2785 }
2777 g_free(file); 2786 g_free(file);
2778 } 2787 }
2779 return ret; 2788 return ret;
2780 } 2789 }
2828 g = (struct gaim_connection *)c->data; 2837 g = (struct gaim_connection *)c->data;
2829 2838
2830 for (i = 0; i < strlen(g->username); i++) 2839 for (i = 0; i < strlen(g->username); i++)
2831 g_screenname[i] = toupper(g->username[i]); 2840 g_screenname[i] = toupper(g->username[i]);
2832 g_screenname[i] = '\0'; 2841 g_screenname[i] = '\0';
2833 sprintf(path, "%s/%s.blist", file, g_screenname); 2842 sprintf(path, "%s/%s.%d.blist", file, g_screenname, g->protocol);
2834 if ((f = fopen(path,"w"))) { 2843 if ((f = fopen(path,"w"))) {
2835 debug_printf("writing %s\n", path); 2844 debug_printf("writing %s\n", path);
2836 toc_build_config(g, buf, 8192 - 1, TRUE); 2845 toc_build_config(g, buf, 8192 - 1, TRUE);
2837 fprintf(f, "%s\n", buf); 2846 fprintf(f, "%s\n", buf);
2838 fclose(f); 2847 fclose(f);
2905 return; 2914 return;
2906 } 2915 }
2907 /* FIXME : import buddy list file. moderately important */ 2916 /* FIXME : import buddy list file. moderately important */
2908 gc = connections->data; 2917 gc = connections->data;
2909 from_dialog = TRUE; 2918 from_dialog = TRUE;
2910 } 2919 } else {
2911 else {
2912 for (i = 0; i < strlen(gc->username); i++) 2920 for (i = 0; i < strlen(gc->username); i++)
2913 g_screenname[i] = toupper(gc->username[i]); 2921 g_screenname[i] = toupper(gc->username[i]);
2914 g_screenname[i] = '\0'; 2922 g_screenname[i] = '\0';
2915 2923
2916 file = gaim_user_dir(); 2924 file = gaim_user_dir();
2917 if ( file != (char *) NULL ) { 2925 if ( file != (char *) NULL ) {
2918 sprintf( path, "%s/%s.blist", file, g_screenname); 2926 sprintf( path, "%s/%s.%d.blist", file, g_screenname, gc->protocol);
2919 g_free(file); 2927 g_free(file);
2920 } else { 2928 } else {
2921 return; 2929 return;
2922 } 2930 }
2923 } 2931 }