diff options
-rw-r--r-- | mail/ChangeLog | 3 | ||||
-rw-r--r-- | mail/em-migrate.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 08478f7f29..b1cd112795 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,8 @@ 2004-01-16 Jeffrey Stedfast <fejj@ximian.com> + * em-migrate.c (cp): Oops, still need to stat() the src file so we + can report what percentage of the file has been completed so far. + * message-list.c (message_list_set_folder): Move 'message_list->folder = folder;' out of the uri compare if-block and move it into the if-block that tests that folder != NULL. diff --git a/mail/em-migrate.c b/mail/em-migrate.c index f7610b7e27..26c3c9c566 100644 --- a/mail/em-migrate.c +++ b/mail/em-migrate.c @@ -1248,10 +1248,13 @@ cp (const char *src, const char *dest, gboolean show_progress) if (stat (dest, &st) == 0 && st.st_size > 0) return -1; + if (stat (src, &st) == -1) + return -1; + if ((fd[0] = open (src, O_RDONLY)) == -1) return -1; - if ((fd[1] = open (dest, O_WRONLY | O_CREAT, 0666)) == -1) { + if ((fd[1] = open (dest, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == -1) { errnosav = errno; close (fd[0]); errno = errnosav; |