diff options
-rw-r--r-- | mail/ChangeLog | 5 | ||||
-rw-r--r-- | mail/em-migrate.c | 4 |
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) |