From: Nathan W. <fac...@us...> - 2003-03-25 06:35:47
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1:/tmp/cvs-serv7416/src Modified Files: list.c Log Message: this saves the blist.xml file to an alternate name, and then moves it, that way we don't lose your precious buddies if gaim crashes. Of course, if gaim were to crash, it wouldn't be gaim's fault, it would be the fault of some external force. This is because gaim is perfect, and Sean is perfect. Yeah. This should be done for .gaimrc too, but i'm too tired to do that right now. Index: list.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/list.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- list.c 22 Mar 2003 21:56:48 -0000 1.47 +++ list.c 25 Mar 2003 06:35:45 -0000 1.48 @@ -1211,6 +1211,7 @@ FILE *file; char *user_dir = gaim_user_dir(); char *filename; + char *filename_real; if(!user_dir) return; @@ -1225,7 +1226,7 @@ else fclose(file); - filename = g_build_filename(user_dir, "blist.xml", NULL); + filename = g_build_filename(user_dir, "blist.xml.save", NULL); if((file = fopen(filename, "w"))) { gaim_blist_write(file, NULL); @@ -1235,7 +1236,14 @@ debug_printf("unable to write %s\n", filename); } + filename_real = g_build_filename(user_dir, "blist.xml", NULL); + + if(rename(filename, filename_real) < 0) + debug_printf("error renaming %s to %s\n", filename, filename_real); + + g_free(filename); + g_free(filename_real); } gboolean gaim_privacy_permit_add(struct gaim_account *account, const char *who) { |