"In-Reply-To", in_reply_to);
orig_references = notmuch_message_get_header (message, "references");
+ if (!orig_references)
+ /* Treat errors like missing References headers. */
+ orig_references = "";
references = talloc_asprintf (ctx, "%s%s%s",
- orig_references ? orig_references : "",
- orig_references ? " " : "",
+ *orig_references ? orig_references : "",
+ *orig_references ? " " : "",
in_reply_to);
g_mime_object_set_header (GMIME_OBJECT (reply),
"References", references);
"From": "Notmuch Test Suite <test_suite@notmuchmail.org>",
"To": "Carl Worth <cworth@cworth.org>, cworth@cworth.org",
"In-reply-to": "<87liy5ap00.fsf@yoom.home.cworth.org>",
- "References": " <87liy5ap00.fsf@yoom.home.cworth.org>"},
+ "References": "<87liy5ap00.fsf@yoom.home.cworth.org>"},
"original": {"id": "XXXXX",
"match": false,
"excluded": false,
"reply-headers": {
"From": "Notmuch Test Suite <test_suite@notmuchmail.org>",
"In-reply-to": "<'${gen_msg_id}'>",
- "References": " <'${gen_msg_id}'>",
+ "References": "<'${gen_msg_id}'>",
"Subject": "Re: \u00e0\u00df\u00e7",
"To": "\u2603 <snowman@example.com>"
}