From d2735be904ae6f88cab9cfefc47d809d9582442b Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Sun, 2 Feb 2003 12:33:23 +0000 Subject: - remove LOG from audio_out.c, fix backing up the configfile if there's no configfile to save, and if there's already a backup file CVS patchset: 4087 CVS date: 2003/02/02 12:33:23 --- src/xine-engine/configfile.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/xine-engine/configfile.c') diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 16a774182..50892323a 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: configfile.c,v 1.44 2003/02/01 13:15:22 mroi Exp $ + * $Id: configfile.c,v 1.45 2003/02/02 12:33:23 hadess Exp $ * * config object (was: file) management - implementation * @@ -719,6 +719,7 @@ void xine_config_save (xine_t *xine, const char *filename) { FILE *f_config, *f_backup; sprintf(temp, "%s~", filename); + unlink (temp); if (stat(temp, &backup_stat) != 0) { char line[1024]; @@ -746,12 +747,14 @@ void xine_config_save (xine_t *xine, const char *filename) { } else { if (f_config) fclose(f_config); + else + backup = 1; if (f_backup) fclose(f_backup); } } - if (!backup) { + if (!backup && (stat(filename, &config_stat) == 0)) { printf("configfile: WARNING: backing up configfile to %s failed\n", temp); printf("configfile: WARNING: your configuration will not be saved\n"); return; -- cgit v1.2.3