Update of /cvsroot/gaim/gaim/src
In directory sc8-pr-cvs1:/tmp/cvs-serv6719/src
Modified Files:
gaimrc.c
Log Message:
If your partition was full when saving preferences, .gaimrc.save could
get created or half created, and then that file would get renamed to
.gaimrc, which is bad, because the new rc file would be corrupt or
whatever. So I just added an ugly little check for "if I can add a
newline on to the end of ~/.gaimrc.save, then it probably got written
ok."
I'm not really a big fan of .gaimrc. Someone with some skills might
want to rewrite it? Or maybe we should use xml or something? I
dunno.
Hooverphonic is cool
Index: gaimrc.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/gaimrc.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -d -r1.160 -r1.161
--- gaimrc.c 28 Apr 2003 06:11:48 -0000 1.160
+++ gaimrc.c 28 Apr 2003 06:49:07 -0000 1.161
@@ -1586,10 +1586,14 @@
gaimrc_write_plugins(f);
gaimrc_write_proxy(f);
- fclose(f);
- if (rename(filename_temp, filename) < 0)
- gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
+ if (fprintf(f, "\n") == 1) {
+ if (rename(filename_temp, filename) < 0)
+ gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
"Error renaming %s to %s\n", filename_temp, filename);
+ } else
+ gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
+ "Unable to create new .gaimrc file. Preferences not updated.");
+ fclose(f);
is_saving_prefs = 0;
} else
gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
|