save_with_backup(): do not try to rename file if it doesn't exist

master
Yevgen Muntyan 2007-06-24 12:19:14 -05:00
parent 57be413bea
commit 2ae1fd34fb
1 changed files with 2 additions and 1 deletions

View File

@ -1450,7 +1450,8 @@ save_with_backup (const char *filename,
if (!_moo_save_file_utf8 (tmp_file, data, len, error))
goto out;
_moo_rename_file (filename, bak_file, &error_move);
if (g_file_test (filename, G_FILE_TEST_EXISTS))
_moo_rename_file (filename, bak_file, &error_move);
if (!_moo_rename_file (tmp_file, filename, error))
{