aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-display.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-07-25 08:16:32 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-07-25 08:16:32 +0800
commitbd34e927c740ec7171565abf4dfc7f743179e944 (patch)
tree59f41c7dfa8517ae41f62b4f6045ed38d84f7db1 /mail/mail-display.c
parent1cf393ef9a95f6f8b1f6f80042cf8e873a4fe454 (diff)
downloadgsoc2013-evolution-bd34e927c740ec7171565abf4dfc7f743179e944.tar.gz
gsoc2013-evolution-bd34e927c740ec7171565abf4dfc7f743179e944.tar.zst
gsoc2013-evolution-bd34e927c740ec7171565abf4dfc7f743179e944.zip
Pass the O_TRUNC flag to open so that we don't leave trailing garbage at
2001-07-24 Jeffrey Stedfast <fejj@ximian.com> * mail-ops.c (save_part_save): Pass the O_TRUNC flag to open so that we don't leave trailing garbage at the end of the file if the new file content is shorter than the old file content. svn path=/trunk/; revision=11373
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r--mail/mail-display.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mail/mail-display.c b/mail/mail-display.c
index ea795fc6d2..a681fdd5cf 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -94,7 +94,7 @@ write_data_to_file (CamelMimePart *part, const char *name, gboolean unique)
if (fd == -1 && errno == EEXIST && !unique) {
GtkWidget *dlg;
GtkWidget *text;
-
+
dlg = gnome_dialog_new (_("Overwrite file?"),
GNOME_STOCK_BUTTON_YES,
GNOME_STOCK_BUTTON_NO,
@@ -103,15 +103,16 @@ write_data_to_file (CamelMimePart *part, const char *name, gboolean unique)
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dlg)->vbox), text, TRUE, TRUE, 4);
gtk_window_set_policy(GTK_WINDOW(dlg), FALSE, TRUE, FALSE);
gtk_widget_show (text);
-
+
if (gnome_dialog_run_and_close (GNOME_DIALOG (dlg)) != 0)
return FALSE;
}
+
if (fd != -1)
- close(fd);
-
+ close (fd);
+
/* should this have progress of what its doing? */
- mail_msg_wait(mail_save_part(part, name, write_data_written, &ret));
+ mail_msg_wait (mail_save_part (part, name, write_data_written, &ret));
return ret;
}