diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/install.c | 9 |
2 files changed, 13 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2008-03-06 Vincent Untz <vuntz@gnome.org> + + * src/install.c: (process_one_file): don't unlink the destination file + if it's the same as the source file in case of errors. + Fix bug #14851. + 2008-02-11 Vincent Untz <vuntz@gnome.org> * configure.in: post-release bump to 0.16 diff --git a/src/install.c b/src/install.c index b21b337..3c71868 100644 --- a/src/install.c +++ b/src/install.c @@ -196,7 +196,10 @@ process_one_file (const char *filename, { g_set_error (err, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE, _("Failed to validate the created desktop file")); - g_unlink (new_filename); + + if (!files_are_the_same (filename, new_filename)) + g_unlink (new_filename); + g_free (new_filename); return; } @@ -208,7 +211,9 @@ process_one_file (const char *filename, _("Failed to set permissions %o on \"%s\": %s"), permissions, new_filename, g_strerror (errno)); - g_unlink (new_filename); + if (!files_are_the_same (filename, new_filename)) + g_unlink (new_filename); + g_free (new_filename); return; } |