diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-01-16 02:55:10 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-01-16 02:55:10 +0800 |
commit | b3fe89ecf60c8beb7778490f50425625b6c4744d (patch) | |
tree | b7b74e685d36955066a5e40ee10a3950ce95dbf1 /mail/em-migrate.c | |
parent | b282f92587ff44751e4e4720a5adf39e395e2ad7 (diff) | |
download | gsoc2013-evolution-b3fe89ecf60c8beb7778490f50425625b6c4744d.tar.gz 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/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) |