summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2008-03-06 15:26:13 +0000
committerVincent Untz <vuntz@gnome.org>2008-03-06 15:26:13 +0000
commit83e6050a2501379a7709379e9dfdf656738a7148 (patch)
tree03b27df11f8864a498329899c97c0907643794d7
parent32ee3cdb6fa4a19fb3c42943fe9d2040560a2232 (diff)
don't unlink the destination file if it's the same as the source file in
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.
-rw-r--r--ChangeLog6
-rw-r--r--src/install.c9
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 7dd89ed..34fcc24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;
}