diff options
Diffstat (limited to 'mail/em-migrate.c')
-rw-r--r-- | mail/em-migrate.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) |