changeset 5251:d11cb52d5309

[gaim-migrate @ 5623] <javabsp> KingAnt: Err, shouldn't you rename after you close the file? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 28 Apr 2003 07:09:52 +0000
parents 649e54d617da
children 7c9393b1ea36
files src/gaimrc.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/gaimrc.c	Mon Apr 28 06:49:07 2003 +0000
+++ b/src/gaimrc.c	Mon Apr 28 07:09:52 2003 +0000
@@ -1587,13 +1587,15 @@
 
 		gaimrc_write_proxy(f);
 		if (fprintf(f, "\n") == 1) {
+			fclose(f);
 			if (rename(filename_temp, filename) < 0)
 				gaim_debug(GAIM_DEBUG_ERROR, "gaimrc", 
 					   "Error renaming %s to %s\n", filename_temp, filename);
-		} else
+		} else {
+			fclose(f);
 			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",