[PATCH v2 04/14] cli/reply: unify reply format functions

Jani Nikula jani at nikula.org
Fri Sep 9 23:26:43 PDT 2016


On Sat, 10 Sep 2016, David Bremner <david at tethera.net> wrote:
> Jani Nikula <jani at nikula.org> writes:
>
>> Prepare for further future unification by making the code similar. The
>> only functional change is that errors in mime_node_open() also break
>> execution in default reply format.
>
>>      GMimeMessage *reply;
>> -    mime_node_t *root;
>> +    mime_node_t *node;
>> +
>> +    if (mime_node_open (ctx, message, &params->crypto, &node))
>> +	return 1;
>>  
>>      reply = create_reply_message (ctx, config, message, reply_all);
>>      if (!reply)
>>  	return 1;
>>  
>>      show_reply_headers (reply);
>> +    format_part_reply (node);
>>  
>>      g_object_unref (G_OBJECT (reply));
>
> I'm not sure if this matters in the long run, but a related change is
> that the g_object_unref is skipped in case mime_node_open returns an
> error.

The order changes too, we don't yet have an object to g_object_unref if
mime_node_open fails.

BR,
Jani.


More information about the notmuch mailing list