aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-01-16 02:55:10 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-01-16 02:55:10 +0800
commitb3fe89ecf60c8beb7778490f50425625b6c4744d (patch)
treeb7b74e685d36955066a5e40ee10a3950ce95dbf1 /mail
parentb282f92587ff44751e4e4720a5adf39e395e2ad7 (diff)
downloadgsoc2013-evolution-b3fe89ecf60c8beb7778490f50425625b6c4744d.tar
gsoc2013-evolution-b3fe89ecf60c8beb7778490f50425625b6c4744d.tar.gz
gsoc2013-evolution-b3fe89ecf60c8beb7778490f50425625b6c4744d.tar.bz2
gsoc2013-evolution-b3fe89ecf60c8beb7778490f50425625b6c4744d.tar.lz
gsoc2013-evolution-b3fe89ecf60c8beb7778490f50425625b6c4744d.tar.xz
gsoc2013-evolution-b3fe89ecf60c8beb7778490f50425625b6c4744d.tar.zst
gsoc2013-evolution-b3fe89ecf60c8beb7778490f50425625b6c4744d.zip
Only abort the copy if the dest folder both exists and contains data.
2004-01-15 Jeffrey Stedfast <fejj@ximian.com> * em-migrate.c (cp): Only abort the copy if the dest folder both exists and contains data. Fixes bug #52880. svn path=/trunk/; revision=24250
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/em-migrate.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 201f5595ab..2c4d09c427 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-15 Jeffrey Stedfast <fejj@ximian.com>
+
+ * em-migrate.c (cp): Only abort the copy if the dest folder both
+ exists and contains data. Fixes bug #52880.
+
2004-01-15 Rodrigo Moya <rodrigo@ximian.com>
* em-folder-browser.c: removed ForgetPasswords verb.
diff --git a/mail/em-migrate.c b/mail/em-migrate.c
index 4bc72e79dc..ccb4fedfe3 100644
--- a/mail/em-migrate.c
+++ b/mail/em-migrate.c
@@ -1243,7 +1243,9 @@ cp (const char *src, const char *dest, gboolean show_progress)
size_t total = 0;
struct stat st;
- if (stat (src, &st) == -1)
+ /* if the dest file exists and has content, abort - we don't
+ * want to corrupt their existing data */
+ if (stat (dest, &st) != -1 || st.st_size > 0)
return -1;
if ((fd[0] = open (src, O_RDONLY)) == -1)