comparison src/gaimrc.c @ 5250:649e54d617da

[gaim-migrate @ 5622] 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 committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 28 Apr 2003 06:49:07 +0000
parents d635e8fe2fba
children d11cb52d5309
comparison
equal deleted inserted replaced
5249:98fc2d44c2ba 5250:649e54d617da
1584 1584
1585 if (gaim_plugins_enabled()) 1585 if (gaim_plugins_enabled())
1586 gaimrc_write_plugins(f); 1586 gaimrc_write_plugins(f);
1587 1587
1588 gaimrc_write_proxy(f); 1588 gaimrc_write_proxy(f);
1589 if (fprintf(f, "\n") == 1) {
1590 if (rename(filename_temp, filename) < 0)
1591 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
1592 "Error renaming %s to %s\n", filename_temp, filename);
1593 } else
1594 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
1595 "Unable to create new .gaimrc file. Preferences not updated.");
1589 fclose(f); 1596 fclose(f);
1590 if (rename(filename_temp, filename) < 0)
1591 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
1592 "Error renaming %s to %s\n", filename_temp, filename);
1593 is_saving_prefs = 0; 1597 is_saving_prefs = 0;
1594 } else 1598 } else
1595 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc", 1599 gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
1596 "Error opening %s\n", filename_temp); 1600 "Error opening %s\n", filename_temp);
1597 1601