changeset 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 aac04affc65d
children 48cc2d81ddbb
files src/browser.c src/dialogs.c
diffstat 2 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser.c	Thu Dec 14 12:26:56 2000 +0000
+++ b/src/browser.c	Thu Dec 14 13:22:58 2000 +0000
@@ -398,7 +398,7 @@
 			/* Print to warn user... */
 			debug_printf("%s: window 0x%x was destroyed.\n", progname, (unsigned int)window);
 			result = 6;
-			goto DONE;
+			done = True;
 		} else if (event->type == GDK_PROPERTY_NOTIFY &&
 			   event->property.state == GDK_PROPERTY_NEW_VALUE &&
 			   event->property.window == window &&
@@ -471,8 +471,6 @@
 		gdk_event_free(event);
 	}
 
-      DONE:
-
 	if (new_command)
 		g_free(new_command);
 
--- 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;