[Commits] [SCM] claws branch, master, updated. 3.9.1-15-g7e26548

colin at claws-mail.org colin at claws-mail.org
Fri May 24 20:29:06 CEST 2013


The branch master of project "claws" (Claws Mail) has been updated
       via  7e2654802e7eb97090da16bdf0fc3e4adf4fd283 (commit)
      from  6b978617931b7116397c6c625a26dc638154dd28 (commit)


- Log -----------------------------------------------------------------
commit 7e2654802e7eb97090da16bdf0fc3e4adf4fd283
Author: Colin Leroy <colin at colino.net>
Date:   Fri May 24 20:27:02 2013 +0200

    Fix undoing file insertion.

diff --git a/src/compose.c b/src/compose.c
index 7b2e6fa..6ddbc78 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -3504,6 +3504,7 @@ static ComposeInsertResult compose_insert_file(Compose *compose, const gchar *fi
 	gboolean badtxt = FALSE;
 	struct stat file_stat;
 	int ret;
+	GString *file_contents = NULL;
 
 	cm_return_val_if_fail(file != NULL, COMPOSE_INSERT_NO_FILE);
 
@@ -3563,6 +3564,7 @@ static ComposeInsertResult compose_insert_file(Compose *compose, const gchar *fi
 
 	cur_encoding = conv_get_locale_charset_str_no_utf8();
 
+	file_contents = g_string_new("");
 	while (fgets(buf, sizeof(buf), fp) != NULL) {
 		gchar *str;
 
@@ -3582,10 +3584,14 @@ static ComposeInsertResult compose_insert_file(Compose *compose, const gchar *fi
 				if (str[len] == '\r') str[len] = '\n';
 		}
 
-		gtk_text_buffer_insert(buffer, &iter, str, -1);
+		file_contents = g_string_append(file_contents, str);
 		g_free(str);
 	}
 
+	gtk_text_buffer_insert(buffer, &iter, file_contents->str, -1);
+	g_string_free(file_contents, TRUE);
+
+	compose_changed_cb(NULL, compose);
 	g_signal_handlers_unblock_by_func(G_OBJECT(buffer),
 					  G_CALLBACK(text_inserted),
 					  compose);

-----------------------------------------------------------------------

Summary of changes:
 src/compose.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list