After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711305 - g_mime_object_write_to_stream() adds extra space in References: header
g_mime_object_write_to_stream() adds extra space in References: header
Status: RESOLVED FIXED
Product: gmime
Classification: Other
Component: general
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: Jeffrey Stedfast
Jeffrey Stedfast
Depends on:
Blocks:
 
 
Reported: 2013-11-02 19:45 UTC by Jani Nikula
Modified: 2013-11-03 13:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jani Nikula 2013-11-02 19:45:52 UTC
g_mime_object_write_to_stream() adds an extra space in the References: header after the colon. There is no extra space in the value returned by g_mime_object_get_header().

This causes the notmuch [1] test suite to fail with diff from expected to actual result:

        -References: <msg-001@notmuch-test-suite>
        +References:  <msg-001@notmuch-test-suite>

This used to work, and looking into gmime sources, the likely culprit seems to be
commit a248cc044c6ad55505939363aa858c930867a014
Author: Jeffrey Stedfast <fejj@gnome.org>
Date:   Sun Sep 29 13:23:30 2013 -0400

    Implemented custom header writer for References

introduced in gmime 2.6.19.

Indeed, write_references() has first:

	g_string_append_len (folded, ": ", 2);

and then within the while loop for the non-folding branch before adding any values:

	g_string_append_c (folded, ' ');

[1] http://notmuchmail.org/
Comment 1 Jeffrey Stedfast 2013-11-02 20:10:09 UTC
Thanks.

Fixed in git master.
Comment 2 Jani Nikula 2013-11-03 13:46:49 UTC
Wow, that was fast. Awesome, thanks!