[Commits] [SCM] claws branch, master, updated. 3.9.2-104-g6c24a52

colin at claws-mail.org colin at claws-mail.org
Sat Nov 2 09:16:20 CET 2013


The branch master of project "claws" (Claws Mail) has been updated
       via  6c24a52c96905f126c45a30805eb2a277cdc91b6 (commit)
      from  ec952436361925077850223398627d52de59f76f (commit)


- Log -----------------------------------------------------------------
commit 6c24a52c96905f126c45a30805eb2a277cdc91b6
Author: Colin Leroy <colin at colino.net>
Date:   Sat Nov 2 09:14:56 2013 +0100

    Fix bug #3011, "crash when using %f Action on two or more uncached
    (IMAP) messages". Thanks Paul for the idea!

diff --git a/src/action.c b/src/action.c
index a6aaf01..e236301 100644
--- a/src/action.c
+++ b/src/action.c
@@ -759,7 +759,7 @@ static gboolean execute_actions(gchar *action, GSList *msg_list,
 				gint body_pos, MimeInfo *partinfo,
 				void (*callback)(void *data), void *data)
 {
-	GSList *children_list = NULL;
+	GSList *children_list = NULL, *cur = NULL;
 	gint is_ok  = TRUE;
 	gint msg_list_len;
 	Children *children;
@@ -850,9 +850,19 @@ static gboolean execute_actions(gchar *action, GSList *msg_list,
 	    ((action_type & ACTION_SINGLE) == 0 || msg_list_len == 1))
 		children->open_in = 1;
 
-	if (action_type & ACTION_SINGLE) {
-		GSList *cur;
+	/* Pre-fetch bodies, makes it easier on IMAP (see bug #3011) */
+	for (cur = msg_list; cur; cur = cur->next) {
+		gchar *dummy;
+		msginfo = (MsgInfo *)cur->data;
 
+		dummy = procmsg_get_message_file((MsgInfo *)cur->data);
+		if (dummy)
+			g_free(dummy);
+		else
+			is_ok = FALSE;
+	}
+
+	if (is_ok && (action_type & ACTION_SINGLE)) {
 		for (cur = msg_list; cur && is_ok == TRUE; cur = cur->next) {
 			msginfo = (MsgInfo *)cur->data;
 			if (!msginfo) {
@@ -877,7 +887,7 @@ static gboolean execute_actions(gchar *action, GSList *msg_list,
 			}
 			g_free(cmd);
 		}
-	} else {
+	} else if (is_ok) {
 		cmd = parse_action_cmd(action, NULL, msg_list, partinfo,
 				       user_str, user_hidden_str, sel_str);
 		if (cmd) {

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

Summary of changes:
 src/action.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list