mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
reply: Remove extraneous space from generated References
Previously, the References header code seemed to assume notmuch_message_get_header would return NULL if the header was not present, but it actually returns "". As a result of this, it was inserting an unnecessary space when concatenating an empty or missing original references header with the new reference. This shows up in only two tests because the text reply format later passes the whole reply template through g_mime_filter_headers, which has the side effect of stripping out this extra space.
This commit is contained in:
parent
ad7bb423fb
commit
6cdab6e0b7
3 changed files with 7 additions and 4 deletions
|
@ -537,9 +537,12 @@ create_reply_message(void *ctx,
|
|||
"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);
|
||||
|
|
Loading…
Reference in a new issue